diff --git a/lib/enu/diagnosticMessages.generated.json.lcg b/lib/enu/diagnosticMessages.generated.json.lcg
index 58166339abe..e4080a9bb37 100644
--- a/lib/enu/diagnosticMessages.generated.json.lcg
+++ b/lib/enu/diagnosticMessages.generated.json.lcg
@@ -741,6 +741,18 @@
+ -
+
+
+
+
+
+ -
+
+
+
+
+
-
@@ -873,9 +885,9 @@
- -
+
-
-
+
@@ -1107,6 +1119,12 @@
+ -
+
+
+
+
+
-
@@ -1215,6 +1233,12 @@
+ -
+
+
+
+
+
-
@@ -1433,19 +1457,19 @@
-
-
+
- -
+
-
-
+
- -
+
-
-
+
@@ -2049,6 +2073,12 @@
+ -
+
+ {1}'?]]>
+
+
+
-
@@ -2763,12 +2793,24 @@
+ -
+
+
+
+
+
-
+ -
+
+
+
+
+
-
@@ -2847,6 +2889,12 @@
+ -
+
+
+
+
+
-
@@ -3573,6 +3621,12 @@
+ -
+
+
+
+
+
-
@@ -3939,6 +3993,12 @@
+ -
+
+
+
+
+
-
@@ -4095,6 +4155,12 @@
+ -
+
+
+
+
+
-
@@ -4299,6 +4365,12 @@
+ -
+
+
+
+
+
-
@@ -4413,6 +4485,18 @@
+ -
+
+
+
+
+
+ -
+
+
+
+
+
-
@@ -4455,6 +4539,12 @@
+ -
+
+
+
+
+
-
@@ -4869,6 +4959,12 @@
+ -
+
+
+
+
+
-
@@ -5487,9 +5583,9 @@
- -
+
-
-
+
@@ -5577,9 +5673,9 @@
- -
+
-
-
+
@@ -5781,6 +5877,18 @@
+ -
+
+
+
+
+
+ -
+
+
+
+
+
-
@@ -6249,6 +6357,12 @@
+ -
+
+
+
+
+
-
@@ -6273,6 +6387,18 @@
+ -
+
+
+
+
+
+ -
+
+
+
+
+
-
@@ -6357,6 +6483,12 @@
+ -
+
+
+
+
+
-
diff --git a/lib/ko/diagnosticMessages.generated.json b/lib/ko/diagnosticMessages.generated.json
index 1003d62329c..a1b1320115a 100644
--- a/lib/ko/diagnosticMessages.generated.json
+++ b/lib/ko/diagnosticMessages.generated.json
@@ -3,7 +3,7 @@
"A_0_modifier_cannot_be_used_with_an_interface_declaration_1045": "'{0}' 한정자는 인터페이스 선언에서 사용할 수 없습니다.",
"A_0_parameter_must_be_the_first_parameter_2680": "'{0}' 매개 변수는 첫 번째 매개 변수여야 합니다.",
"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463": "바인딩 패턴 매개 변수는 구현 서명에서 선택 사항이 될 수 없습니다.",
- "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105": "'break' 문은 이 문을 둘러싼 반복 문 또는 switch 문 내에서만 사용할 수 있습니다.",
+ "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105": "'break' 문은 이 문을 둘러싼 반복문 또는 switch 문 내에서만 사용할 수 있습니다.",
"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116": "'break' 문은 이 문을 둘러싼 문의 레이블로만 이동할 수 있습니다.",
"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500": "클래스는 선택적 형식 인수가 포함된 식별자/정규화된 이름만 구현할 수 있습니다.",
"A_class_declaration_without_the_default_modifier_must_have_a_name_1211": "'default' 한정자를 사용하지 않는 클래스 선언에는 이름이 있어야 합니다.",
@@ -23,8 +23,8 @@
"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_1254": "앰비언트 컨텍스트의 'const' 이니셜라이저는 문자열 또는 숫자 리터럴이어야 합니다.",
"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005": "생성자는 해당 클래스가 'null'을 확장하는 경우 'super' 호출을 포함할 수 없습니다.",
"A_constructor_cannot_have_a_this_parameter_2681": "생성자에는 'this' 매개 변수를 사용할 수 없습니다.",
- "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104": "'continue' 문은 이 문을 둘러싼 반복 문 내에서만 사용할 수 있습니다.",
- "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115": "'continue' 문은 이 문을 둘러싼 반복 문의 레이블로만 이동할 수 있습니다.",
+ "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104": "'continue' 문은 이 문을 둘러싼 반복문 내에서만 사용할 수 있습니다.",
+ "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115": "'continue' 문은 이 문을 둘러싼 반복문의 레이블로만 이동할 수 있습니다.",
"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038": "'declare' 한정자는 이미 존재하는 앰비언트 컨텍스트에서 사용할 수 없습니다.",
"A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file_1046": "'declare' 한정자는 .d.ts 파일의 최상위 선언에 필요합니다.",
"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249": "데코레이터는 오버로드가 아니라 메서드 구현만 데코레이팅할 수 있습니다.",
diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts
index f08e5d55677..464dea83926 100644
--- a/lib/lib.dom.d.ts
+++ b/lib/lib.dom.d.ts
@@ -162,6 +162,7 @@ interface BiquadFilterOptions extends AudioNodeOptions {
}
interface BlobPropertyBag {
+ endings?: EndingType;
type?: string;
}
@@ -220,11 +221,12 @@ interface ComputedEffectTiming extends EffectTiming {
progress?: number | null;
}
-interface ComputedKeyframe extends Record {
- composite?: CompositeOperation | null;
- computedOffset?: number;
- easing?: string;
- offset?: number | null;
+interface ComputedKeyframe {
+ composite: CompositeOperationOrAuto;
+ computedOffset: number;
+ easing: string;
+ offset: number | null;
+ [property: string]: string | number | null | undefined;
}
interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {
@@ -586,10 +588,11 @@ interface KeyboardEventInit extends EventModifierInit {
repeat?: boolean;
}
-interface Keyframe extends Record {
- composite?: CompositeOperation | null;
+interface Keyframe {
+ composite?: CompositeOperationOrAuto;
easing?: string;
offset?: number | null;
+ [property: string]: string | number | null | undefined;
}
interface KeyframeAnimationOptions extends KeyframeEffectOptions {
@@ -907,6 +910,12 @@ interface PeriodicWaveOptions extends PeriodicWaveConstraints {
real?: number[] | Float32Array;
}
+interface PipeOptions {
+ preventAbort?: boolean;
+ preventCancel?: boolean;
+ preventClose?: boolean;
+}
+
interface PointerEventInit extends MouseEventInit {
height?: number;
isPrimary?: boolean;
@@ -941,10 +950,11 @@ interface PromiseRejectionEventInit extends EventInit {
reason?: any;
}
-interface PropertyIndexedKeyframes extends Record {
- composite?: CompositeOperation | (CompositeOperation | null)[];
+interface PropertyIndexedKeyframes {
+ composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[];
easing?: string | string[];
offset?: number | (number | null)[];
+ [property: string]: string | string[] | number | null | (number | null)[] | undefined;
}
interface PushSubscriptionJSON {
@@ -958,9 +968,9 @@ interface PushSubscriptionOptionsInit {
userVisibleOnly?: boolean;
}
-interface QueuingStrategy {
+interface QueuingStrategy {
highWaterMark?: number;
- size?: WritableStreamChunkCallback;
+ size?: QueuingStrategySizeCallback;
}
interface RTCAnswerOptions extends RTCOfferAnswerOptions {
@@ -1516,6 +1526,14 @@ interface TrackEventInit extends EventInit {
track?: VideoTrack | AudioTrack | TextTrack | null;
}
+interface Transformer {
+ flush?: TransformStreamDefaultControllerCallback;
+ readableType?: undefined;
+ start?: TransformStreamDefaultControllerCallback;
+ transform?: TransformStreamDefaultControllerTransformCallback;
+ writableType?: undefined;
+}
+
interface TransitionEventInit extends EventInit {
elapsedTime?: number;
propertyName?: string;
@@ -1527,11 +1545,27 @@ interface UIEventInit extends EventInit {
view?: Window | null;
}
-interface UnderlyingSink {
+interface UnderlyingByteSource {
+ autoAllocateChunkSize?: number;
+ cancel?: ReadableStreamErrorCallback;
+ pull?: ReadableByteStreamControllerCallback;
+ start?: ReadableByteStreamControllerCallback;
+ type: "bytes";
+}
+
+interface UnderlyingSink {
abort?: WritableStreamErrorCallback;
- close?: WritableStreamDefaultControllerCallback;
- start: WritableStreamDefaultControllerCallback;
- write?: WritableStreamChunkCallback;
+ close?: WritableStreamDefaultControllerCloseCallback;
+ start?: WritableStreamDefaultControllerStartCallback;
+ type?: undefined;
+ write?: WritableStreamDefaultControllerWriteCallback;
+}
+
+interface UnderlyingSource {
+ cancel?: ReadableStreamErrorCallback;
+ pull?: ReadableStreamDefaultControllerCallback;
+ start?: ReadableStreamDefaultControllerCallback;
+ type?: undefined;
}
interface VRDisplayEventInit extends EventInit {
@@ -1581,6 +1615,12 @@ interface WheelEventInit extends MouseEventInit {
deltaZ?: number;
}
+interface WorkerOptions {
+ credentials?: RequestCredentials;
+ name?: string;
+ type?: WorkerType;
+}
+
interface WorkletOptions {
credentials?: RequestCredentials;
}
@@ -1590,18 +1630,12 @@ interface EventListener {
}
interface ANGLE_instanced_arrays {
- drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void;
- drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void;
- vertexAttribDivisorANGLE(index: number, divisor: number): void;
- readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
+ 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;
}
-declare var ANGLE_instanced_arrays: {
- prototype: ANGLE_instanced_arrays;
- new(): ANGLE_instanced_arrays;
- readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
-};
-
interface AbortController {
/**
* Returns the AbortSignal object associated with this object.
@@ -2188,7 +2222,7 @@ declare var Blob: {
};
interface Body {
- readonly body: ReadableStream | null;
+ readonly body: ReadableStream | null;
readonly bodyUsed: boolean;
arrayBuffer(): Promise;
blob(): Promise;
@@ -2233,14 +2267,14 @@ interface BroadcastChannelEventMap {
messageerror: MessageEvent;
}
-interface ByteLengthQueuingStrategy {
+interface ByteLengthQueuingStrategy extends QueuingStrategy {
highWaterMark: number;
- size(chunk?: any): number;
+ size(chunk: ArrayBufferView): number;
}
declare var ByteLengthQueuingStrategy: {
prototype: ByteLengthQueuingStrategy;
- new(strategy: QueuingStrategy): ByteLengthQueuingStrategy;
+ new(options: { highWaterMark: number }): ByteLengthQueuingStrategy;
};
interface CDATASection extends Text {
@@ -2403,15 +2437,15 @@ interface CSSStyleDeclaration {
alignItems: string | null;
alignSelf: string | null;
alignmentBaseline: string | null;
- animation: string | null;
- animationDelay: string | null;
- animationDirection: string | null;
- animationDuration: string | null;
- animationFillMode: string | null;
- animationIterationCount: string | null;
- animationName: string | null;
- animationPlayState: string | null;
- animationTimingFunction: string | null;
+ animation: string;
+ animationDelay: string;
+ animationDirection: string;
+ animationDuration: string;
+ animationFillMode: string;
+ animationIterationCount: string;
+ animationName: string;
+ animationPlayState: string;
+ animationTimingFunction: string;
backfaceVisibility: string | null;
background: string | null;
backgroundAttachment: string | null;
@@ -2654,6 +2688,7 @@ interface CSSStyleDeclaration {
rubyOverhang: string | null;
rubyPosition: string | null;
scale: string | null;
+ scrollBehavior: string;
stopColor: string | null;
stopOpacity: string | null;
stroke: string | null;
@@ -2679,50 +2714,79 @@ interface CSSStyleDeclaration {
textTransform: string | null;
textUnderlinePosition: string | null;
top: string | null;
- touchAction: string | null;
+ touchAction: string;
transform: string | null;
transformOrigin: string | null;
transformStyle: string | null;
- transition: string | null;
- transitionDelay: string | null;
- transitionDuration: string | null;
- transitionProperty: string | null;
- transitionTimingFunction: string | null;
+ transition: string;
+ transitionDelay: string;
+ transitionDuration: string;
+ transitionProperty: string;
+ transitionTimingFunction: string;
translate: string | null;
unicodeBidi: string | null;
userSelect: string | null;
verticalAlign: string | null;
visibility: string | null;
- webkitAlignContent: string | null;
- webkitAlignItems: string | null;
- webkitAlignSelf: string | null;
- webkitAnimation: string | null;
- webkitAnimationDelay: string | null;
- webkitAnimationDirection: string | null;
- webkitAnimationDuration: string | null;
- webkitAnimationFillMode: string | null;
- webkitAnimationIterationCount: string | null;
- webkitAnimationName: string | null;
- webkitAnimationPlayState: string | null;
- webkitAnimationTimingFunction: string | null;
- webkitAppearance: string | null;
- webkitBackfaceVisibility: string | null;
- webkitBackgroundClip: string | null;
- webkitBackgroundOrigin: string | null;
- webkitBackgroundSize: string | null;
- webkitBorderBottomLeftRadius: string | null;
- webkitBorderBottomRightRadius: string | null;
+ /** @deprecated */
+ webkitAlignContent: string;
+ /** @deprecated */
+ webkitAlignItems: string;
+ /** @deprecated */
+ webkitAlignSelf: string;
+ /** @deprecated */
+ webkitAnimation: string;
+ /** @deprecated */
+ webkitAnimationDelay: string;
+ /** @deprecated */
+ webkitAnimationDirection: string;
+ /** @deprecated */
+ webkitAnimationDuration: string;
+ /** @deprecated */
+ webkitAnimationFillMode: string;
+ /** @deprecated */
+ webkitAnimationIterationCount: string;
+ /** @deprecated */
+ webkitAnimationName: string;
+ /** @deprecated */
+ webkitAnimationPlayState: string;
+ /** @deprecated */
+ webkitAnimationTimingFunction: string;
+ /** @deprecated */
+ webkitAppearance: string;
+ /** @deprecated */
+ webkitBackfaceVisibility: string;
+ /** @deprecated */
+ webkitBackgroundClip: string;
+ /** @deprecated */
+ webkitBackgroundOrigin: string;
+ /** @deprecated */
+ webkitBackgroundSize: string;
+ /** @deprecated */
+ webkitBorderBottomLeftRadius: string;
+ /** @deprecated */
+ webkitBorderBottomRightRadius: string;
webkitBorderImage: string | null;
- webkitBorderRadius: string | null;
- webkitBorderTopLeftRadius: string | null;
- webkitBorderTopRightRadius: string | null;
- webkitBoxAlign: string | null;
+ /** @deprecated */
+ webkitBorderRadius: string;
+ /** @deprecated */
+ webkitBorderTopLeftRadius: string;
+ /** @deprecated */
+ webkitBorderTopRightRadius: string;
+ /** @deprecated */
+ webkitBoxAlign: string;
webkitBoxDirection: string | null;
- webkitBoxFlex: string | null;
- webkitBoxOrdinalGroup: string | null;
+ /** @deprecated */
+ webkitBoxFlex: string;
+ /** @deprecated */
+ webkitBoxOrdinalGroup: string;
webkitBoxOrient: string | null;
- webkitBoxPack: string | null;
- webkitBoxSizing: string | null;
+ /** @deprecated */
+ webkitBoxPack: string;
+ /** @deprecated */
+ webkitBoxShadow: string;
+ /** @deprecated */
+ webkitBoxSizing: string;
webkitColumnBreakAfter: string | null;
webkitColumnBreakBefore: string | null;
webkitColumnBreakInside: string | null;
@@ -2735,32 +2799,85 @@ interface CSSStyleDeclaration {
webkitColumnSpan: string | null;
webkitColumnWidth: any;
webkitColumns: string | null;
- webkitFilter: string | null;
- webkitFlex: string | null;
- webkitFlexBasis: string | null;
- webkitFlexDirection: string | null;
- webkitFlexFlow: string | null;
- webkitFlexGrow: string | null;
- webkitFlexShrink: string | null;
- webkitFlexWrap: string | null;
- webkitJustifyContent: string | null;
- webkitOrder: string | null;
- webkitPerspective: string | null;
- webkitPerspectiveOrigin: string | null;
+ /** @deprecated */
+ webkitFilter: string;
+ /** @deprecated */
+ webkitFlex: string;
+ /** @deprecated */
+ webkitFlexBasis: string;
+ /** @deprecated */
+ webkitFlexDirection: string;
+ /** @deprecated */
+ webkitFlexFlow: string;
+ /** @deprecated */
+ webkitFlexGrow: string;
+ /** @deprecated */
+ webkitFlexShrink: string;
+ /** @deprecated */
+ webkitFlexWrap: string;
+ /** @deprecated */
+ webkitJustifyContent: string;
+ /** @deprecated */
+ webkitMask: string;
+ /** @deprecated */
+ webkitMaskBoxImage: string;
+ /** @deprecated */
+ webkitMaskBoxImageOutset: string;
+ /** @deprecated */
+ webkitMaskBoxImageRepeat: string;
+ /** @deprecated */
+ webkitMaskBoxImageSlice: string;
+ /** @deprecated */
+ webkitMaskBoxImageSource: string;
+ /** @deprecated */
+ webkitMaskBoxImageWidth: string;
+ /** @deprecated */
+ webkitMaskClip: string;
+ /** @deprecated */
+ webkitMaskComposite: string;
+ /** @deprecated */
+ webkitMaskImage: string;
+ /** @deprecated */
+ webkitMaskOrigin: string;
+ /** @deprecated */
+ webkitMaskPosition: string;
+ /** @deprecated */
+ webkitMaskRepeat: string;
+ /** @deprecated */
+ webkitMaskSize: string;
+ /** @deprecated */
+ webkitOrder: string;
+ /** @deprecated */
+ webkitPerspective: string;
+ /** @deprecated */
+ webkitPerspectiveOrigin: string;
webkitTapHighlightColor: string | null;
- webkitTextFillColor: string | null;
- webkitTextSizeAdjust: any;
- webkitTextStroke: string | null;
- webkitTextStrokeColor: string | null;
- webkitTextStrokeWidth: string | null;
- webkitTransform: string | null;
- webkitTransformOrigin: string | null;
- webkitTransformStyle: string | null;
- webkitTransition: string | null;
- webkitTransitionDelay: string | null;
- webkitTransitionDuration: string | null;
- webkitTransitionProperty: string | null;
- webkitTransitionTimingFunction: string | null;
+ /** @deprecated */
+ webkitTextFillColor: string;
+ /** @deprecated */
+ webkitTextSizeAdjust: string;
+ /** @deprecated */
+ webkitTextStroke: string;
+ /** @deprecated */
+ webkitTextStrokeColor: string;
+ /** @deprecated */
+ webkitTextStrokeWidth: string;
+ /** @deprecated */
+ webkitTransform: string;
+ /** @deprecated */
+ webkitTransformOrigin: string;
+ /** @deprecated */
+ webkitTransformStyle: string;
+ /** @deprecated */
+ webkitTransition: string;
+ /** @deprecated */
+ webkitTransitionDelay: string;
+ /** @deprecated */
+ webkitTransitionDuration: string;
+ /** @deprecated */
+ webkitTransitionProperty: string;
+ /** @deprecated */
+ webkitTransitionTimingFunction: string;
webkitUserModify: string | null;
webkitUserSelect: string | null;
webkitWritingMode: string | null;
@@ -3241,14 +3358,14 @@ interface Coordinates {
readonly speed: number | null;
}
-interface CountQueuingStrategy {
+interface CountQueuingStrategy extends QueuingStrategy {
highWaterMark: number;
- size(): number;
+ size(chunk: any): 1;
}
declare var CountQueuingStrategy: {
prototype: CountQueuingStrategy;
- new(strategy: QueuingStrategy): CountQueuingStrategy;
+ new(options: { highWaterMark: number }): CountQueuingStrategy;
};
interface Crypto {
@@ -4004,7 +4121,7 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
/**
* Gets a reference to the root node of the document.
*/
- readonly documentElement: HTMLElement | null;
+ readonly documentElement: HTMLElement;
/**
* Returns document's URL.
*/
@@ -4036,7 +4153,7 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
/**
* Returns the head element.
*/
- readonly head: HTMLHeadElement | null;
+ readonly head: HTMLHeadElement;
readonly hidden: boolean;
/**
* Retrieves a collection, in source order, of img objects in the document.
@@ -4066,7 +4183,7 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
/**
* Contains information about the current URL.
*/
- location: Location | null;
+ location: Location;
onfullscreenchange: ((this: Document, ev: Event) => any) | null;
onfullscreenerror: ((this: Document, ev: Event) => any) | null;
/**
@@ -4116,6 +4233,7 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
/** @deprecated */
captureEvents(): void;
caretPositionFromPoint(x: number, y: number): CaretPosition | null;
+ /** @deprecated */
caretRangeFromPoint(x: number, y: number): Range;
/** @deprecated */
clear(): void;
@@ -4169,6 +4287,7 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement;
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "cursor"): SVGCursorElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement;
@@ -4341,7 +4460,9 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
* @param filter A custom NodeFilter function to use.
* @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.
*/
- createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null, entityReferenceExpansion?: boolean): TreeWalker;
+ createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;
+ /** @deprecated */
+ createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter | null, entityReferenceExpansion?: boolean): TreeWalker;
/**
* Returns the element for the specified x coordinate and the specified y coordinate.
* @param x The x-offset
@@ -4349,7 +4470,7 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
*/
elementFromPoint(x: number, y: number): Element | null;
elementsFromPoint(x: number, y: number): Element[];
- evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;
+ evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | ((prefix: string) => string | null) | null, type: number, result: XPathResult | null): XPathResult;
/**
* Executes a command on the current document, current selection, or the given range.
* @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
@@ -4570,6 +4691,9 @@ interface DocumentOrShadowRoot {
* Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
*/
readonly styleSheets: StyleSheetList;
+ caretPositionFromPoint(x: number, y: number): CaretPosition | null;
+ /** @deprecated */
+ caretRangeFromPoint(x: number, y: number): Range;
elementFromPoint(x: number, y: number): Element | null;
elementsFromPoint(x: number, y: number): Element[];
getSelection(): Selection | null;
@@ -4621,35 +4745,28 @@ declare var DynamicsCompressorNode: {
};
interface EXT_blend_minmax {
- readonly MAX_EXT: number;
- readonly MIN_EXT: number;
+ readonly MAX_EXT: GLenum;
+ readonly MIN_EXT: GLenum;
}
interface EXT_frag_depth {
}
interface EXT_sRGB {
- readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number;
- readonly SRGB8_ALPHA8_EXT: number;
- readonly SRGB_ALPHA_EXT: number;
- readonly SRGB_EXT: number;
+ readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum;
+ readonly SRGB8_ALPHA8_EXT: GLenum;
+ readonly SRGB_ALPHA_EXT: GLenum;
+ readonly SRGB_EXT: GLenum;
}
interface EXT_shader_texture_lod {
}
interface EXT_texture_filter_anisotropic {
- readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
- readonly TEXTURE_MAX_ANISOTROPY_EXT: number;
+ readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
+ readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
}
-declare var EXT_texture_filter_anisotropic: {
- prototype: EXT_texture_filter_anisotropic;
- new(): EXT_texture_filter_anisotropic;
- readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
- readonly TEXTURE_MAX_ANISOTROPY_EXT: number;
-};
-
interface ElementEventMap {
"fullscreenchange": Event;
"fullscreenerror": Event;
@@ -4867,6 +4984,7 @@ interface Event {
*/
readonly isTrusted: boolean;
returnValue: boolean;
+ /** @deprecated */
readonly srcElement: Element | null;
/**
* Returns the object to which event is dispatched (its target).
@@ -5033,7 +5151,7 @@ interface FileReader extends EventTarget {
readAsArrayBuffer(blob: Blob): void;
readAsBinaryString(blob: Blob): void;
readAsDataURL(blob: Blob): void;
- readAsText(blob: Blob, label?: string): void;
+ readAsText(blob: Blob, encoding?: string): void;
readonly DONE: number;
readonly EMPTY: number;
readonly LOADING: number;
@@ -6520,6 +6638,7 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument {
* Sets or retrieves the frame name.
*/
name: string;
+ readonly referrerPolicy: ReferrerPolicy;
readonly sandbox: DOMTokenList;
/**
* Sets or retrieves whether the frame can be scrolled.
@@ -7155,7 +7274,7 @@ interface HTMLMediaElement extends HTMLElement {
*/
readonly seekable: TimeRanges;
/**
- * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource.
+ * Gets a flag that indicates whether the client is currently moving to a new playback position in the media resource.
*/
readonly seeking: boolean;
/**
@@ -9304,7 +9423,9 @@ interface Location {
/**
* Reloads the current page.
*/
- reload(forcedReload?: boolean): void;
+ reload(): void;
+ /** @deprecated */
+ reload(forcedReload: boolean): void;
/**
* Removes the current page from the session history and navigates to the given URL.
*/
@@ -9725,7 +9846,7 @@ interface MediaQueryList extends EventTarget {
/** @deprecated */
addListener(listener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void;
/** @deprecated */
- removeListener(listener: EventListenerOrEventListenerObject | null): void;
+ removeListener(listener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void;
addEventListener(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -10278,6 +10399,7 @@ interface Node extends EventTarget {
* Returns the last child.
*/
readonly lastChild: ChildNode | null;
+ /** @deprecated */
readonly namespaceURI: string | null;
/**
* Returns the next sibling.
@@ -10550,61 +10672,29 @@ declare var Notification: {
interface OES_element_index_uint {
}
-declare var OES_element_index_uint: {
- prototype: OES_element_index_uint;
- new(): OES_element_index_uint;
-};
-
interface OES_standard_derivatives {
- readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;
+ readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum;
}
-declare var OES_standard_derivatives: {
- prototype: OES_standard_derivatives;
- new(): OES_standard_derivatives;
- readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;
-};
-
interface OES_texture_float {
}
-declare var OES_texture_float: {
- prototype: OES_texture_float;
- new(): OES_texture_float;
-};
-
interface OES_texture_float_linear {
}
-declare var OES_texture_float_linear: {
- prototype: OES_texture_float_linear;
- new(): OES_texture_float_linear;
-};
-
interface OES_texture_half_float {
- readonly HALF_FLOAT_OES: number;
+ readonly HALF_FLOAT_OES: GLenum;
}
-declare var OES_texture_half_float: {
- prototype: OES_texture_half_float;
- new(): OES_texture_half_float;
- readonly HALF_FLOAT_OES: number;
-};
-
interface OES_texture_half_float_linear {
}
-declare var OES_texture_half_float_linear: {
- prototype: OES_texture_half_float_linear;
- new(): OES_texture_half_float_linear;
-};
-
interface OES_vertex_array_object {
- readonly VERTEX_ARRAY_BINDING_OES: number;
- bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;
- createVertexArrayOES(): WebGLVertexArrayObjectOES;
- deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;
- isVertexArrayOES(value: any): value is WebGLVertexArrayObjectOES;
+ bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;
+ createVertexArrayOES(): WebGLVertexArrayObjectOES | null;
+ deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;
+ isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): GLboolean;
+ readonly VERTEX_ARRAY_BINDING_OES: GLenum;
}
interface OfflineAudioCompletionEvent extends Event {
@@ -11794,20 +11884,70 @@ declare var Range: {
readonly START_TO_START: number;
};
-interface ReadableStream {
+interface ReadableByteStreamController {
+ readonly byobRequest: ReadableStreamBYOBRequest | undefined;
+ readonly desiredSize: number | null;
+ close(): void;
+ enqueue(chunk: ArrayBufferView): void;
+ error(error?: any): void;
+}
+
+interface ReadableStream {
readonly locked: boolean;
- cancel(): Promise;
- getReader(): ReadableStreamReader;
+ cancel(reason?: any): Promise;
+ getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
+ getReader(): ReadableStreamDefaultReader;
+ pipeThrough({ writable, readable }: { writable: WritableStream, readable: ReadableStream }, options?: PipeOptions): ReadableStream;
+ pipeTo(dest: WritableStream, options?: PipeOptions): Promise;
+ tee(): [ReadableStream, ReadableStream];
}
declare var ReadableStream: {
prototype: ReadableStream;
- new(): ReadableStream;
+ new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number, size?: undefined }): ReadableStream;
+ new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream;
};
-interface ReadableStreamReader {
+interface ReadableStreamBYOBReader {
+ readonly closed: Promise;
+ cancel(reason?: any): Promise;
+ read(view: T): Promise>;
+ releaseLock(): void;
+}
+
+declare var ReadableStreamBYOBReader: {
+ prototype: ReadableStreamBYOBReader;
+ new(stream: ReadableStream): ReadableStreamBYOBReader;
+};
+
+interface ReadableStreamBYOBRequest {
+ readonly view: ArrayBufferView;
+ respond(bytesWritten: number): void;
+ respondWithNewView(view: ArrayBufferView): void;
+}
+
+interface ReadableStreamDefaultController {
+ readonly desiredSize: number | null;
+ close(): void;
+ enqueue(chunk: R): void;
+ error(error?: any): void;
+}
+
+interface ReadableStreamDefaultReader {
+ readonly closed: Promise;
+ cancel(reason?: any): Promise;
+ read(): Promise>;
+ releaseLock(): void;
+}
+
+interface ReadableStreamReadResult {
+ done: boolean;
+ value: T;
+}
+
+interface ReadableStreamReader {
cancel(): Promise;
- read(): Promise;
+ read(): Promise>;
releaseLock(): void;
}
@@ -11819,7 +11959,7 @@ declare var ReadableStreamReader: {
interface Request extends Body {
/**
* Returns the cache mode associated with request, which is a string indicating
- * how the the request will interact with the browser's cache when fetching.
+ * how the request will interact with the browser's cache when fetching.
*/
readonly cache: RequestCache;
/**
@@ -11957,6 +12097,42 @@ declare var SVGAngle: {
readonly SVG_ANGLETYPE_UNSPECIFIED: number;
};
+interface SVGAnimateElement extends SVGAnimationElement {
+ addEventListener(type: K, listener: (this: SVGAnimateElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener(type: K, listener: (this: SVGAnimateElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
+}
+
+declare var SVGAnimateElement: {
+ prototype: SVGAnimateElement;
+ new(): SVGAnimateElement;
+};
+
+interface SVGAnimateMotionElement extends SVGAnimationElement {
+ addEventListener(type: K, listener: (this: SVGAnimateMotionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener(type: K, listener: (this: SVGAnimateMotionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
+}
+
+declare var SVGAnimateMotionElement: {
+ prototype: SVGAnimateMotionElement;
+ new(): SVGAnimateMotionElement;
+};
+
+interface SVGAnimateTransformElement extends SVGAnimationElement {
+ addEventListener(type: K, listener: (this: SVGAnimateTransformElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener(type: K, listener: (this: SVGAnimateTransformElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
+}
+
+declare var SVGAnimateTransformElement: {
+ prototype: SVGAnimateTransformElement;
+ new(): SVGAnimateTransformElement;
+};
+
interface SVGAnimatedAngle {
readonly animVal: SVGAngle;
readonly baseVal: SVGAngle;
@@ -12082,6 +12258,22 @@ declare var SVGAnimatedTransformList: {
new(): SVGAnimatedTransformList;
};
+interface SVGAnimationElement extends SVGElement {
+ readonly targetElement: SVGElement;
+ getCurrentTime(): number;
+ getSimpleDuration(): number;
+ getStartTime(): number;
+ addEventListener(type: K, listener: (this: SVGAnimationElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener(type: K, listener: (this: SVGAnimationElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
+}
+
+declare var SVGAnimationElement: {
+ prototype: SVGAnimationElement;
+ new(): SVGAnimationElement;
+};
+
interface SVGCircleElement extends SVGGraphicsElement {
readonly cx: SVGAnimatedLength;
readonly cy: SVGAnimatedLength;
@@ -12141,6 +12333,20 @@ declare var SVGComponentTransferFunctionElement: {
readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;
};
+interface SVGCursorElement extends SVGElement {
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ addEventListener(type: K, listener: (this: SVGCursorElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener(type: K, listener: (this: SVGCursorElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
+}
+
+declare var SVGCursorElement: {
+ prototype: SVGCursorElement;
+ new(): SVGCursorElement;
+};
+
interface SVGDefsElement extends SVGGraphicsElement {
addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -14798,6 +15004,23 @@ declare var TrackEvent: {
new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent;
};
+interface TransformStream {
+ readonly readable: ReadableStream;
+ readonly writable: WritableStream;
+}
+
+declare var TransformStream: {
+ prototype: TransformStream;
+ new(transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream;
+};
+
+interface TransformStreamDefaultController {
+ readonly desiredSize: number | null;
+ enqueue(chunk: O): void;
+ error(reason?: any): void;
+ terminate(): void;
+}
+
interface TransitionEvent extends Event {
readonly elapsedTime: number;
readonly propertyName: string;
@@ -15115,129 +15338,106 @@ declare var VideoTrackList: {
};
interface WEBGL_color_buffer_float {
- readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number;
- readonly RGB32F_EXT: number;
- readonly RGBA32F_EXT: number;
- readonly UNSIGNED_NORMALIZED_EXT: number;
+ readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum;
+ readonly RGBA32F_EXT: GLenum;
+ readonly UNSIGNED_NORMALIZED_EXT: GLenum;
}
interface WEBGL_compressed_texture_astc {
- readonly COMPRESSED_RGBA_ASTC_10x10_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_10x5_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_10x6_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_10x8_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_12x10_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_12x12_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_4x4_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_5x4_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_5x5_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_6x5_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_6x6_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_8x5_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_8x6_KHR: number;
- readonly COMPRESSED_RGBA_ASTC_8x8_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: number;
- readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: number;
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;
}
interface WEBGL_compressed_texture_s3tc {
- readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;
- readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;
- readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;
- readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;
+ 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;
}
-declare var WEBGL_compressed_texture_s3tc: {
- prototype: WEBGL_compressed_texture_s3tc;
- new(): WEBGL_compressed_texture_s3tc;
- readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;
- readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;
- readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;
- readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;
-};
-
interface WEBGL_compressed_texture_s3tc_srgb {
- readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number;
- readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: number;
- readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number;
- readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: number;
+ 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;
}
interface WEBGL_debug_renderer_info {
- readonly UNMASKED_RENDERER_WEBGL: number;
- readonly UNMASKED_VENDOR_WEBGL: number;
+ readonly UNMASKED_RENDERER_WEBGL: GLenum;
+ readonly UNMASKED_VENDOR_WEBGL: GLenum;
}
-declare var WEBGL_debug_renderer_info: {
- prototype: WEBGL_debug_renderer_info;
- new(): WEBGL_debug_renderer_info;
- readonly UNMASKED_RENDERER_WEBGL: number;
- readonly UNMASKED_VENDOR_WEBGL: number;
-};
-
interface WEBGL_debug_shaders {
getTranslatedShaderSource(shader: WebGLShader): string;
}
interface WEBGL_depth_texture {
- readonly UNSIGNED_INT_24_8_WEBGL: number;
+ readonly UNSIGNED_INT_24_8_WEBGL: GLenum;
}
-declare var WEBGL_depth_texture: {
- prototype: WEBGL_depth_texture;
- new(): WEBGL_depth_texture;
- readonly UNSIGNED_INT_24_8_WEBGL: number;
-};
-
interface WEBGL_draw_buffers {
- readonly COLOR_ATTACHMENT0_WEBGL: number;
- readonly COLOR_ATTACHMENT10_WEBGL: number;
- readonly COLOR_ATTACHMENT11_WEBGL: number;
- readonly COLOR_ATTACHMENT12_WEBGL: number;
- readonly COLOR_ATTACHMENT13_WEBGL: number;
- readonly COLOR_ATTACHMENT14_WEBGL: number;
- readonly COLOR_ATTACHMENT15_WEBGL: number;
- readonly COLOR_ATTACHMENT1_WEBGL: number;
- readonly COLOR_ATTACHMENT2_WEBGL: number;
- readonly COLOR_ATTACHMENT3_WEBGL: number;
- readonly COLOR_ATTACHMENT4_WEBGL: number;
- readonly COLOR_ATTACHMENT5_WEBGL: number;
- readonly COLOR_ATTACHMENT6_WEBGL: number;
- readonly COLOR_ATTACHMENT7_WEBGL: number;
- readonly COLOR_ATTACHMENT8_WEBGL: number;
- readonly COLOR_ATTACHMENT9_WEBGL: number;
- readonly DRAW_BUFFER0_WEBGL: number;
- readonly DRAW_BUFFER10_WEBGL: number;
- readonly DRAW_BUFFER11_WEBGL: number;
- readonly DRAW_BUFFER12_WEBGL: number;
- readonly DRAW_BUFFER13_WEBGL: number;
- readonly DRAW_BUFFER14_WEBGL: number;
- readonly DRAW_BUFFER15_WEBGL: number;
- readonly DRAW_BUFFER1_WEBGL: number;
- readonly DRAW_BUFFER2_WEBGL: number;
- readonly DRAW_BUFFER3_WEBGL: number;
- readonly DRAW_BUFFER4_WEBGL: number;
- readonly DRAW_BUFFER5_WEBGL: number;
- readonly DRAW_BUFFER6_WEBGL: number;
- readonly DRAW_BUFFER7_WEBGL: number;
- readonly DRAW_BUFFER8_WEBGL: number;
- readonly DRAW_BUFFER9_WEBGL: number;
- readonly MAX_COLOR_ATTACHMENTS_WEBGL: number;
- readonly MAX_DRAW_BUFFERS_WEBGL: number;
- drawBuffersWEBGL(buffers: number[]): void;
+ 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;
}
interface WEBGL_lose_context {
@@ -16139,7 +16339,7 @@ declare var WebGLUniformLocation: {
new(): WebGLUniformLocation;
};
-interface WebGLVertexArrayObjectOES {
+interface WebGLVertexArrayObjectOES extends WebGLObject {
}
interface WebKitPoint {
@@ -16196,9 +16396,6 @@ interface WheelEvent extends MouseEvent {
readonly deltaX: number;
readonly deltaY: number;
readonly deltaZ: number;
- readonly wheelDelta: number;
- readonly wheelDeltaX: number;
- readonly wheelDeltaY: number;
getCurrentPoint(element: Element): void;
initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void;
readonly DOM_DELTA_LINE: number;
@@ -16545,7 +16742,7 @@ interface Worker extends EventTarget, AbstractWorker {
declare var Worker: {
prototype: Worker;
- new(stringUrl: string): Worker;
+ new(stringUrl: string, options?: WorkerOptions): Worker;
};
interface Worklet {
@@ -16557,41 +16754,31 @@ declare var Worklet: {
new(): Worklet;
};
-interface WritableStream {
+interface WritableStream {
readonly locked: boolean;
abort(reason?: any): Promise;
- getWriter(): WritableStreamDefaultWriter;
+ getWriter(): WritableStreamDefaultWriter;
}
declare var WritableStream: {
prototype: WritableStream;
- new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream;
+ new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream;
};
interface WritableStreamDefaultController {
error(error?: any): void;
}
-declare var WritableStreamDefaultController: {
- prototype: WritableStreamDefaultController;
- new(): WritableStreamDefaultController;
-};
-
-interface WritableStreamDefaultWriter {
+interface WritableStreamDefaultWriter {
readonly closed: Promise;
- readonly desiredSize: number;
+ readonly desiredSize: number | null;
readonly ready: Promise;
abort(reason?: any): Promise;
close(): Promise;
releaseLock(): void;
- write(chunk?: any): Promise;
+ write(chunk: W): Promise;
}
-declare var WritableStreamDefaultWriter: {
- prototype: WritableStreamDefaultWriter;
- new(): WritableStreamDefaultWriter;
-};
-
interface XMLDocument extends Document {
addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -16772,7 +16959,7 @@ declare var XMLSerializer: {
interface XPathEvaluator {
createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
createNSResolver(nodeResolver?: Node): XPathNSResolver;
- evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;
+ evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | ((prefix: string) => string | null) | null, type: number, result: XPathResult | null): XPathResult;
}
declare var XPathEvaluator: {
@@ -16790,7 +16977,7 @@ declare var XPathExpression: {
};
interface XPathNSResolver {
- lookupNamespaceURI(prefix: string): string;
+ lookupNamespaceURI(prefix: string): string | null;
}
declare var XPathNSResolver: {
@@ -16941,6 +17128,10 @@ interface PositionErrorCallback {
(positionError: PositionError): void;
}
+interface QueuingStrategySizeCallback {
+ (chunk: T): number;
+}
+
interface RTCPeerConnectionErrorCallback {
(error: DOMException): void;
}
@@ -16953,20 +17144,44 @@ interface RTCStatsCallback {
(report: RTCStatsReport): void;
}
+interface ReadableByteStreamControllerCallback {
+ (controller: ReadableByteStreamController): void | PromiseLike;
+}
+
+interface ReadableStreamDefaultControllerCallback {
+ (controller: ReadableStreamDefaultController): void | PromiseLike;
+}
+
+interface ReadableStreamErrorCallback {
+ (reason: any): void | PromiseLike;
+}
+
+interface TransformStreamDefaultControllerCallback {
+ (controller: TransformStreamDefaultController): void | PromiseLike;
+}
+
+interface TransformStreamDefaultControllerTransformCallback {
+ (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike;
+}
+
interface VoidFunction {
(): void;
}
-interface WritableStreamChunkCallback {
- (chunk: any, controller: WritableStreamDefaultController): void;
+interface WritableStreamDefaultControllerCloseCallback {
+ (): void | PromiseLike;
}
-interface WritableStreamDefaultControllerCallback {
- (controller: WritableStreamDefaultController): void;
+interface WritableStreamDefaultControllerStartCallback {
+ (controller: WritableStreamDefaultController): void | PromiseLike;
+}
+
+interface WritableStreamDefaultControllerWriteCallback {
+ (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike;
}
interface WritableStreamErrorCallback {
- (reason: string): void;
+ (reason: any): void | PromiseLike;
}
interface HTMLElementTagNameMap {
@@ -17600,7 +17815,7 @@ declare function removeEventListener(type: K, li
declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
type BlobPart = BufferSource | Blob | string;
type HeadersInit = Headers | string[][] | Record;
-type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string;
+type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string;
type RequestInfo = Request | string;
type DOMHighResTimeStamp = number;
type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext;
@@ -17646,6 +17861,7 @@ type IDBKeyPath = string;
type Transferable = ArrayBuffer | MessagePort | ImageBitmap;
type RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete;
type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;
+/** @deprecated */
type MouseWheelEvent = WheelEvent;
type WindowProxy = Window;
type AlignSetting = "start" | "center" | "end" | "left" | "right";
@@ -17668,11 +17884,13 @@ type ChannelCountMode = "max" | "clamped-max" | "explicit";
type ChannelInterpretation = "speakers" | "discrete";
type ClientTypes = "window" | "worker" | "sharedworker" | "all";
type CompositeOperation = "replace" | "add" | "accumulate";
+type CompositeOperationOrAuto = "replace" | "add" | "accumulate" | "auto";
type DirectionSetting = "" | "rl" | "lr";
type DisplayCaptureSurfaceType = "monitor" | "window" | "application" | "browser";
type DistanceModelType = "linear" | "inverse" | "exponential";
type DocumentReadyState = "loading" | "interactive" | "complete";
type EndOfStreamError = "network" | "decode";
+type EndingType = "transparent" | "native";
type FillMode = "none" | "forwards" | "backwards" | "both" | "auto";
type GamepadHand = "" | "left" | "right";
type GamepadHapticActuatorType = "vibration";
@@ -17751,7 +17969,7 @@ type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors";
type RequestRedirect = "follow" | "error" | "manual";
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
type ScopedCredentialType = "ScopedCred";
-type ScrollBehavior = "auto" | "instant" | "smooth";
+type ScrollBehavior = "auto" | "smooth";
type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
type ScrollRestoration = "auto" | "manual";
type ScrollSetting = "" | "up";
diff --git a/lib/lib.es2015.collection.d.ts b/lib/lib.es2015.collection.d.ts
index c6a02b32cc2..2c19919dd20 100644
--- a/lib/lib.es2015.collection.d.ts
+++ b/lib/lib.es2015.collection.d.ts
@@ -29,7 +29,8 @@ interface Map {
}
interface MapConstructor {
- new (entries?: ReadonlyArray<[K, V]> | null): Map;
+ new(): Map;
+ new(entries?: ReadonlyArray<[K, V]> | null): Map;
readonly prototype: Map;
}
declare var Map: MapConstructor;
diff --git a/lib/lib.es2015.iterable.d.ts b/lib/lib.es2015.iterable.d.ts
index 793f587059b..43b021a197d 100644
--- a/lib/lib.es2015.iterable.d.ts
+++ b/lib/lib.es2015.iterable.d.ts
@@ -155,7 +155,7 @@ interface MapConstructor {
interface WeakMap { }
interface WeakMapConstructor {
- new (iterable: Iterable<[K, V]>): WeakMap;
+ new (iterable: Iterable<[K, V]>): WeakMap;
}
interface Set {
diff --git a/lib/lib.es2015.symbol.wellknown.d.ts b/lib/lib.es2015.symbol.wellknown.d.ts
index 922cbb35a82..400f70a7f4d 100644
--- a/lib/lib.es2015.symbol.wellknown.d.ts
+++ b/lib/lib.es2015.symbol.wellknown.d.ts
@@ -83,7 +83,7 @@ interface SymbolConstructor {
}
interface Symbol {
- readonly [Symbol.toStringTag]: "Symbol";
+ readonly [Symbol.toStringTag]: string;
}
interface Array {
@@ -127,23 +127,23 @@ interface Date {
}
interface Map {
- readonly [Symbol.toStringTag]: "Map";
+ readonly [Symbol.toStringTag]: string;
}
interface WeakMap {
- readonly [Symbol.toStringTag]: "WeakMap";
+ readonly [Symbol.toStringTag]: string;
}
interface Set {
- readonly [Symbol.toStringTag]: "Set";
+ readonly [Symbol.toStringTag]: string;
}
interface WeakSet {
- readonly [Symbol.toStringTag]: "WeakSet";
+ readonly [Symbol.toStringTag]: string;
}
interface JSON {
- readonly [Symbol.toStringTag]: "JSON";
+ readonly [Symbol.toStringTag]: string;
}
interface Function {
@@ -158,15 +158,15 @@ interface Function {
}
interface GeneratorFunction {
- readonly [Symbol.toStringTag]: "GeneratorFunction";
+ readonly [Symbol.toStringTag]: string;
}
interface Math {
- readonly [Symbol.toStringTag]: "Math";
+ readonly [Symbol.toStringTag]: string;
}
interface Promise {
- readonly [Symbol.toStringTag]: "Promise";
+ readonly [Symbol.toStringTag]: string;
}
interface PromiseConstructor {
@@ -261,11 +261,11 @@ interface String {
}
interface ArrayBuffer {
- readonly [Symbol.toStringTag]: "ArrayBuffer";
+ readonly [Symbol.toStringTag]: string;
}
interface DataView {
- readonly [Symbol.toStringTag]: "DataView";
+ readonly [Symbol.toStringTag]: string;
}
interface Int8Array {
diff --git a/lib/lib.esnext.bigint.d.ts b/lib/lib.esnext.bigint.d.ts
new file mode 100644
index 00000000000..ccb73bee761
--- /dev/null
+++ b/lib/lib.esnext.bigint.d.ts
@@ -0,0 +1,629 @@
+/*! *****************************************************************************
+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 BigInt {
+ /**
+ * Returns a string representation of an object.
+ * @param radix Specifies a radix for converting numeric values to strings.
+ */
+ toString(radix?: number): string;
+
+ /** Returns a string representation appropriate to the host environment's current locale. */
+ toLocaleString(): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): bigint;
+
+ readonly [Symbol.toStringTag]: "BigInt";
+}
+
+interface BigIntConstructor {
+ (value?: any): bigint;
+ readonly prototype: BigInt;
+
+ /**
+ * Interprets the low bits of a BigInt as a 2's-complement signed integer.
+ * All higher bits are discarded.
+ * @param bits The number of low bits to use
+ * @param int The BigInt whose bits to extract
+ */
+ asIntN(bits: number, int: bigint): bigint;
+ /**
+ * Interprets the low bits of a BigInt as an unsigned integer.
+ * All higher bits are discarded.
+ * @param bits The number of low bits to use
+ * @param int The BigInt whose bits to extract
+ */
+ asUintN(bits: number, int: bigint): bigint;
+}
+
+declare const BigInt: BigIntConstructor;
+
+/**
+ * A typed array of 64-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated, an exception is raised.
+ */
+interface BigInt64Array {
+ /** The size in bytes of each element in the array. */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /** The ArrayBuffer instance referenced by the array. */
+ readonly buffer: ArrayBufferLike;
+
+ /** The length in bytes of the array. */
+ readonly byteLength: number;
+
+ /** The offset in bytes of the array. */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /** Yields index, value pairs for every entry in the array. */
+ entries(): IterableIterator<[number, bigint]>;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in the array until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: bigint, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find 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.
+ */
+ find(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): bigint | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and -1
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex 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.
+ */
+ findIndex(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array) => void, thisArg?: any): void;
+
+ /**
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
+ * @param searchElement The element to search for.
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
+ */
+ includes(searchElement: bigint, fromIndex?: number): boolean;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: bigint, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /** Yields each index in the array. */
+ keys(): IterableIterator;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: bigint, fromIndex?: number): number;
+
+ /** The length of the array. */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: bigint, index: number, array: BigInt64Array) => bigint, thisArg?: any): BigInt64Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U;
+
+ /** Reverses the elements in the array. */
+ reverse(): this;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): BigInt64Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in the array until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts the array.
+ * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
+ */
+ sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
+
+ /**
+ * Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): BigInt64Array;
+
+ /** Converts the array to a string by using the current locale. */
+ toLocaleString(): string;
+
+ /** Returns a string representation of the array. */
+ toString(): string;
+
+ /** Yields each value in the array. */
+ values(): IterableIterator;
+
+ [Symbol.iterator](): IterableIterator;
+
+ readonly [Symbol.toStringTag]: "BigInt64Array";
+
+ [index: number]: bigint;
+}
+
+interface BigInt64ArrayConstructor {
+ readonly prototype: BigInt64Array;
+ new(length?: number): BigInt64Array;
+ new(array: Iterable): BigInt64Array;
+ new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array;
+
+ /** The size in bytes of each element in the array. */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: bigint[]): BigInt64Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike): BigInt64Array;
+ from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array;
+}
+
+declare const BigInt64Array: BigInt64ArrayConstructor;
+
+/**
+ * A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated, an exception is raised.
+ */
+interface BigUint64Array {
+ /** The size in bytes of each element in the array. */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /** The ArrayBuffer instance referenced by the array. */
+ readonly buffer: ArrayBufferLike;
+
+ /** The length in bytes of the array. */
+ readonly byteLength: number;
+
+ /** The offset in bytes of the array. */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /** Yields index, value pairs for every entry in the array. */
+ entries(): IterableIterator<[number, bigint]>;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in the array until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: bigint, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find 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.
+ */
+ find(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): bigint | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and -1
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex 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.
+ */
+ findIndex(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array) => void, thisArg?: any): void;
+
+ /**
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
+ * @param searchElement The element to search for.
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
+ */
+ includes(searchElement: bigint, fromIndex?: number): boolean;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: bigint, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /** Yields each index in the array. */
+ keys(): IterableIterator;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: bigint, fromIndex?: number): number;
+
+ /** The length of the array. */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: bigint, index: number, array: BigUint64Array) => bigint, thisArg?: any): BigUint64Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U;
+
+ /** Reverses the elements in the array. */
+ reverse(): this;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): BigUint64Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in the array until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts the array.
+ * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
+ */
+ sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
+
+ /**
+ * Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): BigUint64Array;
+
+ /** Converts the array to a string by using the current locale. */
+ toLocaleString(): string;
+
+ /** Returns a string representation of the array. */
+ toString(): string;
+
+ /** Yields each value in the array. */
+ values(): IterableIterator;
+
+ [Symbol.iterator](): IterableIterator;
+
+ readonly [Symbol.toStringTag]: "BigUint64Array";
+
+ [index: number]: bigint;
+}
+
+interface BigUint64ArrayConstructor {
+ readonly prototype: BigUint64Array;
+ new(length?: number): BigUint64Array;
+ new(array: Iterable): BigUint64Array;
+ new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array;
+
+ /** The size in bytes of each element in the array. */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: bigint[]): BigUint64Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike): BigUint64Array;
+ from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array;
+}
+
+declare const BigUint64Array: BigUint64ArrayConstructor;
+
+interface DataView {
+ /**
+ * Gets the BigInt64 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
+
+ /**
+ * Gets the BigUint64 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
+
+ /**
+ * Stores a BigInt64 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
+
+ /**
+ * Stores a BigUint64 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
+}
\ No newline at end of file
diff --git a/lib/lib.esnext.d.ts b/lib/lib.esnext.d.ts
index 8e8592bd61a..f213999684d 100644
--- a/lib/lib.esnext.d.ts
+++ b/lib/lib.esnext.d.ts
@@ -21,5 +21,6 @@ and limitations under the License.
///
///
///
+///
///
///
diff --git a/lib/lib.webworker.d.ts b/lib/lib.webworker.d.ts
index 2fa70fb2a6b..238702731fd 100644
--- a/lib/lib.webworker.d.ts
+++ b/lib/lib.webworker.d.ts
@@ -59,6 +59,7 @@ interface Algorithm {
}
interface BlobPropertyBag {
+ endings?: EndingType;
type?: string;
}
@@ -302,6 +303,12 @@ interface PerformanceObserverInit {
entryTypes: string[];
}
+interface PipeOptions {
+ preventAbort?: boolean;
+ preventCancel?: boolean;
+ preventClose?: boolean;
+}
+
interface ProgressEventInit extends EventInit {
lengthComputable?: boolean;
loaded?: number;
@@ -333,6 +340,11 @@ interface PushSubscriptionOptionsInit {
userVisibleOnly?: boolean;
}
+interface QueuingStrategy {
+ highWaterMark?: number;
+ size?: QueuingStrategySizeCallback;
+}
+
interface RegistrationOptions {
scope?: string;
type?: WorkerType;
@@ -407,10 +419,69 @@ interface TextDecoderOptions {
ignoreBOM?: boolean;
}
+interface Transformer {
+ flush?: TransformStreamDefaultControllerCallback;
+ readableType?: undefined;
+ start?: TransformStreamDefaultControllerCallback;
+ transform?: TransformStreamDefaultControllerTransformCallback;
+ writableType?: undefined;
+}
+
+interface UnderlyingByteSource {
+ autoAllocateChunkSize?: number;
+ cancel?: ReadableStreamErrorCallback;
+ pull?: ReadableByteStreamControllerCallback;
+ start?: ReadableByteStreamControllerCallback;
+ type: "bytes";
+}
+
+interface UnderlyingSink {
+ abort?: WritableStreamErrorCallback;
+ close?: WritableStreamDefaultControllerCloseCallback;
+ start?: WritableStreamDefaultControllerStartCallback;
+ type?: undefined;
+ write?: WritableStreamDefaultControllerWriteCallback;
+}
+
+interface UnderlyingSource {
+ cancel?: ReadableStreamErrorCallback;
+ pull?: ReadableStreamDefaultControllerCallback;
+ start?: ReadableStreamDefaultControllerCallback;
+ type?: undefined;
+}
+
+interface WebGLContextAttributes {
+ alpha?: GLboolean;
+ antialias?: GLboolean;
+ depth?: GLboolean;
+ failIfMajorPerformanceCaveat?: boolean;
+ powerPreference?: WebGLPowerPreference;
+ premultipliedAlpha?: GLboolean;
+ preserveDrawingBuffer?: GLboolean;
+ stencil?: GLboolean;
+}
+
+interface WebGLContextEventInit extends EventInit {
+ statusMessage?: string;
+}
+
+interface WorkerOptions {
+ credentials?: RequestCredentials;
+ name?: string;
+ type?: WorkerType;
+}
+
interface EventListener {
(evt: Event): void;
}
+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;
+}
+
interface AbortController {
/**
* Returns the AbortSignal object associated with this object.
@@ -482,7 +553,7 @@ declare var Blob: {
};
interface Body {
- readonly body: ReadableStream | null;
+ readonly body: ReadableStream | null;
readonly bodyUsed: boolean;
arrayBuffer(): Promise;
blob(): Promise;
@@ -527,6 +598,16 @@ interface BroadcastChannelEventMap {
messageerror: MessageEvent;
}
+interface ByteLengthQueuingStrategy extends QueuingStrategy {
+ highWaterMark: number;
+ size(chunk: ArrayBufferView): number;
+}
+
+declare var ByteLengthQueuingStrategy: {
+ prototype: ByteLengthQueuingStrategy;
+ new(options: { highWaterMark: number }): ByteLengthQueuingStrategy;
+};
+
interface Cache {
add(request: RequestInfo): Promise;
addAll(requests: RequestInfo[]): Promise;
@@ -675,6 +756,16 @@ declare var Console: {
new(): Console;
};
+interface CountQueuingStrategy extends QueuingStrategy {
+ highWaterMark: number;
+ size(chunk: any): 1;
+}
+
+declare var CountQueuingStrategy: {
+ prototype: CountQueuingStrategy;
+ new(options: { highWaterMark: number }): CountQueuingStrategy;
+};
+
interface Crypto {
readonly subtle: SubtleCrypto;
getRandomValues(array: T): T;
@@ -1002,6 +1093,29 @@ interface DhKeyGenParams extends Algorithm {
prime: Uint8Array;
}
+interface EXT_blend_minmax {
+ readonly MAX_EXT: GLenum;
+ readonly MIN_EXT: GLenum;
+}
+
+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;
+}
+
+interface EXT_shader_texture_lod {
+}
+
+interface EXT_texture_filter_anisotropic {
+ readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
+ readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
+}
+
interface ErrorEvent extends Event {
readonly colno: number;
readonly error: any;
@@ -1039,7 +1153,6 @@ interface Event {
*/
readonly isTrusted: boolean;
returnValue: boolean;
- readonly srcElement: object | null;
/**
* Returns the object to which event is dispatched (its target).
*/
@@ -1217,7 +1330,7 @@ interface FileReader extends EventTarget {
readAsArrayBuffer(blob: Blob): void;
readAsBinaryString(blob: Blob): void;
readAsDataURL(blob: Blob): void;
- readAsText(blob: Blob, label?: string): void;
+ readAsText(blob: Blob, encoding?: string): void;
readonly DONE: number;
readonly EMPTY: number;
readonly LOADING: number;
@@ -1239,7 +1352,7 @@ interface FileReaderSync {
readAsArrayBuffer(blob: Blob): ArrayBuffer;
readAsBinaryString(blob: Blob): string;
readAsDataURL(blob: Blob): string;
- readAsText(blob: Blob, label?: string): string;
+ readAsText(blob: Blob, encoding?: string): string;
}
declare var FileReaderSync: {
@@ -1994,6 +2107,34 @@ declare var NotificationEvent: {
new(type: string, eventInitDict: NotificationEventInit): NotificationEvent;
};
+interface OES_element_index_uint {
+}
+
+interface OES_standard_derivatives {
+ readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum;
+}
+
+interface OES_texture_float {
+}
+
+interface OES_texture_float_linear {
+}
+
+interface OES_texture_half_float {
+ readonly HALF_FLOAT_OES: GLenum;
+}
+
+interface OES_texture_half_float_linear {
+}
+
+interface OES_vertex_array_object {
+ bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;
+ createVertexArrayOES(): WebGLVertexArrayObjectOES | null;
+ deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;
+ isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): GLboolean;
+ readonly VERTEX_ARRAY_BINDING_OES: GLenum;
+}
+
interface Path2D extends CanvasPath {
addPath(path: Path2D, transform?: DOMMatrix2DInit): void;
}
@@ -2197,20 +2338,70 @@ declare var PushSubscriptionOptions: {
new(): PushSubscriptionOptions;
};
-interface ReadableStream {
+interface ReadableByteStreamController {
+ readonly byobRequest: ReadableStreamBYOBRequest | undefined;
+ readonly desiredSize: number | null;
+ close(): void;
+ enqueue(chunk: ArrayBufferView): void;
+ error(error?: any): void;
+}
+
+interface ReadableStream {
readonly locked: boolean;
- cancel(): Promise;
- getReader(): ReadableStreamReader;
+ cancel(reason?: any): Promise;
+ getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
+ getReader(): ReadableStreamDefaultReader;
+ pipeThrough({ writable, readable }: { writable: WritableStream, readable: ReadableStream }, options?: PipeOptions): ReadableStream;
+ pipeTo(dest: WritableStream, options?: PipeOptions): Promise;
+ tee(): [ReadableStream, ReadableStream];
}
declare var ReadableStream: {
prototype: ReadableStream;
- new(): ReadableStream;
+ new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number, size?: undefined }): ReadableStream;
+ new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream;
};
-interface ReadableStreamReader {
+interface ReadableStreamBYOBReader {
+ readonly closed: Promise;
+ cancel(reason?: any): Promise;
+ read(view: T): Promise>;
+ releaseLock(): void;
+}
+
+declare var ReadableStreamBYOBReader: {
+ prototype: ReadableStreamBYOBReader;
+ new(stream: ReadableStream): ReadableStreamBYOBReader;
+};
+
+interface ReadableStreamBYOBRequest {
+ readonly view: ArrayBufferView;
+ respond(bytesWritten: number): void;
+ respondWithNewView(view: ArrayBufferView): void;
+}
+
+interface ReadableStreamDefaultController {
+ readonly desiredSize: number | null;
+ close(): void;
+ enqueue(chunk: R): void;
+ error(error?: any): void;
+}
+
+interface ReadableStreamDefaultReader {
+ readonly closed: Promise;
+ cancel(reason?: any): Promise;
+ read(): Promise>;
+ releaseLock(): void;
+}
+
+interface ReadableStreamReadResult {
+ done: boolean;
+ value: T;
+}
+
+interface ReadableStreamReader {
cancel(): Promise;
- read(): Promise;
+ read(): Promise>;
releaseLock(): void;
}
@@ -2222,7 +2413,7 @@ declare var ReadableStreamReader: {
interface Request extends Body {
/**
* Returns the cache mode associated with request, which is a string indicating
- * how the the request will interact with the browser's cache when fetching.
+ * how the request will interact with the browser's cache when fetching.
*/
readonly cache: RequestCache;
/**
@@ -2544,6 +2735,46 @@ declare var TextEncoder: {
new(): TextEncoder;
};
+interface TextMetrics {
+ readonly actualBoundingBoxAscent: number;
+ readonly actualBoundingBoxDescent: number;
+ readonly actualBoundingBoxLeft: number;
+ readonly actualBoundingBoxRight: number;
+ readonly alphabeticBaseline: number;
+ readonly emHeightAscent: number;
+ readonly emHeightDescent: number;
+ readonly fontBoundingBoxAscent: number;
+ readonly fontBoundingBoxDescent: number;
+ readonly hangingBaseline: number;
+ /**
+ * Returns the measurement described below.
+ */
+ readonly ideographicBaseline: number;
+ readonly width: number;
+}
+
+declare var TextMetrics: {
+ prototype: TextMetrics;
+ new(): TextMetrics;
+};
+
+interface TransformStream {
+ readonly readable: ReadableStream;
+ readonly writable: WritableStream;
+}
+
+declare var TransformStream: {
+ prototype: TransformStream;
+ new(transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream;
+};
+
+interface TransformStreamDefaultController {
+ readonly desiredSize: number | null;
+ enqueue(chunk: O): void;
+ error(reason?: any): void;
+ terminate(): void;
+}
+
interface URL {
hash: string;
host: string;
@@ -2601,6 +2832,978 @@ declare var URLSearchParams: {
new(init?: string[][] | Record | string | URLSearchParams): URLSearchParams;
};
+interface WEBGL_color_buffer_float {
+ readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum;
+ readonly RGBA32F_EXT: GLenum;
+ readonly UNSIGNED_NORMALIZED_EXT: GLenum;
+}
+
+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;
+}
+
+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;
+}
+
+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;
+}
+
+interface WEBGL_debug_renderer_info {
+ readonly UNMASKED_RENDERER_WEBGL: GLenum;
+ readonly UNMASKED_VENDOR_WEBGL: GLenum;
+}
+
+interface WEBGL_debug_shaders {
+ getTranslatedShaderSource(shader: WebGLShader): string;
+}
+
+interface WEBGL_depth_texture {
+ readonly UNSIGNED_INT_24_8_WEBGL: GLenum;
+}
+
+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;
+}
+
+interface WEBGL_lose_context {
+ loseContext(): void;
+ restoreContext(): void;
+}
+
+interface WebGLActiveInfo {
+ readonly name: string;
+ readonly size: GLint;
+ readonly type: GLenum;
+}
+
+declare var WebGLActiveInfo: {
+ prototype: WebGLActiveInfo;
+ new(): WebGLActiveInfo;
+};
+
+interface WebGLBuffer extends WebGLObject {
+}
+
+declare var WebGLBuffer: {
+ prototype: WebGLBuffer;
+ new(): WebGLBuffer;
+};
+
+interface WebGLContextEvent extends Event {
+ readonly statusMessage: string;
+}
+
+declare var WebGLContextEvent: {
+ prototype: WebGLContextEvent;
+ new(type: string, eventInit?: WebGLContextEventInit): WebGLContextEvent;
+};
+
+interface WebGLFramebuffer extends WebGLObject {
+}
+
+declare var WebGLFramebuffer: {
+ prototype: WebGLFramebuffer;
+ new(): WebGLFramebuffer;
+};
+
+interface WebGLObject {
+}
+
+declare var WebGLObject: {
+ prototype: WebGLObject;
+ new(): WebGLObject;
+};
+
+interface WebGLProgram extends WebGLObject {
+}
+
+declare var WebGLProgram: {
+ prototype: WebGLProgram;
+ new(): WebGLProgram;
+};
+
+interface WebGLRenderbuffer extends WebGLObject {
+}
+
+declare var WebGLRenderbuffer: {
+ prototype: WebGLRenderbuffer;
+ new(): WebGLRenderbuffer;
+};
+
+interface WebGLRenderingContext extends WebGLRenderingContextBase {
+}
+
+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;
+};
+
+interface WebGLRenderingContextBase {
+ readonly drawingBufferHeight: GLsizei;
+ readonly drawingBufferWidth: GLsizei;
+ activeTexture(texture: GLenum): void;
+ attachShader(program: WebGLProgram, shader: WebGLShader): void;
+ bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void;
+ bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void;
+ bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void;
+ bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
+ bindTexture(target: GLenum, texture: WebGLTexture | null): void;
+ blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;
+ blendEquation(mode: GLenum): void;
+ blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum): void;
+ blendFunc(sfactor: GLenum, dfactor: GLenum): void;
+ blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void;
+ bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;
+ bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void;
+ bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void;
+ checkFramebufferStatus(target: GLenum): GLenum;
+ clear(mask: GLbitfield): void;
+ clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;
+ clearDepth(depth: GLclampf): void;
+ clearStencil(s: GLint): void;
+ colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void;
+ compileShader(shader: WebGLShader): void;
+ compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView): void;
+ compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView): void;
+ copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint): void;
+ copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
+ createBuffer(): WebGLBuffer | null;
+ createFramebuffer(): WebGLFramebuffer | null;
+ createProgram(): WebGLProgram | null;
+ createRenderbuffer(): WebGLRenderbuffer | null;
+ createShader(type: GLenum): WebGLShader | null;
+ createTexture(): WebGLTexture | null;
+ cullFace(mode: GLenum): void;
+ deleteBuffer(buffer: WebGLBuffer | null): void;
+ deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;
+ deleteProgram(program: WebGLProgram | null): void;
+ deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;
+ deleteShader(shader: WebGLShader | null): void;
+ deleteTexture(texture: WebGLTexture | null): void;
+ depthFunc(func: GLenum): void;
+ depthMask(flag: GLboolean): void;
+ depthRange(zNear: GLclampf, zFar: GLclampf): void;
+ detachShader(program: WebGLProgram, shader: WebGLShader): void;
+ disable(cap: GLenum): void;
+ disableVertexAttribArray(index: GLuint): void;
+ drawArrays(mode: GLenum, first: GLint, count: GLsizei): void;
+ drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr): void;
+ enable(cap: GLenum): void;
+ enableVertexAttribArray(index: GLuint): void;
+ finish(): void;
+ flush(): void;
+ framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void;
+ framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level: GLint): void;
+ frontFace(mode: GLenum): void;
+ generateMipmap(target: GLenum): void;
+ getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
+ getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;
+ getAttachedShaders(program: WebGLProgram): WebGLShader[] | null;
+ getAttribLocation(program: WebGLProgram, name: string): GLint;
+ getBufferParameter(target: GLenum, pname: GLenum): any;
+ getContextAttributes(): WebGLContextAttributes | null;
+ getError(): GLenum;
+ getExtension(extensionName: "EXT_blend_minmax"): EXT_blend_minmax | null;
+ getExtension(extensionName: "EXT_texture_filter_anisotropic"): EXT_texture_filter_anisotropic | null;
+ getExtension(extensionName: "EXT_frag_depth"): EXT_frag_depth | null;
+ getExtension(extensionName: "EXT_shader_texture_lod"): EXT_shader_texture_lod | null;
+ getExtension(extensionName: "EXT_sRGB"): EXT_sRGB | null;
+ getExtension(extensionName: "OES_vertex_array_object"): OES_vertex_array_object | null;
+ getExtension(extensionName: "WEBGL_color_buffer_float"): WEBGL_color_buffer_float | null;
+ getExtension(extensionName: "WEBGL_compressed_texture_astc"): WEBGL_compressed_texture_astc | null;
+ getExtension(extensionName: "WEBGL_compressed_texture_s3tc_srgb"): WEBGL_compressed_texture_s3tc_srgb | null;
+ getExtension(extensionName: "WEBGL_debug_shaders"): WEBGL_debug_shaders | null;
+ getExtension(extensionName: "WEBGL_draw_buffers"): WEBGL_draw_buffers | null;
+ getExtension(extensionName: "WEBGL_lose_context"): WEBGL_lose_context | null;
+ getExtension(extensionName: "WEBGL_depth_texture"): WEBGL_depth_texture | null;
+ getExtension(extensionName: "WEBGL_debug_renderer_info"): WEBGL_debug_renderer_info | null;
+ getExtension(extensionName: "WEBGL_compressed_texture_s3tc"): WEBGL_compressed_texture_s3tc | null;
+ getExtension(extensionName: "OES_texture_half_float_linear"): OES_texture_half_float_linear | null;
+ getExtension(extensionName: "OES_texture_half_float"): OES_texture_half_float | null;
+ getExtension(extensionName: "OES_texture_float_linear"): OES_texture_float_linear | null;
+ getExtension(extensionName: "OES_texture_float"): OES_texture_float | null;
+ getExtension(extensionName: "OES_standard_derivatives"): OES_standard_derivatives | null;
+ getExtension(extensionName: "OES_element_index_uint"): OES_element_index_uint | null;
+ getExtension(extensionName: "ANGLE_instanced_arrays"): ANGLE_instanced_arrays | null;
+ getExtension(extensionName: string): any;
+ getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum): any;
+ getParameter(pname: GLenum): any;
+ getProgramInfoLog(program: WebGLProgram): string | null;
+ getProgramParameter(program: WebGLProgram, pname: GLenum): any;
+ getRenderbufferParameter(target: GLenum, pname: GLenum): any;
+ getShaderInfoLog(shader: WebGLShader): string | null;
+ getShaderParameter(shader: WebGLShader, pname: GLenum): any;
+ getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum): WebGLShaderPrecisionFormat | null;
+ getShaderSource(shader: WebGLShader): string | null;
+ getSupportedExtensions(): string[] | null;
+ getTexParameter(target: GLenum, pname: GLenum): any;
+ getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;
+ getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null;
+ getVertexAttrib(index: GLuint, pname: GLenum): any;
+ getVertexAttribOffset(index: GLuint, pname: GLenum): GLintptr;
+ hint(target: GLenum, mode: GLenum): void;
+ isBuffer(buffer: WebGLBuffer | null): GLboolean;
+ isContextLost(): boolean;
+ isEnabled(cap: GLenum): GLboolean;
+ isFramebuffer(framebuffer: WebGLFramebuffer | null): GLboolean;
+ isProgram(program: WebGLProgram | null): GLboolean;
+ isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): GLboolean;
+ isShader(shader: WebGLShader | null): GLboolean;
+ isTexture(texture: WebGLTexture | null): GLboolean;
+ lineWidth(width: GLfloat): void;
+ linkProgram(program: WebGLProgram): void;
+ pixelStorei(pname: GLenum, param: GLint): void;
+ polygonOffset(factor: GLfloat, units: GLfloat): void;
+ readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
+ renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
+ sampleCoverage(value: GLclampf, invert: GLboolean): void;
+ scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
+ shaderSource(shader: WebGLShader, source: string): void;
+ stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void;
+ stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void;
+ stencilMask(mask: GLuint): void;
+ stencilMaskSeparate(face: GLenum, mask: GLuint): void;
+ stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void;
+ stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void;
+ texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
+ texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;
+ texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void;
+ texParameteri(target: GLenum, pname: GLenum, param: GLint): void;
+ texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
+ texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;
+ uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void;
+ uniform1fv(location: WebGLUniformLocation | null, v: Float32List): void;
+ uniform1i(location: WebGLUniformLocation | null, x: GLint): void;
+ uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void;
+ uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void;
+ uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void;
+ uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void;
+ uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void;
+ uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void;
+ uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void;
+ uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void;
+ uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void;
+ uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
+ uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void;
+ uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void;
+ uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void;
+ uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
+ uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
+ uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
+ useProgram(program: WebGLProgram | null): void;
+ validateProgram(program: WebGLProgram): void;
+ vertexAttrib1f(index: GLuint, x: GLfloat): void;
+ vertexAttrib1fv(index: GLuint, values: Float32List): void;
+ vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void;
+ vertexAttrib2fv(index: GLuint, values: Float32List): void;
+ vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void;
+ vertexAttrib3fv(index: GLuint, values: Float32List): void;
+ vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;
+ 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;
+}
+
+interface WebGLShader extends WebGLObject {
+}
+
+declare var WebGLShader: {
+ prototype: WebGLShader;
+ new(): WebGLShader;
+};
+
+interface WebGLShaderPrecisionFormat {
+ readonly precision: GLint;
+ readonly rangeMax: GLint;
+ readonly rangeMin: GLint;
+}
+
+declare var WebGLShaderPrecisionFormat: {
+ prototype: WebGLShaderPrecisionFormat;
+ new(): WebGLShaderPrecisionFormat;
+};
+
+interface WebGLTexture extends WebGLObject {
+}
+
+declare var WebGLTexture: {
+ prototype: WebGLTexture;
+ new(): WebGLTexture;
+};
+
+interface WebGLUniformLocation {
+}
+
+declare var WebGLUniformLocation: {
+ prototype: WebGLUniformLocation;
+ new(): WebGLUniformLocation;
+};
+
+interface WebGLVertexArrayObjectOES extends WebGLObject {
+}
+
interface WebSocketEventMap {
"close": CloseEvent;
"error": Event;
@@ -2696,7 +3899,7 @@ interface Worker extends EventTarget, AbstractWorker {
declare var Worker: {
prototype: Worker;
- new(stringUrl: string): Worker;
+ new(stringUrl: string, options?: WorkerOptions): Worker;
};
interface WorkerGlobalScopeEventMap {
@@ -2756,6 +3959,31 @@ interface WorkerUtils extends WindowBase64 {
importScripts(...urls: string[]): void;
}
+interface WritableStream {
+ readonly locked: boolean;
+ abort(reason?: any): Promise;
+ getWriter(): WritableStreamDefaultWriter;
+}
+
+declare var WritableStream: {
+ prototype: WritableStream;
+ new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream;
+};
+
+interface WritableStreamDefaultController {
+ error(error?: any): void;
+}
+
+interface WritableStreamDefaultWriter {
+ readonly closed: Promise;
+ readonly desiredSize: number | null;
+ readonly ready: Promise;
+ abort(reason?: any): Promise;
+ close(): Promise;
+ releaseLock(): void;
+ write(chunk: W): Promise;
+}
+
interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {
"readystatechange": Event;
}
@@ -2917,6 +4145,46 @@ interface PerformanceObserverCallback {
(entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
}
+interface QueuingStrategySizeCallback {
+ (chunk: T): number;
+}
+
+interface ReadableByteStreamControllerCallback {
+ (controller: ReadableByteStreamController): void | PromiseLike;
+}
+
+interface ReadableStreamDefaultControllerCallback {
+ (controller: ReadableStreamDefaultController): void | PromiseLike;
+}
+
+interface ReadableStreamErrorCallback {
+ (reason: any): void | PromiseLike;
+}
+
+interface TransformStreamDefaultControllerCallback {
+ (controller: TransformStreamDefaultController): void | PromiseLike;
+}
+
+interface TransformStreamDefaultControllerTransformCallback {
+ (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike;
+}
+
+interface WritableStreamDefaultControllerCloseCallback {
+ (): void | PromiseLike;
+}
+
+interface WritableStreamDefaultControllerStartCallback {
+ (controller: WritableStreamDefaultController): void | PromiseLike;
+}
+
+interface WritableStreamDefaultControllerWriteCallback {
+ (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike;
+}
+
+interface WritableStreamErrorCallback {
+ (reason: any): void | PromiseLike;
+}
+
declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
declare function close(): void;
declare function postMessage(message: any, transfer?: Transferable[]): void;
@@ -2966,7 +4234,7 @@ declare function removeEventListener;
-type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string;
+type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string;
type RequestInfo = Request | string;
type DOMHighResTimeStamp = number;
type CanvasImageSource = ImageBitmap;
@@ -2980,6 +4248,19 @@ type AlgorithmIdentifier = string | Algorithm;
type HashAlgorithmIdentifier = AlgorithmIdentifier;
type BigInteger = Uint8Array;
type NamedCurve = string;
+type GLenum = number;
+type GLboolean = boolean;
+type GLbitfield = number;
+type GLint = number;
+type GLsizei = number;
+type GLintptr = number;
+type GLsizeiptr = number;
+type GLuint = number;
+type GLfloat = number;
+type GLclampf = number;
+type TexImageSource = ImageBitmap | ImageData;
+type Float32List = Float32Array | GLfloat[];
+type Int32List = Int32Array | GLint[];
type BufferSource = ArrayBufferView | ArrayBuffer;
type DOMTimeStamp = number;
type FormDataEntryValue = File | string;
@@ -2987,6 +4268,7 @@ type IDBValidKey = number | string | Date | BufferSource | IDBArrayKey;
type Transferable = ArrayBuffer | MessagePort | ImageBitmap;
type BinaryType = "blob" | "arraybuffer";
type ClientTypes = "window" | "worker" | "sharedworker" | "all";
+type EndingType = "transparent" | "native";
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "pending" | "done";
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
@@ -3007,5 +4289,6 @@ type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaquer
type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant";
type ServiceWorkerUpdateViaCache = "imports" | "all" | "none";
type VisibilityState = "hidden" | "visible" | "prerender";
+type WebGLPowerPreference = "default" | "low-power" | "high-performance";
type WorkerType = "classic" | "module";
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
diff --git a/lib/protocol.d.ts b/lib/protocol.d.ts
index 5823233a25b..49a507b9881 100644
--- a/lib/protocol.d.ts
+++ b/lib/protocol.d.ts
@@ -61,7 +61,8 @@ declare namespace ts.server.protocol {
GetApplicableRefactors = "getApplicableRefactors",
GetEditsForRefactor = "getEditsForRefactor",
OrganizeImports = "organizeImports",
- GetEditsForFileRename = "getEditsForFileRename"
+ GetEditsForFileRename = "getEditsForFileRename",
+ ConfigurePlugin = "configurePlugin"
}
/**
* A TypeScript Server message
@@ -136,6 +137,10 @@ declare namespace ts.server.protocol {
* Contains message body if success === true.
*/
body?: any;
+ /**
+ * Contains extra information that plugin can include to be passed on
+ */
+ metadata?: unknown;
}
/**
* Arguments for FileRequest messages.
@@ -781,7 +786,7 @@ declare namespace ts.server.protocol {
/**
* The file locations referencing the symbol.
*/
- refs: ReferencesResponseItem[];
+ refs: ReadonlyArray;
/**
* The name of the symbol.
*/
@@ -1010,6 +1015,14 @@ declare namespace ts.server.protocol {
*/
interface ConfigureResponse extends Response {
}
+ interface ConfigurePluginRequestArguments {
+ pluginName: string;
+ configuration: any;
+ }
+ interface ConfigurePluginRequest extends Request {
+ command: CommandTypes.ConfigurePlugin;
+ arguments: ConfigurePluginRequestArguments;
+ }
/**
* Information found in an "open" request.
*/
@@ -1847,6 +1860,7 @@ declare namespace ts.server.protocol {
*/
interface DiagnosticEvent extends Event {
body?: DiagnosticEventBody;
+ event: DiagnosticEventKind;
}
interface ConfigFileDiagnosticEventBody {
/**
diff --git a/lib/tsc.js b/lib/tsc.js
index 6309a02f3fe..f04ae41349c 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -429,7 +429,24 @@ var ts;
function flatMap(array, mapfn) {
var result;
if (array) {
- result = [];
+ for (var i = 0; i < array.length; i++) {
+ var v = mapfn(array[i], i);
+ if (v) {
+ if (isArray(v)) {
+ result = addRange(result, v);
+ }
+ else {
+ result = append(result, v);
+ }
+ }
+ }
+ }
+ return result || ts.emptyArray;
+ }
+ ts.flatMap = flatMap;
+ function flatMapToMutable(array, mapfn) {
+ var result = [];
+ if (array) {
for (var i = 0; i < array.length; i++) {
var v = mapfn(array[i], i);
if (v) {
@@ -444,7 +461,7 @@ var ts;
}
return result;
}
- ts.flatMap = flatMap;
+ ts.flatMapToMutable = flatMapToMutable;
function flatMapIterator(iter, mapfn) {
var first = iter.next();
if (first.done) {
@@ -670,7 +687,7 @@ var ts;
ts.deduplicate = deduplicate;
function deduplicateSorted(array, comparer) {
if (array.length === 0)
- return [];
+ return ts.emptyArray;
var last = array[0];
var deduplicated = [last];
for (var i = 1; i < array.length; i++) {
@@ -698,7 +715,7 @@ var ts;
}
ts.insertSorted = insertSorted;
function sortAndDeduplicate(array, comparer, equalityComparer) {
- return deduplicateSorted(sort(array, comparer), equalityComparer || comparer);
+ return deduplicateSorted(sort(array, comparer), equalityComparer || comparer || compareStringsCaseSensitive);
}
ts.sortAndDeduplicate = sortAndDeduplicate;
function arrayIsEqualTo(array1, array2, equalityComparer) {
@@ -821,7 +838,7 @@ var ts;
indices.sort(function (x, y) { return comparer(array[x], array[y]) || compareValues(x, y); });
}
function sort(array, comparer) {
- return array.slice().sort(comparer);
+ return (array.length === 0 ? array : array.slice().sort(comparer));
}
ts.sort = sort;
function arrayIterator(array) {
@@ -900,12 +917,15 @@ var ts;
}
ts.replaceElement = replaceElement;
function binarySearch(array, value, keySelector, keyComparer, offset) {
- if (!array || array.length === 0) {
+ return binarySearchKey(array, keySelector(value), keySelector, keyComparer, offset);
+ }
+ ts.binarySearch = binarySearch;
+ function binarySearchKey(array, key, keySelector, keyComparer, offset) {
+ if (!some(array)) {
return -1;
}
var low = offset || 0;
var high = array.length - 1;
- var key = keySelector(value);
while (low <= high) {
var middle = low + ((high - low) >> 1);
var midKey = keySelector(array[middle]);
@@ -922,7 +942,7 @@ var ts;
}
return ~low;
}
- ts.binarySearch = binarySearch;
+ ts.binarySearchKey = binarySearchKey;
function reduceLeft(array, f, initial, start, count) {
if (array && array.length > 0) {
var size = array.length;
@@ -1695,6 +1715,33 @@ var ts;
var counts;
var marks;
var measures;
+ function createTimerIf(condition, measureName, startMarkName, endMarkName) {
+ return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer;
+ }
+ performance.createTimerIf = createTimerIf;
+ function createTimer(measureName, startMarkName, endMarkName) {
+ var enterCount = 0;
+ return {
+ enter: enter,
+ exit: exit
+ };
+ function enter() {
+ if (++enterCount === 1) {
+ mark(startMarkName);
+ }
+ }
+ function exit() {
+ if (--enterCount === 0) {
+ mark(endMarkName);
+ measure(measureName, startMarkName, endMarkName);
+ }
+ else if (enterCount < 0) {
+ ts.Debug.fail("enter/exit count does not match.");
+ }
+ }
+ }
+ performance.createTimer = createTimer;
+ performance.nullTimer = { enter: ts.noop, exit: ts.noop };
function mark(markName) {
if (enabled) {
marks.set(markName, ts.timestamp());
@@ -2040,13 +2087,14 @@ var ts;
TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithConstructSignatureAndValue"] = 1] = "TypeWithConstructSignatureAndValue";
TypeReferenceSerializationKind[TypeReferenceSerializationKind["VoidNullableOrNeverType"] = 2] = "VoidNullableOrNeverType";
TypeReferenceSerializationKind[TypeReferenceSerializationKind["NumberLikeType"] = 3] = "NumberLikeType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["StringLikeType"] = 4] = "StringLikeType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["BooleanType"] = 5] = "BooleanType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["ArrayLikeType"] = 6] = "ArrayLikeType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["ESSymbolType"] = 7] = "ESSymbolType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["Promise"] = 8] = "Promise";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithCallSignature"] = 9] = "TypeWithCallSignature";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["BigIntLikeType"] = 4] = "BigIntLikeType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["StringLikeType"] = 5] = "StringLikeType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["BooleanType"] = 6] = "BooleanType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["ArrayLikeType"] = 7] = "ArrayLikeType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["ESSymbolType"] = 8] = "ESSymbolType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["Promise"] = 9] = "Promise";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithCallSignature"] = 10] = "TypeWithCallSignature";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 11] = "ObjectType";
})(TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {}));
var DiagnosticCategory;
(function (DiagnosticCategory) {
@@ -3208,6 +3256,7 @@ var ts;
use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."),
Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."),
use_strict_directive_used_here: diag(1349, ts.DiagnosticCategory.Error, "use_strict_directive_used_here_1349", "'use strict' directive used here."),
+ Print_the_final_configuration_instead_of_building: diag(1350, ts.DiagnosticCategory.Message, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."),
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -3264,14 +3313,14 @@ var ts;
Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: diag(2353, ts.DiagnosticCategory.Error, "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),
This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: diag(2354, ts.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", "This syntax requires an imported helper but module '{0}' cannot be found."),
A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: diag(2355, ts.DiagnosticCategory.Error, "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'void' nor 'any' must return a value."),
- An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: diag(2356, ts.DiagnosticCategory.Error, "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number' or an enum type."),
+ An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, ts.DiagnosticCategory.Error, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),
The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts.DiagnosticCategory.Error, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),
The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'."),
The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2361, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter."),
- The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type."),
- The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type."),
+ The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
+ The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."),
Operator_0_cannot_be_applied_to_types_1_and_2: diag(2365, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_types_1_and_2_2365", "Operator '{0}' cannot be applied to types '{1}' and '{2}'."),
Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: diag(2366, ts.DiagnosticCategory.Error, "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", "Function lacks ending return statement and return type does not include 'undefined'."),
@@ -3478,9 +3527,9 @@ var ts;
No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),
Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"),
Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."),
Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."),
Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."),
_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."),
@@ -3578,6 +3627,13 @@ var ts;
Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),
Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"),
It_is_highly_likely_that_you_are_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "It_is_highly_likely_that_you_are_missing_a_semicolon_2734", "It is highly likely that you are missing a semicolon."),
+ Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),
+ Operator_0_cannot_be_applied_to_type_1: diag(2736, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."),
+ BigInt_literals_are_not_available_when_targeting_lower_than_ESNext: diag(2737, ts.DiagnosticCategory.Error, "BigInt_literals_are_not_available_when_targeting_lower_than_ESNext_2737", "BigInt literals are not available when targeting lower than ESNext."),
+ An_outer_value_of_this_is_shadowed_by_this_container: diag(2738, ts.DiagnosticCategory.Message, "An_outer_value_of_this_is_shadowed_by_this_container_2738", "An outer value of 'this' is shadowed by this container."),
+ Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"),
+ Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),
+ Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."),
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -3894,6 +3950,9 @@ var ts;
Did_you_mean_to_call_this_expression: diag(6212, ts.DiagnosticCategory.Message, "Did_you_mean_to_call_this_expression_6212", "Did you mean to call this expression?"),
Did_you_mean_to_use_new_with_this_expression: diag(6213, ts.DiagnosticCategory.Message, "Did_you_mean_to_use_new_with_this_expression_6213", "Did you mean to use 'new' with this expression?"),
Enable_strict_bind_call_and_apply_methods_on_functions: diag(6214, ts.DiagnosticCategory.Message, "Enable_strict_bind_call_and_apply_methods_on_functions_6214", "Enable strict 'bind', 'call', and 'apply' methods on functions."),
+ Using_compiler_options_of_project_reference_redirect_0: diag(6215, ts.DiagnosticCategory.Message, "Using_compiler_options_of_project_reference_redirect_0_6215", "Using compiler options of project reference redirect '{0}'."),
+ Found_1_error: diag(6216, ts.DiagnosticCategory.Message, "Found_1_error_6216", "Found 1 error."),
+ Found_0_errors: diag(6217, ts.DiagnosticCategory.Message, "Found_0_errors_6217", "Found {0} errors."),
Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"),
Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"),
Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
@@ -3934,6 +3993,7 @@ var ts;
_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, ts.DiagnosticCategory.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, ts.DiagnosticCategory.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."),
Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, ts.DiagnosticCategory.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, ts.DiagnosticCategory.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, ts.DiagnosticCategory.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'."),
Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: diag(7016, ts.DiagnosticCategory.Error, "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", "Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),
Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: diag(7017, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017", "Element implicitly has an 'any' type because type '{0}' has no index signature."),
@@ -3961,6 +4021,14 @@ var ts;
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: diag(7040, ts.DiagnosticCategory.Error, "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040", "If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}`"),
The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any: diag(7041, ts.DiagnosticCategory.Error, "The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any_7041", "The containing arrow function captures the global value of 'this' which implicitly has type 'any'."),
Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: diag(7042, ts.DiagnosticCategory.Error, "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042", "Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),
+ Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7043, ts.DiagnosticCategory.Suggestion, "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043", "Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
+ Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7044, ts.DiagnosticCategory.Suggestion, "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044", "Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
+ Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7045, ts.DiagnosticCategory.Suggestion, "Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045", "Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
+ Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage: diag(7046, ts.DiagnosticCategory.Suggestion, "Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046", "Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),
+ Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage: diag(7047, ts.DiagnosticCategory.Suggestion, "Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047", "Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),
+ Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),
+ Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),
+ _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."),
@@ -4122,98 +4190,101 @@ var ts;
Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"),
Generate_types_for_0: diag(95067, ts.DiagnosticCategory.Message, "Generate_types_for_0_95067", "Generate types for '{0}'"),
Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"),
+ Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"),
+ Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"),
};
})(ts || (ts = {}));
var ts;
(function (ts) {
var _a;
function tokenIsIdentifierOrKeyword(token) {
- return token >= 71;
+ return token >= 72;
}
ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
function tokenIsIdentifierOrKeywordOrGreaterThan(token) {
- return token === 29 || tokenIsIdentifierOrKeyword(token);
+ return token === 30 || tokenIsIdentifierOrKeyword(token);
}
ts.tokenIsIdentifierOrKeywordOrGreaterThan = tokenIsIdentifierOrKeywordOrGreaterThan;
var textToKeywordObj = (_a = {
- abstract: 117,
- any: 119,
- as: 118,
- boolean: 122,
- break: 72,
- case: 73,
- catch: 74,
- class: 75,
- continue: 77,
- const: 76
+ abstract: 118,
+ any: 120,
+ as: 119,
+ bigint: 146,
+ boolean: 123,
+ break: 73,
+ case: 74,
+ catch: 75,
+ class: 76,
+ continue: 78,
+ const: 77
},
- _a["" + "constructor"] = 123,
- _a.debugger = 78,
- _a.declare = 124,
- _a.default = 79,
- _a.delete = 80,
- _a.do = 81,
- _a.else = 82,
- _a.enum = 83,
- _a.export = 84,
- _a.extends = 85,
- _a.false = 86,
- _a.finally = 87,
- _a.for = 88,
- _a.from = 143,
- _a.function = 89,
- _a.get = 125,
- _a.if = 90,
- _a.implements = 108,
- _a.import = 91,
- _a.in = 92,
- _a.infer = 126,
- _a.instanceof = 93,
- _a.interface = 109,
- _a.is = 127,
- _a.keyof = 128,
- _a.let = 110,
- _a.module = 129,
- _a.namespace = 130,
- _a.never = 131,
- _a.new = 94,
- _a.null = 95,
- _a.number = 134,
- _a.object = 135,
- _a.package = 111,
- _a.private = 112,
- _a.protected = 113,
- _a.public = 114,
- _a.readonly = 132,
- _a.require = 133,
- _a.global = 144,
- _a.return = 96,
- _a.set = 136,
- _a.static = 115,
- _a.string = 137,
- _a.super = 97,
- _a.switch = 98,
- _a.symbol = 138,
- _a.this = 99,
- _a.throw = 100,
- _a.true = 101,
- _a.try = 102,
- _a.type = 139,
- _a.typeof = 103,
- _a.undefined = 140,
- _a.unique = 141,
- _a.unknown = 142,
- _a.var = 104,
- _a.void = 105,
- _a.while = 106,
- _a.with = 107,
- _a.yield = 116,
- _a.async = 120,
- _a.await = 121,
- _a.of = 145,
+ _a["" + "constructor"] = 124,
+ _a.debugger = 79,
+ _a.declare = 125,
+ _a.default = 80,
+ _a.delete = 81,
+ _a.do = 82,
+ _a.else = 83,
+ _a.enum = 84,
+ _a.export = 85,
+ _a.extends = 86,
+ _a.false = 87,
+ _a.finally = 88,
+ _a.for = 89,
+ _a.from = 144,
+ _a.function = 90,
+ _a.get = 126,
+ _a.if = 91,
+ _a.implements = 109,
+ _a.import = 92,
+ _a.in = 93,
+ _a.infer = 127,
+ _a.instanceof = 94,
+ _a.interface = 110,
+ _a.is = 128,
+ _a.keyof = 129,
+ _a.let = 111,
+ _a.module = 130,
+ _a.namespace = 131,
+ _a.never = 132,
+ _a.new = 95,
+ _a.null = 96,
+ _a.number = 135,
+ _a.object = 136,
+ _a.package = 112,
+ _a.private = 113,
+ _a.protected = 114,
+ _a.public = 115,
+ _a.readonly = 133,
+ _a.require = 134,
+ _a.global = 145,
+ _a.return = 97,
+ _a.set = 137,
+ _a.static = 116,
+ _a.string = 138,
+ _a.super = 98,
+ _a.switch = 99,
+ _a.symbol = 139,
+ _a.this = 100,
+ _a.throw = 101,
+ _a.true = 102,
+ _a.try = 103,
+ _a.type = 140,
+ _a.typeof = 104,
+ _a.undefined = 141,
+ _a.unique = 142,
+ _a.unknown = 143,
+ _a.var = 105,
+ _a.void = 106,
+ _a.while = 107,
+ _a.with = 108,
+ _a.yield = 117,
+ _a.async = 121,
+ _a.await = 122,
+ _a.of = 147,
_a);
var textToKeyword = ts.createMapFromTemplate(textToKeywordObj);
- var textToToken = ts.createMapFromTemplate(__assign({}, textToKeywordObj, { "{": 17, "}": 18, "(": 19, ")": 20, "[": 21, "]": 22, ".": 23, "...": 24, ";": 25, ",": 26, "<": 27, ">": 29, "<=": 30, ">=": 31, "==": 32, "!=": 33, "===": 34, "!==": 35, "=>": 36, "+": 37, "-": 38, "**": 40, "*": 39, "/": 41, "%": 42, "++": 43, "--": 44, "<<": 45, "": 28, ">>": 46, ">>>": 47, "&": 48, "|": 49, "^": 50, "!": 51, "~": 52, "&&": 53, "||": 54, "?": 55, ":": 56, "=": 58, "+=": 59, "-=": 60, "*=": 61, "**=": 62, "/=": 63, "%=": 64, "<<=": 65, ">>=": 66, ">>>=": 67, "&=": 68, "|=": 69, "^=": 70, "@": 57 }));
+ var textToToken = ts.createMapFromTemplate(__assign({}, textToKeywordObj, { "{": 18, "}": 19, "(": 20, ")": 21, "[": 22, "]": 23, ".": 24, "...": 25, ";": 26, ",": 27, "<": 28, ">": 30, "<=": 31, ">=": 32, "==": 33, "!=": 34, "===": 35, "!==": 36, "=>": 37, "+": 38, "-": 39, "**": 41, "*": 40, "/": 42, "%": 43, "++": 44, "--": 45, "<<": 46, "": 29, ">>": 47, ">>>": 48, "&": 49, "|": 50, "^": 51, "!": 52, "~": 53, "&&": 54, "||": 55, "?": 56, ":": 57, "=": 59, "+=": 60, "-=": 61, "*=": 62, "**=": 63, "/=": 64, "%=": 65, "<<=": 66, ">>=": 67, ">>>=": 68, "&=": 69, "|=": 70, "^=": 71, "@": 58 }));
var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];
@@ -4685,8 +4756,8 @@ var ts;
getTokenValue: function () { return tokenValue; },
hasExtendedUnicodeEscape: function () { return (tokenFlags & 8) !== 0; },
hasPrecedingLineBreak: function () { return (tokenFlags & 1) !== 0; },
- isIdentifier: function () { return token === 71 || token > 107; },
- isReservedWord: function () { return token >= 72 && token <= 107; },
+ isIdentifier: function () { return token === 72 || token > 108; },
+ isReservedWord: function () { return token >= 73 && token <= 108; },
isUnterminated: function () { return (tokenFlags & 4) !== 0; },
getTokenFlags: function () { return tokenFlags; },
reScanGreaterToken: reScanGreaterToken,
@@ -4780,18 +4851,29 @@ var ts;
end = pos;
}
}
+ var result;
if (tokenFlags & 512) {
- var result = mainFragment;
+ result = mainFragment;
if (decimalFragment) {
result += "." + decimalFragment;
}
if (scientificFragment) {
result += scientificFragment;
}
- return "" + +result;
}
else {
- return "" + +(text.substring(start, end));
+ result = text.substring(start, end);
+ }
+ if (decimalFragment !== undefined || tokenFlags & 16) {
+ return {
+ type: 8,
+ value: "" + +result
+ };
+ }
+ else {
+ tokenValue = result;
+ var type = checkBigIntSuffix();
+ return { type: type, value: tokenValue };
}
}
function scanOctalDigits() {
@@ -4802,17 +4884,17 @@ var ts;
return +(text.substring(start, pos));
}
function scanExactNumberOfHexDigits(count, canHaveSeparators) {
- return scanHexDigits(count, false, canHaveSeparators);
+ var valueString = scanHexDigits(count, false, canHaveSeparators);
+ return valueString ? parseInt(valueString, 16) : -1;
}
function scanMinimumNumberOfHexDigits(count, canHaveSeparators) {
return scanHexDigits(count, true, canHaveSeparators);
}
function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) {
- var digits = 0;
- var value = 0;
+ var valueChars = [];
var allowSeparator = false;
var isPreviousTokenSeparator = false;
- while (digits < minCount || scanAsManyAsPossible) {
+ while (valueChars.length < minCount || scanAsManyAsPossible) {
var ch = text.charCodeAt(pos);
if (canHaveSeparators && ch === 95) {
tokenFlags |= 512;
@@ -4830,29 +4912,24 @@ var ts;
continue;
}
allowSeparator = canHaveSeparators;
- if (ch >= 48 && ch <= 57) {
- value = value * 16 + ch - 48;
+ if (ch >= 65 && ch <= 70) {
+ ch += 97 - 65;
}
- else if (ch >= 65 && ch <= 70) {
- value = value * 16 + ch - 65 + 10;
- }
- else if (ch >= 97 && ch <= 102) {
- value = value * 16 + ch - 97 + 10;
- }
- else {
+ else if (!((ch >= 48 && ch <= 57) ||
+ (ch >= 97 && ch <= 102))) {
break;
}
+ valueChars.push(ch);
pos++;
- digits++;
isPreviousTokenSeparator = false;
}
- if (digits < minCount) {
- value = -1;
+ if (valueChars.length < minCount) {
+ valueChars = [];
}
if (text.charCodeAt(pos - 1) === 95) {
error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);
}
- return value;
+ return String.fromCharCode.apply(String, valueChars);
}
function scanString(jsxAttributeString) {
if (jsxAttributeString === void 0) { jsxAttributeString = false; }
@@ -4900,20 +4977,20 @@ var ts;
contents += text.substring(start, pos);
tokenFlags |= 4;
error(ts.Diagnostics.Unterminated_template_literal);
- resultingToken = startedWithBacktick ? 13 : 16;
+ resultingToken = startedWithBacktick ? 14 : 17;
break;
}
var currChar = text.charCodeAt(pos);
if (currChar === 96) {
contents += text.substring(start, pos);
pos++;
- resultingToken = startedWithBacktick ? 13 : 16;
+ resultingToken = startedWithBacktick ? 14 : 17;
break;
}
if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) {
contents += text.substring(start, pos);
pos += 2;
- resultingToken = startedWithBacktick ? 14 : 15;
+ resultingToken = startedWithBacktick ? 15 : 16;
break;
}
if (currChar === 92) {
@@ -4997,7 +5074,8 @@ var ts;
}
}
function scanExtendedUnicodeEscape() {
- var escapedValue = scanMinimumNumberOfHexDigits(1, false);
+ var escapedValueString = scanMinimumNumberOfHexDigits(1, false);
+ var escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
var isInvalidExtendedEscape = false;
if (escapedValue < 0) {
error(ts.Diagnostics.Hexadecimal_digit_expected);
@@ -5078,12 +5156,10 @@ var ts;
}
}
}
- return token = 71;
+ return token = 72;
}
function scanBinaryOrOctalDigits(base) {
- ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8");
- var value = 0;
- var numberOfDigits = 0;
+ var value = "";
var separatorAllowed = false;
var isPreviousTokenSeparator = false;
while (true) {
@@ -5104,25 +5180,39 @@ var ts;
continue;
}
separatorAllowed = true;
- var valueOfCh = ch - 48;
- if (!isDigit(ch) || valueOfCh >= base) {
+ if (!isDigit(ch) || ch - 48 >= base) {
break;
}
- value = value * base + valueOfCh;
+ value += text[pos];
pos++;
- numberOfDigits++;
isPreviousTokenSeparator = false;
}
- if (numberOfDigits === 0) {
- return -1;
- }
if (text.charCodeAt(pos - 1) === 95) {
error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);
- return value;
}
return value;
}
+ function checkBigIntSuffix() {
+ if (text.charCodeAt(pos) === 110) {
+ tokenValue += "n";
+ if (tokenFlags & 384) {
+ tokenValue = ts.parsePseudoBigInt(tokenValue) + "n";
+ }
+ pos++;
+ return 9;
+ }
+ else {
+ var numericValue = tokenFlags & 128
+ ? parseInt(tokenValue.slice(2), 2)
+ : tokenFlags & 256
+ ? parseInt(tokenValue.slice(2), 8)
+ : +tokenValue;
+ tokenValue = "" + numericValue;
+ return 8;
+ }
+ }
function scan() {
+ var _a;
startPos = pos;
tokenFlags = 0;
var asteriskSeen = false;
@@ -5193,69 +5283,57 @@ var ts;
case 33:
if (text.charCodeAt(pos + 1) === 61) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 35;
+ return pos += 3, token = 36;
}
- return pos += 2, token = 33;
+ return pos += 2, token = 34;
}
pos++;
- return token = 51;
+ return token = 52;
case 34:
case 39:
tokenValue = scanString();
- return token = 9;
+ return token = 10;
case 96:
return token = scanTemplateAndSetTokenValue();
case 37:
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 64;
+ return pos += 2, token = 65;
}
pos++;
- return token = 42;
+ return token = 43;
case 38:
if (text.charCodeAt(pos + 1) === 38) {
- return pos += 2, token = 53;
+ return pos += 2, token = 54;
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 68;
+ return pos += 2, token = 69;
}
pos++;
- return token = 48;
+ return token = 49;
case 40:
pos++;
- return token = 19;
+ return token = 20;
case 41:
pos++;
- return token = 20;
+ return token = 21;
case 42:
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 61;
+ return pos += 2, token = 62;
}
if (text.charCodeAt(pos + 1) === 42) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 62;
+ return pos += 3, token = 63;
}
- return pos += 2, token = 40;
+ return pos += 2, token = 41;
}
pos++;
if (inJSDocType && !asteriskSeen && (tokenFlags & 1)) {
asteriskSeen = true;
continue;
}
- return token = 39;
+ return token = 40;
case 43:
if (text.charCodeAt(pos + 1) === 43) {
- return pos += 2, token = 43;
- }
- if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 59;
- }
- pos++;
- return token = 37;
- case 44:
- pos++;
- return token = 26;
- case 45:
- if (text.charCodeAt(pos + 1) === 45) {
return pos += 2, token = 44;
}
if (text.charCodeAt(pos + 1) === 61) {
@@ -5263,16 +5341,28 @@ var ts;
}
pos++;
return token = 38;
+ case 44:
+ pos++;
+ return token = 27;
+ case 45:
+ if (text.charCodeAt(pos + 1) === 45) {
+ return pos += 2, token = 45;
+ }
+ if (text.charCodeAt(pos + 1) === 61) {
+ return pos += 2, token = 61;
+ }
+ pos++;
+ return token = 39;
case 46:
if (isDigit(text.charCodeAt(pos + 1))) {
- tokenValue = scanNumber();
+ tokenValue = scanNumber().value;
return token = 8;
}
if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) {
- return pos += 3, token = 24;
+ return pos += 3, token = 25;
}
pos++;
- return token = 23;
+ return token = 24;
case 47:
if (text.charCodeAt(pos + 1) === 47) {
pos += 2;
@@ -5321,43 +5411,43 @@ var ts;
}
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 63;
+ return pos += 2, token = 64;
}
pos++;
- return token = 41;
+ return token = 42;
case 48:
if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) {
pos += 2;
- var value = scanMinimumNumberOfHexDigits(1, true);
- if (value < 0) {
+ tokenValue = scanMinimumNumberOfHexDigits(1, true);
+ if (!tokenValue) {
error(ts.Diagnostics.Hexadecimal_digit_expected);
- value = 0;
+ tokenValue = "0";
}
- tokenValue = "" + value;
+ tokenValue = "0x" + tokenValue;
tokenFlags |= 64;
- return token = 8;
+ return token = checkBigIntSuffix();
}
else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) {
pos += 2;
- var value = scanBinaryOrOctalDigits(2);
- if (value < 0) {
+ tokenValue = scanBinaryOrOctalDigits(2);
+ if (!tokenValue) {
error(ts.Diagnostics.Binary_digit_expected);
- value = 0;
+ tokenValue = "0";
}
- tokenValue = "" + value;
+ tokenValue = "0b" + tokenValue;
tokenFlags |= 128;
- return token = 8;
+ return token = checkBigIntSuffix();
}
else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) {
pos += 2;
- var value = scanBinaryOrOctalDigits(8);
- if (value < 0) {
+ tokenValue = scanBinaryOrOctalDigits(8);
+ if (!tokenValue) {
error(ts.Diagnostics.Octal_digit_expected);
- value = 0;
+ tokenValue = "0";
}
- tokenValue = "" + value;
+ tokenValue = "0o" + tokenValue;
tokenFlags |= 256;
- return token = 8;
+ return token = checkBigIntSuffix();
}
if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) {
tokenValue = "" + scanOctalDigits();
@@ -5373,14 +5463,14 @@ var ts;
case 55:
case 56:
case 57:
- tokenValue = scanNumber();
- return token = 8;
+ (_a = scanNumber(), token = _a.type, tokenValue = _a.value);
+ return token;
case 58:
pos++;
- return token = 56;
+ return token = 57;
case 59:
pos++;
- return token = 25;
+ return token = 26;
case 60:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -5393,20 +5483,20 @@ var ts;
}
if (text.charCodeAt(pos + 1) === 60) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 65;
+ return pos += 3, token = 66;
}
- return pos += 2, token = 45;
+ return pos += 2, token = 46;
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 30;
+ return pos += 2, token = 31;
}
if (languageVariant === 1 &&
text.charCodeAt(pos + 1) === 47 &&
text.charCodeAt(pos + 2) !== 42) {
- return pos += 2, token = 28;
+ return pos += 2, token = 29;
}
pos++;
- return token = 27;
+ return token = 28;
case 61:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -5419,15 +5509,15 @@ var ts;
}
if (text.charCodeAt(pos + 1) === 61) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 34;
+ return pos += 3, token = 35;
}
- return pos += 2, token = 32;
+ return pos += 2, token = 33;
}
if (text.charCodeAt(pos + 1) === 62) {
- return pos += 2, token = 36;
+ return pos += 2, token = 37;
}
pos++;
- return token = 58;
+ return token = 59;
case 62:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -5439,25 +5529,25 @@ var ts;
}
}
pos++;
- return token = 29;
+ return token = 30;
case 63:
pos++;
- return token = 55;
+ return token = 56;
case 91:
pos++;
- return token = 21;
+ return token = 22;
case 93:
pos++;
- return token = 22;
+ return token = 23;
case 94:
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 70;
+ return pos += 2, token = 71;
}
pos++;
- return token = 50;
+ return token = 51;
case 123:
pos++;
- return token = 17;
+ return token = 18;
case 124:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -5469,22 +5559,22 @@ var ts;
}
}
if (text.charCodeAt(pos + 1) === 124) {
- return pos += 2, token = 54;
+ return pos += 2, token = 55;
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 69;
+ return pos += 2, token = 70;
}
pos++;
- return token = 49;
+ return token = 50;
case 125:
pos++;
- return token = 18;
+ return token = 19;
case 126:
pos++;
- return token = 52;
+ return token = 53;
case 64:
pos++;
- return token = 57;
+ return token = 58;
case 92:
var cookedChar = peekUnicodeEscape();
if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
@@ -5522,29 +5612,29 @@ var ts;
}
}
function reScanGreaterToken() {
- if (token === 29) {
+ if (token === 30) {
if (text.charCodeAt(pos) === 62) {
if (text.charCodeAt(pos + 1) === 62) {
if (text.charCodeAt(pos + 2) === 61) {
- return pos += 3, token = 67;
+ return pos += 3, token = 68;
}
- return pos += 2, token = 47;
+ return pos += 2, token = 48;
}
if (text.charCodeAt(pos + 1) === 61) {
- return pos += 2, token = 66;
+ return pos += 2, token = 67;
}
pos++;
- return token = 46;
+ return token = 47;
}
if (text.charCodeAt(pos) === 61) {
pos++;
- return token = 31;
+ return token = 32;
}
}
return token;
}
function reScanSlashToken() {
- if (token === 41 || token === 63) {
+ if (token === 42 || token === 64) {
var p = tokenPos + 1;
var inEscape = false;
var inCharacterClass = false;
@@ -5583,12 +5673,12 @@ var ts;
}
pos = p;
tokenValue = text.substring(tokenPos, pos);
- token = 12;
+ token = 13;
}
return token;
}
function reScanTemplateToken() {
- ts.Debug.assert(token === 18, "'reScanTemplateToken' should only be called on a '}'");
+ ts.Debug.assert(token === 19, "'reScanTemplateToken' should only be called on a '}'");
pos = tokenPos;
return token = scanTemplateAndSetTokenValue();
}
@@ -5605,14 +5695,14 @@ var ts;
if (char === 60) {
if (text.charCodeAt(pos + 1) === 47) {
pos += 2;
- return token = 28;
+ return token = 29;
}
pos++;
- return token = 27;
+ return token = 28;
}
if (char === 123) {
pos++;
- return token = 17;
+ return token = 18;
}
var firstNonWhitespace = 0;
while (pos < end) {
@@ -5635,7 +5725,7 @@ var ts;
}
pos++;
}
- return firstNonWhitespace === -1 ? 11 : 10;
+ return firstNonWhitespace === -1 ? 12 : 11;
}
function scanJsxIdentifier() {
if (tokenIsIdentifierOrKeyword(token)) {
@@ -5659,7 +5749,7 @@ var ts;
case 34:
case 39:
tokenValue = scanString(true);
- return token = 9;
+ return token = 10;
default:
return scan();
}
@@ -5682,36 +5772,36 @@ var ts;
}
return token = 5;
case 64:
- return token = 57;
+ return token = 58;
case 10:
case 13:
tokenFlags |= 1;
return token = 4;
case 42:
- return token = 39;
+ return token = 40;
case 123:
- return token = 17;
- case 125:
return token = 18;
+ case 125:
+ return token = 19;
case 91:
- return token = 21;
- case 93:
return token = 22;
- case 60:
- return token = 27;
- case 61:
- return token = 58;
- case 44:
- return token = 26;
- case 46:
+ case 93:
return token = 23;
+ case 60:
+ return token = 28;
+ case 61:
+ return token = 59;
+ case 44:
+ return token = 27;
+ case 46:
+ return token = 24;
case 96:
while (pos < end && text.charCodeAt(pos) !== 96) {
pos++;
}
tokenValue = text.substring(tokenPos + 1, pos);
pos++;
- return token = 13;
+ return token = 14;
}
if (isIdentifierStart(ch, 6)) {
while (isIdentifierPart(text.charCodeAt(pos), 6) && pos < end) {
@@ -5856,7 +5946,6 @@ var ts;
getText: function () { return str; },
write: writeText,
rawWrite: writeText,
- writeTextOfNode: writeText,
writeKeyword: writeText,
writeOperator: writeText,
writePunctuation: writeText,
@@ -5865,7 +5954,9 @@ var ts;
writeLiteral: writeText,
writeParameter: writeText,
writeProperty: writeText,
- writeSymbol: writeText,
+ writeSymbol: function (s, _) { return writeText(s); },
+ writeTrailingSemicolon: writeText,
+ writeComment: writeText,
getTextPos: function () { return str.length; },
getLine: function () { return 0; },
getColumn: function () { return 0; },
@@ -6054,7 +6145,7 @@ var ts;
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 277) {
+ while (node && node.kind !== 279) {
node = node.parent;
}
return node;
@@ -6062,11 +6153,11 @@ var ts;
ts.getSourceFileOfNode = getSourceFileOfNode;
function isStatementWithLocals(node) {
switch (node.kind) {
- case 216:
- case 244:
- case 223:
- case 224:
+ case 218:
+ case 246:
case 225:
+ case 226:
+ case 227:
return true;
}
return false;
@@ -6159,7 +6250,7 @@ var ts;
if (includeJsDoc && ts.hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0]);
}
- if (node.kind === 304 && node._children.length > 0) {
+ if (node.kind === 306 && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos);
@@ -6178,7 +6269,7 @@ var ts;
}
ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile;
function isJSDocTypeExpressionOrChild(node) {
- return node.kind === 281 || (node.parent && isJSDocTypeExpressionOrChild(node.parent));
+ return node.kind === 283 || (node.parent && isJSDocTypeExpressionOrChild(node.parent));
}
function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) {
if (includeTrivia === void 0) { includeTrivia = false; }
@@ -6210,28 +6301,30 @@ var ts;
}
ts.getEmitFlags = getEmitFlags;
function getLiteralText(node, sourceFile, neverAsciiEscape) {
- if (!nodeIsSynthesized(node) && node.parent && !(ts.isNumericLiteral(node) && node.numericLiteralFlags & 512)) {
+ if (!nodeIsSynthesized(node) && node.parent && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512) ||
+ ts.isBigIntLiteral(node))) {
return getSourceTextOfNodeFromSourceFile(sourceFile, node);
}
var escapeText = neverAsciiEscape || (getEmitFlags(node) & 16777216) ? escapeString : escapeNonAsciiString;
switch (node.kind) {
- case 9:
+ case 10:
if (node.singleQuote) {
return "'" + escapeText(node.text, 39) + "'";
}
else {
return '"' + escapeText(node.text, 34) + '"';
}
- case 13:
- return "`" + escapeText(node.text, 96) + "`";
case 14:
- return "`" + escapeText(node.text, 96) + "${";
+ return "`" + escapeText(node.text, 96) + "`";
case 15:
- return "}" + escapeText(node.text, 96) + "${";
+ return "`" + escapeText(node.text, 96) + "${";
case 16:
+ return "}" + escapeText(node.text, 96) + "${";
+ case 17:
return "}" + escapeText(node.text, 96) + "`";
case 8:
- case 12:
+ case 9:
+ case 13:
return node.text;
}
return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
@@ -6252,15 +6345,15 @@ var ts;
ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
var node = getRootDeclaration(declaration);
- return node.kind === 235 && node.parent.kind === 272;
+ return node.kind === 237 && node.parent.kind === 274;
}
ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement;
function isAmbientModule(node) {
- return ts.isModuleDeclaration(node) && (node.name.kind === 9 || isGlobalScopeAugmentation(node));
+ return ts.isModuleDeclaration(node) && (node.name.kind === 10 || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
function isModuleWithStringLiteralName(node) {
- return ts.isModuleDeclaration(node) && node.name.kind === 9;
+ return ts.isModuleDeclaration(node) && node.name.kind === 10;
}
ts.isModuleWithStringLiteralName = isModuleWithStringLiteralName;
function isNonGlobalAmbientModule(node) {
@@ -6276,11 +6369,11 @@ var ts;
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
- return node && node.kind === 242 && (!node.body);
+ return node && node.kind === 244 && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 277 ||
- node.kind === 242 ||
+ return node.kind === 279 ||
+ node.kind === 244 ||
ts.isFunctionLike(node);
}
ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
@@ -6294,9 +6387,9 @@ var ts;
ts.isExternalModuleAugmentation = isExternalModuleAugmentation;
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 277:
+ case 279:
return ts.isExternalModule(node.parent);
- case 243:
+ case 245:
return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
}
return false;
@@ -6312,22 +6405,22 @@ var ts;
ts.isEffectiveExternalModule = isEffectiveExternalModule;
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 277:
+ case 279:
+ case 246:
+ case 274:
case 244:
- case 272:
- case 242:
- case 223:
- case 224:
case 225:
- case 155:
- case 154:
- case 156:
+ case 226:
+ case 227:
case 157:
- case 237:
- case 194:
- case 195:
+ case 156:
+ case 158:
+ case 159:
+ case 239:
+ case 196:
+ case 197:
return true;
- case 216:
+ case 218:
return !ts.isFunctionLike(parentNode);
}
return false;
@@ -6335,9 +6428,9 @@ var ts;
ts.isBlockScope = isBlockScope;
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 295:
- case 302:
- case 291:
+ case 297:
+ case 304:
+ case 293:
return true;
default:
ts.assertType(node);
@@ -6347,25 +6440,25 @@ var ts;
ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
function isDeclarationWithTypeParameterChildren(node) {
switch (node.kind) {
- case 158:
- case 159:
- case 153:
case 160:
- case 163:
- case 164:
- case 287:
- case 238:
- case 207:
- case 239:
- case 240:
- case 301:
- case 237:
- case 154:
+ case 161:
case 155:
+ case 162:
+ case 165:
+ case 166:
+ case 289:
+ case 240:
+ case 209:
+ case 241:
+ case 242:
+ case 303:
+ case 239:
case 156:
case 157:
- case 194:
- case 195:
+ case 158:
+ case 159:
+ case 196:
+ case 197:
return true;
default:
ts.assertType(node);
@@ -6375,8 +6468,8 @@ var ts;
ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren;
function isAnyImportSyntax(node) {
switch (node.kind) {
- case 247:
- case 246:
+ case 249:
+ case 248:
return true;
default:
return false;
@@ -6385,15 +6478,15 @@ var ts;
ts.isAnyImportSyntax = isAnyImportSyntax;
function isLateVisibilityPaintedStatement(node) {
switch (node.kind) {
- case 247:
- case 246:
- case 217:
- case 238:
- case 237:
- case 242:
+ case 249:
+ case 248:
+ case 219:
case 240:
case 239:
+ case 244:
+ case 242:
case 241:
+ case 243:
return true;
default:
return false;
@@ -6418,12 +6511,13 @@ var ts;
ts.getNameFromIndexInfo = getNameFromIndexInfo;
function getTextOfPropertyName(name) {
switch (name.kind) {
- case 71:
+ case 72:
return name.escapedText;
- case 9:
+ case 10:
case 8:
+ case 14:
return ts.escapeLeadingUnderscores(name.text);
- case 147:
+ case 149:
return isStringOrNumericLiteralLike(name.expression) ? ts.escapeLeadingUnderscores(name.expression.text) : undefined;
default:
return ts.Debug.assertNever(name);
@@ -6432,11 +6526,11 @@ var ts;
ts.getTextOfPropertyName = getTextOfPropertyName;
function entityNameToString(name) {
switch (name.kind) {
- case 71:
+ case 72:
return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name);
- case 146:
+ case 148:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 187:
+ case 189:
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
default:
throw ts.Debug.assertNever(name);
@@ -6481,7 +6575,7 @@ var ts;
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForArrowFunction(sourceFile, node) {
var pos = ts.skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 216) {
+ if (node.body && node.body.kind === 218) {
var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
if (startLine < endLine) {
@@ -6493,31 +6587,31 @@ var ts;
function getErrorSpanForNode(sourceFile, node) {
var errorNode = node;
switch (node.kind) {
- case 277:
+ case 279:
var pos_1 = ts.skipTrivia(sourceFile.text, 0, false);
if (pos_1 === sourceFile.text.length) {
return ts.createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos_1);
- case 235:
- case 184:
- case 238:
- case 207:
- case 239:
- case 242:
- case 241:
- case 276:
case 237:
- case 194:
- case 154:
- case 156:
- case 157:
+ case 186:
case 240:
- case 152:
- case 151:
+ case 209:
+ case 241:
+ case 244:
+ case 243:
+ case 278:
+ case 239:
+ case 196:
+ case 156:
+ case 158:
+ case 159:
+ case 242:
+ case 154:
+ case 153:
errorNode = node.name;
break;
- case 195:
+ case 197:
return getErrorSpanForArrowFunction(sourceFile, node);
}
if (errorNode === undefined) {
@@ -6563,11 +6657,11 @@ var ts;
}
ts.isLet = isLet;
function isSuperCall(n) {
- return n.kind === 189 && n.expression.kind === 97;
+ return n.kind === 191 && n.expression.kind === 98;
}
ts.isSuperCall = isSuperCall;
function isImportCall(n) {
- return n.kind === 189 && n.expression.kind === 91;
+ return n.kind === 191 && n.expression.kind === 92;
}
ts.isImportCall = isImportCall;
function isLiteralImportTypeNode(n) {
@@ -6575,20 +6669,20 @@ var ts;
}
ts.isLiteralImportTypeNode = isLiteralImportTypeNode;
function isPrologueDirective(node) {
- return node.kind === 219
- && node.expression.kind === 9;
+ return node.kind === 221
+ && node.expression.kind === 10;
}
ts.isPrologueDirective = isPrologueDirective;
function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
- return node.kind !== 10 ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined;
+ return node.kind !== 11 ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined;
}
ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode;
function getJSDocCommentRanges(node, text) {
- var commentRanges = (node.kind === 149 ||
- node.kind === 148 ||
- node.kind === 194 ||
- node.kind === 195 ||
- node.kind === 193) ?
+ var commentRanges = (node.kind === 151 ||
+ node.kind === 150 ||
+ node.kind === 196 ||
+ node.kind === 197 ||
+ node.kind === 195) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
ts.getLeadingCommentRanges(text, node.pos);
return ts.filter(commentRanges, function (comment) {
@@ -6603,78 +6697,79 @@ var ts;
ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/;
var defaultLibReferenceRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (161 <= node.kind && node.kind <= 181) {
+ if (163 <= node.kind && node.kind <= 183) {
return true;
}
switch (node.kind) {
- case 119:
- case 142:
- case 134:
- case 137:
- case 122:
- case 138:
+ case 120:
+ case 143:
case 135:
- case 140:
- case 131:
- return true;
- case 105:
- return node.parent.kind !== 198;
- case 209:
- return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 148:
- return node.parent.kind === 179 || node.parent.kind === 174;
- case 71:
- if (node.parent.kind === 146 && node.parent.right === node) {
- node = node.parent;
- }
- else if (node.parent.kind === 187 && node.parent.name === node) {
- node = node.parent;
- }
- ts.Debug.assert(node.kind === 71 || node.kind === 146 || node.kind === 187, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
case 146:
- case 187:
- case 99: {
+ case 138:
+ case 123:
+ case 139:
+ case 136:
+ case 141:
+ case 132:
+ return true;
+ case 106:
+ return node.parent.kind !== 200;
+ case 211:
+ return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
+ case 150:
+ return node.parent.kind === 181 || node.parent.kind === 176;
+ case 72:
+ if (node.parent.kind === 148 && node.parent.right === node) {
+ node = node.parent;
+ }
+ else if (node.parent.kind === 189 && node.parent.name === node) {
+ node = node.parent;
+ }
+ ts.Debug.assert(node.kind === 72 || node.kind === 148 || node.kind === 189, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+ case 148:
+ case 189:
+ case 100: {
var parent = node.parent;
- if (parent.kind === 165) {
+ if (parent.kind === 167) {
return false;
}
- if (parent.kind === 181) {
+ if (parent.kind === 183) {
return !parent.isTypeOf;
}
- if (161 <= parent.kind && parent.kind <= 181) {
+ if (163 <= parent.kind && parent.kind <= 183) {
return true;
}
switch (parent.kind) {
- case 209:
+ case 211:
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
- case 148:
+ case 150:
return node === parent.constraint;
- case 301:
+ case 303:
return node === parent.constraint;
- case 152:
- case 151:
- case 149:
- case 235:
- return node === parent.type;
- case 237:
- case 194:
- case 195:
- case 155:
case 154:
case 153:
- case 156:
- case 157:
+ case 151:
+ case 237:
return node === parent.type;
+ case 239:
+ case 196:
+ case 197:
+ case 157:
+ case 156:
+ case 155:
case 158:
case 159:
+ return node === parent.type;
case 160:
+ case 161:
+ case 162:
return node === parent.type;
- case 192:
+ case 194:
return node === parent.type;
- case 189:
- case 190:
- return ts.contains(parent.typeArguments, node);
case 191:
+ case 192:
+ return ts.contains(parent.typeArguments, node);
+ case 193:
return false;
}
}
@@ -6696,23 +6791,23 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 228:
+ case 230:
return visitor(node);
- case 244:
- case 216:
- case 220:
- case 221:
+ case 246:
+ case 218:
case 222:
case 223:
case 224:
case 225:
- case 229:
- case 230:
- case 269:
- case 270:
+ case 226:
+ case 227:
case 231:
- case 233:
+ case 232:
+ case 271:
case 272:
+ case 233:
+ case 235:
+ case 274:
return ts.forEachChild(node, traverse);
}
}
@@ -6722,23 +6817,23 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 205:
+ case 207:
visitor(node);
var operand = node.expression;
if (operand) {
traverse(operand);
}
return;
+ case 243:
case 241:
- case 239:
+ case 244:
case 242:
case 240:
- case 238:
- case 207:
+ case 209:
return;
default:
if (ts.isFunctionLike(node)) {
- if (node.name && node.name.kind === 147) {
+ if (node.name && node.name.kind === 149) {
traverse(node.name.expression);
return;
}
@@ -6751,10 +6846,10 @@ var ts;
}
ts.forEachYieldExpression = forEachYieldExpression;
function getRestParameterElementType(node) {
- if (node && node.kind === 167) {
+ if (node && node.kind === 169) {
return node.elementType;
}
- else if (node && node.kind === 162) {
+ else if (node && node.kind === 164) {
return ts.singleOrUndefined(node.typeArguments);
}
else {
@@ -6764,12 +6859,12 @@ var ts;
ts.getRestParameterElementType = getRestParameterElementType;
function getMembersOfDeclaration(node) {
switch (node.kind) {
- case 239:
- case 238:
- case 207:
- case 166:
+ case 241:
+ case 240:
+ case 209:
+ case 168:
return node.members;
- case 186:
+ case 188:
return node.properties;
}
}
@@ -6777,14 +6872,14 @@ var ts;
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 184:
- case 276:
- case 149:
- case 273:
- case 152:
+ case 186:
+ case 278:
case 151:
- case 274:
- case 235:
+ case 275:
+ case 154:
+ case 153:
+ case 276:
+ case 237:
return true;
}
}
@@ -6796,8 +6891,8 @@ var ts;
}
ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor;
function isVariableDeclarationInVariableStatement(node) {
- return node.parent.kind === 236
- && node.parent.parent.kind === 217;
+ return node.parent.kind === 238
+ && node.parent.parent.kind === 219;
}
ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
function isValidESSymbolDeclaration(node) {
@@ -6808,13 +6903,13 @@ var ts;
ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 154:
- case 153:
- case 155:
case 156:
+ case 155:
case 157:
- case 237:
- case 194:
+ case 158:
+ case 159:
+ case 239:
+ case 196:
return true;
}
return false;
@@ -6825,7 +6920,7 @@ var ts;
if (beforeUnwrapLabelCallback) {
beforeUnwrapLabelCallback(node);
}
- if (node.statement.kind !== 231) {
+ if (node.statement.kind !== 233) {
return node.statement;
}
node = node.statement;
@@ -6833,17 +6928,17 @@ var ts;
}
ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel;
function isFunctionBlock(node) {
- return node && node.kind === 216 && ts.isFunctionLike(node.parent);
+ return node && node.kind === 218 && ts.isFunctionLike(node.parent);
}
ts.isFunctionBlock = isFunctionBlock;
function isObjectLiteralMethod(node) {
- return node && node.kind === 154 && node.parent.kind === 186;
+ return node && node.kind === 156 && node.parent.kind === 188;
}
ts.isObjectLiteralMethod = isObjectLiteralMethod;
function isObjectLiteralOrClassExpressionMethod(node) {
- return node.kind === 154 &&
- (node.parent.kind === 186 ||
- node.parent.kind === 207);
+ return node.kind === 156 &&
+ (node.parent.kind === 188 ||
+ node.parent.kind === 209);
}
ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
function isIdentifierTypePredicate(predicate) {
@@ -6856,7 +6951,7 @@ var ts;
ts.isThisTypePredicate = isThisTypePredicate;
function getPropertyAssignment(objectLiteral, key, key2) {
return objectLiteral.properties.filter(function (property) {
- if (property.kind === 273) {
+ if (property.kind === 275) {
var propName = getTextOfPropertyName(property.name);
return key === propName || (!!key2 && key2 === propName);
}
@@ -6893,46 +6988,46 @@ var ts;
}
ts.getContainingClass = getContainingClass;
function getThisContainer(node, includeArrowFunctions) {
- ts.Debug.assert(node.kind !== 277);
+ ts.Debug.assert(node.kind !== 279);
while (true) {
node = node.parent;
if (!node) {
return ts.Debug.fail();
}
switch (node.kind) {
- case 147:
+ case 149:
if (ts.isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 150:
- if (node.parent.kind === 149 && ts.isClassElement(node.parent.parent)) {
+ case 152:
+ if (node.parent.kind === 151 && ts.isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (ts.isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 195:
+ case 197:
if (!includeArrowFunctions) {
continue;
}
- case 237:
- case 194:
- case 242:
- case 152:
- case 151:
+ case 239:
+ case 196:
+ case 244:
case 154:
case 153:
- case 155:
case 156:
+ case 155:
case 157:
case 158:
case 159:
case 160:
- case 241:
- case 277:
+ case 161:
+ case 162:
+ case 243:
+ case 279:
return node;
}
}
@@ -6942,9 +7037,9 @@ var ts;
var container = getThisContainer(node, false);
if (container) {
switch (container.kind) {
- case 155:
- case 237:
- case 194:
+ case 157:
+ case 239:
+ case 196:
return container;
}
}
@@ -6958,25 +7053,25 @@ var ts;
return node;
}
switch (node.kind) {
- case 147:
+ case 149:
node = node.parent;
break;
- case 237:
- case 194:
- case 195:
+ case 239:
+ case 196:
+ case 197:
if (!stopOnFunctions) {
continue;
}
- case 152:
- case 151:
case 154:
case 153:
- case 155:
case 156:
+ case 155:
case 157:
+ case 158:
+ case 159:
return node;
- case 150:
- if (node.parent.kind === 149 && ts.isClassElement(node.parent.parent)) {
+ case 152:
+ if (node.parent.kind === 151 && ts.isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (ts.isClassElement(node.parent)) {
@@ -6988,14 +7083,14 @@ var ts;
}
ts.getSuperContainer = getSuperContainer;
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 194 || func.kind === 195) {
+ if (func.kind === 196 || func.kind === 197) {
var prev = func;
var parent = func.parent;
- while (parent.kind === 193) {
+ while (parent.kind === 195) {
prev = parent;
parent = parent.parent;
}
- if (parent.kind === 189 && parent.expression === prev) {
+ if (parent.kind === 191 && parent.expression === prev) {
return parent;
}
}
@@ -7003,26 +7098,26 @@ var ts;
ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;
function isSuperProperty(node) {
var kind = node.kind;
- return (kind === 187 || kind === 188)
- && node.expression.kind === 97;
+ return (kind === 189 || kind === 190)
+ && node.expression.kind === 98;
}
ts.isSuperProperty = isSuperProperty;
function isThisProperty(node) {
var kind = node.kind;
- return (kind === 187 || kind === 188)
- && node.expression.kind === 99;
+ return (kind === 189 || kind === 190)
+ && node.expression.kind === 100;
}
ts.isThisProperty = isThisProperty;
function getEntityNameFromTypeNode(node) {
switch (node.kind) {
- case 162:
+ case 164:
return node.typeName;
- case 209:
+ case 211:
return isEntityNameExpression(node.expression)
? node.expression
: undefined;
- case 71:
- case 146:
+ case 72:
+ case 148:
return node;
}
return undefined;
@@ -7030,10 +7125,10 @@ var ts;
ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
function getInvokedExpression(node) {
switch (node.kind) {
- case 191:
+ case 193:
return node.tag;
- case 260:
- case 259:
+ case 262:
+ case 261:
return node.tagName;
default:
return node.expression;
@@ -7042,21 +7137,21 @@ var ts;
ts.getInvokedExpression = getInvokedExpression;
function nodeCanBeDecorated(node, parent, grandparent) {
switch (node.kind) {
- case 238:
+ case 240:
return true;
- case 152:
- return parent.kind === 238;
- case 156:
- case 157:
case 154:
+ return parent.kind === 240;
+ case 158:
+ case 159:
+ case 156:
return node.body !== undefined
- && parent.kind === 238;
- case 149:
+ && parent.kind === 240;
+ case 151:
return parent.body !== undefined
- && (parent.kind === 155
- || parent.kind === 154
- || parent.kind === 157)
- && grandparent.kind === 238;
+ && (parent.kind === 157
+ || parent.kind === 156
+ || parent.kind === 159)
+ && grandparent.kind === 240;
}
return false;
}
@@ -7072,10 +7167,10 @@ var ts;
ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
function childIsDecorated(node, parent) {
switch (node.kind) {
- case 238:
+ case 240:
return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); });
- case 154:
- case 157:
+ case 156:
+ case 159:
return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); });
default:
return false;
@@ -7084,9 +7179,9 @@ var ts;
ts.childIsDecorated = childIsDecorated;
function isJSXTagName(node) {
var parent = node.parent;
- if (parent.kind === 260 ||
- parent.kind === 259 ||
- parent.kind === 261) {
+ if (parent.kind === 262 ||
+ parent.kind === 261 ||
+ parent.kind === 263) {
return parent.tagName === node;
}
return false;
@@ -7094,55 +7189,56 @@ var ts;
ts.isJSXTagName = isJSXTagName;
function isExpressionNode(node) {
switch (node.kind) {
- case 97:
- case 95:
- case 101:
- case 86:
- case 12:
- case 185:
- case 186:
+ case 98:
+ case 96:
+ case 102:
+ case 87:
+ case 13:
case 187:
case 188:
case 189:
case 190:
case 191:
- case 210:
case 192:
- case 211:
case 193:
+ case 212:
case 194:
- case 207:
+ case 213:
case 195:
- case 198:
case 196:
+ case 209:
case 197:
case 200:
- case 201:
+ case 198:
+ case 199:
case 202:
case 203:
- case 206:
case 204:
- case 13:
- case 208:
- case 258:
- case 259:
- case 262:
case 205:
- case 199:
- case 212:
+ case 208:
+ case 206:
+ case 14:
+ case 210:
+ case 260:
+ case 261:
+ case 264:
+ case 207:
+ case 201:
+ case 214:
return true;
- case 146:
- while (node.parent.kind === 146) {
+ case 148:
+ while (node.parent.kind === 148) {
node = node.parent;
}
- return node.parent.kind === 165 || isJSXTagName(node);
- case 71:
- if (node.parent.kind === 165 || isJSXTagName(node)) {
+ return node.parent.kind === 167 || isJSXTagName(node);
+ case 72:
+ if (node.parent.kind === 167 || isJSXTagName(node)) {
return true;
}
case 8:
case 9:
- case 99:
+ case 10:
+ case 100:
return isInExpressionContext(node);
default:
return false;
@@ -7152,49 +7248,49 @@ var ts;
function isInExpressionContext(node) {
var parent = node.parent;
switch (parent.kind) {
- case 235:
- case 149:
- case 152:
+ case 237:
case 151:
- case 276:
- case 273:
- case 184:
+ case 154:
+ case 153:
+ case 278:
+ case 275:
+ case 186:
return parent.initializer === node;
- case 219:
- case 220:
case 221:
case 222:
- case 228:
- case 229:
- case 230:
- case 269:
- case 232:
- return parent.expression === node;
case 223:
+ case 224:
+ case 230:
+ case 231:
+ case 232:
+ case 271:
+ case 234:
+ return parent.expression === node;
+ case 225:
var forStatement = parent;
- return (forStatement.initializer === node && forStatement.initializer.kind !== 236) ||
+ return (forStatement.initializer === node && forStatement.initializer.kind !== 238) ||
forStatement.condition === node ||
forStatement.incrementor === node;
- case 224:
- case 225:
+ case 226:
+ case 227:
var forInStatement = parent;
- return (forInStatement.initializer === node && forInStatement.initializer.kind !== 236) ||
+ return (forInStatement.initializer === node && forInStatement.initializer.kind !== 238) ||
forInStatement.expression === node;
- case 192:
- case 210:
+ case 194:
+ case 212:
return node === parent.expression;
- case 214:
+ case 216:
return node === parent.expression;
- case 147:
+ case 149:
return node === parent.expression;
- case 150:
- case 268:
- case 267:
- case 275:
+ case 152:
+ case 270:
+ case 269:
+ case 277:
return true;
- case 209:
+ case 211:
return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
- case 274:
+ case 276:
return parent.objectAssignmentInitializer === node;
default:
return isExpressionNode(parent);
@@ -7202,7 +7298,7 @@ var ts;
}
ts.isInExpressionContext = isInExpressionContext;
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 246 && node.moduleReference.kind === 257;
+ return node.kind === 248 && node.moduleReference.kind === 259;
}
ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -7211,7 +7307,7 @@ var ts;
}
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 246 && node.moduleReference.kind !== 257;
+ return node.kind === 248 && node.moduleReference.kind !== 259;
}
ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
function isSourceFileJS(file) {
@@ -7239,15 +7335,15 @@ var ts;
ts.isIdentifier(node.typeName) &&
node.typeName.escapedText === "Object" &&
node.typeArguments && node.typeArguments.length === 2 &&
- (node.typeArguments[0].kind === 137 || node.typeArguments[0].kind === 134);
+ (node.typeArguments[0].kind === 138 || node.typeArguments[0].kind === 135);
}
ts.isJSDocIndexSignature = isJSDocIndexSignature;
function isRequireCall(callExpression, checkArgumentIsStringLiteralLike) {
- if (callExpression.kind !== 189) {
+ if (callExpression.kind !== 191) {
return false;
}
var _a = callExpression, expression = _a.expression, args = _a.arguments;
- if (expression.kind !== 71 || expression.escapedText !== "require") {
+ if (expression.kind !== 72 || expression.escapedText !== "require") {
return false;
}
if (args.length !== 1) {
@@ -7278,16 +7374,16 @@ var ts;
name = node.parent.name;
decl = node.parent;
}
- else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 && node.parent.right === node) {
+ else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59 && node.parent.right === node) {
name = node.parent.left;
decl = name;
}
- else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 54) {
+ else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 55) {
if (ts.isVariableDeclaration(node.parent.parent) && node.parent.parent.initializer === node.parent) {
name = node.parent.parent.name;
decl = node.parent.parent;
}
- else if (ts.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 58 && node.parent.parent.right === node.parent) {
+ else if (ts.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 59 && node.parent.parent.right === node.parent) {
name = node.parent.parent.left;
decl = name;
}
@@ -7302,12 +7398,12 @@ var ts;
}
ts.getDeclarationOfExpando = getDeclarationOfExpando;
function isAssignmentDeclaration(decl) {
- return ts.isBinaryExpression(decl) || ts.isPropertyAccessExpression(decl) || ts.isIdentifier(decl);
+ return ts.isBinaryExpression(decl) || ts.isPropertyAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl);
}
ts.isAssignmentDeclaration = isAssignmentDeclaration;
function getEffectiveInitializer(node) {
if (isInJSFile(node) && node.initializer &&
- ts.isBinaryExpression(node.initializer) && node.initializer.operatorToken.kind === 54 &&
+ ts.isBinaryExpression(node.initializer) && node.initializer.operatorToken.kind === 55 &&
node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) {
return node.initializer.right;
}
@@ -7319,22 +7415,31 @@ var ts;
return init && getExpandoInitializer(init, isPrototypeAccess(node.name));
}
ts.getDeclaredExpandoInitializer = getDeclaredExpandoInitializer;
+ function hasExpandoValueProperty(node, isPrototypeAssignment) {
+ return ts.forEach(node.properties, function (p) { return ts.isPropertyAssignment(p) && ts.isIdentifier(p.name) && p.name.escapedText === "value" && p.initializer && getExpandoInitializer(p.initializer, isPrototypeAssignment); });
+ }
function getAssignedExpandoInitializer(node) {
- if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58) {
+ if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59) {
var isPrototypeAssignment = isPrototypeAccess(node.parent.left);
return getExpandoInitializer(node.parent.right, isPrototypeAssignment) ||
getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment);
}
+ if (node && ts.isCallExpression(node) && isBindableObjectDefinePropertyCall(node)) {
+ var result = hasExpandoValueProperty(node.arguments[2], node.arguments[1].text === "prototype");
+ if (result) {
+ return result;
+ }
+ }
}
ts.getAssignedExpandoInitializer = getAssignedExpandoInitializer;
function getExpandoInitializer(initializer, isPrototypeAssignment) {
if (ts.isCallExpression(initializer)) {
var e = skipParentheses(initializer.expression);
- return e.kind === 194 || e.kind === 195 ? initializer : undefined;
+ return e.kind === 196 || e.kind === 197 ? initializer : undefined;
}
- if (initializer.kind === 194 ||
- initializer.kind === 207 ||
- initializer.kind === 195) {
+ if (initializer.kind === 196 ||
+ initializer.kind === 209 ||
+ initializer.kind === 197) {
return initializer;
}
if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -7343,22 +7448,22 @@ var ts;
}
ts.getExpandoInitializer = getExpandoInitializer;
function getDefaultedExpandoInitializer(name, initializer, isPrototypeAssignment) {
- var e = ts.isBinaryExpression(initializer) && initializer.operatorToken.kind === 54 && getExpandoInitializer(initializer.right, isPrototypeAssignment);
+ var e = ts.isBinaryExpression(initializer) && initializer.operatorToken.kind === 55 && getExpandoInitializer(initializer.right, isPrototypeAssignment);
if (e && isSameEntityName(name, initializer.left)) {
return e;
}
}
function isDefaultedExpandoInitializer(node) {
var name = ts.isVariableDeclaration(node.parent) ? node.parent.name :
- ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 ? node.parent.left :
+ ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59 ? node.parent.left :
undefined;
return name && getExpandoInitializer(node.right, isPrototypeAccess(name)) && isEntityNameExpression(name) && isSameEntityName(name, node.left);
}
ts.isDefaultedExpandoInitializer = isDefaultedExpandoInitializer;
function getNameOfExpando(node) {
if (ts.isBinaryExpression(node.parent)) {
- var parent = (node.parent.operatorToken.kind === 54 && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent;
- if (parent.operatorToken.kind === 58 && ts.isIdentifier(parent.left)) {
+ var parent = (node.parent.operatorToken.kind === 55 && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent;
+ if (parent.operatorToken.kind === 59 && ts.isIdentifier(parent.left)) {
return parent.left;
}
}
@@ -7372,7 +7477,7 @@ var ts;
return name.escapedText === initializer.escapedText;
}
if (ts.isIdentifier(name) && ts.isPropertyAccessExpression(initializer)) {
- return (initializer.expression.kind === 99 ||
+ return (initializer.expression.kind === 100 ||
ts.isIdentifier(initializer.expression) &&
(initializer.expression.escapedText === "window" ||
initializer.expression.escapedText === "self" ||
@@ -7404,8 +7509,31 @@ var ts;
return special === 5 || isInJSFile(expr) ? special : 0;
}
ts.getAssignmentDeclarationKind = getAssignmentDeclarationKind;
+ function isBindableObjectDefinePropertyCall(expr) {
+ return ts.length(expr.arguments) === 3 &&
+ ts.isPropertyAccessExpression(expr.expression) &&
+ ts.isIdentifier(expr.expression.expression) &&
+ ts.idText(expr.expression.expression) === "Object" &&
+ ts.idText(expr.expression.name) === "defineProperty" &&
+ isStringOrNumericLiteralLike(expr.arguments[1]) &&
+ isEntityNameExpression(expr.arguments[0]);
+ }
+ ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;
function getAssignmentDeclarationKindWorker(expr) {
- if (expr.operatorToken.kind !== 58 ||
+ if (ts.isCallExpression(expr)) {
+ if (!isBindableObjectDefinePropertyCall(expr)) {
+ return 0;
+ }
+ var entityName = expr.arguments[0];
+ if (isExportsIdentifier(entityName) || isModuleExportsPropertyAccessExpression(entityName)) {
+ return 8;
+ }
+ if (ts.isPropertyAccessExpression(entityName) && entityName.name.escapedText === "prototype" && isEntityNameExpression(entityName.expression)) {
+ return 9;
+ }
+ return 7;
+ }
+ if (expr.operatorToken.kind !== 59 ||
!ts.isPropertyAccessExpression(expr.left)) {
return 0;
}
@@ -7416,10 +7544,10 @@ var ts;
return getAssignmentDeclarationPropertyAccessKind(lhs);
}
function getAssignmentDeclarationPropertyAccessKind(lhs) {
- if (lhs.expression.kind === 99) {
+ if (lhs.expression.kind === 100) {
return 4;
}
- else if (ts.isIdentifier(lhs.expression) && lhs.expression.escapedText === "module" && lhs.name.escapedText === "exports") {
+ else if (isModuleExportsPropertyAccessExpression(lhs)) {
return 2;
}
else if (isEntityNameExpression(lhs.expression)) {
@@ -7454,7 +7582,7 @@ var ts;
ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment;
function isSpecialPropertyDeclaration(expr) {
return isInJSFile(expr) &&
- expr.parent && expr.parent.kind === 219 &&
+ expr.parent && expr.parent.kind === 221 &&
!!ts.getJSDocTypeTag(expr.parent);
}
ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration;
@@ -7463,7 +7591,7 @@ var ts;
return false;
}
var decl = symbol.valueDeclaration;
- return decl.kind === 237 || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer);
+ return decl.kind === 239 || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer);
}
ts.isFunctionSymbol = isFunctionSymbol;
function importFromModuleSpecifier(node) {
@@ -7472,14 +7600,14 @@ var ts;
ts.importFromModuleSpecifier = importFromModuleSpecifier;
function tryGetImportFromModuleSpecifier(node) {
switch (node.parent.kind) {
- case 247:
- case 253:
+ case 249:
+ case 255:
return node.parent;
- case 257:
+ case 259:
return node.parent.parent;
- case 189:
- return node.parent;
- case 180:
+ case 191:
+ return isImportCall(node.parent) || isRequireCall(node.parent, false) ? node.parent : undefined;
+ case 182:
ts.Debug.assert(ts.isStringLiteral(node));
return ts.tryCast(node.parent.parent, ts.isImportTypeNode);
default:
@@ -7489,12 +7617,12 @@ var ts;
ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier;
function getExternalModuleName(node) {
switch (node.kind) {
- case 247:
- case 253:
+ case 249:
+ case 255:
return node.moduleSpecifier;
- case 246:
- return node.moduleReference.kind === 257 ? node.moduleReference.expression : undefined;
- case 181:
+ case 248:
+ return node.moduleReference.kind === 259 ? node.moduleReference.expression : undefined;
+ case 183:
return isLiteralImportTypeNode(node) ? node.argument.literal : undefined;
default:
return ts.Debug.assertNever(node);
@@ -7503,11 +7631,11 @@ var ts;
ts.getExternalModuleName = getExternalModuleName;
function getNamespaceDeclarationNode(node) {
switch (node.kind) {
- case 247:
+ case 249:
return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport);
- case 246:
+ case 248:
return node;
- case 253:
+ case 255:
return undefined;
default:
return ts.Debug.assertNever(node);
@@ -7515,19 +7643,19 @@ var ts;
}
ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
function isDefaultImport(node) {
- return node.kind === 247 && !!node.importClause && !!node.importClause.name;
+ return node.kind === 249 && !!node.importClause && !!node.importClause.name;
}
ts.isDefaultImport = isDefaultImport;
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 149:
+ case 151:
+ case 156:
+ case 155:
+ case 276:
+ case 275:
case 154:
case 153:
- case 274:
- case 273:
- case 152:
- case 151:
return node.questionToken !== undefined;
}
}
@@ -7535,14 +7663,13 @@ var ts;
}
ts.hasQuestionToken = hasQuestionToken;
function isJSDocConstructSignature(node) {
- return node.kind === 287 &&
- node.parameters.length > 0 &&
- node.parameters[0].name &&
- node.parameters[0].name.escapedText === "new";
+ var param = ts.isJSDocFunctionType(node) ? ts.firstOrUndefined(node.parameters) : undefined;
+ var name = ts.tryCast(param && param.name, ts.isIdentifier);
+ return !!name && name.escapedText === "new";
}
ts.isJSDocConstructSignature = isJSDocConstructSignature;
function isJSDocTypeAlias(node) {
- return node.kind === 302 || node.kind === 295;
+ return node.kind === 304 || node.kind === 297;
}
ts.isJSDocTypeAlias = isJSDocTypeAlias;
function isTypeAlias(node) {
@@ -7552,7 +7679,7 @@ var ts;
function getSourceOfAssignment(node) {
return ts.isExpressionStatement(node) &&
node.expression && ts.isBinaryExpression(node.expression) &&
- node.expression.operatorToken.kind === 58
+ node.expression.operatorToken.kind === 59
? node.expression.right
: undefined;
}
@@ -7561,18 +7688,18 @@ var ts;
ts.isBinaryExpression(node.expression) &&
getAssignmentDeclarationKind(node.expression) !== 0 &&
ts.isBinaryExpression(node.expression.right) &&
- node.expression.right.operatorToken.kind === 54
+ node.expression.right.operatorToken.kind === 55
? node.expression.right.right
: undefined;
}
function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
switch (node.kind) {
- case 217:
+ case 219:
var v = getSingleVariableOfVariableStatement(node);
return v && v.initializer;
- case 152:
+ case 154:
return node.initializer;
- case 273:
+ case 275:
return node.initializer;
}
}
@@ -7582,7 +7709,7 @@ var ts;
function getNestedModuleDeclaration(node) {
return ts.isModuleDeclaration(node) &&
node.body &&
- node.body.kind === 242
+ node.body.kind === 244
? node.body
: undefined;
}
@@ -7596,11 +7723,11 @@ var ts;
if (ts.hasJSDocNodes(node)) {
result = ts.addRange(result, node.jsDoc);
}
- if (node.kind === 149) {
+ if (node.kind === 151) {
result = ts.addRange(result, ts.getJSDocParameterTags(node));
break;
}
- if (node.kind === 148) {
+ if (node.kind === 150) {
result = ts.addRange(result, ts.getJSDocTypeParameterTags(node));
break;
}
@@ -7611,16 +7738,16 @@ var ts;
ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags;
function getNextJSDocCommentLocation(node) {
var parent = node.parent;
- if (parent.kind === 273 ||
- parent.kind === 152 ||
- parent.kind === 219 && node.kind === 187 ||
+ if (parent.kind === 275 ||
+ parent.kind === 154 ||
+ parent.kind === 221 && node.kind === 189 ||
getNestedModuleDeclaration(parent) ||
- ts.isBinaryExpression(node) && node.operatorToken.kind === 58) {
+ ts.isBinaryExpression(node) && node.operatorToken.kind === 59) {
return parent;
}
else if (parent.parent &&
(getSingleVariableOfVariableStatement(parent.parent) === node ||
- ts.isBinaryExpression(parent) && parent.operatorToken.kind === 58)) {
+ ts.isBinaryExpression(parent) && parent.operatorToken.kind === 59)) {
return parent.parent;
}
else if (parent.parent && parent.parent.parent &&
@@ -7642,7 +7769,7 @@ var ts;
if (!decl) {
return undefined;
}
- var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 71 && p.name.escapedText === name; });
+ var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 72 && p.name.escapedText === name; });
return parameter && parameter.symbol;
}
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
@@ -7677,38 +7804,38 @@ var ts;
ts.hasRestParameter = hasRestParameter;
function isRestParameter(node) {
var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
- return node.dotDotDotToken !== undefined || !!type && type.kind === 288;
+ return node.dotDotDotToken !== undefined || !!type && type.kind === 290;
}
ts.isRestParameter = isRestParameter;
function getAssignmentTargetKind(node) {
var parent = node.parent;
while (true) {
switch (parent.kind) {
- case 202:
+ case 204:
var binaryOperator = parent.operatorToken.kind;
return isAssignmentOperator(binaryOperator) && parent.left === node ?
- binaryOperator === 58 ? 1 : 2 :
+ binaryOperator === 59 ? 1 : 2 :
0;
- case 200:
- case 201:
+ case 202:
+ case 203:
var unaryOperator = parent.operator;
- return unaryOperator === 43 || unaryOperator === 44 ? 2 : 0;
- case 224:
- case 225:
+ return unaryOperator === 44 || unaryOperator === 45 ? 2 : 0;
+ case 226:
+ case 227:
return parent.initializer === node ? 1 : 0;
- case 193:
- case 185:
- case 206:
- case 211:
+ case 195:
+ case 187:
+ case 208:
+ case 213:
node = parent;
break;
- case 274:
+ case 276:
if (parent.name !== node) {
return 0;
}
node = parent.parent;
break;
- case 273:
+ case 275:
if (parent.name === node) {
return 0;
}
@@ -7727,22 +7854,22 @@ var ts;
ts.isAssignmentTarget = isAssignmentTarget;
function isNodeWithPossibleHoistedDeclaration(node) {
switch (node.kind) {
- case 216:
- case 217:
- case 229:
- case 220:
- case 230:
- case 244:
- case 269:
- case 270:
+ case 218:
+ case 219:
case 231:
+ case 222:
+ case 232:
+ case 246:
+ case 271:
+ case 272:
+ case 233:
+ case 225:
+ case 226:
+ case 227:
case 223:
case 224:
- case 225:
- case 221:
- case 222:
- case 233:
- case 272:
+ case 235:
+ case 274:
return true;
}
return false;
@@ -7759,32 +7886,32 @@ var ts;
return node;
}
function walkUpParenthesizedTypes(node) {
- return walkUp(node, 175);
+ return walkUp(node, 177);
}
ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes;
function walkUpParenthesizedExpressions(node) {
- return walkUp(node, 193);
+ return walkUp(node, 195);
}
ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions;
function skipParentheses(node) {
- while (node.kind === 193) {
+ while (node.kind === 195) {
node = node.expression;
}
return node;
}
ts.skipParentheses = skipParentheses;
function skipParenthesesUp(node) {
- while (node.kind === 193) {
+ while (node.kind === 195) {
node = node.parent;
}
return node;
}
function isDeleteTarget(node) {
- if (node.kind !== 187 && node.kind !== 188) {
+ if (node.kind !== 189 && node.kind !== 190) {
return false;
}
node = walkUpParenthesizedExpressions(node.parent);
- return node && node.kind === 196;
+ return node && node.kind === 198;
}
ts.isDeleteTarget = isDeleteTarget;
function isNodeDescendantOf(node, ancestor) {
@@ -7803,11 +7930,11 @@ var ts;
function getDeclarationFromName(name) {
var parent = name.parent;
switch (name.kind) {
- case 9:
+ case 10:
case 8:
if (ts.isComputedPropertyName(parent))
return parent.parent;
- case 71:
+ case 72:
if (ts.isDeclaration(parent)) {
return parent.name === name ? parent : undefined;
}
@@ -7830,51 +7957,51 @@ var ts;
}
ts.getDeclarationFromName = getDeclarationFromName;
function isLiteralComputedPropertyDeclarationName(node) {
- return (node.kind === 9 || node.kind === 8) &&
- node.parent.kind === 147 &&
+ return (node.kind === 10 || node.kind === 8) &&
+ node.parent.kind === 149 &&
ts.isDeclaration(node.parent.parent);
}
ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
function isIdentifierName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 152:
- case 151:
case 154:
case 153:
case 156:
- case 157:
- case 276:
- case 273:
- case 187:
+ case 155:
+ case 158:
+ case 159:
+ case 278:
+ case 275:
+ case 189:
return parent.name === node;
- case 146:
+ case 148:
if (parent.right === node) {
- while (parent.kind === 146) {
+ while (parent.kind === 148) {
parent = parent.parent;
}
- return parent.kind === 165 || parent.kind === 162;
+ return parent.kind === 167 || parent.kind === 164;
}
return false;
- case 184:
- case 251:
+ case 186:
+ case 253:
return parent.propertyName === node;
- case 255:
- case 265:
+ case 257:
+ case 267:
return true;
}
return false;
}
ts.isIdentifierName = isIdentifierName;
function isAliasSymbolDeclaration(node) {
- return node.kind === 246 ||
- node.kind === 245 ||
- node.kind === 248 && !!node.name ||
- node.kind === 249 ||
+ return node.kind === 248 ||
+ node.kind === 247 ||
+ node.kind === 250 && !!node.name ||
node.kind === 251 ||
- node.kind === 255 ||
- node.kind === 252 && exportAssignmentIsAlias(node) ||
- ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2;
+ node.kind === 253 ||
+ node.kind === 257 ||
+ node.kind === 254 && exportAssignmentIsAlias(node) ||
+ ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node);
}
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
function exportAssignmentIsAlias(node) {
@@ -7893,12 +8020,12 @@ var ts;
}
ts.getEffectiveBaseTypeNode = getEffectiveBaseTypeNode;
function getClassExtendsHeritageElement(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 85);
+ var heritageClause = getHeritageClause(node.heritageClauses, 86);
return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined;
}
ts.getClassExtendsHeritageElement = getClassExtendsHeritageElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 108);
+ var heritageClause = getHeritageClause(node.heritageClauses, 109);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
@@ -7909,7 +8036,7 @@ var ts;
}
ts.getAllSuperTypeNodes = getAllSuperTypeNodes;
function getInterfaceBaseTypeNodes(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 85);
+ var heritageClause = getHeritageClause(node.heritageClauses, 86);
return heritageClause ? heritageClause.types : undefined;
}
ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes;
@@ -7943,11 +8070,11 @@ var ts;
}
ts.getAncestor = getAncestor;
function isKeyword(token) {
- return 72 <= token && token <= 145;
+ return 73 <= token && token <= 147;
}
ts.isKeyword = isKeyword;
function isContextualKeyword(token) {
- return 117 <= token && token <= 145;
+ return 118 <= token && token <= 147;
}
ts.isContextualKeyword = isContextualKeyword;
function isNonContextualKeyword(token) {
@@ -7959,6 +8086,11 @@ var ts;
return token !== undefined && isNonContextualKeyword(token);
}
ts.isStringANonContextualKeyword = isStringANonContextualKeyword;
+ function isIdentifierANonContextualKeyword(_a) {
+ var originalKeywordKind = _a.originalKeywordKind;
+ return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind);
+ }
+ ts.isIdentifierANonContextualKeyword = isIdentifierANonContextualKeyword;
function isTrivia(token) {
return 2 <= token && token <= 7;
}
@@ -7969,13 +8101,13 @@ var ts;
}
var flags = 0;
switch (node.kind) {
- case 237:
- case 194:
- case 154:
+ case 239:
+ case 196:
+ case 156:
if (node.asteriskToken) {
flags |= 1;
}
- case 195:
+ case 197:
if (hasModifier(node, 256)) {
flags |= 2;
}
@@ -7989,10 +8121,10 @@ var ts;
ts.getFunctionFlags = getFunctionFlags;
function isAsyncFunction(node) {
switch (node.kind) {
- case 237:
- case 194:
- case 195:
- case 154:
+ case 239:
+ case 196:
+ case 197:
+ case 156:
return node.body !== undefined
&& node.asteriskToken === undefined
&& hasModifier(node, 256);
@@ -8010,7 +8142,7 @@ var ts;
}
ts.hasDynamicName = hasDynamicName;
function isDynamicName(name) {
- return name.kind === 147 &&
+ return name.kind === 149 &&
!isStringOrNumericLiteralLike(name.expression) &&
!isWellKnownSymbolSyntactically(name.expression);
}
@@ -8021,12 +8153,12 @@ var ts;
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
function getPropertyNameForPropertyNameNode(name) {
switch (name.kind) {
- case 71:
+ case 72:
return name.escapedText;
- case 9:
+ case 10:
case 8:
return ts.escapeLeadingUnderscores(name.text);
- case 147:
+ case 149:
var nameExpression = name.expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name));
@@ -8042,9 +8174,9 @@ var ts;
ts.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode;
function isPropertyNameLiteral(node) {
switch (node.kind) {
- case 71:
- case 9:
- case 13:
+ case 72:
+ case 10:
+ case 14:
case 8:
return true;
default:
@@ -8053,11 +8185,11 @@ var ts;
}
ts.isPropertyNameLiteral = isPropertyNameLiteral;
function getTextOfIdentifierOrLiteral(node) {
- return node.kind === 71 ? ts.idText(node) : node.text;
+ return node.kind === 72 ? ts.idText(node) : node.text;
}
ts.getTextOfIdentifierOrLiteral = getTextOfIdentifierOrLiteral;
function getEscapedTextOfIdentifierOrLiteral(node) {
- return node.kind === 71 ? node.escapedText : ts.escapeLeadingUnderscores(node.text);
+ return node.kind === 72 ? node.escapedText : ts.escapeLeadingUnderscores(node.text);
}
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
function getPropertyNameForKnownSymbolName(symbolName) {
@@ -8069,7 +8201,7 @@ var ts;
}
ts.isKnownSymbol = isKnownSymbol;
function isESSymbolIdentifier(node) {
- return node.kind === 71 && node.escapedText === "Symbol";
+ return node.kind === 72 && node.escapedText === "Symbol";
}
ts.isESSymbolIdentifier = isESSymbolIdentifier;
function isPushOrUnshiftIdentifier(node) {
@@ -8078,11 +8210,11 @@ var ts;
ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
function isParameterDeclaration(node) {
var root = getRootDeclaration(node);
- return root.kind === 149;
+ return root.kind === 151;
}
ts.isParameterDeclaration = isParameterDeclaration;
function getRootDeclaration(node) {
- while (node.kind === 184) {
+ while (node.kind === 186) {
node = node.parent.parent;
}
return node;
@@ -8090,15 +8222,15 @@ var ts;
ts.getRootDeclaration = getRootDeclaration;
function nodeStartsNewLexicalEnvironment(node) {
var kind = node.kind;
- return kind === 155
- || kind === 194
- || kind === 237
- || kind === 195
- || kind === 154
+ return kind === 157
+ || kind === 196
+ || kind === 239
+ || kind === 197
|| kind === 156
- || kind === 157
- || kind === 242
- || kind === 277;
+ || kind === 158
+ || kind === 159
+ || kind === 244
+ || kind === 279;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
function nodeIsSynthesized(range) {
@@ -8112,38 +8244,38 @@ var ts;
ts.getOriginalSourceFile = getOriginalSourceFile;
function getExpressionAssociativity(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 190 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 192 && expression.arguments !== undefined;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
ts.getExpressionAssociativity = getExpressionAssociativity;
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 190:
+ case 192:
return hasArguments ? 0 : 1;
- case 200:
- case 197:
- case 198:
- case 196:
- case 199:
- case 203:
- case 205:
- return 1;
case 202:
+ case 199:
+ case 200:
+ case 198:
+ case 201:
+ case 205:
+ case 207:
+ return 1;
+ case 204:
switch (operator) {
- case 40:
- case 58:
+ case 41:
case 59:
case 60:
- case 62:
case 61:
case 63:
+ case 62:
case 64:
case 65:
case 66:
case 67:
case 68:
- case 70:
case 69:
+ case 71:
+ case 70:
return 1;
}
}
@@ -8152,15 +8284,15 @@ var ts;
ts.getOperatorAssociativity = getOperatorAssociativity;
function getExpressionPrecedence(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 190 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 192 && expression.arguments !== undefined;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
ts.getExpressionPrecedence = getExpressionPrecedence;
function getOperator(expression) {
- if (expression.kind === 202) {
+ if (expression.kind === 204) {
return expression.operatorToken.kind;
}
- else if (expression.kind === 200 || expression.kind === 201) {
+ else if (expression.kind === 202 || expression.kind === 203) {
return expression.operator;
}
else {
@@ -8170,72 +8302,73 @@ var ts;
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 307:
+ case 309:
return 0;
- case 206:
+ case 208:
return 1;
- case 205:
+ case 207:
return 2;
- case 203:
+ case 205:
return 4;
- case 202:
+ case 204:
switch (operatorKind) {
- case 26:
+ case 27:
return 0;
- case 58:
case 59:
case 60:
- case 62:
case 61:
case 63:
+ case 62:
case 64:
case 65:
case 66:
case 67:
case 68:
- case 70:
case 69:
+ case 71:
+ case 70:
return 3;
default:
return getBinaryOperatorPrecedence(operatorKind);
}
- case 200:
- case 197:
- case 198:
- case 196:
+ case 202:
case 199:
- return 16;
+ case 200:
+ case 198:
case 201:
+ return 16;
+ case 203:
return 17;
- case 189:
- return 18;
- case 190:
- return hasArguments ? 19 : 18;
case 191:
- case 187:
- case 188:
+ return 18;
+ case 192:
+ return hasArguments ? 19 : 18;
+ case 193:
+ case 189:
+ case 190:
return 19;
- case 99:
- case 97:
- case 71:
- case 95:
- case 101:
- case 86:
+ case 100:
+ case 98:
+ case 72:
+ case 96:
+ case 102:
+ case 87:
case 8:
case 9:
- case 185:
- case 186:
- case 194:
- case 195:
- case 207:
- case 258:
- case 259:
- case 262:
- case 12:
+ case 10:
+ case 187:
+ case 188:
+ case 196:
+ case 197:
+ case 209:
+ case 260:
+ case 261:
+ case 264:
case 13:
- case 204:
- case 193:
- case 208:
+ case 14:
+ case 206:
+ case 195:
+ case 210:
return 20;
default:
return -1;
@@ -8244,41 +8377,41 @@ var ts;
ts.getOperatorPrecedence = getOperatorPrecedence;
function getBinaryOperatorPrecedence(kind) {
switch (kind) {
- case 54:
+ case 55:
return 5;
- case 53:
+ case 54:
return 6;
- case 49:
- return 7;
case 50:
+ return 7;
+ case 51:
return 8;
- case 48:
+ case 49:
return 9;
- case 32:
case 33:
case 34:
case 35:
+ case 36:
return 10;
- case 27:
- case 29:
+ case 28:
case 30:
case 31:
+ case 32:
+ case 94:
case 93:
- case 92:
- case 118:
+ case 119:
return 11;
- case 45:
case 46:
case 47:
+ case 48:
return 12;
- case 37:
case 38:
- return 13;
case 39:
- case 41:
- case 42:
- return 14;
+ return 13;
case 40:
+ case 42:
+ case 43:
+ return 14;
+ case 41:
return 15;
}
return -1;
@@ -8343,7 +8476,7 @@ var ts;
if (fileName) {
return fileDiagnostics.get(fileName) || [];
}
- var fileDiags = ts.flatMap(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); });
+ var fileDiags = ts.flatMapToMutable(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); });
if (!nonFileDiagnostics.length) {
return fileDiags;
}
@@ -8389,7 +8522,7 @@ var ts;
}
function isIntrinsicJsxName(name) {
var ch = name.charCodeAt(0);
- return (ch >= 97 && ch <= 122) || name.indexOf("-") > -1;
+ return (ch >= 97 && ch <= 122) || ts.stringContains(name, "-");
}
ts.isIntrinsicJsxName = isIntrinsicJsxName;
function get16BitUnicodeEscapeSequence(charCode) {
@@ -8470,16 +8603,10 @@ var ts;
lineStart = true;
}
}
- function writeTextOfNode(text, node) {
- var s = getTextOfNodeFromSourceText(text, node);
- write(s);
- updateLineCountAndPosFor(s);
- }
reset();
return {
write: write,
rawWrite: rawWrite,
- writeTextOfNode: writeTextOfNode,
writeLiteral: writeLiteral,
writeLine: writeLine,
increaseIndent: function () { indent++; },
@@ -8502,10 +8629,77 @@ var ts;
writePunctuation: write,
writeSpace: write,
writeStringLiteral: write,
- writeSymbol: write
+ writeSymbol: function (s, _) { return write(s); },
+ writeTrailingSemicolon: write,
+ writeComment: write
};
}
ts.createTextWriter = createTextWriter;
+ function getTrailingSemicolonOmittingWriter(writer) {
+ var pendingTrailingSemicolon = false;
+ function commitPendingTrailingSemicolon() {
+ if (pendingTrailingSemicolon) {
+ writer.writeTrailingSemicolon(";");
+ pendingTrailingSemicolon = false;
+ }
+ }
+ return __assign({}, writer, { writeTrailingSemicolon: function () {
+ pendingTrailingSemicolon = true;
+ },
+ writeLiteral: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeLiteral(s);
+ },
+ writeStringLiteral: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeStringLiteral(s);
+ },
+ writeSymbol: function (s, sym) {
+ commitPendingTrailingSemicolon();
+ writer.writeSymbol(s, sym);
+ },
+ writePunctuation: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writePunctuation(s);
+ },
+ writeKeyword: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeKeyword(s);
+ },
+ writeOperator: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeOperator(s);
+ },
+ writeParameter: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeParameter(s);
+ },
+ writeSpace: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeSpace(s);
+ },
+ writeProperty: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeProperty(s);
+ },
+ writeComment: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeComment(s);
+ },
+ writeLine: function () {
+ commitPendingTrailingSemicolon();
+ writer.writeLine();
+ },
+ increaseIndent: function () {
+ commitPendingTrailingSemicolon();
+ writer.increaseIndent();
+ },
+ decreaseIndent: function () {
+ commitPendingTrailingSemicolon();
+ writer.decreaseIndent();
+ } });
+ }
+ ts.getTrailingSemicolonOmittingWriter = getTrailingSemicolonOmittingWriter;
function getResolvedExternalModuleName(host, file, referenceFile) {
return file.moduleName || getExternalModuleNameFromPath(host, file.fileName, referenceFile && referenceFile.fileName);
}
@@ -8625,11 +8819,11 @@ var ts;
}
ts.parameterIsThisKeyword = parameterIsThisKeyword;
function isThisIdentifier(node) {
- return !!node && node.kind === 71 && identifierIsThisKeyword(node);
+ return !!node && node.kind === 72 && identifierIsThisKeyword(node);
}
ts.isThisIdentifier = isThisIdentifier;
function identifierIsThisKeyword(id) {
- return id.originalKeywordKind === 99;
+ return id.originalKeywordKind === 100;
}
ts.identifierIsThisKeyword = identifierIsThisKeyword;
function getAllAccessorDeclarations(declarations, accessor) {
@@ -8639,10 +8833,10 @@ var ts;
var setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 156) {
+ if (accessor.kind === 158) {
getAccessor = accessor;
}
- else if (accessor.kind === 157) {
+ else if (accessor.kind === 159) {
setAccessor = accessor;
}
else {
@@ -8662,10 +8856,10 @@ var ts;
else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 156 && !getAccessor) {
+ if (member.kind === 158 && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 157 && !setAccessor) {
+ if (member.kind === 159 && !setAccessor) {
setAccessor = member;
}
}
@@ -8702,7 +8896,7 @@ var ts;
}
ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
function isNonTypeAliasTemplate(tag) {
- return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 289 && tag.parent.tags.some(isJSDocTypeAlias));
+ return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 291 && tag.parent.tags.some(isJSDocTypeAlias));
}
function getEffectiveSetAccessorTypeAnnotationNode(node) {
var parameter = getSetAccessorValueParameter(node);
@@ -8730,13 +8924,13 @@ var ts;
function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) {
if (comments && comments.length > 0) {
if (leadingSeparator) {
- writer.write(" ");
+ writer.writeSpace(" ");
}
var emitInterveningSeparator = false;
for (var _i = 0, comments_1 = comments; _i < comments_1.length; _i++) {
var comment = comments_1[_i];
if (emitInterveningSeparator) {
- writer.write(" ");
+ writer.writeSpace(" ");
emitInterveningSeparator = false;
}
writeComment(text, lineMap, writer, comment.pos, comment.end, newLine);
@@ -8748,7 +8942,7 @@ var ts;
}
}
if (emitInterveningSeparator && trailingSeparator) {
- writer.write(" ");
+ writer.writeSpace(" ");
}
}
}
@@ -8828,7 +9022,7 @@ var ts;
}
}
else {
- writer.write(text.substring(commentPos, commentEnd));
+ writer.writeComment(text.substring(commentPos, commentEnd));
}
}
ts.writeCommentRange = writeCommentRange;
@@ -8836,13 +9030,13 @@ var ts;
var end = Math.min(commentEnd, nextLineStart - 1);
var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, "");
if (currentLineText) {
- writer.write(currentLineText);
+ writer.writeComment(currentLineText);
if (end !== commentEnd) {
writer.writeLine();
}
}
else {
- writer.writeLiteral(newLine);
+ writer.rawWrite(newLine);
}
}
function calculateIndent(text, pos, end) {
@@ -8894,7 +9088,7 @@ var ts;
flags |= modifierToFlag(modifier.kind);
}
}
- if (node.flags & 4 || (node.kind === 71 && node.isInJSDocNamespace)) {
+ if (node.flags & 4 || (node.kind === 72 && node.isInJSDocNamespace)) {
flags |= 1;
}
return flags;
@@ -8902,29 +9096,29 @@ var ts;
ts.getModifierFlagsNoCache = getModifierFlagsNoCache;
function modifierToFlag(token) {
switch (token) {
- case 115: return 32;
- case 114: return 4;
- case 113: return 16;
- case 112: return 8;
- case 117: return 128;
- case 84: return 1;
- case 124: return 2;
- case 76: return 2048;
- case 79: return 512;
- case 120: return 256;
- case 132: return 64;
+ case 116: return 32;
+ case 115: return 4;
+ case 114: return 16;
+ case 113: return 8;
+ case 118: return 128;
+ case 85: return 1;
+ case 125: return 2;
+ case 77: return 2048;
+ case 80: return 512;
+ case 121: return 256;
+ case 133: return 64;
}
return 0;
}
ts.modifierToFlag = modifierToFlag;
function isLogicalOperator(token) {
- return token === 54
- || token === 53
- || token === 51;
+ return token === 55
+ || token === 54
+ || token === 52;
}
ts.isLogicalOperator = isLogicalOperator;
function isAssignmentOperator(token) {
- return token >= 58 && token <= 70;
+ return token >= 59 && token <= 71;
}
ts.isAssignmentOperator = isAssignmentOperator;
function tryGetClassExtendingExpressionWithTypeArguments(node) {
@@ -8936,14 +9130,14 @@ var ts;
return ts.isExpressionWithTypeArguments(node)
&& ts.isHeritageClause(node.parent)
&& ts.isClassLike(node.parent.parent)
- ? { class: node.parent.parent, isImplements: node.parent.token === 108 }
+ ? { class: node.parent.parent, isImplements: node.parent.token === 109 }
: undefined;
}
ts.tryGetClassImplementingOrExtendingExpressionWithTypeArguments = tryGetClassImplementingOrExtendingExpressionWithTypeArguments;
function isAssignmentExpression(node, excludeCompoundAssignment) {
return ts.isBinaryExpression(node)
&& (excludeCompoundAssignment
- ? node.operatorToken.kind === 58
+ ? node.operatorToken.kind === 59
: isAssignmentOperator(node.operatorToken.kind))
&& ts.isLeftHandSideExpression(node.left);
}
@@ -8951,8 +9145,8 @@ var ts;
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, true)) {
var kind = node.left.kind;
- return kind === 186
- || kind === 185;
+ return kind === 188
+ || kind === 187;
}
return false;
}
@@ -8962,7 +9156,7 @@ var ts;
}
ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
function isEntityNameExpression(node) {
- return node.kind === 71 || isPropertyAccessEntityNameExpression(node);
+ return node.kind === 72 || isPropertyAccessEntityNameExpression(node);
}
ts.isEntityNameExpression = isEntityNameExpression;
function isPropertyAccessEntityNameExpression(node) {
@@ -8974,17 +9168,17 @@ var ts;
}
ts.isPrototypeAccess = isPrototypeAccess;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return (node.parent.kind === 146 && node.parent.right === node) ||
- (node.parent.kind === 187 && node.parent.name === node);
+ return (node.parent.kind === 148 && node.parent.right === node) ||
+ (node.parent.kind === 189 && node.parent.name === node);
}
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
function isEmptyObjectLiteral(expression) {
- return expression.kind === 186 &&
+ return expression.kind === 188 &&
expression.properties.length === 0;
}
ts.isEmptyObjectLiteral = isEmptyObjectLiteral;
function isEmptyArrayLiteral(expression) {
- return expression.kind === 185 &&
+ return expression.kind === 187 &&
expression.elements.length === 0;
}
ts.isEmptyArrayLiteral = isEmptyArrayLiteral;
@@ -9286,8 +9480,8 @@ var ts;
var parseNode = ts.getParseTreeNode(node);
if (parseNode) {
switch (parseNode.parent.kind) {
- case 241:
- case 242:
+ case 243:
+ case 244:
return parseNode === parseNode.parent.name;
}
}
@@ -9353,32 +9547,32 @@ var ts;
if (!parent)
return 0;
switch (parent.kind) {
- case 193:
+ case 195:
return accessKind(parent);
- case 201:
- case 200:
- var operator = parent.operator;
- return operator === 43 || operator === 44 ? writeOrReadWrite() : 0;
+ case 203:
case 202:
+ var operator = parent.operator;
+ return operator === 44 || operator === 45 ? writeOrReadWrite() : 0;
+ case 204:
var _a = parent, left = _a.left, operatorToken = _a.operatorToken;
return left === node && isAssignmentOperator(operatorToken.kind) ?
- operatorToken.kind === 58 ? 1 : writeOrReadWrite()
+ operatorToken.kind === 59 ? 1 : writeOrReadWrite()
: 0;
- case 187:
+ case 189:
return parent.name !== node ? 0 : accessKind(parent);
- case 273: {
+ case 275: {
var parentAccess = accessKind(parent.parent);
return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess;
}
- case 274:
+ case 276:
return node === parent.objectAssignmentInitializer ? 0 : accessKind(parent.parent);
- case 185:
+ case 187:
return accessKind(parent);
default:
return 0;
}
function writeOrReadWrite() {
- return parent.parent && skipParenthesesUp(parent.parent).kind === 219 ? 1 : 2;
+ return parent.parent && skipParenthesesUp(parent.parent).kind === 221 ? 1 : 2;
}
}
function reverseAccessKind(a) {
@@ -9467,7 +9661,7 @@ var ts;
}
ts.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol;
function getObjectFlags(type) {
- return type.flags & 131072 ? type.objectFlags : 0;
+ return type.flags & 524288 ? type.objectFlags : 0;
}
ts.getObjectFlags = getObjectFlags;
function typeHasCallOrConstructSignatures(type, checker) {
@@ -9646,9 +9840,9 @@ var ts;
}
ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function getTypeParameterOwner(d) {
- if (d && d.kind === 148) {
+ if (d && d.kind === 150) {
for (var current = d; current; current = current.parent) {
- if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 239) {
+ if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 241) {
return current;
}
}
@@ -9656,7 +9850,7 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
function isParameterPropertyDeclaration(node) {
- return ts.hasModifier(node, 92) && node.parent.kind === 155;
+ return ts.hasModifier(node, 92) && node.parent.kind === 157;
}
ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
function isEmptyBindingPattern(node) {
@@ -9686,14 +9880,14 @@ var ts;
node = walkUpBindingElementsAndPatterns(node);
}
var flags = getFlags(node);
- if (node.kind === 235) {
+ if (node.kind === 237) {
node = node.parent;
}
- if (node && node.kind === 236) {
+ if (node && node.kind === 238) {
flags |= getFlags(node);
node = node.parent;
}
- if (node && node.kind === 217) {
+ if (node && node.kind === 219) {
flags |= getFlags(node);
}
return flags;
@@ -9804,27 +9998,27 @@ var ts;
return getDeclarationIdentifier(hostNode);
}
switch (hostNode.kind) {
- case 217:
+ case 219:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
break;
- case 219:
+ case 221:
var expr = hostNode.expression;
switch (expr.kind) {
- case 187:
+ case 189:
return expr.name;
- case 188:
+ case 190:
var arg = expr.argumentExpression;
if (ts.isIdentifier(arg)) {
return arg;
}
}
break;
- case 193: {
+ case 195: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 231: {
+ case 233: {
if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -9846,17 +10040,18 @@ var ts;
ts.isNamedDeclaration = isNamedDeclaration;
function getNonAssignedNameOfDeclaration(declaration) {
switch (declaration.kind) {
- case 71:
+ case 72:
return declaration;
- case 303:
- case 297: {
+ case 305:
+ case 299: {
var name = declaration.name;
- if (name.kind === 146) {
+ if (name.kind === 148) {
return name.right;
}
break;
}
- case 202: {
+ case 191:
+ case 204: {
var expr = declaration;
switch (ts.getAssignmentDeclarationKind(expr)) {
case 1:
@@ -9864,13 +10059,17 @@ var ts;
case 5:
case 3:
return expr.left.name;
+ case 7:
+ case 8:
+ case 9:
+ return expr.arguments[1];
default:
return undefined;
}
}
- case 302:
+ case 304:
return getNameOfJSDocTypedef(declaration);
- case 252: {
+ case 254: {
var expression = declaration.expression;
return ts.isIdentifier(expression) ? expression : undefined;
}
@@ -10010,7 +10209,7 @@ var ts;
return ts.emptyArray;
}
if (ts.isJSDocTypeAlias(node)) {
- ts.Debug.assert(node.parent.kind === 289);
+ ts.Debug.assert(node.parent.kind === 291);
return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
}
if (node.typeParameters) {
@@ -10042,673 +10241,677 @@ var ts;
return node.kind === 8;
}
ts.isNumericLiteral = isNumericLiteral;
- function isStringLiteral(node) {
+ function isBigIntLiteral(node) {
return node.kind === 9;
}
+ ts.isBigIntLiteral = isBigIntLiteral;
+ function isStringLiteral(node) {
+ return node.kind === 10;
+ }
ts.isStringLiteral = isStringLiteral;
function isJsxText(node) {
- return node.kind === 10;
+ return node.kind === 11;
}
ts.isJsxText = isJsxText;
function isRegularExpressionLiteral(node) {
- return node.kind === 12;
+ return node.kind === 13;
}
ts.isRegularExpressionLiteral = isRegularExpressionLiteral;
function isNoSubstitutionTemplateLiteral(node) {
- return node.kind === 13;
+ return node.kind === 14;
}
ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral;
function isTemplateHead(node) {
- return node.kind === 14;
+ return node.kind === 15;
}
ts.isTemplateHead = isTemplateHead;
function isTemplateMiddle(node) {
- return node.kind === 15;
+ return node.kind === 16;
}
ts.isTemplateMiddle = isTemplateMiddle;
function isTemplateTail(node) {
- return node.kind === 16;
+ return node.kind === 17;
}
ts.isTemplateTail = isTemplateTail;
function isIdentifier(node) {
- return node.kind === 71;
+ return node.kind === 72;
}
ts.isIdentifier = isIdentifier;
function isQualifiedName(node) {
- return node.kind === 146;
+ return node.kind === 148;
}
ts.isQualifiedName = isQualifiedName;
function isComputedPropertyName(node) {
- return node.kind === 147;
+ return node.kind === 149;
}
ts.isComputedPropertyName = isComputedPropertyName;
function isTypeParameterDeclaration(node) {
- return node.kind === 148;
+ return node.kind === 150;
}
ts.isTypeParameterDeclaration = isTypeParameterDeclaration;
function isParameter(node) {
- return node.kind === 149;
+ return node.kind === 151;
}
ts.isParameter = isParameter;
function isDecorator(node) {
- return node.kind === 150;
+ return node.kind === 152;
}
ts.isDecorator = isDecorator;
function isPropertySignature(node) {
- return node.kind === 151;
+ return node.kind === 153;
}
ts.isPropertySignature = isPropertySignature;
function isPropertyDeclaration(node) {
- return node.kind === 152;
+ return node.kind === 154;
}
ts.isPropertyDeclaration = isPropertyDeclaration;
function isMethodSignature(node) {
- return node.kind === 153;
+ return node.kind === 155;
}
ts.isMethodSignature = isMethodSignature;
function isMethodDeclaration(node) {
- return node.kind === 154;
+ return node.kind === 156;
}
ts.isMethodDeclaration = isMethodDeclaration;
function isConstructorDeclaration(node) {
- return node.kind === 155;
+ return node.kind === 157;
}
ts.isConstructorDeclaration = isConstructorDeclaration;
function isGetAccessorDeclaration(node) {
- return node.kind === 156;
+ return node.kind === 158;
}
ts.isGetAccessorDeclaration = isGetAccessorDeclaration;
function isSetAccessorDeclaration(node) {
- return node.kind === 157;
+ return node.kind === 159;
}
ts.isSetAccessorDeclaration = isSetAccessorDeclaration;
function isCallSignatureDeclaration(node) {
- return node.kind === 158;
+ return node.kind === 160;
}
ts.isCallSignatureDeclaration = isCallSignatureDeclaration;
function isConstructSignatureDeclaration(node) {
- return node.kind === 159;
+ return node.kind === 161;
}
ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration;
function isIndexSignatureDeclaration(node) {
- return node.kind === 160;
+ return node.kind === 162;
}
ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration;
function isGetOrSetAccessorDeclaration(node) {
- return node.kind === 157 || node.kind === 156;
+ return node.kind === 159 || node.kind === 158;
}
ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration;
function isTypePredicateNode(node) {
- return node.kind === 161;
+ return node.kind === 163;
}
ts.isTypePredicateNode = isTypePredicateNode;
function isTypeReferenceNode(node) {
- return node.kind === 162;
+ return node.kind === 164;
}
ts.isTypeReferenceNode = isTypeReferenceNode;
function isFunctionTypeNode(node) {
- return node.kind === 163;
+ return node.kind === 165;
}
ts.isFunctionTypeNode = isFunctionTypeNode;
function isConstructorTypeNode(node) {
- return node.kind === 164;
+ return node.kind === 166;
}
ts.isConstructorTypeNode = isConstructorTypeNode;
function isTypeQueryNode(node) {
- return node.kind === 165;
+ return node.kind === 167;
}
ts.isTypeQueryNode = isTypeQueryNode;
function isTypeLiteralNode(node) {
- return node.kind === 166;
+ return node.kind === 168;
}
ts.isTypeLiteralNode = isTypeLiteralNode;
function isArrayTypeNode(node) {
- return node.kind === 167;
+ return node.kind === 169;
}
ts.isArrayTypeNode = isArrayTypeNode;
function isTupleTypeNode(node) {
- return node.kind === 168;
+ return node.kind === 170;
}
ts.isTupleTypeNode = isTupleTypeNode;
function isUnionTypeNode(node) {
- return node.kind === 171;
+ return node.kind === 173;
}
ts.isUnionTypeNode = isUnionTypeNode;
function isIntersectionTypeNode(node) {
- return node.kind === 172;
+ return node.kind === 174;
}
ts.isIntersectionTypeNode = isIntersectionTypeNode;
function isConditionalTypeNode(node) {
- return node.kind === 173;
+ return node.kind === 175;
}
ts.isConditionalTypeNode = isConditionalTypeNode;
function isInferTypeNode(node) {
- return node.kind === 174;
+ return node.kind === 176;
}
ts.isInferTypeNode = isInferTypeNode;
function isParenthesizedTypeNode(node) {
- return node.kind === 175;
+ return node.kind === 177;
}
ts.isParenthesizedTypeNode = isParenthesizedTypeNode;
function isThisTypeNode(node) {
- return node.kind === 176;
+ return node.kind === 178;
}
ts.isThisTypeNode = isThisTypeNode;
function isTypeOperatorNode(node) {
- return node.kind === 177;
+ return node.kind === 179;
}
ts.isTypeOperatorNode = isTypeOperatorNode;
function isIndexedAccessTypeNode(node) {
- return node.kind === 178;
+ return node.kind === 180;
}
ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode;
function isMappedTypeNode(node) {
- return node.kind === 179;
+ return node.kind === 181;
}
ts.isMappedTypeNode = isMappedTypeNode;
function isLiteralTypeNode(node) {
- return node.kind === 180;
+ return node.kind === 182;
}
ts.isLiteralTypeNode = isLiteralTypeNode;
function isImportTypeNode(node) {
- return node.kind === 181;
+ return node.kind === 183;
}
ts.isImportTypeNode = isImportTypeNode;
function isObjectBindingPattern(node) {
- return node.kind === 182;
+ return node.kind === 184;
}
ts.isObjectBindingPattern = isObjectBindingPattern;
function isArrayBindingPattern(node) {
- return node.kind === 183;
+ return node.kind === 185;
}
ts.isArrayBindingPattern = isArrayBindingPattern;
function isBindingElement(node) {
- return node.kind === 184;
+ return node.kind === 186;
}
ts.isBindingElement = isBindingElement;
function isArrayLiteralExpression(node) {
- return node.kind === 185;
+ return node.kind === 187;
}
ts.isArrayLiteralExpression = isArrayLiteralExpression;
function isObjectLiteralExpression(node) {
- return node.kind === 186;
+ return node.kind === 188;
}
ts.isObjectLiteralExpression = isObjectLiteralExpression;
function isPropertyAccessExpression(node) {
- return node.kind === 187;
+ return node.kind === 189;
}
ts.isPropertyAccessExpression = isPropertyAccessExpression;
function isElementAccessExpression(node) {
- return node.kind === 188;
+ return node.kind === 190;
}
ts.isElementAccessExpression = isElementAccessExpression;
function isCallExpression(node) {
- return node.kind === 189;
+ return node.kind === 191;
}
ts.isCallExpression = isCallExpression;
function isNewExpression(node) {
- return node.kind === 190;
+ return node.kind === 192;
}
ts.isNewExpression = isNewExpression;
function isTaggedTemplateExpression(node) {
- return node.kind === 191;
+ return node.kind === 193;
}
ts.isTaggedTemplateExpression = isTaggedTemplateExpression;
function isTypeAssertion(node) {
- return node.kind === 192;
+ return node.kind === 194;
}
ts.isTypeAssertion = isTypeAssertion;
function isParenthesizedExpression(node) {
- return node.kind === 193;
+ return node.kind === 195;
}
ts.isParenthesizedExpression = isParenthesizedExpression;
function skipPartiallyEmittedExpressions(node) {
- while (node.kind === 306) {
+ while (node.kind === 308) {
node = node.expression;
}
return node;
}
ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions;
function isFunctionExpression(node) {
- return node.kind === 194;
+ return node.kind === 196;
}
ts.isFunctionExpression = isFunctionExpression;
function isArrowFunction(node) {
- return node.kind === 195;
+ return node.kind === 197;
}
ts.isArrowFunction = isArrowFunction;
function isDeleteExpression(node) {
- return node.kind === 196;
+ return node.kind === 198;
}
ts.isDeleteExpression = isDeleteExpression;
function isTypeOfExpression(node) {
- return node.kind === 197;
+ return node.kind === 199;
}
ts.isTypeOfExpression = isTypeOfExpression;
function isVoidExpression(node) {
- return node.kind === 198;
+ return node.kind === 200;
}
ts.isVoidExpression = isVoidExpression;
function isAwaitExpression(node) {
- return node.kind === 199;
+ return node.kind === 201;
}
ts.isAwaitExpression = isAwaitExpression;
function isPrefixUnaryExpression(node) {
- return node.kind === 200;
+ return node.kind === 202;
}
ts.isPrefixUnaryExpression = isPrefixUnaryExpression;
function isPostfixUnaryExpression(node) {
- return node.kind === 201;
+ return node.kind === 203;
}
ts.isPostfixUnaryExpression = isPostfixUnaryExpression;
function isBinaryExpression(node) {
- return node.kind === 202;
+ return node.kind === 204;
}
ts.isBinaryExpression = isBinaryExpression;
function isConditionalExpression(node) {
- return node.kind === 203;
+ return node.kind === 205;
}
ts.isConditionalExpression = isConditionalExpression;
function isTemplateExpression(node) {
- return node.kind === 204;
+ return node.kind === 206;
}
ts.isTemplateExpression = isTemplateExpression;
function isYieldExpression(node) {
- return node.kind === 205;
+ return node.kind === 207;
}
ts.isYieldExpression = isYieldExpression;
function isSpreadElement(node) {
- return node.kind === 206;
+ return node.kind === 208;
}
ts.isSpreadElement = isSpreadElement;
function isClassExpression(node) {
- return node.kind === 207;
+ return node.kind === 209;
}
ts.isClassExpression = isClassExpression;
function isOmittedExpression(node) {
- return node.kind === 208;
+ return node.kind === 210;
}
ts.isOmittedExpression = isOmittedExpression;
function isExpressionWithTypeArguments(node) {
- return node.kind === 209;
+ return node.kind === 211;
}
ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
function isAsExpression(node) {
- return node.kind === 210;
+ return node.kind === 212;
}
ts.isAsExpression = isAsExpression;
function isNonNullExpression(node) {
- return node.kind === 211;
+ return node.kind === 213;
}
ts.isNonNullExpression = isNonNullExpression;
function isMetaProperty(node) {
- return node.kind === 212;
+ return node.kind === 214;
}
ts.isMetaProperty = isMetaProperty;
function isTemplateSpan(node) {
- return node.kind === 214;
+ return node.kind === 216;
}
ts.isTemplateSpan = isTemplateSpan;
function isSemicolonClassElement(node) {
- return node.kind === 215;
+ return node.kind === 217;
}
ts.isSemicolonClassElement = isSemicolonClassElement;
function isBlock(node) {
- return node.kind === 216;
+ return node.kind === 218;
}
ts.isBlock = isBlock;
function isVariableStatement(node) {
- return node.kind === 217;
+ return node.kind === 219;
}
ts.isVariableStatement = isVariableStatement;
function isEmptyStatement(node) {
- return node.kind === 218;
+ return node.kind === 220;
}
ts.isEmptyStatement = isEmptyStatement;
function isExpressionStatement(node) {
- return node.kind === 219;
+ return node.kind === 221;
}
ts.isExpressionStatement = isExpressionStatement;
function isIfStatement(node) {
- return node.kind === 220;
+ return node.kind === 222;
}
ts.isIfStatement = isIfStatement;
function isDoStatement(node) {
- return node.kind === 221;
+ return node.kind === 223;
}
ts.isDoStatement = isDoStatement;
function isWhileStatement(node) {
- return node.kind === 222;
+ return node.kind === 224;
}
ts.isWhileStatement = isWhileStatement;
function isForStatement(node) {
- return node.kind === 223;
+ return node.kind === 225;
}
ts.isForStatement = isForStatement;
function isForInStatement(node) {
- return node.kind === 224;
+ return node.kind === 226;
}
ts.isForInStatement = isForInStatement;
function isForOfStatement(node) {
- return node.kind === 225;
+ return node.kind === 227;
}
ts.isForOfStatement = isForOfStatement;
function isContinueStatement(node) {
- return node.kind === 226;
+ return node.kind === 228;
}
ts.isContinueStatement = isContinueStatement;
function isBreakStatement(node) {
- return node.kind === 227;
+ return node.kind === 229;
}
ts.isBreakStatement = isBreakStatement;
function isBreakOrContinueStatement(node) {
- return node.kind === 227 || node.kind === 226;
+ return node.kind === 229 || node.kind === 228;
}
ts.isBreakOrContinueStatement = isBreakOrContinueStatement;
function isReturnStatement(node) {
- return node.kind === 228;
+ return node.kind === 230;
}
ts.isReturnStatement = isReturnStatement;
function isWithStatement(node) {
- return node.kind === 229;
+ return node.kind === 231;
}
ts.isWithStatement = isWithStatement;
function isSwitchStatement(node) {
- return node.kind === 230;
+ return node.kind === 232;
}
ts.isSwitchStatement = isSwitchStatement;
function isLabeledStatement(node) {
- return node.kind === 231;
+ return node.kind === 233;
}
ts.isLabeledStatement = isLabeledStatement;
function isThrowStatement(node) {
- return node.kind === 232;
+ return node.kind === 234;
}
ts.isThrowStatement = isThrowStatement;
function isTryStatement(node) {
- return node.kind === 233;
+ return node.kind === 235;
}
ts.isTryStatement = isTryStatement;
function isDebuggerStatement(node) {
- return node.kind === 234;
+ return node.kind === 236;
}
ts.isDebuggerStatement = isDebuggerStatement;
function isVariableDeclaration(node) {
- return node.kind === 235;
+ return node.kind === 237;
}
ts.isVariableDeclaration = isVariableDeclaration;
function isVariableDeclarationList(node) {
- return node.kind === 236;
+ return node.kind === 238;
}
ts.isVariableDeclarationList = isVariableDeclarationList;
function isFunctionDeclaration(node) {
- return node.kind === 237;
+ return node.kind === 239;
}
ts.isFunctionDeclaration = isFunctionDeclaration;
function isClassDeclaration(node) {
- return node.kind === 238;
+ return node.kind === 240;
}
ts.isClassDeclaration = isClassDeclaration;
function isInterfaceDeclaration(node) {
- return node.kind === 239;
+ return node.kind === 241;
}
ts.isInterfaceDeclaration = isInterfaceDeclaration;
function isTypeAliasDeclaration(node) {
- return node.kind === 240;
+ return node.kind === 242;
}
ts.isTypeAliasDeclaration = isTypeAliasDeclaration;
function isEnumDeclaration(node) {
- return node.kind === 241;
+ return node.kind === 243;
}
ts.isEnumDeclaration = isEnumDeclaration;
function isModuleDeclaration(node) {
- return node.kind === 242;
+ return node.kind === 244;
}
ts.isModuleDeclaration = isModuleDeclaration;
function isModuleBlock(node) {
- return node.kind === 243;
+ return node.kind === 245;
}
ts.isModuleBlock = isModuleBlock;
function isCaseBlock(node) {
- return node.kind === 244;
+ return node.kind === 246;
}
ts.isCaseBlock = isCaseBlock;
function isNamespaceExportDeclaration(node) {
- return node.kind === 245;
+ return node.kind === 247;
}
ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration;
function isImportEqualsDeclaration(node) {
- return node.kind === 246;
+ return node.kind === 248;
}
ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
function isImportDeclaration(node) {
- return node.kind === 247;
+ return node.kind === 249;
}
ts.isImportDeclaration = isImportDeclaration;
function isImportClause(node) {
- return node.kind === 248;
+ return node.kind === 250;
}
ts.isImportClause = isImportClause;
function isNamespaceImport(node) {
- return node.kind === 249;
+ return node.kind === 251;
}
ts.isNamespaceImport = isNamespaceImport;
function isNamedImports(node) {
- return node.kind === 250;
+ return node.kind === 252;
}
ts.isNamedImports = isNamedImports;
function isImportSpecifier(node) {
- return node.kind === 251;
+ return node.kind === 253;
}
ts.isImportSpecifier = isImportSpecifier;
function isExportAssignment(node) {
- return node.kind === 252;
+ return node.kind === 254;
}
ts.isExportAssignment = isExportAssignment;
function isExportDeclaration(node) {
- return node.kind === 253;
+ return node.kind === 255;
}
ts.isExportDeclaration = isExportDeclaration;
function isNamedExports(node) {
- return node.kind === 254;
+ return node.kind === 256;
}
ts.isNamedExports = isNamedExports;
function isExportSpecifier(node) {
- return node.kind === 255;
+ return node.kind === 257;
}
ts.isExportSpecifier = isExportSpecifier;
function isMissingDeclaration(node) {
- return node.kind === 256;
+ return node.kind === 258;
}
ts.isMissingDeclaration = isMissingDeclaration;
function isExternalModuleReference(node) {
- return node.kind === 257;
+ return node.kind === 259;
}
ts.isExternalModuleReference = isExternalModuleReference;
function isJsxElement(node) {
- return node.kind === 258;
+ return node.kind === 260;
}
ts.isJsxElement = isJsxElement;
function isJsxSelfClosingElement(node) {
- return node.kind === 259;
+ return node.kind === 261;
}
ts.isJsxSelfClosingElement = isJsxSelfClosingElement;
function isJsxOpeningElement(node) {
- return node.kind === 260;
+ return node.kind === 262;
}
ts.isJsxOpeningElement = isJsxOpeningElement;
function isJsxClosingElement(node) {
- return node.kind === 261;
+ return node.kind === 263;
}
ts.isJsxClosingElement = isJsxClosingElement;
function isJsxFragment(node) {
- return node.kind === 262;
+ return node.kind === 264;
}
ts.isJsxFragment = isJsxFragment;
function isJsxOpeningFragment(node) {
- return node.kind === 263;
+ return node.kind === 265;
}
ts.isJsxOpeningFragment = isJsxOpeningFragment;
function isJsxClosingFragment(node) {
- return node.kind === 264;
+ return node.kind === 266;
}
ts.isJsxClosingFragment = isJsxClosingFragment;
function isJsxAttribute(node) {
- return node.kind === 265;
+ return node.kind === 267;
}
ts.isJsxAttribute = isJsxAttribute;
function isJsxAttributes(node) {
- return node.kind === 266;
+ return node.kind === 268;
}
ts.isJsxAttributes = isJsxAttributes;
function isJsxSpreadAttribute(node) {
- return node.kind === 267;
+ return node.kind === 269;
}
ts.isJsxSpreadAttribute = isJsxSpreadAttribute;
function isJsxExpression(node) {
- return node.kind === 268;
+ return node.kind === 270;
}
ts.isJsxExpression = isJsxExpression;
function isCaseClause(node) {
- return node.kind === 269;
+ return node.kind === 271;
}
ts.isCaseClause = isCaseClause;
function isDefaultClause(node) {
- return node.kind === 270;
+ return node.kind === 272;
}
ts.isDefaultClause = isDefaultClause;
function isHeritageClause(node) {
- return node.kind === 271;
+ return node.kind === 273;
}
ts.isHeritageClause = isHeritageClause;
function isCatchClause(node) {
- return node.kind === 272;
+ return node.kind === 274;
}
ts.isCatchClause = isCatchClause;
function isPropertyAssignment(node) {
- return node.kind === 273;
+ return node.kind === 275;
}
ts.isPropertyAssignment = isPropertyAssignment;
function isShorthandPropertyAssignment(node) {
- return node.kind === 274;
+ return node.kind === 276;
}
ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment;
function isSpreadAssignment(node) {
- return node.kind === 275;
+ return node.kind === 277;
}
ts.isSpreadAssignment = isSpreadAssignment;
function isEnumMember(node) {
- return node.kind === 276;
+ return node.kind === 278;
}
ts.isEnumMember = isEnumMember;
function isSourceFile(node) {
- return node.kind === 277;
+ return node.kind === 279;
}
ts.isSourceFile = isSourceFile;
function isBundle(node) {
- return node.kind === 278;
+ return node.kind === 280;
}
ts.isBundle = isBundle;
function isUnparsedSource(node) {
- return node.kind === 279;
+ return node.kind === 281;
}
ts.isUnparsedSource = isUnparsedSource;
function isJSDocTypeExpression(node) {
- return node.kind === 281;
+ return node.kind === 283;
}
ts.isJSDocTypeExpression = isJSDocTypeExpression;
function isJSDocAllType(node) {
- return node.kind === 282;
+ return node.kind === 284;
}
ts.isJSDocAllType = isJSDocAllType;
function isJSDocUnknownType(node) {
- return node.kind === 283;
+ return node.kind === 285;
}
ts.isJSDocUnknownType = isJSDocUnknownType;
function isJSDocNullableType(node) {
- return node.kind === 284;
+ return node.kind === 286;
}
ts.isJSDocNullableType = isJSDocNullableType;
function isJSDocNonNullableType(node) {
- return node.kind === 285;
+ return node.kind === 287;
}
ts.isJSDocNonNullableType = isJSDocNonNullableType;
function isJSDocOptionalType(node) {
- return node.kind === 286;
+ return node.kind === 288;
}
ts.isJSDocOptionalType = isJSDocOptionalType;
function isJSDocFunctionType(node) {
- return node.kind === 287;
+ return node.kind === 289;
}
ts.isJSDocFunctionType = isJSDocFunctionType;
function isJSDocVariadicType(node) {
- return node.kind === 288;
+ return node.kind === 290;
}
ts.isJSDocVariadicType = isJSDocVariadicType;
function isJSDoc(node) {
- return node.kind === 289;
+ return node.kind === 291;
}
ts.isJSDoc = isJSDoc;
function isJSDocAugmentsTag(node) {
- return node.kind === 293;
+ return node.kind === 295;
}
ts.isJSDocAugmentsTag = isJSDocAugmentsTag;
function isJSDocClassTag(node) {
- return node.kind === 294;
+ return node.kind === 296;
}
ts.isJSDocClassTag = isJSDocClassTag;
function isJSDocEnumTag(node) {
- return node.kind === 296;
+ return node.kind === 298;
}
ts.isJSDocEnumTag = isJSDocEnumTag;
function isJSDocThisTag(node) {
- return node.kind === 299;
+ return node.kind === 301;
}
ts.isJSDocThisTag = isJSDocThisTag;
function isJSDocParameterTag(node) {
- return node.kind === 297;
+ return node.kind === 299;
}
ts.isJSDocParameterTag = isJSDocParameterTag;
function isJSDocReturnTag(node) {
- return node.kind === 298;
+ return node.kind === 300;
}
ts.isJSDocReturnTag = isJSDocReturnTag;
function isJSDocTypeTag(node) {
- return node.kind === 300;
+ return node.kind === 302;
}
ts.isJSDocTypeTag = isJSDocTypeTag;
function isJSDocTemplateTag(node) {
- return node.kind === 301;
+ return node.kind === 303;
}
ts.isJSDocTemplateTag = isJSDocTemplateTag;
function isJSDocTypedefTag(node) {
- return node.kind === 302;
+ return node.kind === 304;
}
ts.isJSDocTypedefTag = isJSDocTypedefTag;
function isJSDocPropertyTag(node) {
- return node.kind === 303;
+ return node.kind === 305;
}
ts.isJSDocPropertyTag = isJSDocPropertyTag;
function isJSDocPropertyLikeTag(node) {
- return node.kind === 303 || node.kind === 297;
+ return node.kind === 305 || node.kind === 299;
}
ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag;
function isJSDocTypeLiteral(node) {
- return node.kind === 290;
+ return node.kind === 292;
}
ts.isJSDocTypeLiteral = isJSDocTypeLiteral;
function isJSDocCallbackTag(node) {
- return node.kind === 295;
+ return node.kind === 297;
}
ts.isJSDocCallbackTag = isJSDocCallbackTag;
function isJSDocSignature(node) {
- return node.kind === 291;
+ return node.kind === 293;
}
ts.isJSDocSignature = isJSDocSignature;
})(ts || (ts = {}));
(function (ts) {
function isSyntaxList(n) {
- return n.kind === 304;
+ return n.kind === 306;
}
ts.isSyntaxList = isSyntaxList;
function isNode(node) {
@@ -10716,11 +10919,11 @@ var ts;
}
ts.isNode = isNode;
function isNodeKind(kind) {
- return kind >= 146;
+ return kind >= 148;
}
ts.isNodeKind = isNodeKind;
function isToken(n) {
- return n.kind >= 0 && n.kind <= 145;
+ return n.kind >= 0 && n.kind <= 147;
}
ts.isToken = isToken;
function isNodeArray(array) {
@@ -10728,7 +10931,7 @@ var ts;
}
ts.isNodeArray = isNodeArray;
function isLiteralKind(kind) {
- return 8 <= kind && kind <= 13;
+ return 8 <= kind && kind <= 14;
}
ts.isLiteralKind = isLiteralKind;
function isLiteralExpression(node) {
@@ -10736,7 +10939,7 @@ var ts;
}
ts.isLiteralExpression = isLiteralExpression;
function isTemplateLiteralKind(kind) {
- return 13 <= kind && kind <= 16;
+ return 14 <= kind && kind <= 17;
}
ts.isTemplateLiteralKind = isTemplateLiteralKind;
function isTemplateLiteralToken(node) {
@@ -10745,12 +10948,12 @@ var ts;
ts.isTemplateLiteralToken = isTemplateLiteralToken;
function isTemplateMiddleOrTemplateTail(node) {
var kind = node.kind;
- return kind === 15
- || kind === 16;
+ return kind === 16
+ || kind === 17;
}
ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail;
function isStringTextContainingNode(node) {
- return node.kind === 9 || isTemplateLiteralKind(node.kind);
+ return node.kind === 10 || isTemplateLiteralKind(node.kind);
}
ts.isStringTextContainingNode = isStringTextContainingNode;
function isGeneratedIdentifier(node) {
@@ -10759,17 +10962,17 @@ var ts;
ts.isGeneratedIdentifier = isGeneratedIdentifier;
function isModifierKind(token) {
switch (token) {
- case 117:
- case 120:
- case 76:
- case 124:
- case 79:
- case 84:
- case 114:
- case 112:
- case 113:
- case 132:
+ case 118:
+ case 121:
+ case 77:
+ case 125:
+ case 80:
+ case 85:
case 115:
+ case 113:
+ case 114:
+ case 133:
+ case 116:
return true;
}
return false;
@@ -10780,7 +10983,7 @@ var ts;
}
ts.isParameterPropertyModifier = isParameterPropertyModifier;
function isClassMemberModifier(idToken) {
- return isParameterPropertyModifier(idToken) || idToken === 115;
+ return isParameterPropertyModifier(idToken) || idToken === 116;
}
ts.isClassMemberModifier = isClassMemberModifier;
function isModifier(node) {
@@ -10789,23 +10992,23 @@ var ts;
ts.isModifier = isModifier;
function isEntityName(node) {
var kind = node.kind;
- return kind === 146
- || kind === 71;
+ return kind === 148
+ || kind === 72;
}
ts.isEntityName = isEntityName;
function isPropertyName(node) {
var kind = node.kind;
- return kind === 71
- || kind === 9
+ return kind === 72
+ || kind === 10
|| kind === 8
- || kind === 147;
+ || kind === 149;
}
ts.isPropertyName = isPropertyName;
function isBindingName(node) {
var kind = node.kind;
- return kind === 71
- || kind === 182
- || kind === 183;
+ return kind === 72
+ || kind === 184
+ || kind === 185;
}
ts.isBindingName = isBindingName;
function isFunctionLike(node) {
@@ -10818,13 +11021,13 @@ var ts;
ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration;
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 237:
- case 154:
- case 155:
+ case 239:
case 156:
case 157:
- case 194:
- case 195:
+ case 158:
+ case 159:
+ case 196:
+ case 197:
return true;
default:
return false;
@@ -10832,14 +11035,14 @@ var ts;
}
function isFunctionLikeKind(kind) {
switch (kind) {
- case 153:
- case 158:
- case 291:
- case 159:
+ case 155:
case 160:
- case 163:
- case 287:
- case 164:
+ case 293:
+ case 161:
+ case 162:
+ case 165:
+ case 289:
+ case 166:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -10852,28 +11055,28 @@ var ts;
ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock;
function isClassElement(node) {
var kind = node.kind;
- return kind === 155
- || kind === 152
+ return kind === 157
|| kind === 154
|| kind === 156
- || kind === 157
- || kind === 160
- || kind === 215;
+ || kind === 158
+ || kind === 159
+ || kind === 162
+ || kind === 217;
}
ts.isClassElement = isClassElement;
function isClassLike(node) {
- return node && (node.kind === 238 || node.kind === 207);
+ return node && (node.kind === 240 || node.kind === 209);
}
ts.isClassLike = isClassLike;
function isAccessor(node) {
- return node && (node.kind === 156 || node.kind === 157);
+ return node && (node.kind === 158 || node.kind === 159);
}
ts.isAccessor = isAccessor;
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
return true;
default:
return false;
@@ -10882,11 +11085,11 @@ var ts;
ts.isMethodOrAccessor = isMethodOrAccessor;
function isTypeElement(node) {
var kind = node.kind;
- return kind === 159
- || kind === 158
- || kind === 151
+ return kind === 161
+ || kind === 160
|| kind === 153
- || kind === 160;
+ || kind === 155
+ || kind === 162;
}
ts.isTypeElement = isTypeElement;
function isClassOrTypeElement(node) {
@@ -10895,36 +11098,37 @@ var ts;
ts.isClassOrTypeElement = isClassOrTypeElement;
function isObjectLiteralElementLike(node) {
var kind = node.kind;
- return kind === 273
- || kind === 274
- || kind === 275
- || kind === 154
+ return kind === 275
+ || kind === 276
+ || kind === 277
|| kind === 156
- || kind === 157;
+ || kind === 158
+ || kind === 159;
}
ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
function isTypeNodeKind(kind) {
- return (kind >= 161 && kind <= 181)
- || kind === 119
- || kind === 142
- || kind === 134
+ return (kind >= 163 && kind <= 183)
+ || kind === 120
+ || kind === 143
|| kind === 135
- || kind === 122
- || kind === 137
+ || kind === 146
+ || kind === 136
+ || kind === 123
|| kind === 138
- || kind === 99
- || kind === 105
- || kind === 140
- || kind === 95
- || kind === 131
- || kind === 209
- || kind === 282
- || kind === 283
+ || kind === 139
+ || kind === 100
+ || kind === 106
+ || kind === 141
+ || kind === 96
+ || kind === 132
+ || kind === 211
|| kind === 284
|| kind === 285
|| kind === 286
|| kind === 287
- || kind === 288;
+ || kind === 288
+ || kind === 289
+ || kind === 290;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
@@ -10932,8 +11136,8 @@ var ts;
ts.isTypeNode = isTypeNode;
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 163:
- case 164:
+ case 165:
+ case 166:
return true;
}
return false;
@@ -10942,29 +11146,29 @@ var ts;
function isBindingPattern(node) {
if (node) {
var kind = node.kind;
- return kind === 183
- || kind === 182;
+ return kind === 185
+ || kind === 184;
}
return false;
}
ts.isBindingPattern = isBindingPattern;
function isAssignmentPattern(node) {
var kind = node.kind;
- return kind === 185
- || kind === 186;
+ return kind === 187
+ || kind === 188;
}
ts.isAssignmentPattern = isAssignmentPattern;
function isArrayBindingElement(node) {
var kind = node.kind;
- return kind === 184
- || kind === 208;
+ return kind === 186
+ || kind === 210;
}
ts.isArrayBindingElement = isArrayBindingElement;
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 235:
- case 149:
- case 184:
+ case 237:
+ case 151:
+ case 186:
return true;
}
return false;
@@ -10977,8 +11181,8 @@ var ts;
ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern;
function isObjectBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 182:
- case 186:
+ case 184:
+ case 188:
return true;
}
return false;
@@ -10986,8 +11190,8 @@ var ts;
ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern;
function isArrayBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 183:
case 185:
+ case 187:
return true;
}
return false;
@@ -10995,25 +11199,25 @@ var ts;
ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern;
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
var kind = node.kind;
- return kind === 187
- || kind === 146
- || kind === 181;
+ return kind === 189
+ || kind === 148
+ || kind === 183;
}
ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode;
function isPropertyAccessOrQualifiedName(node) {
var kind = node.kind;
- return kind === 187
- || kind === 146;
+ return kind === 189
+ || kind === 148;
}
ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName;
function isCallLikeExpression(node) {
switch (node.kind) {
- case 260:
- case 259:
- case 189:
- case 190:
+ case 262:
+ case 261:
case 191:
- case 150:
+ case 192:
+ case 193:
+ case 152:
return true;
default:
return false;
@@ -11021,13 +11225,13 @@ var ts;
}
ts.isCallLikeExpression = isCallLikeExpression;
function isCallOrNewExpression(node) {
- return node.kind === 189 || node.kind === 190;
+ return node.kind === 191 || node.kind === 192;
}
ts.isCallOrNewExpression = isCallOrNewExpression;
function isTemplateLiteral(node) {
var kind = node.kind;
- return kind === 204
- || kind === 13;
+ return kind === 206
+ || kind === 14;
}
ts.isTemplateLiteral = isTemplateLiteral;
function isLeftHandSideExpression(node) {
@@ -11036,33 +11240,34 @@ var ts;
ts.isLeftHandSideExpression = isLeftHandSideExpression;
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 187:
- case 188:
- case 190:
case 189:
- case 258:
- case 259:
- case 262:
+ case 190:
+ case 192:
case 191:
- case 185:
+ case 260:
+ case 261:
+ case 264:
case 193:
- case 186:
- case 207:
- case 194:
- case 71:
- case 12:
+ case 187:
+ case 195:
+ case 188:
+ case 209:
+ case 196:
+ case 72:
+ case 13:
case 8:
case 9:
- case 13:
- case 204:
- case 86:
- case 95:
- case 99:
- case 101:
- case 97:
- case 211:
- case 212:
- case 91:
+ case 10:
+ case 14:
+ case 206:
+ case 87:
+ case 96:
+ case 100:
+ case 102:
+ case 98:
+ case 213:
+ case 214:
+ case 92:
return true;
default:
return false;
@@ -11074,13 +11279,13 @@ var ts;
ts.isUnaryExpression = isUnaryExpression;
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 200:
- case 201:
- case 196:
- case 197:
+ case 202:
+ case 203:
case 198:
case 199:
- case 192:
+ case 200:
+ case 201:
+ case 194:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -11088,11 +11293,11 @@ var ts;
}
function isUnaryExpressionWithWrite(expr) {
switch (expr.kind) {
- case 201:
+ case 203:
return true;
- case 200:
- return expr.operator === 43 ||
- expr.operator === 44;
+ case 202:
+ return expr.operator === 44 ||
+ expr.operator === 45;
default:
return false;
}
@@ -11104,15 +11309,15 @@ var ts;
ts.isExpression = isExpression;
function isExpressionKind(kind) {
switch (kind) {
- case 203:
case 205:
- case 195:
- case 202:
- case 206:
- case 210:
+ case 207:
+ case 197:
+ case 204:
case 208:
- case 307:
- case 306:
+ case 212:
+ case 210:
+ case 309:
+ case 308:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -11120,16 +11325,16 @@ var ts;
}
function isAssertionExpression(node) {
var kind = node.kind;
- return kind === 192
- || kind === 210;
+ return kind === 194
+ || kind === 212;
}
ts.isAssertionExpression = isAssertionExpression;
function isPartiallyEmittedExpression(node) {
- return node.kind === 306;
+ return node.kind === 308;
}
ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression;
function isNotEmittedStatement(node) {
- return node.kind === 305;
+ return node.kind === 307;
}
ts.isNotEmittedStatement = isNotEmittedStatement;
function isNotEmittedOrPartiallyEmittedNode(node) {
@@ -11139,20 +11344,20 @@ var ts;
ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
+ case 225:
+ case 226:
+ case 227:
case 223:
case 224:
- case 225:
- case 221:
- case 222:
return true;
- case 231:
+ case 233:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
}
ts.isIterationStatement = isIterationStatement;
function isForInOrOfStatement(node) {
- return node.kind === 224 || node.kind === 225;
+ return node.kind === 226 || node.kind === 227;
}
ts.isForInOrOfStatement = isForInOrOfStatement;
function isConciseBody(node) {
@@ -11171,108 +11376,108 @@ var ts;
ts.isForInitializer = isForInitializer;
function isModuleBody(node) {
var kind = node.kind;
- return kind === 243
- || kind === 242
- || kind === 71;
+ return kind === 245
+ || kind === 244
+ || kind === 72;
}
ts.isModuleBody = isModuleBody;
function isNamespaceBody(node) {
var kind = node.kind;
- return kind === 243
- || kind === 242;
+ return kind === 245
+ || kind === 244;
}
ts.isNamespaceBody = isNamespaceBody;
function isJSDocNamespaceBody(node) {
var kind = node.kind;
- return kind === 71
- || kind === 242;
+ return kind === 72
+ || kind === 244;
}
ts.isJSDocNamespaceBody = isJSDocNamespaceBody;
function isNamedImportBindings(node) {
var kind = node.kind;
- return kind === 250
- || kind === 249;
+ return kind === 252
+ || kind === 251;
}
ts.isNamedImportBindings = isNamedImportBindings;
function isModuleOrEnumDeclaration(node) {
- return node.kind === 242 || node.kind === 241;
+ return node.kind === 244 || node.kind === 243;
}
ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
function isDeclarationKind(kind) {
- return kind === 195
- || kind === 184
- || kind === 238
- || kind === 207
- || kind === 155
- || kind === 241
- || kind === 276
- || kind === 255
- || kind === 237
- || kind === 194
- || kind === 156
- || kind === 248
- || kind === 246
- || kind === 251
+ return kind === 197
+ || kind === 186
+ || kind === 240
+ || kind === 209
+ || kind === 157
+ || kind === 243
+ || kind === 278
+ || kind === 257
|| kind === 239
- || kind === 265
+ || kind === 196
+ || kind === 158
+ || kind === 250
+ || kind === 248
+ || kind === 253
+ || kind === 241
+ || kind === 267
+ || kind === 156
+ || kind === 155
+ || kind === 244
+ || kind === 247
+ || kind === 251
+ || kind === 151
+ || kind === 275
|| kind === 154
|| kind === 153
+ || kind === 159
+ || kind === 276
|| kind === 242
- || kind === 245
- || kind === 249
- || kind === 149
- || kind === 273
- || kind === 152
- || kind === 151
- || kind === 157
- || kind === 274
- || kind === 240
- || kind === 148
- || kind === 235
- || kind === 302
- || kind === 295
- || kind === 303;
+ || kind === 150
+ || kind === 237
+ || kind === 304
+ || kind === 297
+ || kind === 305;
}
function isDeclarationStatementKind(kind) {
- return kind === 237
- || kind === 256
- || kind === 238
- || kind === 239
+ return kind === 239
+ || kind === 258
|| kind === 240
|| kind === 241
|| kind === 242
- || kind === 247
- || kind === 246
- || kind === 253
- || kind === 252
- || kind === 245;
+ || kind === 243
+ || kind === 244
+ || kind === 249
+ || kind === 248
+ || kind === 255
+ || kind === 254
+ || kind === 247;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 227
- || kind === 226
- || kind === 234
- || kind === 221
- || kind === 219
- || kind === 218
- || kind === 224
- || kind === 225
- || kind === 223
- || kind === 220
- || kind === 231
+ return kind === 229
|| kind === 228
+ || kind === 236
+ || kind === 223
+ || kind === 221
+ || kind === 220
+ || kind === 226
+ || kind === 227
+ || kind === 225
+ || kind === 222
+ || kind === 233
|| kind === 230
|| kind === 232
- || kind === 233
- || kind === 217
- || kind === 222
- || kind === 229
- || kind === 305
- || kind === 309
- || kind === 308;
+ || kind === 234
+ || kind === 235
+ || kind === 219
+ || kind === 224
+ || kind === 231
+ || kind === 307
+ || kind === 311
+ || kind === 310;
}
function isDeclaration(node) {
- if (node.kind === 148) {
- return node.parent.kind !== 301 || ts.isInJSFile(node);
+ if (node.kind === 150) {
+ return node.parent.kind !== 303 || ts.isInJSFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -11293,10 +11498,10 @@ var ts;
}
ts.isStatement = isStatement;
function isBlockStatement(node) {
- if (node.kind !== 216)
+ if (node.kind !== 218)
return false;
if (node.parent !== undefined) {
- if (node.parent.kind === 233 || node.parent.kind === 272) {
+ if (node.parent.kind === 235 || node.parent.kind === 274) {
return false;
}
}
@@ -11304,69 +11509,69 @@ var ts;
}
function isModuleReference(node) {
var kind = node.kind;
- return kind === 257
- || kind === 146
- || kind === 71;
+ return kind === 259
+ || kind === 148
+ || kind === 72;
}
ts.isModuleReference = isModuleReference;
function isJsxTagNameExpression(node) {
var kind = node.kind;
- return kind === 99
- || kind === 71
- || kind === 187;
+ return kind === 100
+ || kind === 72
+ || kind === 189;
}
ts.isJsxTagNameExpression = isJsxTagNameExpression;
function isJsxChild(node) {
var kind = node.kind;
- return kind === 258
- || kind === 268
- || kind === 259
- || kind === 10
- || kind === 262;
+ return kind === 260
+ || kind === 270
+ || kind === 261
+ || kind === 11
+ || kind === 264;
}
ts.isJsxChild = isJsxChild;
function isJsxAttributeLike(node) {
var kind = node.kind;
- return kind === 265
- || kind === 267;
+ return kind === 267
+ || kind === 269;
}
ts.isJsxAttributeLike = isJsxAttributeLike;
function isStringLiteralOrJsxExpression(node) {
var kind = node.kind;
- return kind === 9
- || kind === 268;
+ return kind === 10
+ || kind === 270;
}
ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression;
function isJsxOpeningLikeElement(node) {
var kind = node.kind;
- return kind === 260
- || kind === 259;
+ return kind === 262
+ || kind === 261;
}
ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement;
function isCaseOrDefaultClause(node) {
var kind = node.kind;
- return kind === 269
- || kind === 270;
+ return kind === 271
+ || kind === 272;
}
ts.isCaseOrDefaultClause = isCaseOrDefaultClause;
function isJSDocNode(node) {
- return node.kind >= 281 && node.kind <= 303;
+ return node.kind >= 283 && node.kind <= 305;
}
ts.isJSDocNode = isJSDocNode;
function isJSDocCommentContainingNode(node) {
- return node.kind === 289 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
+ return node.kind === 291 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
}
ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode;
function isJSDocTag(node) {
- return node.kind >= 292 && node.kind <= 303;
+ return node.kind >= 294 && node.kind <= 305;
}
ts.isJSDocTag = isJSDocTag;
function isSetAccessor(node) {
- return node.kind === 157;
+ return node.kind === 159;
}
ts.isSetAccessor = isSetAccessor;
function isGetAccessor(node) {
- return node.kind === 156;
+ return node.kind === 158;
}
ts.isGetAccessor = isGetAccessor;
function hasJSDocNodes(node) {
@@ -11387,11 +11592,11 @@ var ts;
}
ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer;
function isObjectLiteralElement(node) {
- return node.kind === 265 || node.kind === 267 || isObjectLiteralElementLike(node);
+ return node.kind === 267 || node.kind === 269 || isObjectLiteralElementLike(node);
}
ts.isObjectLiteralElement = isObjectLiteralElement;
function isTypeReferenceType(node) {
- return node.kind === 162 || node.kind === 209;
+ return node.kind === 164 || node.kind === 211;
}
ts.isTypeReferenceType = isTypeReferenceType;
var MAX_SMI_X86 = 1073741823;
@@ -11419,13 +11624,13 @@ var ts;
}
ts.guessIndentation = guessIndentation;
function isStringLiteralLike(node) {
- return node.kind === 9 || node.kind === 13;
+ return node.kind === 10 || node.kind === 14;
}
ts.isStringLiteralLike = isStringLiteralLike;
})(ts || (ts = {}));
(function (ts) {
function isNamedImportsOrExports(node) {
- return node.kind === 250 || node.kind === 254;
+ return node.kind === 252 || node.kind === 256;
}
ts.isNamedImportsOrExports = isNamedImportsOrExports;
function Symbol(flags, name) {
@@ -11472,7 +11677,7 @@ var ts;
};
function formatStringFromArgs(text, args, baseIndex) {
if (baseIndex === void 0) { baseIndex = 0; }
- return text.replace(/{(\d+)}/g, function (_match, index) { return ts.Debug.assertDefined(args[+index + baseIndex]); });
+ return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.assertDefined(args[+index + baseIndex]); });
}
ts.formatStringFromArgs = formatStringFromArgs;
function getLocaleSpecificMessage(message) {
@@ -12629,6 +12834,71 @@ var ts;
}
}
ts.getOrUpdate = getOrUpdate;
+ function parsePseudoBigInt(stringValue) {
+ var log2Base;
+ switch (stringValue.charCodeAt(1)) {
+ case 98:
+ case 66:
+ log2Base = 1;
+ break;
+ case 111:
+ case 79:
+ log2Base = 3;
+ break;
+ case 120:
+ case 88:
+ log2Base = 4;
+ break;
+ default:
+ var nIndex = stringValue.length - 1;
+ var nonZeroStart = 0;
+ while (stringValue.charCodeAt(nonZeroStart) === 48) {
+ nonZeroStart++;
+ }
+ return stringValue.slice(nonZeroStart, nIndex) || "0";
+ }
+ var startIndex = 2, endIndex = stringValue.length - 1;
+ var bitsNeeded = (endIndex - startIndex) * log2Base;
+ var segments = new Uint16Array((bitsNeeded >>> 4) + (bitsNeeded & 15 ? 1 : 0));
+ for (var i = endIndex - 1, bitOffset = 0; i >= startIndex; i--, bitOffset += log2Base) {
+ var segment = bitOffset >>> 4;
+ var digitChar = stringValue.charCodeAt(i);
+ var digit = digitChar <= 57
+ ? digitChar - 48
+ : 10 + digitChar -
+ (digitChar <= 70 ? 65 : 97);
+ var shiftedDigit = digit << (bitOffset & 15);
+ segments[segment] |= shiftedDigit;
+ var residual = shiftedDigit >>> 16;
+ if (residual)
+ segments[segment + 1] |= residual;
+ }
+ var base10Value = "";
+ var firstNonzeroSegment = segments.length - 1;
+ var segmentsRemaining = true;
+ while (segmentsRemaining) {
+ var mod10 = 0;
+ segmentsRemaining = false;
+ for (var segment = firstNonzeroSegment; segment >= 0; segment--) {
+ var newSegment = mod10 << 16 | segments[segment];
+ var segmentValue = (newSegment / 10) | 0;
+ segments[segment] = segmentValue;
+ mod10 = newSegment - segmentValue * 10;
+ if (segmentValue && !segmentsRemaining) {
+ firstNonzeroSegment = segment;
+ segmentsRemaining = true;
+ }
+ }
+ base10Value = mod10 + base10Value;
+ }
+ return base10Value;
+ }
+ ts.parsePseudoBigInt = parsePseudoBigInt;
+ function pseudoBigIntToString(_a) {
+ var negative = _a.negative, base10Value = _a.base10Value;
+ return (negative && base10Value !== "0" ? "-" : "") + base10Value;
+ }
+ ts.pseudoBigIntToString = pseudoBigIntToString;
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -12637,10 +12907,10 @@ var ts;
var IdentifierConstructor;
var SourceFileConstructor;
function createNode(kind, pos, end) {
- if (kind === 277) {
+ if (kind === 279) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
- else if (kind === 71) {
+ else if (kind === 72) {
return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end);
}
else if (!ts.isNodeKind(kind)) {
@@ -12675,19 +12945,19 @@ var ts;
}
ts.isJSDocLikeText = isJSDocLikeText;
function forEachChild(node, cbNode, cbNodes) {
- if (!node || node.kind <= 145) {
+ if (!node || node.kind <= 147) {
return;
}
switch (node.kind) {
- case 146:
+ case 148:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.right);
- case 148:
+ case 150:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.constraint) ||
visitNode(cbNode, node.default) ||
visitNode(cbNode, node.expression);
- case 274:
+ case 276:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -12695,9 +12965,9 @@ var ts;
visitNode(cbNode, node.exclamationToken) ||
visitNode(cbNode, node.equalsToken) ||
visitNode(cbNode, node.objectAssignmentInitializer);
- case 275:
+ case 277:
return visitNode(cbNode, node.expression);
- case 149:
+ case 151:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.dotDotDotToken) ||
@@ -12705,7 +12975,7 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 152:
+ case 154:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -12713,51 +12983,51 @@ var ts;
visitNode(cbNode, node.exclamationToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 151:
+ case 153:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 273:
+ case 275:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.initializer);
- case 235:
+ case 237:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.exclamationToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 184:
+ case 186:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.dotDotDotToken) ||
visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 163:
- case 164:
- case 158:
- case 159:
+ case 165:
+ case 166:
case 160:
+ case 161:
+ case 162:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNodes(cbNode, cbNodes, node.typeParameters) ||
visitNodes(cbNode, cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 154:
- case 153:
- case 155:
case 156:
+ case 155:
case 157:
- case 194:
- case 237:
- case 195:
+ case 158:
+ case 159:
+ case 196:
+ case 239:
+ case 197:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.asteriskToken) ||
@@ -12769,302 +13039,302 @@ var ts;
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.equalsGreaterThanToken) ||
visitNode(cbNode, node.body);
- case 162:
+ case 164:
return visitNode(cbNode, node.typeName) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 161:
+ case 163:
return visitNode(cbNode, node.parameterName) ||
visitNode(cbNode, node.type);
- case 165:
- return visitNode(cbNode, node.exprName);
- case 166:
- return visitNodes(cbNode, cbNodes, node.members);
case 167:
- return visitNode(cbNode, node.elementType);
+ return visitNode(cbNode, node.exprName);
case 168:
+ return visitNodes(cbNode, cbNodes, node.members);
+ case 169:
+ return visitNode(cbNode, node.elementType);
+ case 170:
return visitNodes(cbNode, cbNodes, node.elementTypes);
- case 171:
- case 172:
- return visitNodes(cbNode, cbNodes, node.types);
case 173:
+ case 174:
+ return visitNodes(cbNode, cbNodes, node.types);
+ case 175:
return visitNode(cbNode, node.checkType) ||
visitNode(cbNode, node.extendsType) ||
visitNode(cbNode, node.trueType) ||
visitNode(cbNode, node.falseType);
- case 174:
+ case 176:
return visitNode(cbNode, node.typeParameter);
- case 181:
+ case 183:
return visitNode(cbNode, node.argument) ||
visitNode(cbNode, node.qualifier) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 175:
case 177:
+ case 179:
return visitNode(cbNode, node.type);
- case 178:
+ case 180:
return visitNode(cbNode, node.objectType) ||
visitNode(cbNode, node.indexType);
- case 179:
+ case 181:
return visitNode(cbNode, node.readonlyToken) ||
visitNode(cbNode, node.typeParameter) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type);
- case 180:
- return visitNode(cbNode, node.literal);
case 182:
- case 183:
- return visitNodes(cbNode, cbNodes, node.elements);
+ return visitNode(cbNode, node.literal);
+ case 184:
case 185:
return visitNodes(cbNode, cbNodes, node.elements);
- case 186:
- return visitNodes(cbNode, cbNodes, node.properties);
case 187:
+ return visitNodes(cbNode, cbNodes, node.elements);
+ case 188:
+ return visitNodes(cbNode, cbNodes, node.properties);
+ case 189:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.name);
- case 188:
+ case 190:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.argumentExpression);
- case 189:
- case 190:
+ case 191:
+ case 192:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNodes(cbNode, cbNodes, node.arguments);
- case 191:
+ case 193:
return visitNode(cbNode, node.tag) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNode(cbNode, node.template);
- case 192:
+ case 194:
return visitNode(cbNode, node.type) ||
visitNode(cbNode, node.expression);
- case 193:
- return visitNode(cbNode, node.expression);
- case 196:
- return visitNode(cbNode, node.expression);
- case 197:
+ case 195:
return visitNode(cbNode, node.expression);
case 198:
return visitNode(cbNode, node.expression);
- case 200:
- return visitNode(cbNode, node.operand);
- case 205:
- return visitNode(cbNode, node.asteriskToken) ||
- visitNode(cbNode, node.expression);
case 199:
return visitNode(cbNode, node.expression);
- case 201:
- return visitNode(cbNode, node.operand);
+ case 200:
+ return visitNode(cbNode, node.expression);
case 202:
+ return visitNode(cbNode, node.operand);
+ case 207:
+ return visitNode(cbNode, node.asteriskToken) ||
+ visitNode(cbNode, node.expression);
+ case 201:
+ return visitNode(cbNode, node.expression);
+ case 203:
+ return visitNode(cbNode, node.operand);
+ case 204:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.operatorToken) ||
visitNode(cbNode, node.right);
- case 210:
+ case 212:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.type);
- case 211:
+ case 213:
return visitNode(cbNode, node.expression);
- case 212:
+ case 214:
return visitNode(cbNode, node.name);
- case 203:
+ case 205:
return visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.whenTrue) ||
visitNode(cbNode, node.colonToken) ||
visitNode(cbNode, node.whenFalse);
- case 206:
+ case 208:
return visitNode(cbNode, node.expression);
- case 216:
- case 243:
+ case 218:
+ case 245:
return visitNodes(cbNode, cbNodes, node.statements);
- case 277:
+ case 279:
return visitNodes(cbNode, cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
- case 217:
+ case 219:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.declarationList);
- case 236:
+ case 238:
return visitNodes(cbNode, cbNodes, node.declarations);
- case 219:
+ case 221:
return visitNode(cbNode, node.expression);
- case 220:
+ case 222:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.thenStatement) ||
visitNode(cbNode, node.elseStatement);
- case 221:
+ case 223:
return visitNode(cbNode, node.statement) ||
visitNode(cbNode, node.expression);
- case 222:
+ case 224:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 223:
+ case 225:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.incrementor) ||
visitNode(cbNode, node.statement);
- case 224:
+ case 226:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 225:
+ case 227:
return visitNode(cbNode, node.awaitModifier) ||
visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 226:
- case 227:
- return visitNode(cbNode, node.label);
case 228:
- return visitNode(cbNode, node.expression);
case 229:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.statement);
+ return visitNode(cbNode, node.label);
case 230:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.caseBlock);
- case 244:
- return visitNodes(cbNode, cbNodes, node.clauses);
- case 269:
- return visitNode(cbNode, node.expression) ||
- visitNodes(cbNode, cbNodes, node.statements);
- case 270:
- return visitNodes(cbNode, cbNodes, node.statements);
+ return visitNode(cbNode, node.expression);
case 231:
- return visitNode(cbNode, node.label) ||
+ return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
case 232:
- return visitNode(cbNode, node.expression);
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.caseBlock);
+ case 246:
+ return visitNodes(cbNode, cbNodes, node.clauses);
+ case 271:
+ return visitNode(cbNode, node.expression) ||
+ visitNodes(cbNode, cbNodes, node.statements);
+ case 272:
+ return visitNodes(cbNode, cbNodes, node.statements);
case 233:
+ return visitNode(cbNode, node.label) ||
+ visitNode(cbNode, node.statement);
+ case 234:
+ return visitNode(cbNode, node.expression);
+ case 235:
return visitNode(cbNode, node.tryBlock) ||
visitNode(cbNode, node.catchClause) ||
visitNode(cbNode, node.finallyBlock);
- case 272:
+ case 274:
return visitNode(cbNode, node.variableDeclaration) ||
visitNode(cbNode, node.block);
- case 150:
+ case 152:
return visitNode(cbNode, node.expression);
- case 238:
- case 207:
- return visitNodes(cbNode, cbNodes, node.decorators) ||
- visitNodes(cbNode, cbNodes, node.modifiers) ||
- visitNode(cbNode, node.name) ||
- visitNodes(cbNode, cbNodes, node.typeParameters) ||
- visitNodes(cbNode, cbNodes, node.heritageClauses) ||
- visitNodes(cbNode, cbNodes, node.members);
- case 239:
- return visitNodes(cbNode, cbNodes, node.decorators) ||
- visitNodes(cbNode, cbNodes, node.modifiers) ||
- visitNode(cbNode, node.name) ||
- visitNodes(cbNode, cbNodes, node.typeParameters) ||
- visitNodes(cbNode, cbNodes, node.heritageClauses) ||
- visitNodes(cbNode, cbNodes, node.members);
case 240:
+ case 209:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNode, cbNodes, node.typeParameters) ||
- visitNode(cbNode, node.type);
+ visitNodes(cbNode, cbNodes, node.heritageClauses) ||
+ visitNodes(cbNode, cbNodes, node.members);
case 241:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
+ visitNodes(cbNode, cbNodes, node.typeParameters) ||
+ visitNodes(cbNode, cbNodes, node.heritageClauses) ||
visitNodes(cbNode, cbNodes, node.members);
- case 276:
- return visitNode(cbNode, node.name) ||
- visitNode(cbNode, node.initializer);
case 242:
+ return visitNodes(cbNode, cbNodes, node.decorators) ||
+ visitNodes(cbNode, cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNodes(cbNode, cbNodes, node.typeParameters) ||
+ visitNode(cbNode, node.type);
+ case 243:
+ return visitNodes(cbNode, cbNodes, node.decorators) ||
+ visitNodes(cbNode, cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNodes(cbNode, cbNodes, node.members);
+ case 278:
+ return visitNode(cbNode, node.name) ||
+ visitNode(cbNode, node.initializer);
+ case 244:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.body);
- case 246:
+ case 248:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.moduleReference);
- case 247:
+ case 249:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.importClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 248:
+ case 250:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.namedBindings);
- case 245:
+ case 247:
return visitNode(cbNode, node.name);
- case 249:
+ case 251:
return visitNode(cbNode, node.name);
- case 250:
- case 254:
+ case 252:
+ case 256:
return visitNodes(cbNode, cbNodes, node.elements);
- case 253:
+ case 255:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.exportClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 251:
- case 255:
+ case 253:
+ case 257:
return visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name);
- case 252:
+ case 254:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.expression);
- case 204:
+ case 206:
return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
- case 214:
+ case 216:
return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
- case 147:
+ case 149:
return visitNode(cbNode, node.expression);
- case 271:
+ case 273:
return visitNodes(cbNode, cbNodes, node.types);
- case 209:
+ case 211:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 257:
+ case 259:
return visitNode(cbNode, node.expression);
- case 256:
- return visitNodes(cbNode, cbNodes, node.decorators);
- case 307:
- return visitNodes(cbNode, cbNodes, node.elements);
case 258:
+ return visitNodes(cbNode, cbNodes, node.decorators);
+ case 309:
+ return visitNodes(cbNode, cbNodes, node.elements);
+ case 260:
return visitNode(cbNode, node.openingElement) ||
visitNodes(cbNode, cbNodes, node.children) ||
visitNode(cbNode, node.closingElement);
- case 262:
+ case 264:
return visitNode(cbNode, node.openingFragment) ||
visitNodes(cbNode, cbNodes, node.children) ||
visitNode(cbNode, node.closingFragment);
- case 259:
- case 260:
+ case 261:
+ case 262:
return visitNode(cbNode, node.tagName) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNode(cbNode, node.attributes);
- case 266:
+ case 268:
return visitNodes(cbNode, cbNodes, node.properties);
- case 265:
+ case 267:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 267:
+ case 269:
return visitNode(cbNode, node.expression);
- case 268:
+ case 270:
return visitNode(cbNode, node.dotDotDotToken) ||
visitNode(cbNode, node.expression);
- case 261:
+ case 263:
return visitNode(cbNode, node.tagName);
- case 169:
- case 170:
- case 281:
- case 285:
- case 284:
+ case 171:
+ case 172:
+ case 283:
+ case 287:
case 286:
case 288:
+ case 290:
return visitNode(cbNode, node.type);
- case 287:
+ case 289:
return visitNodes(cbNode, cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 289:
+ case 291:
return visitNodes(cbNode, cbNodes, node.tags);
- case 297:
- case 303:
+ case 299:
+ case 305:
if (node.isNameFirst) {
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.typeExpression);
@@ -13073,17 +13343,17 @@ var ts;
return visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.name);
}
- case 298:
- return visitNode(cbNode, node.typeExpression);
case 300:
return visitNode(cbNode, node.typeExpression);
- case 293:
- return visitNode(cbNode, node.class);
- case 301:
- return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters);
case 302:
+ return visitNode(cbNode, node.typeExpression);
+ case 295:
+ return visitNode(cbNode, node.class);
+ case 303:
+ return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters);
+ case 304:
if (node.typeExpression &&
- node.typeExpression.kind === 281) {
+ node.typeExpression.kind === 283) {
return visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.fullName);
}
@@ -13091,20 +13361,20 @@ var ts;
return visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
}
- case 295:
+ case 297:
return visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
- case 299:
+ case 301:
return visitNode(cbNode, node.typeExpression);
- case 296:
+ case 298:
return visitNode(cbNode, node.typeExpression);
- case 291:
+ case 293:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
ts.forEach(node.typeParameters, cbNode) ||
ts.forEach(node.parameters, cbNode) ||
visitNode(cbNode, node.type);
- case 290:
+ case 292:
if (node.jsDocPropertyTags) {
for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) {
var tag = _a[_i];
@@ -13112,7 +13382,7 @@ var ts;
}
}
return;
- case 306:
+ case 308:
return visitNode(cbNode, node.expression);
}
}
@@ -13223,18 +13493,18 @@ var ts;
sourceFile.endOfFileToken = parseTokenNode();
}
else {
- var statement = createNode(219);
+ var statement = createNode(221);
switch (token()) {
- case 21:
+ case 22:
statement.expression = parseArrayLiteralExpression();
break;
- case 101:
- case 86:
- case 95:
+ case 102:
+ case 87:
+ case 96:
statement.expression = parseTokenNode();
break;
- case 38:
- if (lookAhead(function () { return nextToken() === 8 && nextToken() !== 56; })) {
+ case 39:
+ if (lookAhead(function () { return nextToken() === 8 && nextToken() !== 57; })) {
statement.expression = parsePrefixUnaryExpression();
}
else {
@@ -13242,8 +13512,8 @@ var ts;
}
break;
case 8:
- case 9:
- if (lookAhead(function () { return nextToken() !== 56; })) {
+ case 10:
+ if (lookAhead(function () { return nextToken() !== 57; })) {
statement.expression = parseLiteralNode();
break;
}
@@ -13363,7 +13633,7 @@ var ts;
}
Parser.fixupParentReferences = fixupParentReferences;
function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) {
- var sourceFile = new SourceFileConstructor(277, 0, sourceText.length);
+ var sourceFile = new SourceFileConstructor(279, 0, sourceText.length);
nodeCount++;
sourceFile.text = sourceText;
sourceFile.bindDiagnostics = [];
@@ -13520,16 +13790,16 @@ var ts;
return speculationHelper(callback, false);
}
function isIdentifier() {
- if (token() === 71) {
+ if (token() === 72) {
return true;
}
- if (token() === 116 && inYieldContext()) {
+ if (token() === 117 && inYieldContext()) {
return false;
}
- if (token() === 121 && inAwaitContext()) {
+ if (token() === 122 && inAwaitContext()) {
return false;
}
- return token() > 107;
+ return token() > 108;
}
function parseExpected(kind, diagnosticMessage, shouldAdvance) {
if (shouldAdvance === void 0) { shouldAdvance = true; }
@@ -13570,27 +13840,27 @@ var ts;
return finishNode(node);
}
function canParseSemicolon() {
- if (token() === 25) {
+ if (token() === 26) {
return true;
}
- return token() === 18 || token() === 1 || scanner.hasPrecedingLineBreak();
+ return token() === 19 || token() === 1 || scanner.hasPrecedingLineBreak();
}
function parseSemicolon() {
if (canParseSemicolon()) {
- if (token() === 25) {
+ if (token() === 26) {
nextToken();
}
return true;
}
else {
- return parseExpected(25);
+ return parseExpected(26);
}
}
function createNode(kind, pos) {
nodeCount++;
var p = pos >= 0 ? pos : scanner.getStartPos();
return ts.isNodeKind(kind) || kind === 0 ? new NodeConstructor(kind, p, p) :
- kind === 71 ? new IdentifierConstructor(kind, p, p) :
+ kind === 72 ? new IdentifierConstructor(kind, p, p) :
new TokenConstructor(kind, p, p);
}
function createNodeWithJSDoc(kind, pos) {
@@ -13626,7 +13896,7 @@ var ts;
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
var result = createNode(kind);
- if (kind === 71) {
+ if (kind === 72) {
result.escapedText = "";
}
else if (ts.isLiteralKind(kind) || ts.isTemplateLiteralKind(kind)) {
@@ -13644,8 +13914,8 @@ var ts;
function createIdentifier(isIdentifier, diagnosticMessage) {
identifierCount++;
if (isIdentifier) {
- var node = createNode(71);
- if (token() !== 71) {
+ var node = createNode(72);
+ if (token() !== 72) {
node.originalKeywordKind = token();
}
node.escapedText = ts.escapeLeadingUnderscores(internIdentifier(scanner.getTokenValue()));
@@ -13653,7 +13923,7 @@ var ts;
return finishNode(node);
}
var reportAtCurrentPosition = token() === 1;
- return createMissingNode(71, reportAtCurrentPosition, diagnosticMessage || ts.Diagnostics.Identifier_expected);
+ return createMissingNode(72, reportAtCurrentPosition, diagnosticMessage || ts.Diagnostics.Identifier_expected);
}
function parseIdentifier(diagnosticMessage) {
return createIdentifier(isIdentifier(), diagnosticMessage);
@@ -13663,16 +13933,16 @@ var ts;
}
function isLiteralPropertyName() {
return ts.tokenIsIdentifierOrKeyword(token()) ||
- token() === 9 ||
+ token() === 10 ||
token() === 8;
}
function parsePropertyNameWorker(allowComputedPropertyNames) {
- if (token() === 9 || token() === 8) {
+ if (token() === 10 || token() === 8) {
var node = parseLiteralNode();
node.text = internIdentifier(node.text);
return node;
}
- if (allowComputedPropertyNames && token() === 21) {
+ if (allowComputedPropertyNames && token() === 22) {
return parseComputedPropertyName();
}
return parseIdentifierName();
@@ -13681,10 +13951,10 @@ var ts;
return parsePropertyNameWorker(true);
}
function parseComputedPropertyName() {
- var node = createNode(147);
- parseExpected(21);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(149);
parseExpected(22);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(23);
return finishNode(node);
}
function parseContextualModifier(t) {
@@ -13699,19 +13969,19 @@ var ts;
}
function nextTokenCanFollowModifier() {
switch (token()) {
- case 76:
- return nextToken() === 83;
- case 84:
+ case 77:
+ return nextToken() === 84;
+ case 85:
nextToken();
- if (token() === 79) {
+ if (token() === 80) {
return lookAhead(nextTokenCanFollowDefaultKeyword);
}
- return token() !== 39 && token() !== 118 && token() !== 17 && canFollowModifier();
- case 79:
+ return token() !== 40 && token() !== 119 && token() !== 18 && canFollowModifier();
+ case 80:
return nextTokenCanFollowDefaultKeyword();
- case 115:
- case 125:
- case 136:
+ case 116:
+ case 126:
+ case 137:
nextToken();
return canFollowModifier();
default:
@@ -13722,18 +13992,18 @@ var ts;
return ts.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 21
- || token() === 17
- || token() === 39
- || token() === 24
+ return token() === 22
+ || token() === 18
+ || token() === 40
+ || token() === 25
|| isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
- return token() === 75 || token() === 89 ||
- token() === 109 ||
- (token() === 117 && lookAhead(nextTokenIsClassKeywordOnSameLine)) ||
- (token() === 120 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
+ return token() === 76 || token() === 90 ||
+ token() === 110 ||
+ (token() === 118 && lookAhead(nextTokenIsClassKeywordOnSameLine)) ||
+ (token() === 121 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
}
function isListElement(parsingContext, inErrorRecovery) {
var node = currentNode(parsingContext);
@@ -13744,21 +14014,21 @@ var ts;
case 0:
case 1:
case 3:
- return !(token() === 25 && inErrorRecovery) && isStartOfStatement();
+ return !(token() === 26 && inErrorRecovery) && isStartOfStatement();
case 2:
- return token() === 73 || token() === 79;
+ return token() === 74 || token() === 80;
case 4:
return lookAhead(isTypeMemberStart);
case 5:
- return lookAhead(isClassMemberStart) || (token() === 25 && !inErrorRecovery);
+ return lookAhead(isClassMemberStart) || (token() === 26 && !inErrorRecovery);
case 6:
- return token() === 21 || isLiteralPropertyName();
+ return token() === 22 || isLiteralPropertyName();
case 12:
switch (token()) {
- case 21:
- case 39:
+ case 22:
+ case 40:
+ case 25:
case 24:
- case 23:
return true;
default:
return isLiteralPropertyName();
@@ -13766,9 +14036,9 @@ var ts;
case 18:
return isLiteralPropertyName();
case 9:
- return token() === 21 || token() === 24 || isLiteralPropertyName();
+ return token() === 22 || token() === 25 || isLiteralPropertyName();
case 7:
- if (token() === 17) {
+ if (token() === 18) {
return lookAhead(isValidHeritageClauseObjectLiteral);
}
if (!inErrorRecovery) {
@@ -13780,38 +14050,40 @@ var ts;
case 8:
return isIdentifierOrPattern();
case 10:
- return token() === 26 || token() === 24 || isIdentifierOrPattern();
+ return token() === 27 || token() === 25 || isIdentifierOrPattern();
case 19:
return isIdentifier();
case 15:
- if (token() === 26) {
- return true;
+ switch (token()) {
+ case 27:
+ case 24:
+ return true;
}
case 11:
- return token() === 24 || isStartOfExpression();
+ return token() === 25 || isStartOfExpression();
case 16:
return isStartOfParameter(false);
case 17:
return isStartOfParameter(true);
case 20:
case 21:
- return token() === 26 || isStartOfType();
+ return token() === 27 || isStartOfType();
case 22:
return isHeritageClause();
case 23:
return ts.tokenIsIdentifierOrKeyword(token());
case 13:
- return ts.tokenIsIdentifierOrKeyword(token()) || token() === 17;
+ return ts.tokenIsIdentifierOrKeyword(token()) || token() === 18;
case 14:
return true;
}
return ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
- ts.Debug.assert(token() === 17);
- if (nextToken() === 18) {
+ ts.Debug.assert(token() === 18);
+ if (nextToken() === 19) {
var next = nextToken();
- return next === 26 || next === 17 || next === 85 || next === 108;
+ return next === 27 || next === 18 || next === 86 || next === 109;
}
return true;
}
@@ -13828,8 +14100,8 @@ var ts;
return ts.tokenIsIdentifierOrKeywordOrGreaterThan(token());
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token() === 108 ||
- token() === 85) {
+ if (token() === 109 ||
+ token() === 86) {
return lookAhead(nextTokenIsStartOfExpression);
}
return false;
@@ -13855,33 +14127,33 @@ var ts;
case 12:
case 9:
case 23:
- return token() === 18;
+ return token() === 19;
case 3:
- return token() === 18 || token() === 73 || token() === 79;
+ return token() === 19 || token() === 74 || token() === 80;
case 7:
- return token() === 17 || token() === 85 || token() === 108;
+ return token() === 18 || token() === 86 || token() === 109;
case 8:
return isVariableDeclaratorListTerminator();
case 19:
- return token() === 29 || token() === 19 || token() === 17 || token() === 85 || token() === 108;
+ return token() === 30 || token() === 20 || token() === 18 || token() === 86 || token() === 109;
case 11:
- return token() === 20 || token() === 25;
+ return token() === 21 || token() === 26;
case 15:
case 21:
case 10:
- return token() === 22;
+ return token() === 23;
case 17:
case 16:
case 18:
- return token() === 20 || token() === 22;
+ return token() === 21 || token() === 23;
case 20:
- return token() !== 26;
+ return token() !== 27;
case 22:
- return token() === 17 || token() === 18;
+ return token() === 18 || token() === 19;
case 13:
- return token() === 29 || token() === 41;
+ return token() === 30 || token() === 42;
case 14:
- return token() === 27 && lookAhead(nextTokenIsSlash);
+ return token() === 28 && lookAhead(nextTokenIsSlash);
default:
return false;
}
@@ -13893,7 +14165,7 @@ var ts;
if (isInOrOfKeyword(token())) {
return true;
}
- if (token() === 36) {
+ if (token() === 37) {
return true;
}
return false;
@@ -14003,17 +14275,17 @@ var ts;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 155:
- case 160:
- case 156:
case 157:
- case 152:
- case 215:
- return true;
+ case 162:
+ case 158:
+ case 159:
case 154:
+ case 217:
+ return true;
+ case 156:
var methodDeclaration = node;
- var nameIsConstructor = methodDeclaration.name.kind === 71 &&
- methodDeclaration.name.originalKeywordKind === 123;
+ var nameIsConstructor = methodDeclaration.name.kind === 72 &&
+ methodDeclaration.name.originalKeywordKind === 124;
return !nameIsConstructor;
}
}
@@ -14022,8 +14294,8 @@ var ts;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 269:
- case 270:
+ case 271:
+ case 272:
return true;
}
}
@@ -14032,65 +14304,65 @@ var ts;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 237:
- case 217:
- case 216:
- case 220:
+ case 239:
case 219:
- case 232:
- case 228:
- case 230:
- case 227:
- case 226:
- case 224:
- case 225:
- case 223:
- case 222:
- case 229:
case 218:
- case 233:
- case 231:
+ case 222:
case 221:
case 234:
- case 247:
- case 246:
- case 253:
- case 252:
- case 242:
- case 238:
- case 239:
- case 241:
+ case 230:
+ case 232:
+ case 229:
+ case 228:
+ case 226:
+ case 227:
+ case 225:
+ case 224:
+ case 231:
+ case 220:
+ case 235:
+ case 233:
+ case 223:
+ case 236:
+ case 249:
+ case 248:
+ case 255:
+ case 254:
+ case 244:
case 240:
+ case 241:
+ case 243:
+ case 242:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 276;
+ return node.kind === 278;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 159:
+ case 161:
+ case 155:
+ case 162:
case 153:
case 160:
- case 151:
- case 158:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 235) {
+ if (node.kind !== 237) {
return false;
}
var variableDeclarator = node;
return variableDeclarator.initializer === undefined;
}
function isReusableParameter(node) {
- if (node.kind !== 149) {
+ if (node.kind !== 151) {
return false;
}
var parameter = node;
@@ -14144,15 +14416,15 @@ var ts;
var startPos = scanner.getStartPos();
list.push(parseListElement(kind, parseElement));
commaStart = scanner.getTokenPos();
- if (parseOptional(26)) {
+ if (parseOptional(27)) {
continue;
}
commaStart = -1;
if (isListTerminator(kind)) {
break;
}
- parseExpected(26);
- if (considerSemicolonAsDelimiter && token() === 25 && !scanner.hasPrecedingLineBreak()) {
+ parseExpected(27);
+ if (considerSemicolonAsDelimiter && token() === 26 && !scanner.hasPrecedingLineBreak()) {
nextToken();
}
if (startPos === scanner.getStartPos()) {
@@ -14193,8 +14465,8 @@ var ts;
function parseEntityName(allowReservedWords, diagnosticMessage) {
var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
var dotPos = scanner.getStartPos();
- while (parseOptional(23)) {
- if (token() === 27) {
+ while (parseOptional(24)) {
+ if (token() === 28) {
entity.jsdocDotPos = dotPos;
break;
}
@@ -14204,7 +14476,7 @@ var ts;
return entity;
}
function createQualifiedName(entity, name) {
- var node = createNode(146, entity.pos);
+ var node = createNode(148, entity.pos);
node.left = entity;
node.right = name;
return finishNode(node);
@@ -14213,33 +14485,33 @@ var ts;
if (scanner.hasPrecedingLineBreak() && ts.tokenIsIdentifierOrKeyword(token())) {
var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
if (matchesPattern) {
- return createMissingNode(71, true, ts.Diagnostics.Identifier_expected);
+ return createMissingNode(72, true, ts.Diagnostics.Identifier_expected);
}
}
return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
}
function parseTemplateExpression() {
- var template = createNode(204);
+ var template = createNode(206);
template.head = parseTemplateHead();
- ts.Debug.assert(template.head.kind === 14, "Template head has wrong token kind");
+ ts.Debug.assert(template.head.kind === 15, "Template head has wrong token kind");
var list = [];
var listPos = getNodePos();
do {
list.push(parseTemplateSpan());
- } while (ts.last(list).literal.kind === 15);
+ } while (ts.last(list).literal.kind === 16);
template.templateSpans = createNodeArray(list, listPos);
return finishNode(template);
}
function parseTemplateSpan() {
- var span = createNode(214);
+ var span = createNode(216);
span.expression = allowInAnd(parseExpression);
var literal;
- if (token() === 18) {
+ if (token() === 19) {
reScanTemplateToken();
literal = parseTemplateMiddleOrTemplateTail();
}
else {
- literal = parseExpectedToken(16, ts.Diagnostics._0_expected, ts.tokenToString(18));
+ literal = parseExpectedToken(17, ts.Diagnostics._0_expected, ts.tokenToString(19));
}
span.literal = literal;
return finishNode(span);
@@ -14249,18 +14521,17 @@ var ts;
}
function parseTemplateHead() {
var fragment = parseLiteralLikeNode(token());
- ts.Debug.assert(fragment.kind === 14, "Template head has wrong token kind");
+ ts.Debug.assert(fragment.kind === 15, "Template head has wrong token kind");
return fragment;
}
function parseTemplateMiddleOrTemplateTail() {
var fragment = parseLiteralLikeNode(token());
- ts.Debug.assert(fragment.kind === 15 || fragment.kind === 16, "Template fragment has wrong token kind");
+ ts.Debug.assert(fragment.kind === 16 || fragment.kind === 17, "Template fragment has wrong token kind");
return fragment;
}
function parseLiteralLikeNode(kind) {
var node = createNode(kind);
- var text = scanner.getTokenValue();
- node.text = text;
+ node.text = scanner.getTokenValue();
if (scanner.hasExtendedUnicodeEscape()) {
node.hasExtendedUnicodeEscape = true;
}
@@ -14275,23 +14546,23 @@ var ts;
return node;
}
function parseTypeReference() {
- var node = createNode(162);
+ var node = createNode(164);
node.typeName = parseEntityName(true, ts.Diagnostics.Type_expected);
- if (!scanner.hasPrecedingLineBreak() && token() === 27) {
- node.typeArguments = parseBracketedList(20, parseType, 27, 29);
+ if (!scanner.hasPrecedingLineBreak() && token() === 28) {
+ node.typeArguments = parseBracketedList(20, parseType, 28, 30);
}
return finishNode(node);
}
function typeHasArrowFunctionBlockingParseError(node) {
switch (node.kind) {
- case 162:
+ case 164:
return ts.nodeIsMissing(node.typeName);
- case 163:
- case 164: {
+ case 165:
+ case 166: {
var _a = node, parameters = _a.parameters, type = _a.type;
return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);
}
- case 175:
+ case 177:
return typeHasArrowFunctionBlockingParseError(node.type);
default:
return false;
@@ -14299,20 +14570,20 @@ var ts;
}
function parseThisTypePredicate(lhs) {
nextToken();
- var node = createNode(161, lhs.pos);
+ var node = createNode(163, lhs.pos);
node.parameterName = lhs;
node.type = parseType();
return finishNode(node);
}
function parseThisTypeNode() {
- var node = createNode(176);
+ var node = createNode(178);
nextToken();
return finishNode(node);
}
function parseJSDocAllType(postFixEquals) {
- var result = createNode(282);
+ var result = createNode(284);
if (postFixEquals) {
- return createPostfixType(286, result);
+ return createPostfixType(288, result);
}
else {
nextToken();
@@ -14320,7 +14591,7 @@ var ts;
return finishNode(result);
}
function parseJSDocNonNullableType() {
- var result = createNode(285);
+ var result = createNode(287);
nextToken();
result.type = parseNonArrayType();
return finishNode(result);
@@ -14328,66 +14599,66 @@ var ts;
function parseJSDocUnknownOrNullableType() {
var pos = scanner.getStartPos();
nextToken();
- if (token() === 26 ||
- token() === 18 ||
- token() === 20 ||
- token() === 29 ||
- token() === 58 ||
- token() === 49) {
- var result = createNode(283, pos);
+ if (token() === 27 ||
+ token() === 19 ||
+ token() === 21 ||
+ token() === 30 ||
+ token() === 59 ||
+ token() === 50) {
+ var result = createNode(285, pos);
return finishNode(result);
}
else {
- var result = createNode(284, pos);
+ var result = createNode(286, pos);
result.type = parseType();
return finishNode(result);
}
}
function parseJSDocFunctionType() {
if (lookAhead(nextTokenIsOpenParen)) {
- var result = createNodeWithJSDoc(287);
+ var result = createNodeWithJSDoc(289);
nextToken();
- fillSignature(56, 4 | 32, result);
+ fillSignature(57, 4 | 32, result);
return finishNode(result);
}
- var node = createNode(162);
+ var node = createNode(164);
node.typeName = parseIdentifierName();
return finishNode(node);
}
function parseJSDocParameter() {
- var parameter = createNode(149);
- if (token() === 99 || token() === 94) {
+ var parameter = createNode(151);
+ if (token() === 100 || token() === 95) {
parameter.name = parseIdentifierName();
- parseExpected(56);
+ parseExpected(57);
}
parameter.type = parseJSDocType();
return finishNode(parameter);
}
function parseJSDocType() {
scanner.setInJSDocType(true);
- var dotdotdot = parseOptionalToken(24);
+ var dotdotdot = parseOptionalToken(25);
var type = parseTypeOrTypePredicate();
scanner.setInJSDocType(false);
if (dotdotdot) {
- var variadic = createNode(288, dotdotdot.pos);
+ var variadic = createNode(290, dotdotdot.pos);
variadic.type = type;
type = finishNode(variadic);
}
- if (token() === 58) {
- return createPostfixType(286, type);
+ if (token() === 59) {
+ return createPostfixType(288, type);
}
return type;
}
function parseTypeQuery() {
- var node = createNode(165);
- parseExpected(103);
+ var node = createNode(167);
+ parseExpected(104);
node.exprName = parseEntityName(true);
return finishNode(node);
}
function parseTypeParameter() {
- var node = createNode(148);
+ var node = createNode(150);
node.name = parseIdentifier();
- if (parseOptional(85)) {
+ if (parseOptional(86)) {
if (isStartOfType() || !isStartOfExpression()) {
node.constraint = parseType();
}
@@ -14395,44 +14666,44 @@ var ts;
node.expression = parseUnaryExpressionOrHigher();
}
}
- if (parseOptional(58)) {
+ if (parseOptional(59)) {
node.default = parseType();
}
return finishNode(node);
}
function parseTypeParameters() {
- if (token() === 27) {
- return parseBracketedList(19, parseTypeParameter, 27, 29);
+ if (token() === 28) {
+ return parseBracketedList(19, parseTypeParameter, 28, 30);
}
}
function parseParameterType() {
- if (parseOptional(56)) {
+ if (parseOptional(57)) {
return parseType();
}
return undefined;
}
function isStartOfParameter(isJSDocParameter) {
- return token() === 24 ||
+ return token() === 25 ||
isIdentifierOrPattern() ||
ts.isModifierKind(token()) ||
- token() === 57 ||
+ token() === 58 ||
isStartOfType(!isJSDocParameter);
}
function parseParameter() {
- var node = createNodeWithJSDoc(149);
- if (token() === 99) {
+ var node = createNodeWithJSDoc(151);
+ if (token() === 100) {
node.name = createIdentifier(true);
node.type = parseParameterType();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
- node.dotDotDotToken = parseOptionalToken(24);
+ node.dotDotDotToken = parseOptionalToken(25);
node.name = parseIdentifierOrPattern();
if (ts.getFullWidth(node.name) === 0 && !ts.hasModifiers(node) && ts.isModifierKind(token())) {
nextToken();
}
- node.questionToken = parseOptionalToken(55);
+ node.questionToken = parseOptionalToken(56);
node.type = parseParameterType();
node.initializer = parseInitializer();
return finishNode(node);
@@ -14450,22 +14721,22 @@ var ts;
return parametersParsedSuccessfully;
}
function shouldParseReturnType(returnToken, isType) {
- if (returnToken === 36) {
+ if (returnToken === 37) {
parseExpected(returnToken);
return true;
}
- else if (parseOptional(56)) {
+ else if (parseOptional(57)) {
return true;
}
- else if (isType && token() === 36) {
- parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(56));
+ else if (isType && token() === 37) {
+ parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(57));
nextToken();
return true;
}
return false;
}
function parseParameterList(signature, flags) {
- if (!parseExpected(19)) {
+ if (!parseExpected(20)) {
signature.parameters = createMissingList();
return false;
}
@@ -14478,29 +14749,29 @@ var ts;
parseDelimitedList(16, parseParameter);
setYieldContext(savedYieldContext);
setAwaitContext(savedAwaitContext);
- return parseExpected(20);
+ return parseExpected(21);
}
function parseTypeMemberSemicolon() {
- if (parseOptional(26)) {
+ if (parseOptional(27)) {
return;
}
parseSemicolon();
}
function parseSignatureMember(kind) {
var node = createNodeWithJSDoc(kind);
- if (kind === 159) {
- parseExpected(94);
+ if (kind === 161) {
+ parseExpected(95);
}
- fillSignature(56, 4, node);
+ fillSignature(57, 4, node);
parseTypeMemberSemicolon();
return finishNode(node);
}
function isIndexSignature() {
- return token() === 21 && lookAhead(isUnambiguouslyIndexSignature);
+ return token() === 22 && lookAhead(isUnambiguouslyIndexSignature);
}
function isUnambiguouslyIndexSignature() {
nextToken();
- if (token() === 24 || token() === 22) {
+ if (token() === 25 || token() === 23) {
return true;
}
if (ts.isModifierKind(token())) {
@@ -14515,33 +14786,33 @@ var ts;
else {
nextToken();
}
- if (token() === 56 || token() === 26) {
+ if (token() === 57 || token() === 27) {
return true;
}
- if (token() !== 55) {
+ if (token() !== 56) {
return false;
}
nextToken();
- return token() === 56 || token() === 26 || token() === 22;
+ return token() === 57 || token() === 27 || token() === 23;
}
function parseIndexSignatureDeclaration(node) {
- node.kind = 160;
- node.parameters = parseBracketedList(16, parseParameter, 21, 22);
+ node.kind = 162;
+ node.parameters = parseBracketedList(16, parseParameter, 22, 23);
node.type = parseTypeAnnotation();
parseTypeMemberSemicolon();
return finishNode(node);
}
function parsePropertyOrMethodSignature(node) {
node.name = parsePropertyName();
- node.questionToken = parseOptionalToken(55);
- if (token() === 19 || token() === 27) {
- node.kind = 153;
- fillSignature(56, 4, node);
+ node.questionToken = parseOptionalToken(56);
+ if (token() === 20 || token() === 28) {
+ node.kind = 155;
+ fillSignature(57, 4, node);
}
else {
- node.kind = 151;
+ node.kind = 153;
node.type = parseTypeAnnotation();
- if (token() === 58) {
+ if (token() === 59) {
node.initializer = parseInitializer();
}
}
@@ -14549,7 +14820,7 @@ var ts;
return finishNode(node);
}
function isTypeMemberStart() {
- if (token() === 19 || token() === 27) {
+ if (token() === 20 || token() === 28) {
return true;
}
var idToken = false;
@@ -14557,7 +14828,7 @@ var ts;
idToken = true;
nextToken();
}
- if (token() === 21) {
+ if (token() === 22) {
return true;
}
if (isLiteralPropertyName()) {
@@ -14565,21 +14836,21 @@ var ts;
nextToken();
}
if (idToken) {
- return token() === 19 ||
- token() === 27 ||
- token() === 55 ||
+ return token() === 20 ||
+ token() === 28 ||
token() === 56 ||
- token() === 26 ||
+ token() === 57 ||
+ token() === 27 ||
canParseSemicolon();
}
return false;
}
function parseTypeMember() {
- if (token() === 19 || token() === 27) {
- return parseSignatureMember(158);
+ if (token() === 20 || token() === 28) {
+ return parseSignatureMember(160);
}
- if (token() === 94 && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(159);
+ if (token() === 95 && lookAhead(nextTokenIsOpenParenOrLessThan)) {
+ return parseSignatureMember(161);
}
var node = createNodeWithJSDoc(0);
node.modifiers = parseModifiers();
@@ -14590,30 +14861,30 @@ var ts;
}
function nextTokenIsOpenParenOrLessThan() {
nextToken();
- return token() === 19 || token() === 27;
+ return token() === 20 || token() === 28;
}
function nextTokenIsDot() {
- return nextToken() === 23;
+ return nextToken() === 24;
}
function nextTokenIsOpenParenOrLessThanOrDot() {
switch (nextToken()) {
- case 19:
- case 27:
- case 23:
+ case 20:
+ case 28:
+ case 24:
return true;
}
return false;
}
function parseTypeLiteral() {
- var node = createNode(166);
+ var node = createNode(168);
node.members = parseObjectTypeMembers();
return finishNode(node);
}
function parseObjectTypeMembers() {
var members;
- if (parseExpected(17)) {
+ if (parseExpected(18)) {
members = parseList(4, parseTypeMember);
- parseExpected(18);
+ parseExpected(19);
}
else {
members = createMissingList();
@@ -14622,89 +14893,89 @@ var ts;
}
function isStartOfMappedType() {
nextToken();
- if (token() === 37 || token() === 38) {
- return nextToken() === 132;
+ if (token() === 38 || token() === 39) {
+ return nextToken() === 133;
}
- if (token() === 132) {
+ if (token() === 133) {
nextToken();
}
- return token() === 21 && nextTokenIsIdentifier() && nextToken() === 92;
+ return token() === 22 && nextTokenIsIdentifier() && nextToken() === 93;
}
function parseMappedTypeParameter() {
- var node = createNode(148);
+ var node = createNode(150);
node.name = parseIdentifier();
- parseExpected(92);
+ parseExpected(93);
node.constraint = parseType();
return finishNode(node);
}
function parseMappedType() {
- var node = createNode(179);
- parseExpected(17);
- if (token() === 132 || token() === 37 || token() === 38) {
+ var node = createNode(181);
+ parseExpected(18);
+ if (token() === 133 || token() === 38 || token() === 39) {
node.readonlyToken = parseTokenNode();
- if (node.readonlyToken.kind !== 132) {
- parseExpectedToken(132);
+ if (node.readonlyToken.kind !== 133) {
+ parseExpectedToken(133);
}
}
- parseExpected(21);
- node.typeParameter = parseMappedTypeParameter();
parseExpected(22);
- if (token() === 55 || token() === 37 || token() === 38) {
+ node.typeParameter = parseMappedTypeParameter();
+ parseExpected(23);
+ if (token() === 56 || token() === 38 || token() === 39) {
node.questionToken = parseTokenNode();
- if (node.questionToken.kind !== 55) {
- parseExpectedToken(55);
+ if (node.questionToken.kind !== 56) {
+ parseExpectedToken(56);
}
}
node.type = parseTypeAnnotation();
parseSemicolon();
- parseExpected(18);
+ parseExpected(19);
return finishNode(node);
}
function parseTupleElementType() {
var pos = getNodePos();
- if (parseOptional(24)) {
- var node = createNode(170, pos);
+ if (parseOptional(25)) {
+ var node = createNode(172, pos);
node.type = parseType();
return finishNode(node);
}
var type = parseType();
- if (!(contextFlags & 2097152) && type.kind === 284 && type.pos === type.type.pos) {
- type.kind = 169;
+ if (!(contextFlags & 2097152) && type.kind === 286 && type.pos === type.type.pos) {
+ type.kind = 171;
}
return type;
}
function parseTupleType() {
- var node = createNode(168);
- node.elementTypes = parseBracketedList(21, parseTupleElementType, 21, 22);
+ var node = createNode(170);
+ node.elementTypes = parseBracketedList(21, parseTupleElementType, 22, 23);
return finishNode(node);
}
function parseParenthesizedType() {
- var node = createNode(175);
- parseExpected(19);
- node.type = parseType();
+ var node = createNode(177);
parseExpected(20);
+ node.type = parseType();
+ parseExpected(21);
return finishNode(node);
}
function parseFunctionOrConstructorType() {
var pos = getNodePos();
- var kind = parseOptional(94) ? 164 : 163;
+ var kind = parseOptional(95) ? 166 : 165;
var node = createNodeWithJSDoc(kind, pos);
- fillSignature(36, 4, node);
+ fillSignature(37, 4, node);
return finishNode(node);
}
function parseKeywordAndNoDot() {
var node = parseTokenNode();
- return token() === 23 ? undefined : node;
+ return token() === 24 ? undefined : node;
}
function parseLiteralTypeNode(negative) {
- var node = createNode(180);
+ var node = createNode(182);
var unaryMinusExpression;
if (negative) {
- unaryMinusExpression = createNode(200);
- unaryMinusExpression.operator = 38;
+ unaryMinusExpression = createNode(202);
+ unaryMinusExpression.operator = 39;
nextToken();
}
- var expression = token() === 101 || token() === 86
+ var expression = token() === 102 || token() === 87
? parseTokenNode()
: parseLiteralLikeNode(token());
if (negative) {
@@ -14717,78 +14988,81 @@ var ts;
}
function isStartOfTypeOfImportType() {
nextToken();
- return token() === 91;
+ return token() === 92;
}
function parseImportType() {
sourceFile.flags |= 524288;
- var node = createNode(181);
- if (parseOptional(103)) {
+ var node = createNode(183);
+ if (parseOptional(104)) {
node.isTypeOf = true;
}
- parseExpected(91);
- parseExpected(19);
- node.argument = parseType();
+ parseExpected(92);
parseExpected(20);
- if (parseOptional(23)) {
+ node.argument = parseType();
+ parseExpected(21);
+ if (parseOptional(24)) {
node.qualifier = parseEntityName(true, ts.Diagnostics.Type_expected);
}
node.typeArguments = tryParseTypeArguments();
return finishNode(node);
}
- function nextTokenIsNumericLiteral() {
- return nextToken() === 8;
+ function nextTokenIsNumericOrBigIntLiteral() {
+ nextToken();
+ return token() === 8 || token() === 9;
}
function parseNonArrayType() {
switch (token()) {
- case 119:
- case 142:
- case 137:
- case 134:
+ case 120:
+ case 143:
case 138:
- case 122:
- case 140:
- case 131:
case 135:
+ case 146:
+ case 139:
+ case 123:
+ case 141:
+ case 132:
+ case 136:
return tryParse(parseKeywordAndNoDot) || parseTypeReference();
- case 39:
+ case 40:
return parseJSDocAllType(false);
- case 61:
+ case 62:
return parseJSDocAllType(true);
- case 55:
+ case 56:
return parseJSDocUnknownOrNullableType();
- case 89:
+ case 90:
return parseJSDocFunctionType();
- case 51:
+ case 52:
return parseJSDocNonNullableType();
- case 13:
- case 9:
+ case 14:
+ case 10:
case 8:
- case 101:
- case 86:
+ case 9:
+ case 102:
+ case 87:
return parseLiteralTypeNode();
- case 38:
- return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode(true) : parseTypeReference();
- case 105:
- case 95:
+ case 39:
+ return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode(true) : parseTypeReference();
+ case 106:
+ case 96:
return parseTokenNode();
- case 99: {
+ case 100: {
var thisKeyword = parseThisTypeNode();
- if (token() === 127 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 128 && !scanner.hasPrecedingLineBreak()) {
return parseThisTypePredicate(thisKeyword);
}
else {
return thisKeyword;
}
}
- case 103:
+ case 104:
return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery();
- case 17:
+ case 18:
return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral();
- case 21:
+ case 22:
return parseTupleType();
- case 19:
+ case 20:
return parseParenthesizedType();
- case 91:
+ case 92:
return parseImportType();
default:
return parseTypeReference();
@@ -14796,42 +15070,44 @@ var ts;
}
function isStartOfType(inStartOfParameter) {
switch (token()) {
- case 119:
- case 142:
- case 137:
- case 134:
- case 122:
+ case 120:
+ case 143:
case 138:
- case 141:
- case 105:
- case 140:
- case 95:
- case 99:
- case 103:
- case 131:
- case 17:
- case 21:
- case 27:
- case 49:
- case 48:
- case 94:
- case 9:
- case 8:
- case 101:
- case 86:
case 135:
- case 39:
- case 55:
- case 51:
- case 24:
- case 126:
- case 91:
+ case 146:
+ case 123:
+ case 139:
+ case 142:
+ case 106:
+ case 141:
+ case 96:
+ case 100:
+ case 104:
+ case 132:
+ case 18:
+ case 22:
+ case 28:
+ case 50:
+ case 49:
+ case 95:
+ case 10:
+ case 8:
+ case 9:
+ case 102:
+ case 87:
+ case 136:
+ case 40:
+ case 56:
+ case 52:
+ case 25:
+ case 127:
+ case 92:
return true;
- case 89:
+ case 90:
return !inStartOfParameter;
- case 38:
- return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral);
- case 19:
+ case 39:
+ return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral);
+ case 20:
return !inStartOfParameter && lookAhead(isStartOfParenthesizedOrFunctionType);
default:
return isIdentifier();
@@ -14839,34 +15115,34 @@ var ts;
}
function isStartOfParenthesizedOrFunctionType() {
nextToken();
- return token() === 20 || isStartOfParameter(false) || isStartOfType();
+ return token() === 21 || isStartOfParameter(false) || isStartOfType();
}
function parsePostfixTypeOrHigher() {
var type = parseNonArrayType();
while (!scanner.hasPrecedingLineBreak()) {
switch (token()) {
- case 51:
- type = createPostfixType(285, type);
+ case 52:
+ type = createPostfixType(287, type);
break;
- case 55:
+ case 56:
if (!(contextFlags & 2097152) && lookAhead(nextTokenIsStartOfType)) {
return type;
}
- type = createPostfixType(284, type);
+ type = createPostfixType(286, type);
break;
- case 21:
- parseExpected(21);
+ case 22:
+ parseExpected(22);
if (isStartOfType()) {
- var node = createNode(178, type.pos);
+ var node = createNode(180, type.pos);
node.objectType = type;
node.indexType = parseType();
- parseExpected(22);
+ parseExpected(23);
type = finishNode(node);
}
else {
- var node = createNode(167, type.pos);
+ var node = createNode(169, type.pos);
node.elementType = type;
- parseExpected(22);
+ parseExpected(23);
type = finishNode(node);
}
break;
@@ -14883,16 +15159,16 @@ var ts;
return finishNode(postfix);
}
function parseTypeOperator(operator) {
- var node = createNode(177);
+ var node = createNode(179);
parseExpected(operator);
node.operator = operator;
node.type = parseTypeOperatorOrHigher();
return finishNode(node);
}
function parseInferType() {
- var node = createNode(174);
- parseExpected(126);
- var typeParameter = createNode(148);
+ var node = createNode(176);
+ parseExpected(127);
+ var typeParameter = createNode(150);
typeParameter.name = parseIdentifier();
node.typeParameter = finishNode(typeParameter);
return finishNode(node);
@@ -14900,10 +15176,10 @@ var ts;
function parseTypeOperatorOrHigher() {
var operator = token();
switch (operator) {
- case 128:
- case 141:
+ case 129:
+ case 142:
return parseTypeOperator(operator);
- case 126:
+ case 127:
return parseInferType();
}
return parsePostfixTypeOrHigher();
@@ -14923,26 +15199,26 @@ var ts;
return type;
}
function parseIntersectionTypeOrHigher() {
- return parseUnionOrIntersectionType(172, parseTypeOperatorOrHigher, 48);
+ return parseUnionOrIntersectionType(174, parseTypeOperatorOrHigher, 49);
}
function parseUnionTypeOrHigher() {
- return parseUnionOrIntersectionType(171, parseIntersectionTypeOrHigher, 49);
+ return parseUnionOrIntersectionType(173, parseIntersectionTypeOrHigher, 50);
}
function isStartOfFunctionType() {
- if (token() === 27) {
+ if (token() === 28) {
return true;
}
- return token() === 19 && lookAhead(isUnambiguouslyStartOfFunctionType);
+ return token() === 20 && lookAhead(isUnambiguouslyStartOfFunctionType);
}
function skipParameterStart() {
if (ts.isModifierKind(token())) {
parseModifiers();
}
- if (isIdentifier() || token() === 99) {
+ if (isIdentifier() || token() === 100) {
nextToken();
return true;
}
- if (token() === 21 || token() === 17) {
+ if (token() === 22 || token() === 18) {
var previousErrorCount = parseDiagnostics.length;
parseIdentifierOrPattern();
return previousErrorCount === parseDiagnostics.length;
@@ -14951,17 +15227,17 @@ var ts;
}
function isUnambiguouslyStartOfFunctionType() {
nextToken();
- if (token() === 20 || token() === 24) {
+ if (token() === 21 || token() === 25) {
return true;
}
if (skipParameterStart()) {
- if (token() === 56 || token() === 26 ||
- token() === 55 || token() === 58) {
+ if (token() === 57 || token() === 27 ||
+ token() === 56 || token() === 59) {
return true;
}
- if (token() === 20) {
+ if (token() === 21) {
nextToken();
- if (token() === 36) {
+ if (token() === 37) {
return true;
}
}
@@ -14972,7 +15248,7 @@ var ts;
var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
var type = parseType();
if (typePredicateVariable) {
- var node = createNode(161, typePredicateVariable.pos);
+ var node = createNode(163, typePredicateVariable.pos);
node.parameterName = typePredicateVariable;
node.type = type;
return finishNode(node);
@@ -14983,7 +15259,7 @@ var ts;
}
function parseTypePredicatePrefix() {
var id = parseIdentifier();
- if (token() === 127 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 128 && !scanner.hasPrecedingLineBreak()) {
nextToken();
return id;
}
@@ -14992,47 +15268,48 @@ var ts;
return doOutsideOfContext(20480, parseTypeWorker);
}
function parseTypeWorker(noConditionalTypes) {
- if (isStartOfFunctionType() || token() === 94) {
+ if (isStartOfFunctionType() || token() === 95) {
return parseFunctionOrConstructorType();
}
var type = parseUnionTypeOrHigher();
- if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85)) {
- var node = createNode(173, type.pos);
+ if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(86)) {
+ var node = createNode(175, type.pos);
node.checkType = type;
node.extendsType = parseTypeWorker(true);
- parseExpected(55);
- node.trueType = parseTypeWorker();
parseExpected(56);
+ node.trueType = parseTypeWorker();
+ parseExpected(57);
node.falseType = parseTypeWorker();
return finishNode(node);
}
return type;
}
function parseTypeAnnotation() {
- return parseOptional(56) ? parseType() : undefined;
+ return parseOptional(57) ? parseType() : undefined;
}
function isStartOfLeftHandSideExpression() {
switch (token()) {
- case 99:
- case 97:
- case 95:
- case 101:
- case 86:
+ case 100:
+ case 98:
+ case 96:
+ case 102:
+ case 87:
case 8:
case 9:
- case 13:
+ case 10:
case 14:
- case 19:
- case 21:
- case 17:
- case 89:
- case 75:
- case 94:
- case 41:
- case 63:
- case 71:
+ case 15:
+ case 20:
+ case 22:
+ case 18:
+ case 90:
+ case 76:
+ case 95:
+ case 42:
+ case 64:
+ case 72:
return true;
- case 91:
+ case 92:
return lookAhead(nextTokenIsOpenParenOrLessThanOrDot);
default:
return isIdentifier();
@@ -15043,18 +15320,18 @@ var ts;
return true;
}
switch (token()) {
- case 37:
case 38:
+ case 39:
+ case 53:
case 52:
- case 51:
- case 80:
- case 103:
- case 105:
- case 43:
+ case 81:
+ case 104:
+ case 106:
case 44:
- case 27:
- case 121:
- case 116:
+ case 45:
+ case 28:
+ case 122:
+ case 117:
return true;
default:
if (isBinaryOperator()) {
@@ -15064,10 +15341,10 @@ var ts;
}
}
function isStartOfExpressionStatement() {
- return token() !== 17 &&
- token() !== 89 &&
- token() !== 75 &&
- token() !== 57 &&
+ return token() !== 18 &&
+ token() !== 90 &&
+ token() !== 76 &&
+ token() !== 58 &&
isStartOfExpression();
}
function parseExpression() {
@@ -15077,7 +15354,7 @@ var ts;
}
var expr = parseAssignmentExpressionOrHigher();
var operatorToken;
- while ((operatorToken = parseOptionalToken(26))) {
+ while ((operatorToken = parseOptionalToken(27))) {
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher());
}
if (saveDecoratorContext) {
@@ -15086,7 +15363,7 @@ var ts;
return expr;
}
function parseInitializer() {
- return parseOptional(58) ? parseAssignmentExpressionOrHigher() : undefined;
+ return parseOptional(59) ? parseAssignmentExpressionOrHigher() : undefined;
}
function parseAssignmentExpressionOrHigher() {
if (isYieldExpression()) {
@@ -15097,7 +15374,7 @@ var ts;
return arrowExpression;
}
var expr = parseBinaryExpressionOrHigher(0);
- if (expr.kind === 71 && token() === 36) {
+ if (expr.kind === 72 && token() === 37) {
return parseSimpleArrowFunctionExpression(expr);
}
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
@@ -15106,7 +15383,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token() === 116) {
+ if (token() === 117) {
if (inYieldContext()) {
return true;
}
@@ -15119,11 +15396,11 @@ var ts;
return !scanner.hasPrecedingLineBreak() && isIdentifier();
}
function parseYieldExpression() {
- var node = createNode(205);
+ var node = createNode(207);
nextToken();
if (!scanner.hasPrecedingLineBreak() &&
- (token() === 39 || isStartOfExpression())) {
- node.asteriskToken = parseOptionalToken(39);
+ (token() === 40 || isStartOfExpression())) {
+ node.asteriskToken = parseOptionalToken(40);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -15132,20 +15409,20 @@ var ts;
}
}
function parseSimpleArrowFunctionExpression(identifier, asyncModifier) {
- ts.Debug.assert(token() === 36, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
+ ts.Debug.assert(token() === 37, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
var node;
if (asyncModifier) {
- node = createNode(195, asyncModifier.pos);
+ node = createNode(197, asyncModifier.pos);
node.modifiers = asyncModifier;
}
else {
- node = createNode(195, identifier.pos);
+ node = createNode(197, identifier.pos);
}
- var parameter = createNode(149, identifier.pos);
+ var parameter = createNode(151, identifier.pos);
parameter.name = identifier;
finishNode(parameter);
node.parameters = createNodeArray([parameter], parameter.pos, parameter.end);
- node.equalsGreaterThanToken = parseExpectedToken(36);
+ node.equalsGreaterThanToken = parseExpectedToken(37);
node.body = parseArrowFunctionExpressionBody(!!asyncModifier);
return addJSDocComment(finishNode(node));
}
@@ -15162,92 +15439,92 @@ var ts;
}
var isAsync = ts.hasModifier(arrowFunction, 256);
var lastToken = token();
- arrowFunction.equalsGreaterThanToken = parseExpectedToken(36);
- arrowFunction.body = (lastToken === 36 || lastToken === 17)
+ arrowFunction.equalsGreaterThanToken = parseExpectedToken(37);
+ arrowFunction.body = (lastToken === 37 || lastToken === 18)
? parseArrowFunctionExpressionBody(isAsync)
: parseIdentifier();
return finishNode(arrowFunction);
}
function isParenthesizedArrowFunctionExpression() {
- if (token() === 19 || token() === 27 || token() === 120) {
+ if (token() === 20 || token() === 28 || token() === 121) {
return lookAhead(isParenthesizedArrowFunctionExpressionWorker);
}
- if (token() === 36) {
+ if (token() === 37) {
return 1;
}
return 0;
}
function isParenthesizedArrowFunctionExpressionWorker() {
- if (token() === 120) {
+ if (token() === 121) {
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return 0;
}
- if (token() !== 19 && token() !== 27) {
+ if (token() !== 20 && token() !== 28) {
return 0;
}
}
var first = token();
var second = nextToken();
- if (first === 19) {
- if (second === 20) {
+ if (first === 20) {
+ if (second === 21) {
var third = nextToken();
switch (third) {
- case 36:
- case 56:
- case 17:
+ case 37:
+ case 57:
+ case 18:
return 1;
default:
return 0;
}
}
- if (second === 21 || second === 17) {
+ if (second === 22 || second === 18) {
return 2;
}
- if (second === 24) {
+ if (second === 25) {
return 1;
}
- if (ts.isModifierKind(second) && second !== 120 && lookAhead(nextTokenIsIdentifier)) {
+ if (ts.isModifierKind(second) && second !== 121 && lookAhead(nextTokenIsIdentifier)) {
return 1;
}
- if (!isIdentifier() && second !== 99) {
+ if (!isIdentifier() && second !== 100) {
return 0;
}
switch (nextToken()) {
- case 56:
+ case 57:
return 1;
- case 55:
+ case 56:
nextToken();
- if (token() === 56 || token() === 26 || token() === 58 || token() === 20) {
+ if (token() === 57 || token() === 27 || token() === 59 || token() === 21) {
return 1;
}
return 0;
- case 26:
- case 58:
- case 20:
+ case 27:
+ case 59:
+ case 21:
return 2;
}
return 0;
}
else {
- ts.Debug.assert(first === 27);
+ ts.Debug.assert(first === 28);
if (!isIdentifier()) {
return 0;
}
if (sourceFile.languageVariant === 1) {
var isArrowFunctionInJsx = lookAhead(function () {
var third = nextToken();
- if (third === 85) {
+ if (third === 86) {
var fourth = nextToken();
switch (fourth) {
- case 58:
- case 29:
+ case 59:
+ case 30:
return false;
default:
return true;
}
}
- else if (third === 26) {
+ else if (third === 27) {
return true;
}
return false;
@@ -15264,7 +15541,7 @@ var ts;
return parseParenthesizedArrowFunctionExpressionHead(false);
}
function tryParseAsyncSimpleArrowFunctionExpression() {
- if (token() === 120) {
+ if (token() === 121) {
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1) {
var asyncModifier = parseModifiersForArrowFunction();
var expr = parseBinaryExpressionOrHigher(0);
@@ -15274,37 +15551,37 @@ var ts;
return undefined;
}
function isUnParenthesizedAsyncArrowFunctionWorker() {
- if (token() === 120) {
+ if (token() === 121) {
nextToken();
- if (scanner.hasPrecedingLineBreak() || token() === 36) {
+ if (scanner.hasPrecedingLineBreak() || token() === 37) {
return 0;
}
var expr = parseBinaryExpressionOrHigher(0);
- if (!scanner.hasPrecedingLineBreak() && expr.kind === 71 && token() === 36) {
+ if (!scanner.hasPrecedingLineBreak() && expr.kind === 72 && token() === 37) {
return 1;
}
}
return 0;
}
function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) {
- var node = createNodeWithJSDoc(195);
+ var node = createNodeWithJSDoc(197);
node.modifiers = parseModifiersForArrowFunction();
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
- if (!fillSignature(56, isAsync, node) && !allowAmbiguity) {
+ if (!fillSignature(57, isAsync, node) && !allowAmbiguity) {
return undefined;
}
- if (!allowAmbiguity && token() !== 36 && token() !== 17) {
+ if (!allowAmbiguity && token() !== 37 && token() !== 18) {
return undefined;
}
return node;
}
function parseArrowFunctionExpressionBody(isAsync) {
- if (token() === 17) {
+ if (token() === 18) {
return parseFunctionBlock(isAsync ? 2 : 0);
}
- if (token() !== 25 &&
- token() !== 89 &&
- token() !== 75 &&
+ if (token() !== 26 &&
+ token() !== 90 &&
+ token() !== 76 &&
isStartOfStatement() &&
!isStartOfExpressionStatement()) {
return parseFunctionBlock(16 | (isAsync ? 2 : 0));
@@ -15314,18 +15591,18 @@ var ts;
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
}
function parseConditionalExpressionRest(leftOperand) {
- var questionToken = parseOptionalToken(55);
+ var questionToken = parseOptionalToken(56);
if (!questionToken) {
return leftOperand;
}
- var node = createNode(203, leftOperand.pos);
+ var node = createNode(205, leftOperand.pos);
node.condition = leftOperand;
node.questionToken = questionToken;
node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher);
- node.colonToken = parseExpectedToken(56);
+ node.colonToken = parseExpectedToken(57);
node.whenFalse = ts.nodeIsPresent(node.colonToken)
? parseAssignmentExpressionOrHigher()
- : createMissingNode(71, false, ts.Diagnostics._0_expected, ts.tokenToString(56));
+ : createMissingNode(72, false, ts.Diagnostics._0_expected, ts.tokenToString(57));
return finishNode(node);
}
function parseBinaryExpressionOrHigher(precedence) {
@@ -15333,22 +15610,22 @@ var ts;
return parseBinaryExpressionRest(precedence, leftOperand);
}
function isInOrOfKeyword(t) {
- return t === 92 || t === 145;
+ return t === 93 || t === 147;
}
function parseBinaryExpressionRest(precedence, leftOperand) {
while (true) {
reScanGreaterToken();
var newPrecedence = ts.getBinaryOperatorPrecedence(token());
- var consumeCurrentOperator = token() === 40 ?
+ var consumeCurrentOperator = token() === 41 ?
newPrecedence >= precedence :
newPrecedence > precedence;
if (!consumeCurrentOperator) {
break;
}
- if (token() === 92 && inDisallowInContext()) {
+ if (token() === 93 && inDisallowInContext()) {
break;
}
- if (token() === 118) {
+ if (token() === 119) {
if (scanner.hasPrecedingLineBreak()) {
break;
}
@@ -15364,51 +15641,51 @@ var ts;
return leftOperand;
}
function isBinaryOperator() {
- if (inDisallowInContext() && token() === 92) {
+ if (inDisallowInContext() && token() === 93) {
return false;
}
return ts.getBinaryOperatorPrecedence(token()) > 0;
}
function makeBinaryExpression(left, operatorToken, right) {
- var node = createNode(202, left.pos);
+ var node = createNode(204, left.pos);
node.left = left;
node.operatorToken = operatorToken;
node.right = right;
return finishNode(node);
}
function makeAsExpression(left, right) {
- var node = createNode(210, left.pos);
+ var node = createNode(212, left.pos);
node.expression = left;
node.type = right;
return finishNode(node);
}
function parsePrefixUnaryExpression() {
- var node = createNode(200);
+ var node = createNode(202);
node.operator = token();
nextToken();
node.operand = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseDeleteExpression() {
- var node = createNode(196);
- nextToken();
- node.expression = parseSimpleUnaryExpression();
- return finishNode(node);
- }
- function parseTypeOfExpression() {
- var node = createNode(197);
- nextToken();
- node.expression = parseSimpleUnaryExpression();
- return finishNode(node);
- }
- function parseVoidExpression() {
var node = createNode(198);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
+ function parseTypeOfExpression() {
+ var node = createNode(199);
+ nextToken();
+ node.expression = parseSimpleUnaryExpression();
+ return finishNode(node);
+ }
+ function parseVoidExpression() {
+ var node = createNode(200);
+ nextToken();
+ node.expression = parseSimpleUnaryExpression();
+ return finishNode(node);
+ }
function isAwaitExpression() {
- if (token() === 121) {
+ if (token() === 122) {
if (inAwaitContext()) {
return true;
}
@@ -15417,7 +15694,7 @@ var ts;
return false;
}
function parseAwaitExpression() {
- var node = createNode(199);
+ var node = createNode(201);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
@@ -15425,16 +15702,16 @@ var ts;
function parseUnaryExpressionOrHigher() {
if (isUpdateExpression()) {
var updateExpression = parseUpdateExpression();
- return token() === 40 ?
+ return token() === 41 ?
parseBinaryExpressionRest(ts.getBinaryOperatorPrecedence(token()), updateExpression) :
updateExpression;
}
var unaryOperator = token();
var simpleUnaryExpression = parseSimpleUnaryExpression();
- if (token() === 40) {
+ if (token() === 41) {
var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
var end = simpleUnaryExpression.end;
- if (simpleUnaryExpression.kind === 192) {
+ if (simpleUnaryExpression.kind === 194) {
parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
}
else {
@@ -15445,20 +15722,20 @@ var ts;
}
function parseSimpleUnaryExpression() {
switch (token()) {
- case 37:
case 38:
+ case 39:
+ case 53:
case 52:
- case 51:
return parsePrefixUnaryExpression();
- case 80:
+ case 81:
return parseDeleteExpression();
- case 103:
+ case 104:
return parseTypeOfExpression();
- case 105:
+ case 106:
return parseVoidExpression();
- case 27:
+ case 28:
return parseTypeAssertion();
- case 121:
+ case 122:
if (isAwaitExpression()) {
return parseAwaitExpression();
}
@@ -15468,16 +15745,16 @@ var ts;
}
function isUpdateExpression() {
switch (token()) {
- case 37:
case 38:
+ case 39:
+ case 53:
case 52:
- case 51:
- case 80:
- case 103:
- case 105:
- case 121:
+ case 81:
+ case 104:
+ case 106:
+ case 122:
return false;
- case 27:
+ case 28:
if (sourceFile.languageVariant !== 1) {
return false;
}
@@ -15486,20 +15763,20 @@ var ts;
}
}
function parseUpdateExpression() {
- if (token() === 43 || token() === 44) {
- var node = createNode(200);
+ if (token() === 44 || token() === 45) {
+ var node = createNode(202);
node.operator = token();
nextToken();
node.operand = parseLeftHandSideExpressionOrHigher();
return finishNode(node);
}
- else if (sourceFile.languageVariant === 1 && token() === 27 && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) {
+ else if (sourceFile.languageVariant === 1 && token() === 28 && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) {
return parseJsxElementOrSelfClosingElementOrFragment(true);
}
var expression = parseLeftHandSideExpressionOrHigher();
ts.Debug.assert(ts.isLeftHandSideExpression(expression));
- if ((token() === 43 || token() === 44) && !scanner.hasPrecedingLineBreak()) {
- var node = createNode(201, expression.pos);
+ if ((token() === 44 || token() === 45) && !scanner.hasPrecedingLineBreak()) {
+ var node = createNode(203, expression.pos);
node.operand = expression;
node.operator = token();
nextToken();
@@ -15509,7 +15786,7 @@ var ts;
}
function parseLeftHandSideExpressionOrHigher() {
var expression;
- if (token() === 91) {
+ if (token() === 92) {
if (lookAhead(nextTokenIsOpenParenOrLessThan)) {
sourceFile.flags |= 524288;
expression = parseTokenNode();
@@ -15518,8 +15795,8 @@ var ts;
var fullStart = scanner.getStartPos();
nextToken();
nextToken();
- var node = createNode(212, fullStart);
- node.keywordToken = 91;
+ var node = createNode(214, fullStart);
+ node.keywordToken = 92;
node.name = parseIdentifierName();
expression = finishNode(node);
sourceFile.flags |= 1048576;
@@ -15529,7 +15806,7 @@ var ts;
}
}
else {
- expression = token() === 97 ? parseSuperExpression() : parseMemberExpressionOrHigher();
+ expression = token() === 98 ? parseSuperExpression() : parseMemberExpressionOrHigher();
}
return parseCallExpressionRest(expression);
}
@@ -15539,20 +15816,20 @@ var ts;
}
function parseSuperExpression() {
var expression = parseTokenNode();
- if (token() === 19 || token() === 23 || token() === 21) {
+ if (token() === 20 || token() === 24 || token() === 22) {
return expression;
}
- var node = createNode(187, expression.pos);
+ var node = createNode(189, expression.pos);
node.expression = expression;
- parseExpectedToken(23, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
+ parseExpectedToken(24, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
node.name = parseRightSideOfDot(true);
return finishNode(node);
}
function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) {
var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
var result;
- if (opening.kind === 260) {
- var node = createNode(258, opening.pos);
+ if (opening.kind === 262) {
+ var node = createNode(260, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement);
node.closingElement = parseJsxClosingElement(inExpressionContext);
@@ -15561,26 +15838,26 @@ var ts;
}
result = finishNode(node);
}
- else if (opening.kind === 263) {
- var node = createNode(262, opening.pos);
+ else if (opening.kind === 265) {
+ var node = createNode(264, opening.pos);
node.openingFragment = opening;
node.children = parseJsxChildren(node.openingFragment);
node.closingFragment = parseJsxClosingFragment(inExpressionContext);
result = finishNode(node);
}
else {
- ts.Debug.assert(opening.kind === 259);
+ ts.Debug.assert(opening.kind === 261);
result = opening;
}
- if (inExpressionContext && token() === 27) {
+ if (inExpressionContext && token() === 28) {
var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(true); });
if (invalidElement) {
parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element);
- var badNode = createNode(202, result.pos);
+ var badNode = createNode(204, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
- badNode.operatorToken = createMissingNode(26, false, undefined);
+ badNode.operatorToken = createMissingNode(27, false, undefined);
badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos;
return badNode;
}
@@ -15588,8 +15865,8 @@ var ts;
return result;
}
function parseJsxText() {
- var node = createNode(10);
- node.containsOnlyWhiteSpaces = currentToken === 11;
+ var node = createNode(11);
+ node.containsOnlyWhiteSpaces = currentToken === 12;
currentToken = scanner.scanJsxToken();
return finishNode(node);
}
@@ -15603,15 +15880,15 @@ var ts;
parseErrorAtRange(openingTag.tagName, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTag.tagName));
}
return undefined;
- case 28:
+ case 29:
case 7:
return undefined;
- case 10:
case 11:
+ case 12:
return parseJsxText();
- case 17:
+ case 18:
return parseJsxExpression(false);
- case 27:
+ case 28:
return parseJsxElementOrSelfClosingElementOrFragment(false);
default:
return ts.Debug.assertNever(token);
@@ -15632,15 +15909,15 @@ var ts;
return createNodeArray(list, listPos);
}
function parseJsxAttributes() {
- var jsxAttributes = createNode(266);
+ var jsxAttributes = createNode(268);
jsxAttributes.properties = parseList(13, parseJsxAttribute);
return finishNode(jsxAttributes);
}
function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) {
var fullStart = scanner.getStartPos();
- parseExpected(27);
- if (token() === 29) {
- var node_1 = createNode(263, fullStart);
+ parseExpected(28);
+ if (token() === 30) {
+ var node_1 = createNode(265, fullStart);
scanJsxText();
return finishNode(node_1);
}
@@ -15648,20 +15925,20 @@ var ts;
var typeArguments = tryParseTypeArguments();
var attributes = parseJsxAttributes();
var node;
- if (token() === 29) {
- node = createNode(260, fullStart);
+ if (token() === 30) {
+ node = createNode(262, fullStart);
scanJsxText();
}
else {
- parseExpected(41);
+ parseExpected(42);
if (inExpressionContext) {
- parseExpected(29);
+ parseExpected(30);
}
else {
- parseExpected(29, undefined, false);
+ parseExpected(30, undefined, false);
scanJsxText();
}
- node = createNode(259, fullStart);
+ node = createNode(261, fullStart);
}
node.tagName = tagName;
node.typeArguments = typeArguments;
@@ -15670,10 +15947,10 @@ var ts;
}
function parseJsxElementName() {
scanJsxIdentifier();
- var expression = token() === 99 ?
+ var expression = token() === 100 ?
parseTokenNode() : parseIdentifierName();
- while (parseOptional(23)) {
- var propertyAccess = createNode(187, expression.pos);
+ while (parseOptional(24)) {
+ var propertyAccess = createNode(189, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
@@ -15681,33 +15958,33 @@ var ts;
return expression;
}
function parseJsxExpression(inExpressionContext) {
- var node = createNode(268);
- if (!parseExpected(17)) {
+ var node = createNode(270);
+ if (!parseExpected(18)) {
return undefined;
}
- if (token() !== 18) {
- node.dotDotDotToken = parseOptionalToken(24);
+ if (token() !== 19) {
+ node.dotDotDotToken = parseOptionalToken(25);
node.expression = parseAssignmentExpressionOrHigher();
}
if (inExpressionContext) {
- parseExpected(18);
+ parseExpected(19);
}
else {
- parseExpected(18, undefined, false);
+ parseExpected(19, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseJsxAttribute() {
- if (token() === 17) {
+ if (token() === 18) {
return parseJsxSpreadAttribute();
}
scanJsxIdentifier();
- var node = createNode(265);
+ var node = createNode(267);
node.name = parseIdentifierName();
- if (token() === 58) {
+ if (token() === 59) {
switch (scanJsxAttributeValue()) {
- case 9:
+ case 10:
node.initializer = parseLiteralNode();
break;
default:
@@ -15718,71 +15995,71 @@ var ts;
return finishNode(node);
}
function parseJsxSpreadAttribute() {
- var node = createNode(267);
- parseExpected(17);
- parseExpected(24);
- node.expression = parseExpression();
+ var node = createNode(269);
parseExpected(18);
+ parseExpected(25);
+ node.expression = parseExpression();
+ parseExpected(19);
return finishNode(node);
}
function parseJsxClosingElement(inExpressionContext) {
- var node = createNode(261);
- parseExpected(28);
+ var node = createNode(263);
+ parseExpected(29);
node.tagName = parseJsxElementName();
if (inExpressionContext) {
- parseExpected(29);
+ parseExpected(30);
}
else {
- parseExpected(29, undefined, false);
+ parseExpected(30, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseJsxClosingFragment(inExpressionContext) {
- var node = createNode(264);
- parseExpected(28);
+ var node = createNode(266);
+ parseExpected(29);
if (ts.tokenIsIdentifierOrKeyword(token())) {
parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
}
if (inExpressionContext) {
- parseExpected(29);
+ parseExpected(30);
}
else {
- parseExpected(29, undefined, false);
+ parseExpected(30, undefined, false);
scanJsxText();
}
return finishNode(node);
}
function parseTypeAssertion() {
- var node = createNode(192);
- parseExpected(27);
+ var node = createNode(194);
+ parseExpected(28);
node.type = parseType();
- parseExpected(29);
+ parseExpected(30);
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseMemberExpressionRest(expression) {
while (true) {
- var dotToken = parseOptionalToken(23);
+ var dotToken = parseOptionalToken(24);
if (dotToken) {
- var propertyAccess = createNode(187, expression.pos);
+ var propertyAccess = createNode(189, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
continue;
}
- if (token() === 51 && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 52 && !scanner.hasPrecedingLineBreak()) {
nextToken();
- var nonNullExpression = createNode(211, expression.pos);
+ var nonNullExpression = createNode(213, expression.pos);
nonNullExpression.expression = expression;
expression = finishNode(nonNullExpression);
continue;
}
- if (!inDecoratorContext() && parseOptional(21)) {
- var indexedAccess = createNode(188, expression.pos);
+ if (!inDecoratorContext() && parseOptional(22)) {
+ var indexedAccess = createNode(190, expression.pos);
indexedAccess.expression = expression;
- if (token() === 22) {
- indexedAccess.argumentExpression = createMissingNode(71, true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);
+ if (token() === 23) {
+ indexedAccess.argumentExpression = createMissingNode(72, true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);
}
else {
var argument = allowInAnd(parseExpression);
@@ -15791,7 +16068,7 @@ var ts;
}
indexedAccess.argumentExpression = argument;
}
- parseExpected(22);
+ parseExpected(23);
expression = finishNode(indexedAccess);
continue;
}
@@ -15803,13 +16080,13 @@ var ts;
}
}
function isTemplateStartOfTaggedTemplate() {
- return token() === 13 || token() === 14;
+ return token() === 14 || token() === 15;
}
function parseTaggedTemplateRest(tag, typeArguments) {
- var tagExpression = createNode(191, tag.pos);
+ var tagExpression = createNode(193, tag.pos);
tagExpression.tag = tag;
tagExpression.typeArguments = typeArguments;
- tagExpression.template = token() === 13
+ tagExpression.template = token() === 14
? parseLiteralNode()
: parseTemplateExpression();
return finishNode(tagExpression);
@@ -15817,7 +16094,7 @@ var ts;
function parseCallExpressionRest(expression) {
while (true) {
expression = parseMemberExpressionRest(expression);
- if (token() === 27) {
+ if (token() === 28) {
var typeArguments = tryParse(parseTypeArgumentsInExpression);
if (!typeArguments) {
return expression;
@@ -15826,15 +16103,15 @@ var ts;
expression = parseTaggedTemplateRest(expression, typeArguments);
continue;
}
- var callExpr = createNode(189, expression.pos);
+ var callExpr = createNode(191, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
continue;
}
- else if (token() === 19) {
- var callExpr = createNode(189, expression.pos);
+ else if (token() === 20) {
+ var callExpr = createNode(191, expression.pos);
callExpr.expression = expression;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
@@ -15844,17 +16121,17 @@ var ts;
}
}
function parseArgumentList() {
- parseExpected(19);
- var result = parseDelimitedList(11, parseArgumentExpression);
parseExpected(20);
+ var result = parseDelimitedList(11, parseArgumentExpression);
+ parseExpected(21);
return result;
}
function parseTypeArgumentsInExpression() {
- if (!parseOptional(27)) {
+ if (!parseOptional(28)) {
return undefined;
}
var typeArguments = parseDelimitedList(20, parseType);
- if (!parseExpected(29)) {
+ if (!parseExpected(30)) {
return undefined;
}
return typeArguments && canFollowTypeArgumentsInExpression()
@@ -15863,29 +16140,29 @@ var ts;
}
function canFollowTypeArgumentsInExpression() {
switch (token()) {
- case 19:
- case 13:
- case 14:
- case 23:
case 20:
- case 22:
+ case 14:
+ case 15:
+ case 24:
+ case 21:
+ case 23:
+ case 57:
+ case 26:
case 56:
- case 25:
- case 55:
- case 32:
- case 34:
case 33:
case 35:
- case 53:
+ case 34:
+ case 36:
case 54:
- case 50:
- case 48:
+ case 55:
+ case 51:
case 49:
- case 18:
+ case 50:
+ case 19:
case 1:
return true;
- case 26:
- case 17:
+ case 27:
+ case 18:
default:
return false;
}
@@ -15894,120 +16171,121 @@ var ts;
switch (token()) {
case 8:
case 9:
- case 13:
+ case 10:
+ case 14:
return parseLiteralNode();
- case 99:
- case 97:
- case 95:
- case 101:
- case 86:
+ case 100:
+ case 98:
+ case 96:
+ case 102:
+ case 87:
return parseTokenNode();
- case 19:
+ case 20:
return parseParenthesizedExpression();
- case 21:
+ case 22:
return parseArrayLiteralExpression();
- case 17:
+ case 18:
return parseObjectLiteralExpression();
- case 120:
+ case 121:
if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) {
break;
}
return parseFunctionExpression();
- case 75:
+ case 76:
return parseClassExpression();
- case 89:
+ case 90:
return parseFunctionExpression();
- case 94:
+ case 95:
return parseNewExpressionOrNewDotTarget();
- case 41:
- case 63:
- if (reScanSlashToken() === 12) {
+ case 42:
+ case 64:
+ if (reScanSlashToken() === 13) {
return parseLiteralNode();
}
break;
- case 14:
+ case 15:
return parseTemplateExpression();
}
return parseIdentifier(ts.Diagnostics.Expression_expected);
}
function parseParenthesizedExpression() {
- var node = createNodeWithJSDoc(193);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ var node = createNodeWithJSDoc(195);
parseExpected(20);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
return finishNode(node);
}
function parseSpreadElement() {
- var node = createNode(206);
- parseExpected(24);
+ var node = createNode(208);
+ parseExpected(25);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
function parseArgumentOrArrayLiteralElement() {
- return token() === 24 ? parseSpreadElement() :
- token() === 26 ? createNode(208) :
+ return token() === 25 ? parseSpreadElement() :
+ token() === 27 ? createNode(210) :
parseAssignmentExpressionOrHigher();
}
function parseArgumentExpression() {
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
}
function parseArrayLiteralExpression() {
- var node = createNode(185);
- parseExpected(21);
+ var node = createNode(187);
+ parseExpected(22);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.elements = parseDelimitedList(15, parseArgumentOrArrayLiteralElement);
- parseExpected(22);
+ parseExpected(23);
return finishNode(node);
}
function parseObjectLiteralElement() {
var node = createNodeWithJSDoc(0);
- if (parseOptionalToken(24)) {
- node.kind = 275;
+ if (parseOptionalToken(25)) {
+ node.kind = 277;
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
- if (parseContextualModifier(125)) {
- return parseAccessorDeclaration(node, 156);
+ if (parseContextualModifier(126)) {
+ return parseAccessorDeclaration(node, 158);
}
- if (parseContextualModifier(136)) {
- return parseAccessorDeclaration(node, 157);
+ if (parseContextualModifier(137)) {
+ return parseAccessorDeclaration(node, 159);
}
- var asteriskToken = parseOptionalToken(39);
+ var asteriskToken = parseOptionalToken(40);
var tokenIsIdentifier = isIdentifier();
node.name = parsePropertyName();
- node.questionToken = parseOptionalToken(55);
- node.exclamationToken = parseOptionalToken(51);
- if (asteriskToken || token() === 19 || token() === 27) {
+ node.questionToken = parseOptionalToken(56);
+ node.exclamationToken = parseOptionalToken(52);
+ if (asteriskToken || token() === 20 || token() === 28) {
return parseMethodDeclaration(node, asteriskToken);
}
- var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 || token() === 18 || token() === 58);
+ var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 57);
if (isShorthandPropertyAssignment) {
- node.kind = 274;
- var equalsToken = parseOptionalToken(58);
+ node.kind = 276;
+ var equalsToken = parseOptionalToken(59);
if (equalsToken) {
node.equalsToken = equalsToken;
node.objectAssignmentInitializer = allowInAnd(parseAssignmentExpressionOrHigher);
}
}
else {
- node.kind = 273;
- parseExpected(56);
+ node.kind = 275;
+ parseExpected(57);
node.initializer = allowInAnd(parseAssignmentExpressionOrHigher);
}
return finishNode(node);
}
function parseObjectLiteralExpression() {
- var node = createNode(186);
- parseExpected(17);
+ var node = createNode(188);
+ parseExpected(18);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.properties = parseDelimitedList(12, parseObjectLiteralElement, true);
- parseExpected(18);
+ parseExpected(19);
return finishNode(node);
}
function parseFunctionExpression() {
@@ -16015,10 +16293,10 @@ var ts;
if (saveDecoratorContext) {
setDecoratorContext(false);
}
- var node = createNodeWithJSDoc(194);
+ var node = createNodeWithJSDoc(196);
node.modifiers = parseModifiers();
- parseExpected(89);
- node.asteriskToken = parseOptionalToken(39);
+ parseExpected(90);
+ node.asteriskToken = parseOptionalToken(40);
var isGenerator = node.asteriskToken ? 1 : 0;
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
node.name =
@@ -16026,7 +16304,7 @@ var ts;
isGenerator ? doInYieldContext(parseOptionalIdentifier) :
isAsync ? doInAwaitContext(parseOptionalIdentifier) :
parseOptionalIdentifier();
- fillSignature(56, isGenerator | isAsync, node);
+ fillSignature(57, isGenerator | isAsync, node);
node.body = parseFunctionBlock(isGenerator | isAsync);
if (saveDecoratorContext) {
setDecoratorContext(true);
@@ -16038,10 +16316,10 @@ var ts;
}
function parseNewExpressionOrNewDotTarget() {
var fullStart = scanner.getStartPos();
- parseExpected(94);
- if (parseOptional(23)) {
- var node_2 = createNode(212, fullStart);
- node_2.keywordToken = 94;
+ parseExpected(95);
+ if (parseOptional(24)) {
+ var node_2 = createNode(214, fullStart);
+ node_2.keywordToken = 95;
node_2.name = parseIdentifierName();
return finishNode(node_2);
}
@@ -16057,22 +16335,22 @@ var ts;
}
break;
}
- var node = createNode(190, fullStart);
+ var node = createNode(192, fullStart);
node.expression = expression;
node.typeArguments = typeArguments;
- if (node.typeArguments || token() === 19) {
+ if (node.typeArguments || token() === 20) {
node.arguments = parseArgumentList();
}
return finishNode(node);
}
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
- var node = createNode(216);
- if (parseExpected(17, diagnosticMessage) || ignoreMissingOpenBrace) {
+ var node = createNode(218);
+ if (parseExpected(18, diagnosticMessage) || ignoreMissingOpenBrace) {
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
}
node.statements = parseList(1, parseStatement);
- parseExpected(18);
+ parseExpected(19);
}
else {
node.statements = createMissingList();
@@ -16097,48 +16375,48 @@ var ts;
return block;
}
function parseEmptyStatement() {
- var node = createNode(218);
- parseExpected(25);
+ var node = createNode(220);
+ parseExpected(26);
return finishNode(node);
}
function parseIfStatement() {
- var node = createNode(220);
- parseExpected(90);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(222);
+ parseExpected(91);
parseExpected(20);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
node.thenStatement = parseStatement();
- node.elseStatement = parseOptional(82) ? parseStatement() : undefined;
+ node.elseStatement = parseOptional(83) ? parseStatement() : undefined;
return finishNode(node);
}
function parseDoStatement() {
- var node = createNode(221);
- parseExpected(81);
+ var node = createNode(223);
+ parseExpected(82);
node.statement = parseStatement();
- parseExpected(106);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ parseExpected(107);
parseExpected(20);
- parseOptional(25);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
+ parseOptional(26);
return finishNode(node);
}
function parseWhileStatement() {
- var node = createNode(222);
- parseExpected(106);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(224);
+ parseExpected(107);
parseExpected(20);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
node.statement = parseStatement();
return finishNode(node);
}
function parseForOrForInOrForOfStatement() {
var pos = getNodePos();
- parseExpected(88);
- var awaitToken = parseOptionalToken(121);
- parseExpected(19);
+ parseExpected(89);
+ var awaitToken = parseOptionalToken(122);
+ parseExpected(20);
var initializer;
- if (token() !== 25) {
- if (token() === 104 || token() === 110 || token() === 76) {
+ if (token() !== 26) {
+ if (token() === 105 || token() === 111 || token() === 77) {
initializer = parseVariableDeclarationList(true);
}
else {
@@ -16146,33 +16424,33 @@ var ts;
}
}
var forOrForInOrForOfStatement;
- if (awaitToken ? parseExpected(145) : parseOptional(145)) {
- var forOfStatement = createNode(225, pos);
+ if (awaitToken ? parseExpected(147) : parseOptional(147)) {
+ var forOfStatement = createNode(227, pos);
forOfStatement.awaitModifier = awaitToken;
forOfStatement.initializer = initializer;
forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher);
- parseExpected(20);
+ parseExpected(21);
forOrForInOrForOfStatement = forOfStatement;
}
- else if (parseOptional(92)) {
- var forInStatement = createNode(224, pos);
+ else if (parseOptional(93)) {
+ var forInStatement = createNode(226, pos);
forInStatement.initializer = initializer;
forInStatement.expression = allowInAnd(parseExpression);
- parseExpected(20);
+ parseExpected(21);
forOrForInOrForOfStatement = forInStatement;
}
else {
- var forStatement = createNode(223, pos);
+ var forStatement = createNode(225, pos);
forStatement.initializer = initializer;
- parseExpected(25);
- if (token() !== 25 && token() !== 20) {
+ parseExpected(26);
+ if (token() !== 26 && token() !== 21) {
forStatement.condition = allowInAnd(parseExpression);
}
- parseExpected(25);
- if (token() !== 20) {
+ parseExpected(26);
+ if (token() !== 21) {
forStatement.incrementor = allowInAnd(parseExpression);
}
- parseExpected(20);
+ parseExpected(21);
forOrForInOrForOfStatement = forStatement;
}
forOrForInOrForOfStatement.statement = parseStatement();
@@ -16180,7 +16458,7 @@ var ts;
}
function parseBreakOrContinueStatement(kind) {
var node = createNode(kind);
- parseExpected(kind === 227 ? 72 : 77);
+ parseExpected(kind === 229 ? 73 : 78);
if (!canParseSemicolon()) {
node.label = parseIdentifier();
}
@@ -16188,8 +16466,8 @@ var ts;
return finishNode(node);
}
function parseReturnStatement() {
- var node = createNode(228);
- parseExpected(96);
+ var node = createNode(230);
+ parseExpected(97);
if (!canParseSemicolon()) {
node.expression = allowInAnd(parseExpression);
}
@@ -16197,69 +16475,69 @@ var ts;
return finishNode(node);
}
function parseWithStatement() {
- var node = createNode(229);
- parseExpected(107);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(231);
+ parseExpected(108);
parseExpected(20);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
node.statement = doInsideOfContext(8388608, parseStatement);
return finishNode(node);
}
function parseCaseClause() {
- var node = createNode(269);
- parseExpected(73);
+ var node = createNode(271);
+ parseExpected(74);
node.expression = allowInAnd(parseExpression);
- parseExpected(56);
+ parseExpected(57);
node.statements = parseList(3, parseStatement);
return finishNode(node);
}
function parseDefaultClause() {
- var node = createNode(270);
- parseExpected(79);
- parseExpected(56);
+ var node = createNode(272);
+ parseExpected(80);
+ parseExpected(57);
node.statements = parseList(3, parseStatement);
return finishNode(node);
}
function parseCaseOrDefaultClause() {
- return token() === 73 ? parseCaseClause() : parseDefaultClause();
+ return token() === 74 ? parseCaseClause() : parseDefaultClause();
}
function parseSwitchStatement() {
- var node = createNode(230);
- parseExpected(98);
- parseExpected(19);
- node.expression = allowInAnd(parseExpression);
+ var node = createNode(232);
+ parseExpected(99);
parseExpected(20);
- var caseBlock = createNode(244);
- parseExpected(17);
- caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
+ node.expression = allowInAnd(parseExpression);
+ parseExpected(21);
+ var caseBlock = createNode(246);
parseExpected(18);
+ caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
+ parseExpected(19);
node.caseBlock = finishNode(caseBlock);
return finishNode(node);
}
function parseThrowStatement() {
- var node = createNode(232);
- parseExpected(100);
+ var node = createNode(234);
+ parseExpected(101);
node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);
parseSemicolon();
return finishNode(node);
}
function parseTryStatement() {
- var node = createNode(233);
- parseExpected(102);
+ var node = createNode(235);
+ parseExpected(103);
node.tryBlock = parseBlock(false);
- node.catchClause = token() === 74 ? parseCatchClause() : undefined;
- if (!node.catchClause || token() === 87) {
- parseExpected(87);
+ node.catchClause = token() === 75 ? parseCatchClause() : undefined;
+ if (!node.catchClause || token() === 88) {
+ parseExpected(88);
node.finallyBlock = parseBlock(false);
}
return finishNode(node);
}
function parseCatchClause() {
- var result = createNode(272);
- parseExpected(74);
- if (parseOptional(19)) {
+ var result = createNode(274);
+ parseExpected(75);
+ if (parseOptional(20)) {
result.variableDeclaration = parseVariableDeclaration();
- parseExpected(20);
+ parseExpected(21);
}
else {
result.variableDeclaration = undefined;
@@ -16268,21 +16546,21 @@ var ts;
return finishNode(result);
}
function parseDebuggerStatement() {
- var node = createNode(234);
- parseExpected(78);
+ var node = createNode(236);
+ parseExpected(79);
parseSemicolon();
return finishNode(node);
}
function parseExpressionOrLabeledStatement() {
var node = createNodeWithJSDoc(0);
var expression = allowInAnd(parseExpression);
- if (expression.kind === 71 && parseOptional(56)) {
- node.kind = 231;
+ if (expression.kind === 72 && parseOptional(57)) {
+ node.kind = 233;
node.label = expression;
node.statement = parseStatement();
}
else {
- node.kind = 219;
+ node.kind = 221;
node.expression = expression;
parseSemicolon();
}
@@ -16294,60 +16572,60 @@ var ts;
}
function nextTokenIsClassKeywordOnSameLine() {
nextToken();
- return token() === 75 && !scanner.hasPrecedingLineBreak();
+ return token() === 76 && !scanner.hasPrecedingLineBreak();
}
function nextTokenIsFunctionKeywordOnSameLine() {
nextToken();
- return token() === 89 && !scanner.hasPrecedingLineBreak();
+ return token() === 90 && !scanner.hasPrecedingLineBreak();
}
function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine() {
nextToken();
- return (ts.tokenIsIdentifierOrKeyword(token()) || token() === 8 || token() === 9) && !scanner.hasPrecedingLineBreak();
+ return (ts.tokenIsIdentifierOrKeyword(token()) || token() === 8 || token() === 9 || token() === 10) && !scanner.hasPrecedingLineBreak();
}
function isDeclaration() {
while (true) {
switch (token()) {
- case 104:
- case 110:
+ case 105:
+ case 111:
+ case 77:
+ case 90:
case 76:
- case 89:
- case 75:
- case 83:
+ case 84:
return true;
- case 109:
- case 139:
+ case 110:
+ case 140:
return nextTokenIsIdentifierOnSameLine();
- case 129:
case 130:
+ case 131:
return nextTokenIsIdentifierOrStringLiteralOnSameLine();
- case 117:
- case 120:
- case 124:
- case 112:
+ case 118:
+ case 121:
+ case 125:
case 113:
case 114:
- case 132:
+ case 115:
+ case 133:
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return false;
}
continue;
- case 144:
+ case 145:
nextToken();
- return token() === 17 || token() === 71 || token() === 84;
- case 91:
+ return token() === 18 || token() === 72 || token() === 85;
+ case 92:
nextToken();
- return token() === 9 || token() === 39 ||
- token() === 17 || ts.tokenIsIdentifierOrKeyword(token());
- case 84:
+ return token() === 10 || token() === 40 ||
+ token() === 18 || ts.tokenIsIdentifierOrKeyword(token());
+ case 85:
nextToken();
- if (token() === 58 || token() === 39 ||
- token() === 17 || token() === 79 ||
- token() === 118) {
+ if (token() === 59 || token() === 40 ||
+ token() === 18 || token() === 80 ||
+ token() === 119) {
return true;
}
continue;
- case 115:
+ case 116:
nextToken();
continue;
default:
@@ -16360,47 +16638,47 @@ var ts;
}
function isStartOfStatement() {
switch (token()) {
- case 57:
- case 25:
- case 17:
- case 104:
- case 110:
- case 89:
- case 75:
- case 83:
+ case 58:
+ case 26:
+ case 18:
+ case 105:
+ case 111:
case 90:
- case 81:
- case 106:
- case 88:
- case 77:
- case 72:
- case 96:
- case 107:
- case 98:
- case 100:
- case 102:
- case 78:
- case 74:
- case 87:
- return true;
- case 91:
- return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot);
case 76:
case 84:
- return isStartOfDeclaration();
- case 120:
- case 124:
- case 109:
- case 129:
- case 130:
- case 139:
- case 144:
+ case 91:
+ case 82:
+ case 107:
+ case 89:
+ case 78:
+ case 73:
+ case 97:
+ case 108:
+ case 99:
+ case 101:
+ case 103:
+ case 79:
+ case 75:
+ case 88:
+ return true;
+ case 92:
+ return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot);
+ case 77:
+ case 85:
+ return isStartOfDeclaration();
+ case 121:
+ case 125:
+ case 110:
+ case 130:
+ case 131:
+ case 140:
+ case 145:
return true;
- case 114:
- case 112:
- case 113:
case 115:
- case 132:
+ case 113:
+ case 114:
+ case 116:
+ case 133:
return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
default:
return isStartOfExpression();
@@ -16408,73 +16686,73 @@ var ts;
}
function nextTokenIsIdentifierOrStartOfDestructuring() {
nextToken();
- return isIdentifier() || token() === 17 || token() === 21;
+ return isIdentifier() || token() === 18 || token() === 22;
}
function isLetDeclaration() {
return lookAhead(nextTokenIsIdentifierOrStartOfDestructuring);
}
function parseStatement() {
switch (token()) {
- case 25:
+ case 26:
return parseEmptyStatement();
- case 17:
+ case 18:
return parseBlock(false);
- case 104:
- return parseVariableStatement(createNodeWithJSDoc(235));
- case 110:
+ case 105:
+ return parseVariableStatement(createNodeWithJSDoc(237));
+ case 111:
if (isLetDeclaration()) {
- return parseVariableStatement(createNodeWithJSDoc(235));
+ return parseVariableStatement(createNodeWithJSDoc(237));
}
break;
- case 89:
- return parseFunctionDeclaration(createNodeWithJSDoc(237));
- case 75:
- return parseClassDeclaration(createNodeWithJSDoc(238));
case 90:
- return parseIfStatement();
- case 81:
- return parseDoStatement();
- case 106:
- return parseWhileStatement();
- case 88:
- return parseForOrForInOrForOfStatement();
- case 77:
- return parseBreakOrContinueStatement(226);
- case 72:
- return parseBreakOrContinueStatement(227);
- case 96:
- return parseReturnStatement();
- case 107:
- return parseWithStatement();
- case 98:
- return parseSwitchStatement();
- case 100:
- return parseThrowStatement();
- case 102:
- case 74:
- case 87:
- return parseTryStatement();
- case 78:
- return parseDebuggerStatement();
- case 57:
- return parseDeclaration();
- case 120:
- case 109:
- case 139:
- case 129:
- case 130:
- case 124:
+ return parseFunctionDeclaration(createNodeWithJSDoc(239));
case 76:
- case 83:
- case 84:
+ return parseClassDeclaration(createNodeWithJSDoc(240));
case 91:
- case 112:
+ return parseIfStatement();
+ case 82:
+ return parseDoStatement();
+ case 107:
+ return parseWhileStatement();
+ case 89:
+ return parseForOrForInOrForOfStatement();
+ case 78:
+ return parseBreakOrContinueStatement(228);
+ case 73:
+ return parseBreakOrContinueStatement(229);
+ case 97:
+ return parseReturnStatement();
+ case 108:
+ return parseWithStatement();
+ case 99:
+ return parseSwitchStatement();
+ case 101:
+ return parseThrowStatement();
+ case 103:
+ case 75:
+ case 88:
+ return parseTryStatement();
+ case 79:
+ return parseDebuggerStatement();
+ case 58:
+ return parseDeclaration();
+ case 121:
+ case 110:
+ case 140:
+ case 130:
+ case 131:
+ case 125:
+ case 77:
+ case 84:
+ case 85:
+ case 92:
case 113:
case 114:
- case 117:
case 115:
- case 132:
- case 144:
+ case 118:
+ case 116:
+ case 133:
+ case 145:
if (isStartOfDeclaration()) {
return parseDeclaration();
}
@@ -16483,7 +16761,7 @@ var ts;
return parseExpressionOrLabeledStatement();
}
function isDeclareModifier(modifier) {
- return modifier.kind === 124;
+ return modifier.kind === 125;
}
function parseDeclaration() {
var node = createNodeWithJSDoc(0);
@@ -16502,40 +16780,40 @@ var ts;
}
function parseDeclarationWorker(node) {
switch (token()) {
- case 104:
- case 110:
- case 76:
+ case 105:
+ case 111:
+ case 77:
return parseVariableStatement(node);
- case 89:
+ case 90:
return parseFunctionDeclaration(node);
- case 75:
+ case 76:
return parseClassDeclaration(node);
- case 109:
+ case 110:
return parseInterfaceDeclaration(node);
- case 139:
+ case 140:
return parseTypeAliasDeclaration(node);
- case 83:
- return parseEnumDeclaration(node);
- case 144:
- case 129:
- case 130:
- return parseModuleDeclaration(node);
- case 91:
- return parseImportDeclarationOrImportEqualsDeclaration(node);
case 84:
+ return parseEnumDeclaration(node);
+ case 145:
+ case 130:
+ case 131:
+ return parseModuleDeclaration(node);
+ case 92:
+ return parseImportDeclarationOrImportEqualsDeclaration(node);
+ case 85:
nextToken();
switch (token()) {
- case 79:
- case 58:
+ case 80:
+ case 59:
return parseExportAssignment(node);
- case 118:
+ case 119:
return parseNamespaceExportDeclaration(node);
default:
return parseExportDeclaration(node);
}
default:
if (node.decorators || node.modifiers) {
- var missing = createMissingNode(256, true, ts.Diagnostics.Declaration_expected);
+ var missing = createMissingNode(258, true, ts.Diagnostics.Declaration_expected);
missing.pos = node.pos;
missing.decorators = node.decorators;
missing.modifiers = node.modifiers;
@@ -16546,35 +16824,35 @@ var ts;
}
function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
nextToken();
- return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token() === 9);
+ return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token() === 10);
}
function parseFunctionBlockOrSemicolon(flags, diagnosticMessage) {
- if (token() !== 17 && canParseSemicolon()) {
+ if (token() !== 18 && canParseSemicolon()) {
parseSemicolon();
return;
}
return parseFunctionBlock(flags, diagnosticMessage);
}
function parseArrayBindingElement() {
- if (token() === 26) {
- return createNode(208);
+ if (token() === 27) {
+ return createNode(210);
}
- var node = createNode(184);
- node.dotDotDotToken = parseOptionalToken(24);
+ var node = createNode(186);
+ node.dotDotDotToken = parseOptionalToken(25);
node.name = parseIdentifierOrPattern();
node.initializer = parseInitializer();
return finishNode(node);
}
function parseObjectBindingElement() {
- var node = createNode(184);
- node.dotDotDotToken = parseOptionalToken(24);
+ var node = createNode(186);
+ node.dotDotDotToken = parseOptionalToken(25);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
- if (tokenIsIdentifier && token() !== 56) {
+ if (tokenIsIdentifier && token() !== 57) {
node.name = propertyName;
}
else {
- parseExpected(56);
+ parseExpected(57);
node.propertyName = propertyName;
node.name = parseIdentifierOrPattern();
}
@@ -16582,27 +16860,27 @@ var ts;
return finishNode(node);
}
function parseObjectBindingPattern() {
- var node = createNode(182);
- parseExpected(17);
- node.elements = parseDelimitedList(9, parseObjectBindingElement);
+ var node = createNode(184);
parseExpected(18);
+ node.elements = parseDelimitedList(9, parseObjectBindingElement);
+ parseExpected(19);
return finishNode(node);
}
function parseArrayBindingPattern() {
- var node = createNode(183);
- parseExpected(21);
- node.elements = parseDelimitedList(10, parseArrayBindingElement);
+ var node = createNode(185);
parseExpected(22);
+ node.elements = parseDelimitedList(10, parseArrayBindingElement);
+ parseExpected(23);
return finishNode(node);
}
function isIdentifierOrPattern() {
- return token() === 17 || token() === 21 || isIdentifier();
+ return token() === 18 || token() === 22 || isIdentifier();
}
function parseIdentifierOrPattern() {
- if (token() === 21) {
+ if (token() === 22) {
return parseArrayBindingPattern();
}
- if (token() === 17) {
+ if (token() === 18) {
return parseObjectBindingPattern();
}
return parseIdentifier();
@@ -16611,10 +16889,10 @@ var ts;
return parseVariableDeclaration(true);
}
function parseVariableDeclaration(allowExclamation) {
- var node = createNode(235);
+ var node = createNode(237);
node.name = parseIdentifierOrPattern();
- if (allowExclamation && node.name.kind === 71 &&
- token() === 51 && !scanner.hasPrecedingLineBreak()) {
+ if (allowExclamation && node.name.kind === 72 &&
+ token() === 52 && !scanner.hasPrecedingLineBreak()) {
node.exclamationToken = parseTokenNode();
}
node.type = parseTypeAnnotation();
@@ -16624,21 +16902,21 @@ var ts;
return finishNode(node);
}
function parseVariableDeclarationList(inForStatementInitializer) {
- var node = createNode(236);
+ var node = createNode(238);
switch (token()) {
- case 104:
+ case 105:
break;
- case 110:
+ case 111:
node.flags |= 1;
break;
- case 76:
+ case 77:
node.flags |= 2;
break;
default:
ts.Debug.fail();
}
nextToken();
- if (token() === 145 && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 147 && lookAhead(canFollowContextualOfKeyword)) {
node.declarations = createMissingList();
}
else {
@@ -16650,44 +16928,44 @@ var ts;
return finishNode(node);
}
function canFollowContextualOfKeyword() {
- return nextTokenIsIdentifier() && nextToken() === 20;
+ return nextTokenIsIdentifier() && nextToken() === 21;
}
function parseVariableStatement(node) {
- node.kind = 217;
+ node.kind = 219;
node.declarationList = parseVariableDeclarationList(false);
parseSemicolon();
return finishNode(node);
}
function parseFunctionDeclaration(node) {
- node.kind = 237;
- parseExpected(89);
- node.asteriskToken = parseOptionalToken(39);
+ node.kind = 239;
+ parseExpected(90);
+ node.asteriskToken = parseOptionalToken(40);
node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier();
var isGenerator = node.asteriskToken ? 1 : 0;
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
- fillSignature(56, isGenerator | isAsync, node);
+ fillSignature(57, isGenerator | isAsync, node);
node.body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
return finishNode(node);
}
function parseConstructorDeclaration(node) {
- node.kind = 155;
- parseExpected(123);
- fillSignature(56, 0, node);
+ node.kind = 157;
+ parseExpected(124);
+ fillSignature(57, 0, node);
node.body = parseFunctionBlockOrSemicolon(0, ts.Diagnostics.or_expected);
return finishNode(node);
}
function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) {
- node.kind = 154;
+ node.kind = 156;
node.asteriskToken = asteriskToken;
var isGenerator = asteriskToken ? 1 : 0;
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
- fillSignature(56, isGenerator | isAsync, node);
+ fillSignature(57, isGenerator | isAsync, node);
node.body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage);
return finishNode(node);
}
function parsePropertyDeclaration(node) {
- node.kind = 152;
- if (!node.questionToken && token() === 51 && !scanner.hasPrecedingLineBreak()) {
+ node.kind = 154;
+ if (!node.questionToken && token() === 52 && !scanner.hasPrecedingLineBreak()) {
node.exclamationToken = parseTokenNode();
}
node.type = parseTypeAnnotation();
@@ -16698,10 +16976,10 @@ var ts;
return finishNode(node);
}
function parsePropertyOrMethodDeclaration(node) {
- var asteriskToken = parseOptionalToken(39);
+ var asteriskToken = parseOptionalToken(40);
node.name = parsePropertyName();
- node.questionToken = parseOptionalToken(55);
- if (asteriskToken || token() === 19 || token() === 27) {
+ node.questionToken = parseOptionalToken(56);
+ if (asteriskToken || token() === 20 || token() === 28) {
return parseMethodDeclaration(node, asteriskToken, ts.Diagnostics.or_expected);
}
return parsePropertyDeclaration(node);
@@ -16709,13 +16987,13 @@ var ts;
function parseAccessorDeclaration(node, kind) {
node.kind = kind;
node.name = parsePropertyName();
- fillSignature(56, 0, node);
+ fillSignature(57, 0, node);
node.body = parseFunctionBlockOrSemicolon(0);
return finishNode(node);
}
function isClassMemberStart() {
var idToken;
- if (token() === 57) {
+ if (token() === 58) {
return true;
}
while (ts.isModifierKind(token())) {
@@ -16725,27 +17003,27 @@ var ts;
}
nextToken();
}
- if (token() === 39) {
+ if (token() === 40) {
return true;
}
if (isLiteralPropertyName()) {
idToken = token();
nextToken();
}
- if (token() === 21) {
+ if (token() === 22) {
return true;
}
if (idToken !== undefined) {
- if (!ts.isKeyword(idToken) || idToken === 136 || idToken === 125) {
+ if (!ts.isKeyword(idToken) || idToken === 137 || idToken === 126) {
return true;
}
switch (token()) {
- case 19:
- case 27:
- case 51:
+ case 20:
+ case 28:
+ case 52:
+ case 57:
+ case 59:
case 56:
- case 58:
- case 55:
return true;
default:
return canParseSemicolon();
@@ -16758,10 +17036,10 @@ var ts;
var listPos = getNodePos();
while (true) {
var decoratorStart = getNodePos();
- if (!parseOptional(57)) {
+ if (!parseOptional(58)) {
break;
}
- var decorator = createNode(150, decoratorStart);
+ var decorator = createNode(152, decoratorStart);
decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher);
finishNode(decorator);
(list || (list = [])).push(decorator);
@@ -16774,7 +17052,7 @@ var ts;
while (true) {
var modifierStart = scanner.getStartPos();
var modifierKind = token();
- if (token() === 76 && permitInvalidConstAsModifier) {
+ if (token() === 77 && permitInvalidConstAsModifier) {
if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) {
break;
}
@@ -16791,7 +17069,7 @@ var ts;
}
function parseModifiersForArrowFunction() {
var modifiers;
- if (token() === 120) {
+ if (token() === 121) {
var modifierStart = scanner.getStartPos();
var modifierKind = token();
nextToken();
@@ -16801,54 +17079,54 @@ var ts;
return modifiers;
}
function parseClassElement() {
- if (token() === 25) {
- var result = createNode(215);
+ if (token() === 26) {
+ var result = createNode(217);
nextToken();
return finishNode(result);
}
var node = createNodeWithJSDoc(0);
node.decorators = parseDecorators();
node.modifiers = parseModifiers(true);
- if (parseContextualModifier(125)) {
- return parseAccessorDeclaration(node, 156);
+ if (parseContextualModifier(126)) {
+ return parseAccessorDeclaration(node, 158);
}
- if (parseContextualModifier(136)) {
- return parseAccessorDeclaration(node, 157);
+ if (parseContextualModifier(137)) {
+ return parseAccessorDeclaration(node, 159);
}
- if (token() === 123) {
+ if (token() === 124) {
return parseConstructorDeclaration(node);
}
if (isIndexSignature()) {
return parseIndexSignatureDeclaration(node);
}
if (ts.tokenIsIdentifierOrKeyword(token()) ||
- token() === 9 ||
+ token() === 10 ||
token() === 8 ||
- token() === 39 ||
- token() === 21) {
+ token() === 40 ||
+ token() === 22) {
return parsePropertyOrMethodDeclaration(node);
}
if (node.decorators || node.modifiers) {
- node.name = createMissingNode(71, true, ts.Diagnostics.Declaration_expected);
+ node.name = createMissingNode(72, true, ts.Diagnostics.Declaration_expected);
return parsePropertyDeclaration(node);
}
return ts.Debug.fail("Should not have attempted to parse class member declaration.");
}
function parseClassExpression() {
- return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 207);
+ return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 209);
}
function parseClassDeclaration(node) {
- return parseClassDeclarationOrExpression(node, 238);
+ return parseClassDeclarationOrExpression(node, 240);
}
function parseClassDeclarationOrExpression(node, kind) {
node.kind = kind;
- parseExpected(75);
+ parseExpected(76);
node.name = parseNameOfClassDeclarationOrExpression();
node.typeParameters = parseTypeParameters();
node.heritageClauses = parseHeritageClauses();
- if (parseExpected(17)) {
+ if (parseExpected(18)) {
node.members = parseClassMembers();
- parseExpected(18);
+ parseExpected(19);
}
else {
node.members = createMissingList();
@@ -16861,7 +17139,7 @@ var ts;
: undefined;
}
function isImplementsClause() {
- return token() === 108 && lookAhead(nextTokenIsIdentifierOrKeyword);
+ return token() === 109 && lookAhead(nextTokenIsIdentifierOrKeyword);
}
function parseHeritageClauses() {
if (isHeritageClause()) {
@@ -16871,33 +17149,33 @@ var ts;
}
function parseHeritageClause() {
var tok = token();
- ts.Debug.assert(tok === 85 || tok === 108);
- var node = createNode(271);
+ ts.Debug.assert(tok === 86 || tok === 109);
+ var node = createNode(273);
node.token = tok;
nextToken();
node.types = parseDelimitedList(7, parseExpressionWithTypeArguments);
return finishNode(node);
}
function parseExpressionWithTypeArguments() {
- var node = createNode(209);
+ var node = createNode(211);
node.expression = parseLeftHandSideExpressionOrHigher();
node.typeArguments = tryParseTypeArguments();
return finishNode(node);
}
function tryParseTypeArguments() {
- return token() === 27
- ? parseBracketedList(20, parseType, 27, 29)
+ return token() === 28
+ ? parseBracketedList(20, parseType, 28, 30)
: undefined;
}
function isHeritageClause() {
- return token() === 85 || token() === 108;
+ return token() === 86 || token() === 109;
}
function parseClassMembers() {
return parseList(5, parseClassElement);
}
function parseInterfaceDeclaration(node) {
- node.kind = 239;
- parseExpected(109);
+ node.kind = 241;
+ parseExpected(110);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
node.heritageClauses = parseHeritageClauses();
@@ -16905,28 +17183,28 @@ var ts;
return finishNode(node);
}
function parseTypeAliasDeclaration(node) {
- node.kind = 240;
- parseExpected(139);
+ node.kind = 242;
+ parseExpected(140);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
- parseExpected(58);
+ parseExpected(59);
node.type = parseType();
parseSemicolon();
return finishNode(node);
}
function parseEnumMember() {
- var node = createNodeWithJSDoc(276);
+ var node = createNodeWithJSDoc(278);
node.name = parsePropertyName();
node.initializer = allowInAnd(parseInitializer);
return finishNode(node);
}
function parseEnumDeclaration(node) {
- node.kind = 241;
- parseExpected(83);
+ node.kind = 243;
+ parseExpected(84);
node.name = parseIdentifier();
- if (parseExpected(17)) {
+ if (parseExpected(18)) {
node.members = parseDelimitedList(6, parseEnumMember);
- parseExpected(18);
+ parseExpected(19);
}
else {
node.members = createMissingList();
@@ -16934,10 +17212,10 @@ var ts;
return finishNode(node);
}
function parseModuleBlock() {
- var node = createNode(243);
- if (parseExpected(17)) {
+ var node = createNode(245);
+ if (parseExpected(18)) {
node.statements = parseList(1, parseStatement);
- parseExpected(18);
+ parseExpected(19);
}
else {
node.statements = createMissingList();
@@ -16945,18 +17223,18 @@ var ts;
return finishNode(node);
}
function parseModuleOrNamespaceDeclaration(node, flags) {
- node.kind = 242;
+ node.kind = 244;
var namespaceFlag = flags & 16;
node.flags |= flags;
node.name = parseIdentifier();
- node.body = parseOptional(23)
+ node.body = parseOptional(24)
? parseModuleOrNamespaceDeclaration(createNode(0), 4 | namespaceFlag)
: parseModuleBlock();
return finishNode(node);
}
function parseAmbientExternalModuleDeclaration(node) {
- node.kind = 242;
- if (token() === 144) {
+ node.kind = 244;
+ if (token() === 145) {
node.name = parseIdentifier();
node.flags |= 512;
}
@@ -16964,7 +17242,7 @@ var ts;
node.name = parseLiteralNode();
node.name.text = internIdentifier(node.name.text);
}
- if (token() === 17) {
+ if (token() === 18) {
node.body = parseModuleBlock();
}
else {
@@ -16974,75 +17252,75 @@ var ts;
}
function parseModuleDeclaration(node) {
var flags = 0;
- if (token() === 144) {
+ if (token() === 145) {
return parseAmbientExternalModuleDeclaration(node);
}
- else if (parseOptional(130)) {
+ else if (parseOptional(131)) {
flags |= 16;
}
else {
- parseExpected(129);
- if (token() === 9) {
+ parseExpected(130);
+ if (token() === 10) {
return parseAmbientExternalModuleDeclaration(node);
}
}
return parseModuleOrNamespaceDeclaration(node, flags);
}
function isExternalModuleReference() {
- return token() === 133 &&
+ return token() === 134 &&
lookAhead(nextTokenIsOpenParen);
}
function nextTokenIsOpenParen() {
- return nextToken() === 19;
+ return nextToken() === 20;
}
function nextTokenIsSlash() {
- return nextToken() === 41;
+ return nextToken() === 42;
}
function parseNamespaceExportDeclaration(node) {
- node.kind = 245;
- parseExpected(118);
- parseExpected(130);
+ node.kind = 247;
+ parseExpected(119);
+ parseExpected(131);
node.name = parseIdentifier();
parseSemicolon();
return finishNode(node);
}
function parseImportDeclarationOrImportEqualsDeclaration(node) {
- parseExpected(91);
+ parseExpected(92);
var afterImportPos = scanner.getStartPos();
var identifier;
if (isIdentifier()) {
identifier = parseIdentifier();
- if (token() !== 26 && token() !== 143) {
+ if (token() !== 27 && token() !== 144) {
return parseImportEqualsDeclaration(node, identifier);
}
}
- node.kind = 247;
+ node.kind = 249;
if (identifier ||
- token() === 39 ||
- token() === 17) {
+ token() === 40 ||
+ token() === 18) {
node.importClause = parseImportClause(identifier, afterImportPos);
- parseExpected(143);
+ parseExpected(144);
}
node.moduleSpecifier = parseModuleSpecifier();
parseSemicolon();
return finishNode(node);
}
function parseImportEqualsDeclaration(node, identifier) {
- node.kind = 246;
+ node.kind = 248;
node.name = identifier;
- parseExpected(58);
+ parseExpected(59);
node.moduleReference = parseModuleReference();
parseSemicolon();
return finishNode(node);
}
function parseImportClause(identifier, fullStart) {
- var importClause = createNode(248, fullStart);
+ var importClause = createNode(250, fullStart);
if (identifier) {
importClause.name = identifier;
}
if (!importClause.name ||
- parseOptional(26)) {
- importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(250);
+ parseOptional(27)) {
+ importClause.namedBindings = token() === 40 ? parseNamespaceImport() : parseNamedImportsOrExports(252);
}
return finishNode(importClause);
}
@@ -17052,15 +17330,15 @@ var ts;
: parseEntityName(false);
}
function parseExternalModuleReference() {
- var node = createNode(257);
- parseExpected(133);
- parseExpected(19);
- node.expression = parseModuleSpecifier();
+ var node = createNode(259);
+ parseExpected(134);
parseExpected(20);
+ node.expression = parseModuleSpecifier();
+ parseExpected(21);
return finishNode(node);
}
function parseModuleSpecifier() {
- if (token() === 9) {
+ if (token() === 10) {
var result = parseLiteralNode();
result.text = internIdentifier(result.text);
return result;
@@ -17070,22 +17348,22 @@ var ts;
}
}
function parseNamespaceImport() {
- var namespaceImport = createNode(249);
- parseExpected(39);
- parseExpected(118);
+ var namespaceImport = createNode(251);
+ parseExpected(40);
+ parseExpected(119);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
function parseNamedImportsOrExports(kind) {
var node = createNode(kind);
- node.elements = parseBracketedList(23, kind === 250 ? parseImportSpecifier : parseExportSpecifier, 17, 18);
+ node.elements = parseBracketedList(23, kind === 252 ? parseImportSpecifier : parseExportSpecifier, 18, 19);
return finishNode(node);
}
function parseExportSpecifier() {
- return parseImportOrExportSpecifier(255);
+ return parseImportOrExportSpecifier(257);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(251);
+ return parseImportOrExportSpecifier(253);
}
function parseImportOrExportSpecifier(kind) {
var node = createNode(kind);
@@ -17093,9 +17371,9 @@ var ts;
var checkIdentifierStart = scanner.getTokenPos();
var checkIdentifierEnd = scanner.getTextPos();
var identifierName = parseIdentifierName();
- if (token() === 118) {
+ if (token() === 119) {
node.propertyName = identifierName;
- parseExpected(118);
+ parseExpected(119);
checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
checkIdentifierStart = scanner.getTokenPos();
checkIdentifierEnd = scanner.getTextPos();
@@ -17104,21 +17382,21 @@ var ts;
else {
node.name = identifierName;
}
- if (kind === 251 && checkIdentifierIsKeyword) {
+ if (kind === 253 && checkIdentifierIsKeyword) {
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected);
}
return finishNode(node);
}
function parseExportDeclaration(node) {
- node.kind = 253;
- if (parseOptional(39)) {
- parseExpected(143);
+ node.kind = 255;
+ if (parseOptional(40)) {
+ parseExpected(144);
node.moduleSpecifier = parseModuleSpecifier();
}
else {
- node.exportClause = parseNamedImportsOrExports(254);
- if (token() === 143 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
- parseExpected(143);
+ node.exportClause = parseNamedImportsOrExports(256);
+ if (token() === 144 || (token() === 10 && !scanner.hasPrecedingLineBreak())) {
+ parseExpected(144);
node.moduleSpecifier = parseModuleSpecifier();
}
}
@@ -17126,12 +17404,12 @@ var ts;
return finishNode(node);
}
function parseExportAssignment(node) {
- node.kind = 252;
- if (parseOptional(58)) {
+ node.kind = 254;
+ if (parseOptional(59)) {
node.isExportEquals = true;
}
else {
- parseExpected(79);
+ parseExpected(80);
}
node.expression = parseAssignmentExpressionOrHigher();
parseSemicolon();
@@ -17144,10 +17422,10 @@ var ts;
}
function isAnExternalModuleIndicatorNode(node) {
return ts.hasModifier(node, 1)
- || node.kind === 246 && node.moduleReference.kind === 257
- || node.kind === 247
- || node.kind === 252
- || node.kind === 253
+ || node.kind === 248 && node.moduleReference.kind === 259
+ || node.kind === 249
+ || node.kind === 254
+ || node.kind === 255
? node
: undefined;
}
@@ -17160,7 +17438,7 @@ var ts;
return isImportMeta(node) ? node : forEachChild(node, walkTreeForExternalModuleIndicators);
}
function isImportMeta(node) {
- return ts.isMetaProperty(node) && node.keywordToken === 91 && node.name.escapedText === "meta";
+ return ts.isMetaProperty(node) && node.keywordToken === 92 && node.name.escapedText === "meta";
}
var JSDocParser;
(function (JSDocParser) {
@@ -17176,11 +17454,11 @@ var ts;
}
JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
function parseJSDocTypeExpression(mayOmitBraces) {
- var result = createNode(281);
- var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17);
+ var result = createNode(283);
+ var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18);
result.type = doInsideOfContext(2097152, parseJSDocType);
if (!mayOmitBraces || hasBrace) {
- parseExpected(18);
+ parseExpected(19);
}
fixupParentReferences(result);
return finishNode(result);
@@ -17251,7 +17529,7 @@ var ts;
}
loop: while (true) {
switch (token()) {
- case 57:
+ case 58:
if (state === 0 || state === 1) {
removeTrailingWhitespace(comments);
addTag(parseTag(indent));
@@ -17268,7 +17546,7 @@ var ts;
state = 0;
indent = 0;
break;
- case 39:
+ case 40:
var asterisk = scanner.getTokenText();
if (state === 1 || state === 2) {
state = 2;
@@ -17313,7 +17591,7 @@ var ts;
}
}
function createJSDocComment() {
- var result = createNode(289, start);
+ var result = createNode(291, start);
result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd);
result.comment = comments.length ? comments.join("") : undefined;
return finishNode(result, end);
@@ -17346,20 +17624,19 @@ var ts;
}
}
var precedingLineBreak = scanner.hasPrecedingLineBreak();
- while ((precedingLineBreak && token() === 39) || token() === 5 || token() === 4) {
+ while ((precedingLineBreak && token() === 40) || token() === 5 || token() === 4) {
if (token() === 4) {
precedingLineBreak = true;
}
- else if (token() === 39) {
+ else if (token() === 40) {
precedingLineBreak = false;
}
nextJSDocToken();
}
}
function parseTag(indent) {
- ts.Debug.assert(token() === 57);
- var atToken = createNode(57, scanner.getTokenPos());
- atToken.end = scanner.getTextPos();
+ ts.Debug.assert(token() === 58);
+ var start = scanner.getTokenPos();
nextJSDocToken();
var tagName = parseJSDocIdentifierName(undefined);
skipWhitespaceOrAsterisk();
@@ -17367,40 +17644,40 @@ var ts;
switch (tagName.escapedText) {
case "augments":
case "extends":
- tag = parseAugmentsTag(atToken, tagName);
+ tag = parseAugmentsTag(start, tagName);
break;
case "class":
case "constructor":
- tag = parseClassTag(atToken, tagName);
+ tag = parseClassTag(start, tagName);
break;
case "this":
- tag = parseThisTag(atToken, tagName);
+ tag = parseThisTag(start, tagName);
break;
case "enum":
- tag = parseEnumTag(atToken, tagName);
+ tag = parseEnumTag(start, tagName);
break;
case "arg":
case "argument":
case "param":
- return parseParameterOrPropertyTag(atToken, tagName, 2, indent);
+ return parseParameterOrPropertyTag(start, tagName, 2, indent);
case "return":
case "returns":
- tag = parseReturnTag(atToken, tagName);
+ tag = parseReturnTag(start, tagName);
break;
case "template":
- tag = parseTemplateTag(atToken, tagName);
+ tag = parseTemplateTag(start, tagName);
break;
case "type":
- tag = parseTypeTag(atToken, tagName);
+ tag = parseTypeTag(start, tagName);
break;
case "typedef":
- tag = parseTypedefTag(atToken, tagName, indent);
+ tag = parseTypedefTag(start, tagName, indent);
break;
case "callback":
- tag = parseCallbackTag(atToken, tagName, indent);
+ tag = parseCallbackTag(start, tagName, indent);
break;
default:
- tag = parseUnknownTag(atToken, tagName);
+ tag = parseUnknownTag(start, tagName);
break;
}
if (!tag.comment) {
@@ -17429,7 +17706,7 @@ var ts;
}
indent = 0;
break;
- case 57:
+ case 58:
scanner.setTextPos(scanner.getTextPos() - 1);
case 1:
break loop;
@@ -17445,9 +17722,9 @@ var ts;
indent += whitespace.length;
}
break;
- case 17:
+ case 18:
state = 2;
- if (lookAhead(function () { return nextJSDocToken() === 57 && ts.tokenIsIdentifierOrKeyword(nextJSDocToken()) && scanner.getTokenText() === "link"; })) {
+ if (lookAhead(function () { return nextJSDocToken() === 58 && ts.tokenIsIdentifierOrKeyword(nextJSDocToken()) && scanner.getTokenText() === "link"; })) {
pushComment(scanner.getTokenText());
nextJSDocToken();
pushComment(scanner.getTokenText());
@@ -17455,7 +17732,7 @@ var ts;
}
pushComment(scanner.getTokenText());
break;
- case 39:
+ case 40:
if (state === 0) {
state = 1;
indent += 1;
@@ -17472,9 +17749,8 @@ var ts;
removeTrailingWhitespace(comments);
return comments.length === 0 ? undefined : comments.join("");
}
- function parseUnknownTag(atToken, tagName) {
- var result = createNode(292, atToken.pos);
- result.atToken = atToken;
+ function parseUnknownTag(start, tagName) {
+ var result = createNode(294, start);
result.tagName = tagName;
return finishNode(result);
}
@@ -17493,34 +17769,34 @@ var ts;
}
function tryParseTypeExpression() {
skipWhitespaceOrAsterisk();
- return token() === 17 ? parseJSDocTypeExpression() : undefined;
+ return token() === 18 ? parseJSDocTypeExpression() : undefined;
}
function parseBracketNameInPropertyAndParamTag() {
- if (token() === 13) {
+ if (token() === 14) {
return { name: createIdentifier(true), isBracketed: false };
}
- var isBracketed = parseOptional(21);
+ var isBracketed = parseOptional(22);
var name = parseJSDocEntityName();
if (isBracketed) {
skipWhitespace();
- if (parseOptionalToken(58)) {
+ if (parseOptionalToken(59)) {
parseExpression();
}
- parseExpected(22);
+ parseExpected(23);
}
return { name: name, isBracketed: isBracketed };
}
function isObjectOrObjectArrayTypeReference(node) {
switch (node.kind) {
- case 135:
+ case 136:
return true;
- case 167:
+ case 169:
return isObjectOrObjectArrayTypeReference(node.elementType);
default:
return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object";
}
}
- function parseParameterOrPropertyTag(atToken, tagName, target, indent) {
+ function parseParameterOrPropertyTag(start, tagName, target, indent) {
var typeExpression = tryParseTypeExpression();
var isNameFirst = !typeExpression;
skipWhitespaceOrAsterisk();
@@ -17530,15 +17806,14 @@ var ts;
typeExpression = tryParseTypeExpression();
}
var result = target === 1 ?
- createNode(303, atToken.pos) :
- createNode(297, atToken.pos);
- var comment = parseTagComments(indent + scanner.getStartPos() - atToken.pos);
+ createNode(305, start) :
+ createNode(299, start);
+ var comment = parseTagComments(indent + scanner.getStartPos() - start);
var nestedTypeLiteral = target !== 4 && parseNestedTypeLiteral(typeExpression, name, target, indent);
if (nestedTypeLiteral) {
typeExpression = nestedTypeLiteral;
isNameFirst = true;
}
- result.atToken = atToken;
result.tagName = tagName;
result.typeExpression = typeExpression;
result.name = name;
@@ -17549,20 +17824,20 @@ var ts;
}
function parseNestedTypeLiteral(typeExpression, name, target, indent) {
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
- var typeLiteralExpression = createNode(281, scanner.getTokenPos());
+ var typeLiteralExpression = createNode(283, scanner.getTokenPos());
var child = void 0;
var jsdocTypeLiteral = void 0;
var start_2 = scanner.getStartPos();
var children = void 0;
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) {
- if (child.kind === 297 || child.kind === 303) {
+ if (child.kind === 299 || child.kind === 305) {
children = ts.append(children, child);
}
}
if (children) {
- jsdocTypeLiteral = createNode(290, start_2);
+ jsdocTypeLiteral = createNode(292, start_2);
jsdocTypeLiteral.jsDocPropertyTags = children;
- if (typeExpression.type.kind === 167) {
+ if (typeExpression.type.kind === 169) {
jsdocTypeLiteral.isArrayType = true;
}
typeLiteralExpression.type = finishNode(jsdocTypeLiteral);
@@ -17570,81 +17845,74 @@ var ts;
}
}
}
- function parseReturnTag(atToken, tagName) {
- if (ts.forEach(tags, function (t) { return t.kind === 298; })) {
+ function parseReturnTag(start, tagName) {
+ if (ts.forEach(tags, function (t) { return t.kind === 300; })) {
parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
}
- var result = createNode(298, atToken.pos);
- result.atToken = atToken;
+ var result = createNode(300, start);
result.tagName = tagName;
result.typeExpression = tryParseTypeExpression();
return finishNode(result);
}
- function parseTypeTag(atToken, tagName) {
- if (ts.forEach(tags, function (t) { return t.kind === 300; })) {
+ function parseTypeTag(start, tagName) {
+ if (ts.forEach(tags, function (t) { return t.kind === 302; })) {
parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
}
- var result = createNode(300, atToken.pos);
- result.atToken = atToken;
+ var result = createNode(302, start);
result.tagName = tagName;
result.typeExpression = parseJSDocTypeExpression(true);
return finishNode(result);
}
- function parseAugmentsTag(atToken, tagName) {
- var result = createNode(293, atToken.pos);
- result.atToken = atToken;
+ function parseAugmentsTag(start, tagName) {
+ var result = createNode(295, start);
result.tagName = tagName;
result.class = parseExpressionWithTypeArgumentsForAugments();
return finishNode(result);
}
function parseExpressionWithTypeArgumentsForAugments() {
- var usedBrace = parseOptional(17);
- var node = createNode(209);
+ var usedBrace = parseOptional(18);
+ var node = createNode(211);
node.expression = parsePropertyAccessEntityNameExpression();
node.typeArguments = tryParseTypeArguments();
var res = finishNode(node);
if (usedBrace) {
- parseExpected(18);
+ parseExpected(19);
}
return res;
}
function parsePropertyAccessEntityNameExpression() {
var node = parseJSDocIdentifierName();
- while (parseOptional(23)) {
- var prop = createNode(187, node.pos);
+ while (parseOptional(24)) {
+ var prop = createNode(189, node.pos);
prop.expression = node;
prop.name = parseJSDocIdentifierName();
node = finishNode(prop);
}
return node;
}
- function parseClassTag(atToken, tagName) {
- var tag = createNode(294, atToken.pos);
- tag.atToken = atToken;
+ function parseClassTag(start, tagName) {
+ var tag = createNode(296, start);
tag.tagName = tagName;
return finishNode(tag);
}
- function parseThisTag(atToken, tagName) {
- var tag = createNode(299, atToken.pos);
- tag.atToken = atToken;
+ function parseThisTag(start, tagName) {
+ var tag = createNode(301, start);
tag.tagName = tagName;
tag.typeExpression = parseJSDocTypeExpression(true);
skipWhitespace();
return finishNode(tag);
}
- function parseEnumTag(atToken, tagName) {
- var tag = createNode(296, atToken.pos);
- tag.atToken = atToken;
+ function parseEnumTag(start, tagName) {
+ var tag = createNode(298, start);
tag.tagName = tagName;
tag.typeExpression = parseJSDocTypeExpression(true);
skipWhitespace();
return finishNode(tag);
}
- function parseTypedefTag(atToken, tagName, indent) {
+ function parseTypedefTag(start, tagName, indent) {
var typeExpression = tryParseTypeExpression();
skipWhitespaceOrAsterisk();
- var typedefTag = createNode(302, atToken.pos);
- typedefTag.atToken = atToken;
+ var typedefTag = createNode(304, start);
typedefTag.tagName = tagName;
typedefTag.fullName = parseJSDocTypeNameWithNamespace();
typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName);
@@ -17656,12 +17924,11 @@ var ts;
var child = void 0;
var jsdocTypeLiteral = void 0;
var childTypeTag = void 0;
- var start_3 = atToken.pos;
while (child = tryParse(function () { return parseChildPropertyTag(indent); })) {
if (!jsdocTypeLiteral) {
- jsdocTypeLiteral = createNode(290, start_3);
+ jsdocTypeLiteral = createNode(292, start);
}
- if (child.kind === 300) {
+ if (child.kind === 302) {
if (childTypeTag) {
break;
}
@@ -17674,7 +17941,7 @@ var ts;
}
}
if (jsdocTypeLiteral) {
- if (typeExpression && typeExpression.type.kind === 167) {
+ if (typeExpression && typeExpression.type.kind === 169) {
jsdocTypeLiteral.isArrayType = true;
}
typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ?
@@ -17691,8 +17958,8 @@ var ts;
return undefined;
}
var typeNameOrNamespaceName = parseJSDocIdentifierName();
- if (parseOptional(23)) {
- var jsDocNamespaceNode = createNode(242, pos);
+ if (parseOptional(24)) {
+ var jsDocNamespaceNode = createNode(244, pos);
if (nested) {
jsDocNamespaceNode.flags |= 4;
}
@@ -17705,25 +17972,23 @@ var ts;
}
return typeNameOrNamespaceName;
}
- function parseCallbackTag(atToken, tagName, indent) {
- var callbackTag = createNode(295, atToken.pos);
- callbackTag.atToken = atToken;
+ function parseCallbackTag(start, tagName, indent) {
+ var callbackTag = createNode(297, start);
callbackTag.tagName = tagName;
callbackTag.fullName = parseJSDocTypeNameWithNamespace();
callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName);
skipWhitespace();
callbackTag.comment = parseTagComments(indent);
var child;
- var start = scanner.getStartPos();
- var jsdocSignature = createNode(291, start);
+ var jsdocSignature = createNode(293, start);
jsdocSignature.parameters = [];
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4, indent); })) {
jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child);
}
var returnTag = tryParse(function () {
- if (parseOptionalJsdoc(57)) {
+ if (parseOptionalJsdoc(58)) {
var tag = parseTag(indent);
- if (tag && tag.kind === 298) {
+ if (tag && tag.kind === 300) {
return tag;
}
}
@@ -17765,10 +18030,10 @@ var ts;
var seenAsterisk = false;
while (true) {
switch (nextJSDocToken()) {
- case 57:
+ case 58:
if (canParseTag) {
var child = tryParseChildTag(target, indent);
- if (child && (child.kind === 297 || child.kind === 303) &&
+ if (child && (child.kind === 299 || child.kind === 305) &&
target !== 4 &&
name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
@@ -17781,13 +18046,13 @@ var ts;
canParseTag = true;
seenAsterisk = false;
break;
- case 39:
+ case 40:
if (seenAsterisk) {
canParseTag = false;
}
seenAsterisk = true;
break;
- case 71:
+ case 72:
canParseTag = false;
break;
case 1:
@@ -17796,16 +18061,15 @@ var ts;
}
}
function tryParseChildTag(target, indent) {
- ts.Debug.assert(token() === 57);
- var atToken = createNode(57);
- atToken.end = scanner.getTextPos();
+ ts.Debug.assert(token() === 58);
+ var start = scanner.getStartPos();
nextJSDocToken();
var tagName = parseJSDocIdentifierName();
skipWhitespace();
var t;
switch (tagName.escapedText) {
case "type":
- return target === 1 && parseTypeTag(atToken, tagName);
+ return target === 1 && parseTypeTag(start, tagName);
case "prop":
case "property":
t = 1;
@@ -17821,25 +18085,24 @@ var ts;
if (!(target & t)) {
return false;
}
- return parseParameterOrPropertyTag(atToken, tagName, target, indent);
+ return parseParameterOrPropertyTag(start, tagName, target, indent);
}
- function parseTemplateTag(atToken, tagName) {
+ function parseTemplateTag(start, tagName) {
var constraint;
- if (token() === 17) {
+ if (token() === 18) {
constraint = parseJSDocTypeExpression();
}
var typeParameters = [];
var typeParametersPos = getNodePos();
do {
skipWhitespace();
- var typeParameter = createNode(148);
+ var typeParameter = createNode(150);
typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
finishNode(typeParameter);
skipWhitespace();
typeParameters.push(typeParameter);
- } while (parseOptionalJsdoc(26));
- var result = createNode(301, atToken.pos);
- result.atToken = atToken;
+ } while (parseOptionalJsdoc(27));
+ var result = createNode(303, start);
result.tagName = tagName;
result.constraint = constraint;
result.typeParameters = createNodeArray(typeParameters, typeParametersPos);
@@ -17858,13 +18121,13 @@ var ts;
}
function parseJSDocEntityName() {
var entity = parseJSDocIdentifierName();
- if (parseOptional(21)) {
- parseExpected(22);
+ if (parseOptional(22)) {
+ parseExpected(23);
}
- while (parseOptional(23)) {
+ while (parseOptional(24)) {
var name = parseJSDocIdentifierName();
- if (parseOptional(21)) {
- parseExpected(22);
+ if (parseOptional(22)) {
+ parseExpected(23);
}
entity = createQualifiedName(entity, name);
}
@@ -17872,11 +18135,11 @@ var ts;
}
function parseJSDocIdentifierName(message) {
if (!ts.tokenIsIdentifierOrKeyword(token())) {
- return createMissingNode(71, !message, message || ts.Diagnostics.Identifier_expected);
+ return createMissingNode(72, !message, message || ts.Diagnostics.Identifier_expected);
}
var pos = scanner.getTokenPos();
var end = scanner.getTextPos();
- var result = createNode(71, pos);
+ var result = createNode(72, pos);
result.escapedText = ts.escapeLeadingUnderscores(scanner.getTokenText());
finishNode(result, end);
nextJSDocToken();
@@ -17955,9 +18218,9 @@ var ts;
}
function shouldCheckNode(node) {
switch (node.kind) {
- case 9:
+ case 10:
case 8:
- case 71:
+ case 72:
return true;
}
return false;
@@ -18380,10 +18643,10 @@ var ts;
if (lhs.kind !== rhs.kind) {
return false;
}
- if (lhs.kind === 71) {
+ if (lhs.kind === 72) {
return lhs.escapedText === rhs.escapedText;
}
- if (lhs.kind === 99) {
+ if (lhs.kind === 100) {
return true;
}
return lhs.name.escapedText === rhs.name.escapedText &&
@@ -18429,7 +18692,8 @@ var ts;
["esnext.array", "lib.esnext.array.d.ts"],
["esnext.symbol", "lib.esnext.symbol.d.ts"],
["esnext.asynciterable", "lib.esnext.asynciterable.d.ts"],
- ["esnext.intl", "lib.esnext.intl.d.ts"]
+ ["esnext.intl", "lib.esnext.intl.d.ts"],
+ ["esnext.bigint", "lib.esnext.bigint.d.ts"]
];
ts.libs = libEntries.map(function (entry) { return entry[0]; });
ts.libMap = ts.createMapFromEntries(libEntries);
@@ -18474,6 +18738,13 @@ var ts;
category: ts.Diagnostics.Advanced_Options,
description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation
},
+ {
+ name: "pretty",
+ type: "boolean",
+ showInSimplifiedHelpView: true,
+ category: ts.Diagnostics.Command_line_Options,
+ description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental
+ },
{
name: "traceResolution",
type: "boolean",
@@ -18523,11 +18794,11 @@ var ts;
description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date
},
{
- name: "pretty",
+ name: "showConfig",
type: "boolean",
- showInSimplifiedHelpView: true,
category: ts.Diagnostics.Command_line_Options,
- description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental
+ isCommandLineOnly: true,
+ description: ts.Diagnostics.Print_the_final_configuration_instead_of_building
},
{
name: "target",
@@ -19108,6 +19379,7 @@ var ts;
{
name: "maxNodeModuleJsDepth",
type: "number",
+ affectsModuleResolution: true,
category: ts.Diagnostics.Advanced_Options,
description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files
},
@@ -19523,6 +19795,9 @@ var ts;
}
var result = ts.parseJsonText(configFileName, configFileText);
var cwd = host.getCurrentDirectory();
+ result.path = ts.toPath(configFileName, cwd, ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames));
+ result.resolvedPath = result.path;
+ result.originalFileName = result.fileName;
return parseJsonSourceFileConfigFileContent(result, host, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), cwd), optionsToExtend, ts.getNormalizedAbsolutePath(configFileName, cwd));
}
ts.getParsedCommandLineOfConfigFile = getParsedCommandLineOfConfigFile;
@@ -19640,7 +19915,7 @@ var ts;
var result = returnValue ? {} : undefined;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var element = _a[_i];
- if (element.kind !== 273) {
+ if (element.kind !== 275) {
errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected));
continue;
}
@@ -19690,16 +19965,16 @@ var ts;
}
function convertPropertyValueToJson(valueExpression, option) {
switch (valueExpression.kind) {
- case 101:
+ case 102:
reportInvalidOptionValue(option && option.type !== "boolean");
return true;
- case 86:
+ case 87:
reportInvalidOptionValue(option && option.type !== "boolean");
return false;
- case 95:
+ case 96:
reportInvalidOptionValue(option && option.name === "extends");
return null;
- case 9:
+ case 10:
if (!isDoubleQuotedString(valueExpression)) {
errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, ts.Diagnostics.String_literal_with_double_quotes_expected));
}
@@ -19715,13 +19990,13 @@ var ts;
case 8:
reportInvalidOptionValue(option && option.type !== "number");
return Number(valueExpression.text);
- case 200:
- if (valueExpression.operator !== 38 || valueExpression.operand.kind !== 8) {
+ case 202:
+ if (valueExpression.operator !== 39 || valueExpression.operand.kind !== 8) {
break;
}
reportInvalidOptionValue(option && option.type !== "number");
return -Number(valueExpression.operand.text);
- case 186:
+ case 188:
reportInvalidOptionValue(option && option.type !== "object");
var objectLiteralExpression = valueExpression;
if (option) {
@@ -19731,7 +20006,7 @@ var ts;
else {
return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined);
}
- case 185:
+ case 187:
reportInvalidOptionValue(option && option.type !== "list");
return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element);
}
@@ -19770,59 +20045,105 @@ var ts;
}
return false;
}
+ function convertToTSConfig(configParseResult, configFileName, host) {
+ var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames);
+ var files = ts.map(ts.filter(configParseResult.fileNames, !configParseResult.configFileSpecs ? function (_) { return false; } : matchesSpecs(configFileName, configParseResult.configFileSpecs.validatedIncludeSpecs, configParseResult.configFileSpecs.validatedExcludeSpecs)), function (f) { return ts.getRelativePathFromFile(ts.getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), f, getCanonicalFileName); });
+ var optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: ts.getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames });
+ var config = __assign({ compilerOptions: __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) {
+ var _a;
+ return (__assign({}, prev, (_a = {}, _a[cur[0]] = cur[1], _a)));
+ }, {}), { showConfig: undefined, configFile: undefined, configFilePath: undefined, help: undefined, init: undefined, listFiles: undefined, listEmittedFiles: undefined, project: undefined }), references: ts.map(configParseResult.projectReferences, function (r) { return (__assign({}, r, { path: r.originalPath, originalPath: undefined })); }), files: ts.length(files) ? files : undefined }, (configParseResult.configFileSpecs ? {
+ include: filterSameAsDefaultInclude(configParseResult.configFileSpecs.validatedIncludeSpecs),
+ exclude: configParseResult.configFileSpecs.validatedExcludeSpecs
+ } : {}), { compilerOnSave: !!configParseResult.compileOnSave ? true : undefined });
+ return config;
+ }
+ ts.convertToTSConfig = convertToTSConfig;
+ function filterSameAsDefaultInclude(specs) {
+ if (!ts.length(specs))
+ return undefined;
+ if (ts.length(specs) !== 1)
+ return specs;
+ if (specs[0] === "**/*")
+ return undefined;
+ return specs;
+ }
+ function matchesSpecs(path, includeSpecs, excludeSpecs) {
+ if (!includeSpecs)
+ return function (_) { return false; };
+ var patterns = ts.getFileMatcherPatterns(path, excludeSpecs, includeSpecs, ts.sys.useCaseSensitiveFileNames, ts.sys.getCurrentDirectory());
+ var excludeRe = patterns.excludePattern && ts.getRegexFromPattern(patterns.excludePattern, ts.sys.useCaseSensitiveFileNames);
+ var includeRe = patterns.includeFilePattern && ts.getRegexFromPattern(patterns.includeFilePattern, ts.sys.useCaseSensitiveFileNames);
+ if (includeRe) {
+ if (excludeRe) {
+ return function (path) { return includeRe.test(path) && !excludeRe.test(path); };
+ }
+ return function (path) { return includeRe.test(path); };
+ }
+ if (excludeRe) {
+ return function (path) { return !excludeRe.test(path); };
+ }
+ return function (_) { return false; };
+ }
+ function getCustomTypeMapOfCommandLineOption(optionDefinition) {
+ if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") {
+ return undefined;
+ }
+ else if (optionDefinition.type === "list") {
+ return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
+ }
+ else {
+ return optionDefinition.type;
+ }
+ }
+ function getNameOfCompilerOptionValue(value, customTypeMap) {
+ return ts.forEachEntry(customTypeMap, function (mapValue, key) {
+ if (mapValue === value) {
+ return key;
+ }
+ });
+ }
+ function serializeCompilerOptions(options, pathOptions) {
+ var result = ts.createMap();
+ var optionsNameMap = getOptionNameMap().optionNameMap;
+ var getCanonicalFileName = pathOptions && ts.createGetCanonicalFileName(pathOptions.useCaseSensitiveFileNames);
+ var _loop_3 = function (name) {
+ if (ts.hasProperty(options, name)) {
+ if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) {
+ return "continue";
+ }
+ var value = options[name];
+ var optionDefinition = optionsNameMap.get(name.toLowerCase());
+ if (optionDefinition) {
+ var customTypeMap_1 = getCustomTypeMapOfCommandLineOption(optionDefinition);
+ if (!customTypeMap_1) {
+ if (pathOptions && optionDefinition.isFilePath) {
+ result.set(name, ts.getRelativePathFromFile(pathOptions.configFilePath, ts.getNormalizedAbsolutePath(value, ts.getDirectoryPath(pathOptions.configFilePath)), getCanonicalFileName));
+ }
+ else {
+ result.set(name, value);
+ }
+ }
+ else {
+ if (optionDefinition.type === "list") {
+ result.set(name, value.map(function (element) { return getNameOfCompilerOptionValue(element, customTypeMap_1); }));
+ }
+ else {
+ result.set(name, getNameOfCompilerOptionValue(value, customTypeMap_1));
+ }
+ }
+ }
+ }
+ };
+ for (var name in options) {
+ _loop_3(name);
+ }
+ return result;
+ }
function generateTSConfig(options, fileNames, newLine) {
var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
var compilerOptionsMap = serializeCompilerOptions(compilerOptions);
return writeConfigurations();
- function getCustomTypeMapOfCommandLineOption(optionDefinition) {
- if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") {
- return undefined;
- }
- else if (optionDefinition.type === "list") {
- return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
- }
- else {
- return optionDefinition.type;
- }
- }
- function getNameOfCompilerOptionValue(value, customTypeMap) {
- return ts.forEachEntry(customTypeMap, function (mapValue, key) {
- if (mapValue === value) {
- return key;
- }
- });
- }
- function serializeCompilerOptions(options) {
- var result = ts.createMap();
- var optionsNameMap = getOptionNameMap().optionNameMap;
- var _loop_3 = function (name) {
- if (ts.hasProperty(options, name)) {
- if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) {
- return "continue";
- }
- var value = options[name];
- var optionDefinition = optionsNameMap.get(name.toLowerCase());
- if (optionDefinition) {
- var customTypeMap_1 = getCustomTypeMapOfCommandLineOption(optionDefinition);
- if (!customTypeMap_1) {
- result.set(name, value);
- }
- else {
- if (optionDefinition.type === "list") {
- result.set(name, value.map(function (element) { return getNameOfCompilerOptionValue(element, customTypeMap_1); }));
- }
- else {
- result.set(name, getNameOfCompilerOptionValue(value, customTypeMap_1));
- }
- }
- }
- }
- };
- for (var name in options) {
- _loop_3(name);
- }
- return result;
- }
function getDefaultValueForOption(option) {
switch (option.type) {
case "number":
@@ -20168,19 +20489,23 @@ var ts;
}
function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) {
extendedConfig = ts.normalizeSlashes(extendedConfig);
- if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../"))) {
- errors.push(createDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig));
- return undefined;
- }
- var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
- if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) {
- extendedConfigPath = extendedConfigPath + ".json";
- if (!host.fileExists(extendedConfigPath)) {
- errors.push(createDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig));
- return undefined;
+ if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
+ var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
+ if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) {
+ extendedConfigPath = extendedConfigPath + ".json";
+ if (!host.fileExists(extendedConfigPath)) {
+ errors.push(createDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig));
+ return undefined;
+ }
}
+ return extendedConfigPath;
}
- return extendedConfigPath;
+ var resolved = ts.nodeModuleNameResolver(extendedConfig, ts.combinePaths(basePath, "tsconfig.json"), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, undefined, undefined, true);
+ if (resolved.resolvedModule) {
+ return resolved.resolvedModule.resolvedFileName;
+ }
+ errors.push(createDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig));
+ return undefined;
}
function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors) {
var _a;
@@ -20557,7 +20882,8 @@ var ts;
Extensions[Extensions["TypeScript"] = 0] = "TypeScript";
Extensions[Extensions["JavaScript"] = 1] = "JavaScript";
Extensions[Extensions["Json"] = 2] = "Json";
- Extensions[Extensions["DtsOnly"] = 3] = "DtsOnly";
+ Extensions[Extensions["TSConfig"] = 3] = "TSConfig";
+ Extensions[Extensions["DtsOnly"] = 4] = "DtsOnly";
})(Extensions || (Extensions = {}));
function resolvedTypeScriptOnly(resolved) {
if (!resolved) {
@@ -20602,6 +20928,9 @@ var ts;
return readPackageJsonPathField(jsonContent, "typings", baseDirectory, state)
|| readPackageJsonPathField(jsonContent, "types", baseDirectory, state);
}
+ function readPackageJsonTSConfigField(jsonContent, baseDirectory, state) {
+ return readPackageJsonPathField(jsonContent, "tsconfig", baseDirectory, state);
+ }
function readPackageJsonMainField(jsonContent, baseDirectory, state) {
return readPackageJsonPathField(jsonContent, "main", baseDirectory, state);
}
@@ -20689,8 +21018,11 @@ var ts;
return typeRoots;
}
var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types");
- function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) {
+ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference) {
var traceEnabled = isTraceEnabled(options, host);
+ if (redirectedReference) {
+ options = redirectedReference.commandLine.options;
+ }
var failedLookupLocations = [];
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };
var typeRoots = getEffectiveTypeRoots(options, host);
@@ -20711,6 +21043,9 @@ var ts;
trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, typeReferenceDirectiveName, containingFile, typeRoots);
}
}
+ if (redirectedReference) {
+ trace(host, ts.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName);
+ }
}
var resolved = primaryLookup();
var primary = true;
@@ -20720,13 +21055,12 @@ var ts;
}
var resolvedTypeReferenceDirective;
if (resolved) {
- if (!options.preserveSymlinks) {
- resolved = __assign({}, resolved, { fileName: realPath(resolved.fileName, host, traceEnabled) });
- }
+ var fileName = resolved.fileName, packageId = resolved.packageId;
+ var resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled);
if (traceEnabled) {
- trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolved.fileName, primary);
+ trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolvedFileName, primary);
}
- resolvedTypeReferenceDirective = { primary: primary, resolvedFileName: resolved.fileName, packageId: resolved.packageId };
+ resolvedTypeReferenceDirective = { primary: primary, resolvedFileName: resolvedFileName, packageId: packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) };
}
return { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };
function primaryLookup() {
@@ -20734,7 +21068,7 @@ var ts;
if (traceEnabled) {
trace(host, ts.Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", "));
}
- return ts.forEach(typeRoots, function (typeRoot) {
+ return ts.firstDefined(typeRoots, function (typeRoot) {
var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName);
var candidateDirectory = ts.getDirectoryPath(candidate);
var directoryExists = ts.directoryProbablyExists(candidateDirectory, host);
@@ -20758,13 +21092,14 @@ var ts;
}
var result = void 0;
if (!ts.isExternalModuleNameRelative(typeReferenceDirectiveName)) {
- result = loadModuleFromNearestNodeModulesDirectory(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, undefined);
+ var searchResult = loadModuleFromNearestNodeModulesDirectory(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, undefined, undefined);
+ result = searchResult && searchResult.value;
}
else {
var candidate = ts.normalizePathAndParts(ts.combinePaths(initialLocationForSecondaryLookup, typeReferenceDirectiveName)).path;
- result = toSearchResult(nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, false, moduleResolutionState, true));
+ result = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, false, moduleResolutionState, true);
}
- var resolvedFile = resolvedTypeScriptOnly(result && result.value);
+ var resolvedFile = resolvedTypeScriptOnly(result);
if (!resolvedFile && traceEnabled) {
trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName);
}
@@ -20809,28 +21144,54 @@ var ts;
}
ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames;
function createModuleResolutionCache(currentDirectory, getCanonicalFileName) {
- return createModuleResolutionCacheWithMaps(ts.createMap(), ts.createMap(), currentDirectory, getCanonicalFileName);
+ return createModuleResolutionCacheWithMaps(createCacheWithRedirects(), createCacheWithRedirects(), currentDirectory, getCanonicalFileName);
}
ts.createModuleResolutionCache = createModuleResolutionCache;
+ function createCacheWithRedirects() {
+ var ownMap = ts.createMap();
+ var redirectsMap = ts.createMap();
+ return {
+ ownMap: ownMap,
+ redirectsMap: redirectsMap,
+ getOrCreateMapOfCacheRedirects: getOrCreateMapOfCacheRedirects,
+ clear: clear
+ };
+ function getOrCreateMapOfCacheRedirects(redirectedReference) {
+ if (!redirectedReference) {
+ return ownMap;
+ }
+ var path = redirectedReference.sourceFile.path;
+ var redirects = redirectsMap.get(path);
+ if (!redirects) {
+ redirects = ts.createMap();
+ redirectsMap.set(path, redirects);
+ }
+ return redirects;
+ }
+ function clear() {
+ ownMap.clear();
+ redirectsMap.clear();
+ }
+ }
+ ts.createCacheWithRedirects = createCacheWithRedirects;
function createModuleResolutionCacheWithMaps(directoryToModuleNameMap, moduleNameToDirectoryMap, currentDirectory, getCanonicalFileName) {
return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName };
- function getOrCreateCacheForDirectory(directoryName) {
+ function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName);
- var perFolderCache = directoryToModuleNameMap.get(path);
- if (!perFolderCache) {
- perFolderCache = ts.createMap();
- directoryToModuleNameMap.set(path, perFolderCache);
- }
- return perFolderCache;
+ return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, ts.createMap);
}
- function getOrCreateCacheForModuleName(nonRelativeModuleName) {
+ function getOrCreateCacheForModuleName(nonRelativeModuleName, redirectedReference) {
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
- var perModuleNameCache = moduleNameToDirectoryMap.get(nonRelativeModuleName);
- if (!perModuleNameCache) {
- perModuleNameCache = createPerModuleNameCache();
- moduleNameToDirectoryMap.set(nonRelativeModuleName, perModuleNameCache);
+ return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, nonRelativeModuleName, createPerModuleNameCache);
+ }
+ function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create) {
+ var cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
+ var result = cache.get(key);
+ if (!result) {
+ result = create();
+ cache.set(key, result);
}
- return perModuleNameCache;
+ return result;
}
function createPerModuleNameCache() {
var directoryPathMap = ts.createMap();
@@ -20886,13 +21247,19 @@ var ts;
return perFolderCache && perFolderCache.get(moduleName);
}
ts.resolveModuleNameFromCache = resolveModuleNameFromCache;
- function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) {
+ function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
var traceEnabled = isTraceEnabled(compilerOptions, host);
+ if (redirectedReference) {
+ compilerOptions = redirectedReference.commandLine.options;
+ }
if (traceEnabled) {
trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile);
+ if (redirectedReference) {
+ trace(host, ts.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName);
+ }
}
var containingDirectory = ts.getDirectoryPath(containingFile);
- var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory);
+ var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference);
var result = perFolderCache && perFolderCache.get(moduleName);
if (result) {
if (traceEnabled) {
@@ -20914,10 +21281,10 @@ var ts;
}
switch (moduleResolution) {
case ts.ModuleResolutionKind.NodeJs:
- result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache);
+ result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
break;
case ts.ModuleResolutionKind.Classic:
- result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache);
+ result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
break;
default:
return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
@@ -20925,7 +21292,7 @@ var ts;
if (perFolderCache) {
perFolderCache.set(moduleName, result);
if (!ts.isExternalModuleNameRelative(moduleName)) {
- cache.getOrCreateCacheForModuleName(moduleName).set(containingDirectory, result);
+ cache.getOrCreateCacheForModuleName(moduleName, redirectedReference).set(containingDirectory, result);
}
}
}
@@ -20941,6 +21308,9 @@ var ts;
}
ts.resolveModuleName = resolveModuleName;
function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state) {
+ var resolved = tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state);
+ if (resolved)
+ return resolved.value;
if (!ts.isExternalModuleNameRelative(moduleName)) {
return tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, state);
}
@@ -20948,6 +21318,16 @@ var ts;
return tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state);
}
}
+ function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) {
+ var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths;
+ if (baseUrl && paths && !ts.pathIsRelative(moduleName)) {
+ if (state.traceEnabled) {
+ trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName);
+ trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);
+ }
+ return tryLoadModuleUsingPaths(extensions, moduleName, baseUrl, paths, loader, false, state);
+ }
+ }
function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) {
if (!state.compilerOptions.rootDirs) {
return undefined;
@@ -21011,22 +21391,13 @@ var ts;
return undefined;
}
function tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, state) {
- var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths;
+ var baseUrl = state.compilerOptions.baseUrl;
if (!baseUrl) {
return undefined;
}
if (state.traceEnabled) {
trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName);
}
- if (paths) {
- if (state.traceEnabled) {
- trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);
- }
- var resolved = tryLoadModuleUsingPaths(extensions, moduleName, baseUrl, paths, loader, false, state);
- if (resolved) {
- return resolved.value;
- }
- }
var candidate = ts.normalizePath(ts.combinePaths(baseUrl, moduleName));
if (state.traceEnabled) {
trace(state.host, ts.Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName, baseUrl, candidate);
@@ -21046,22 +21417,22 @@ var ts;
return resolvedModule && resolvedModule.resolvedFileName;
}
ts.tryResolveJSModule = tryResolveJSModule;
+ var jsOnlyExtensions = [Extensions.JavaScript];
+ var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
+ var tsPlusJsonExtensions = tsExtensions.concat([Extensions.Json]);
+ var tsconfigExtensions = [Extensions.TSConfig];
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
- return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, true);
+ return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
}
- function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache) {
- return nodeModuleNameResolverWorker(moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, false);
+ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) {
+ return nodeModuleNameResolverWorker(moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, lookupConfig ? tsconfigExtensions : (compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions), redirectedReference);
}
ts.nodeModuleNameResolver = nodeModuleNameResolver;
- function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, jsOnly) {
+ function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
var traceEnabled = isTraceEnabled(compilerOptions, host);
var failedLookupLocations = [];
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };
- var result = jsOnly ?
- tryResolve(Extensions.JavaScript) :
- (tryResolve(Extensions.TypeScript) ||
- tryResolve(Extensions.JavaScript) ||
- (compilerOptions.resolveJsonModule ? tryResolve(Extensions.Json) : undefined));
+ var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
if (result && result.value) {
var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport;
return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations);
@@ -21071,13 +21442,13 @@ var ts;
var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, true); };
var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state);
if (resolved) {
- return toSearchResult({ resolved: resolved, isExternalLibraryImport: ts.stringContains(resolved.path, ts.nodeModulesPathPart) });
+ return toSearchResult({ resolved: resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
}
if (!ts.isExternalModuleNameRelative(moduleName)) {
if (traceEnabled) {
trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]);
}
- var resolved_1 = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache);
+ var resolved_1 = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference);
if (!resolved_1)
return undefined;
var resolvedValue = resolved_1.value;
@@ -21140,6 +21511,10 @@ var ts;
return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson);
}
ts.nodeModulesPathPart = "/node_modules/";
+ function pathContainsNodeModules(path) {
+ return ts.stringContains(path, ts.nodeModulesPathPart);
+ }
+ ts.pathContainsNodeModules = pathContainsNodeModules;
function parseNodeModuleFromPath(resolved) {
var path = ts.normalizePath(resolved.path);
var idx = path.lastIndexOf(ts.nodeModulesPathPart);
@@ -21175,9 +21550,9 @@ var ts;
return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
}
function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
- if (extensions === Extensions.Json) {
+ if (extensions === Extensions.Json || extensions === Extensions.TSConfig) {
var extensionLess = ts.tryRemoveExtension(candidate, ".json");
- return extensionLess === undefined ? undefined : tryAddingExtensions(extensionLess, extensions, onlyRecordFailures, state);
+ return (extensionLess === undefined && extensions === Extensions.Json) ? undefined : tryAddingExtensions(extensionLess || candidate, extensions, onlyRecordFailures, state);
}
var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, onlyRecordFailures, state);
if (resolvedByAddingExtension) {
@@ -21206,6 +21581,7 @@ var ts;
return tryExtension(".ts") || tryExtension(".tsx") || tryExtension(".d.ts");
case Extensions.JavaScript:
return tryExtension(".js") || tryExtension(".jsx");
+ case Extensions.TSConfig:
case Extensions.Json:
return tryExtension(".json");
}
@@ -21288,10 +21664,26 @@ var ts;
}
}
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
- var packageFile = jsonContent && (extensions !== Extensions.JavaScript && extensions !== Extensions.Json
- ? readPackageJsonTypesFields(jsonContent, candidate, state) ||
- (extensions === Extensions.TypeScript ? readPackageJsonMainField(jsonContent, candidate, state) : undefined)
- : readPackageJsonMainField(jsonContent, candidate, state));
+ var packageFile;
+ if (jsonContent) {
+ switch (extensions) {
+ case Extensions.JavaScript:
+ case Extensions.Json:
+ packageFile = readPackageJsonMainField(jsonContent, candidate, state);
+ break;
+ case Extensions.TypeScript:
+ packageFile = readPackageJsonTypesFields(jsonContent, candidate, state) || readPackageJsonMainField(jsonContent, candidate, state);
+ break;
+ case Extensions.DtsOnly:
+ packageFile = readPackageJsonTypesFields(jsonContent, candidate, state);
+ break;
+ case Extensions.TSConfig:
+ packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
+ break;
+ default:
+ return ts.Debug.assertNever(extensions);
+ }
+ }
var loader = function (extensions, candidate, onlyRecordFailures, state) {
var fromFile = tryFile(candidate, onlyRecordFailures, state);
if (fromFile) {
@@ -21308,7 +21700,7 @@ var ts;
};
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
- var indexPath = ts.combinePaths(candidate, "index");
+ var indexPath = ts.combinePaths(candidate, extensions === Extensions.TSConfig ? "tsconfig" : "index");
if (versionPaths && (!packageFile || ts.containsPath(candidate, packageFile))) {
var moduleName = ts.getRelativePathFromDirectory(candidate, packageFile || indexPath, false);
if (state.traceEnabled) {
@@ -21332,6 +21724,7 @@ var ts;
switch (extensions) {
case Extensions.JavaScript:
return extension === ".js" || extension === ".jsx";
+ case Extensions.TSConfig:
case Extensions.Json:
return extension === ".json";
case Extensions.TypeScript:
@@ -21348,14 +21741,14 @@ var ts;
return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) };
}
ts.parsePackageName = parsePackageName;
- function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache) {
- return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, false, cache);
+ function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache, redirectedReference) {
+ return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, false, cache, redirectedReference);
}
function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directory, state) {
- return loadModuleFromNearestNodeModulesDirectoryWorker(Extensions.DtsOnly, moduleName, directory, state, true, undefined);
+ return loadModuleFromNearestNodeModulesDirectoryWorker(Extensions.DtsOnly, moduleName, directory, state, true, undefined, undefined);
}
- function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache) {
- var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName);
+ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
+ var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, redirectedReference);
return ts.forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) {
if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") {
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);
@@ -21376,7 +21769,7 @@ var ts;
if (packageResult) {
return packageResult;
}
- if (extensions !== Extensions.JavaScript && extensions !== Extensions.Json) {
+ if (extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) {
var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, "@types");
var nodeModulesAtTypesExists = nodeModulesFolderExists;
if (nodeModulesFolderExists && !ts.directoryProbablyExists(nodeModulesAtTypes_1, state.host)) {
@@ -21500,7 +21893,7 @@ var ts;
return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } };
}
}
- function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache) {
+ function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
var traceEnabled = isTraceEnabled(compilerOptions, host);
var failedLookupLocations = [];
var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };
@@ -21513,7 +21906,7 @@ var ts;
return { value: resolvedUsingSettings };
}
if (!ts.isExternalModuleNameRelative(moduleName)) {
- var perModuleNameCache_1 = cache && cache.getOrCreateCacheForModuleName(moduleName);
+ var perModuleNameCache_1 = cache && cache.getOrCreateCacheForModuleName(moduleName, redirectedReference);
var resolved_3 = ts.forEachAncestorDirectory(containingDirectory, function (directory) {
var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache_1, moduleName, directory, state);
if (resolutionFromCache) {
@@ -21559,21 +21952,21 @@ var ts;
ts.getModuleInstanceState = getModuleInstanceState;
function getModuleInstanceStateWorker(node) {
switch (node.kind) {
- case 239:
- case 240:
- return 0;
case 241:
+ case 242:
+ return 0;
+ case 243:
if (ts.isEnumConst(node)) {
return 2;
}
break;
- case 247:
- case 246:
+ case 249:
+ case 248:
if (!(ts.hasModifier(node, 1))) {
return 0;
}
break;
- case 243: {
+ case 245: {
var state_1 = 0;
ts.forEachChild(node, function (n) {
var childState = getModuleInstanceStateWorker(n);
@@ -21592,9 +21985,9 @@ var ts;
});
return state_1;
}
- case 242:
+ case 244:
return getModuleInstanceState(node);
- case 71:
+ case 72:
if (node.isInJSDocNamespace) {
return 0;
}
@@ -21713,7 +22106,7 @@ var ts;
}
}
function getDeclarationName(node) {
- if (node.kind === 252) {
+ if (node.kind === 254) {
return node.isExportEquals ? "export=" : "default";
}
var name = ts.getNameOfDeclaration(node);
@@ -21722,7 +22115,7 @@ var ts;
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
}
- if (name.kind === 147) {
+ if (name.kind === 149) {
var nameExpression = name.expression;
if (ts.isStringOrNumericLiteralLike(nameExpression)) {
return ts.escapeLeadingUnderscores(nameExpression.text);
@@ -21733,31 +22126,31 @@ var ts;
return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined;
}
switch (node.kind) {
- case 155:
+ case 157:
return "__constructor";
- case 163:
- case 158:
- case 291:
- return "__call";
- case 164:
- case 159:
- return "__new";
+ case 165:
case 160:
+ case 293:
+ return "__call";
+ case 166:
+ case 161:
+ return "__new";
+ case 162:
return "__index";
- case 253:
+ case 255:
return "__export";
- case 277:
+ case 279:
return "export=";
- case 202:
+ case 204:
if (ts.getAssignmentDeclarationKind(node) === 2) {
return "export=";
}
ts.Debug.fail("Unknown binary declaration kind");
break;
- case 287:
+ case 289:
return (ts.isJSDocConstructSignature(node) ? "__new" : "__call");
- case 149:
- ts.Debug.assert(node.parent.kind === 287, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ case 151:
+ ts.Debug.assert(node.parent.kind === 289, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
var functionType = node.parent;
var index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -21810,7 +22203,7 @@ var ts;
}
else {
if (symbol.declarations && symbol.declarations.length &&
- (node.kind === 252 && !node.isExportEquals)) {
+ (node.kind === 254 && !node.isExportEquals)) {
message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName_1 = false;
}
@@ -21837,7 +22230,7 @@ var ts;
function declareModuleMember(node, symbolFlags, symbolExcludes) {
var hasExportModifier = ts.getCombinedModifierFlags(node) & 1;
if (symbolFlags & 2097152) {
- if (node.kind === 255 || (node.kind === 246 && hasExportModifier)) {
+ if (node.kind === 257 || (node.kind === 248 && hasExportModifier)) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
}
else {
@@ -21867,7 +22260,7 @@ var ts;
var saveThisParentContainer = thisParentContainer;
var savedBlockScopeContainer = blockScopeContainer;
if (containerFlags & 1) {
- if (node.kind !== 195) {
+ if (node.kind !== 197) {
thisParentContainer = container;
}
container = blockScopeContainer = node;
@@ -21895,7 +22288,7 @@ var ts;
currentFlow.container = node;
}
}
- currentReturnTarget = isIIFE || node.kind === 155 ? createBranchLabel() : undefined;
+ currentReturnTarget = isIIFE || node.kind === 157 ? createBranchLabel() : undefined;
currentBreakTarget = undefined;
currentContinueTarget = undefined;
activeLabels = undefined;
@@ -21907,13 +22300,13 @@ var ts;
if (hasExplicitReturn)
node.flags |= 256;
}
- if (node.kind === 277) {
+ if (node.kind === 279) {
node.flags |= emitFlags;
}
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
currentFlow = finishFlowLabel(currentReturnTarget);
- if (node.kind === 155) {
+ if (node.kind === 157) {
node.returnFlowNode = currentFlow;
}
}
@@ -21956,8 +22349,8 @@ var ts;
}
}
function bindEachFunctionsFirst(nodes) {
- bindEach(nodes, function (n) { return n.kind === 237 ? bind(n) : undefined; });
- bindEach(nodes, function (n) { return n.kind !== 237 ? bind(n) : undefined; });
+ bindEach(nodes, function (n) { return n.kind === 239 ? bind(n) : undefined; });
+ bindEach(nodes, function (n) { return n.kind !== 239 ? bind(n) : undefined; });
}
function bindEach(nodes, bindFunction) {
if (bindFunction === void 0) { bindFunction = bind; }
@@ -21990,77 +22383,77 @@ var ts;
return;
}
switch (node.kind) {
- case 222:
+ case 224:
bindWhileStatement(node);
break;
- case 221:
+ case 223:
bindDoStatement(node);
break;
- case 223:
+ case 225:
bindForStatement(node);
break;
- case 224:
- case 225:
+ case 226:
+ case 227:
bindForInOrForOfStatement(node);
break;
- case 220:
+ case 222:
bindIfStatement(node);
break;
- case 228:
- case 232:
+ case 230:
+ case 234:
bindReturnOrThrow(node);
break;
- case 227:
- case 226:
+ case 229:
+ case 228:
bindBreakOrContinueStatement(node);
break;
- case 233:
+ case 235:
bindTryStatement(node);
break;
- case 230:
+ case 232:
bindSwitchStatement(node);
break;
- case 244:
+ case 246:
bindCaseBlock(node);
break;
- case 269:
+ case 271:
bindCaseClause(node);
break;
- case 231:
+ case 233:
bindLabeledStatement(node);
break;
- case 200:
+ case 202:
bindPrefixUnaryExpressionFlow(node);
break;
- case 201:
+ case 203:
bindPostfixUnaryExpressionFlow(node);
break;
- case 202:
+ case 204:
bindBinaryExpressionFlow(node);
break;
- case 196:
+ case 198:
bindDeleteExpressionFlow(node);
break;
- case 203:
+ case 205:
bindConditionalExpressionFlow(node);
break;
- case 235:
+ case 237:
bindVariableDeclarationFlow(node);
break;
- case 189:
+ case 191:
bindCallExpressionFlow(node);
break;
- case 302:
- case 295:
+ case 304:
+ case 297:
bindJSDocTypeAlias(node);
break;
- case 277: {
+ case 279: {
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
}
- case 216:
- case 243:
+ case 218:
+ case 245:
bindEachFunctionsFirst(node.statements);
break;
default:
@@ -22071,26 +22464,26 @@ var ts;
}
function isNarrowingExpression(expr) {
switch (expr.kind) {
- case 71:
- case 99:
- case 187:
- case 188:
- return isNarrowableReference(expr);
+ case 72:
+ case 100:
case 189:
+ case 190:
+ return isNarrowableReference(expr);
+ case 191:
return hasNarrowableArgument(expr);
- case 193:
+ case 195:
return isNarrowingExpression(expr.expression);
- case 202:
+ case 204:
return isNarrowingBinaryExpression(expr);
- case 200:
- return expr.operator === 51 && isNarrowingExpression(expr.operand);
- case 197:
+ case 202:
+ return expr.operator === 52 && isNarrowingExpression(expr.operand);
+ case 199:
return isNarrowingExpression(expr.expression);
}
return false;
}
function isNarrowableReference(expr) {
- return expr.kind === 71 || expr.kind === 99 || expr.kind === 97 ||
+ return expr.kind === 72 || expr.kind === 100 || expr.kind === 98 ||
ts.isPropertyAccessExpression(expr) && isNarrowableReference(expr.expression) ||
ts.isElementAccessExpression(expr) && expr.argumentExpression &&
(ts.isStringLiteral(expr.argumentExpression) || ts.isNumericLiteral(expr.argumentExpression)) &&
@@ -22105,7 +22498,7 @@ var ts;
}
}
}
- if (expr.expression.kind === 187 &&
+ if (expr.expression.kind === 189 &&
isNarrowableReference(expr.expression.expression)) {
return true;
}
@@ -22119,32 +22512,32 @@ var ts;
}
function isNarrowingBinaryExpression(expr) {
switch (expr.operatorToken.kind) {
- case 58:
+ case 59:
return isNarrowableReference(expr.left);
- case 32:
case 33:
case 34:
case 35:
+ case 36:
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) ||
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
- case 93:
+ case 94:
return isNarrowableOperand(expr.left);
- case 92:
+ case 93:
return isNarrowableInOperands(expr.left, expr.right);
- case 26:
+ case 27:
return isNarrowingExpression(expr.right);
}
return false;
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 193:
+ case 195:
return isNarrowableOperand(expr.expression);
- case 202:
+ case 204:
switch (expr.operatorToken.kind) {
- case 58:
+ case 59:
return isNarrowableOperand(expr.left);
- case 26:
+ case 27:
return isNarrowableOperand(expr.right);
}
}
@@ -22178,8 +22571,8 @@ var ts;
if (!expression) {
return flags & 32 ? antecedent : unreachableFlow;
}
- if (expression.kind === 101 && flags & 64 ||
- expression.kind === 86 && flags & 32) {
+ if (expression.kind === 102 && flags & 64 ||
+ expression.kind === 87 && flags & 32) {
return unreachableFlow;
}
if (!isNarrowingExpression(expression)) {
@@ -22217,34 +22610,34 @@ var ts;
function isStatementCondition(node) {
var parent = node.parent;
switch (parent.kind) {
- case 220:
case 222:
- case 221:
- return parent.expression === node;
+ case 224:
case 223:
- case 203:
+ return parent.expression === node;
+ case 225:
+ case 205:
return parent.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 193) {
+ if (node.kind === 195) {
node = node.expression;
}
- else if (node.kind === 200 && node.operator === 51) {
+ else if (node.kind === 202 && node.operator === 52) {
node = node.operand;
}
else {
- return node.kind === 202 && (node.operatorToken.kind === 53 ||
- node.operatorToken.kind === 54);
+ return node.kind === 204 && (node.operatorToken.kind === 54 ||
+ node.operatorToken.kind === 55);
}
}
}
function isTopLevelLogicalExpression(node) {
- while (node.parent.kind === 193 ||
- node.parent.kind === 200 &&
- node.parent.operator === 51) {
+ while (node.parent.kind === 195 ||
+ node.parent.kind === 202 &&
+ node.parent.operator === 52) {
node = node.parent;
}
return !isStatementCondition(node) && !isLogicalExpression(node.parent);
@@ -22285,7 +22678,7 @@ var ts;
}
function bindDoStatement(node) {
var preDoLabel = createLoopLabel();
- var enclosingLabeledStatement = node.parent.kind === 231
+ var enclosingLabeledStatement = node.parent.kind === 233
? ts.lastOrUndefined(activeLabels)
: undefined;
var preConditionLabel = enclosingLabeledStatement ? enclosingLabeledStatement.continueTarget : createBranchLabel();
@@ -22317,13 +22710,13 @@ var ts;
var postLoopLabel = createBranchLabel();
addAntecedent(preLoopLabel, currentFlow);
currentFlow = preLoopLabel;
- if (node.kind === 225) {
+ if (node.kind === 227) {
bind(node.awaitModifier);
}
bind(node.expression);
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 236) {
+ if (node.initializer.kind !== 238) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -22345,7 +22738,7 @@ var ts;
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 228) {
+ if (node.kind === 230) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -22365,7 +22758,7 @@ var ts;
return undefined;
}
function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
- var flowLabel = node.kind === 227 ? breakTarget : continueTarget;
+ var flowLabel = node.kind === 229 ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -22428,7 +22821,7 @@ var ts;
preSwitchCaseFlow = currentFlow;
bind(node.caseBlock);
addAntecedent(postSwitchLabel, currentFlow);
- var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 270; });
+ var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 272; });
node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;
if (!hasDefault) {
addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));
@@ -22493,13 +22886,13 @@ var ts;
if (!activeLabel.referenced && !options.allowUnusedLabels) {
errorOrSuggestionOnNode(ts.unusedLabelIsError(options), node.label, ts.Diagnostics.Unused_label);
}
- if (!node.statement || node.statement.kind !== 221) {
+ if (!node.statement || node.statement.kind !== 223) {
addAntecedent(postStatementLabel, currentFlow);
currentFlow = finishFlowLabel(postStatementLabel);
}
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 202 && node.operatorToken.kind === 58) {
+ if (node.kind === 204 && node.operatorToken.kind === 59) {
bindAssignmentTargetFlow(node.left);
}
else {
@@ -22510,10 +22903,10 @@ var ts;
if (isNarrowableReference(node)) {
currentFlow = createFlowAssignment(currentFlow, node);
}
- else if (node.kind === 185) {
+ else if (node.kind === 187) {
for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
var e = _a[_i];
- if (e.kind === 206) {
+ if (e.kind === 208) {
bindAssignmentTargetFlow(e.expression);
}
else {
@@ -22521,16 +22914,16 @@ var ts;
}
}
}
- else if (node.kind === 186) {
+ else if (node.kind === 188) {
for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
var p = _c[_b];
- if (p.kind === 273) {
+ if (p.kind === 275) {
bindDestructuringTargetFlow(p.initializer);
}
- else if (p.kind === 274) {
+ else if (p.kind === 276) {
bindAssignmentTargetFlow(p.name);
}
- else if (p.kind === 275) {
+ else if (p.kind === 277) {
bindAssignmentTargetFlow(p.expression);
}
}
@@ -22538,7 +22931,7 @@ var ts;
}
function bindLogicalExpression(node, trueTarget, falseTarget) {
var preRightLabel = createBranchLabel();
- if (node.operatorToken.kind === 53) {
+ if (node.operatorToken.kind === 54) {
bindCondition(node.left, preRightLabel, falseTarget);
}
else {
@@ -22549,7 +22942,7 @@ var ts;
bindCondition(node.right, trueTarget, falseTarget);
}
function bindPrefixUnaryExpressionFlow(node) {
- if (node.operator === 51) {
+ if (node.operator === 52) {
var saveTrueTarget = currentTrueTarget;
currentTrueTarget = currentFalseTarget;
currentFalseTarget = saveTrueTarget;
@@ -22559,20 +22952,20 @@ var ts;
}
else {
bindEachChild(node);
- if (node.operator === 43 || node.operator === 44) {
+ if (node.operator === 44 || node.operator === 45) {
bindAssignmentTargetFlow(node.operand);
}
}
}
function bindPostfixUnaryExpressionFlow(node) {
bindEachChild(node);
- if (node.operator === 43 || node.operator === 44) {
+ if (node.operator === 44 || node.operator === 45) {
bindAssignmentTargetFlow(node.operand);
}
}
function bindBinaryExpressionFlow(node) {
var operator = node.operatorToken.kind;
- if (operator === 53 || operator === 54) {
+ if (operator === 54 || operator === 55) {
if (isTopLevelLogicalExpression(node)) {
var postExpressionLabel = createBranchLabel();
bindLogicalExpression(node, postExpressionLabel, postExpressionLabel);
@@ -22586,7 +22979,7 @@ var ts;
bindEachChild(node);
if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
- if (operator === 58 && node.left.kind === 188) {
+ if (operator === 59 && node.left.kind === 190) {
var elementAccess = node.left;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowArrayMutation(currentFlow, node);
@@ -22597,7 +22990,7 @@ var ts;
}
function bindDeleteExpressionFlow(node) {
bindEachChild(node);
- if (node.expression.kind === 187) {
+ if (node.expression.kind === 189) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -22641,10 +23034,10 @@ var ts;
}
function bindCallExpressionFlow(node) {
var expr = node.expression;
- while (expr.kind === 193) {
+ while (expr.kind === 195) {
expr = expr.expression;
}
- if (expr.kind === 194 || expr.kind === 195) {
+ if (expr.kind === 196 || expr.kind === 197) {
bindEach(node.typeArguments);
bindEach(node.arguments);
bind(node.expression);
@@ -22652,7 +23045,7 @@ var ts;
else {
bindEachChild(node);
}
- if (node.expression.kind === 187) {
+ if (node.expression.kind === 189) {
var propertyAccess = node.expression;
if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) {
currentFlow = createFlowArrayMutation(currentFlow, node);
@@ -22661,53 +23054,53 @@ var ts;
}
function getContainerFlags(node) {
switch (node.kind) {
- case 207:
- case 238:
- case 241:
- case 186:
- case 166:
- case 290:
- case 266:
- return 1;
- case 239:
- return 1 | 64;
- case 242:
+ case 209:
case 240:
- case 179:
+ case 243:
+ case 188:
+ case 168:
+ case 292:
+ case 268:
+ return 1;
+ case 241:
+ return 1 | 64;
+ case 244:
+ case 242:
+ case 181:
return 1 | 32;
- case 277:
+ case 279:
return 1 | 4 | 32;
- case 154:
+ case 156:
if (ts.isObjectLiteralOrClassExpressionMethod(node)) {
return 1 | 4 | 32 | 8 | 128;
}
- case 155:
- case 237:
- case 153:
- case 156:
case 157:
+ case 239:
+ case 155:
case 158:
- case 291:
- case 287:
- case 163:
case 159:
case 160:
- case 164:
+ case 293:
+ case 289:
+ case 165:
+ case 161:
+ case 162:
+ case 166:
return 1 | 4 | 32 | 8;
- case 194:
- case 195:
+ case 196:
+ case 197:
return 1 | 4 | 32 | 8 | 16;
- case 243:
+ case 245:
return 4;
- case 152:
+ case 154:
return node.initializer ? 4 : 0;
- case 272:
- case 223:
- case 224:
+ case 274:
case 225:
- case 244:
+ case 226:
+ case 227:
+ case 246:
return 2;
- case 216:
+ case 218:
return ts.isFunctionLike(node.parent) ? 0 : 2;
}
return 0;
@@ -22720,40 +23113,40 @@ var ts;
}
function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 242:
+ case 244:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 277:
+ case 279:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 207:
- case 238:
+ case 209:
+ case 240:
return declareClassMember(node, symbolFlags, symbolExcludes);
- case 241:
+ case 243:
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 166:
- case 290:
- case 186:
- case 239:
- case 266:
+ case 168:
+ case 292:
+ case 188:
+ case 241:
+ case 268:
return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 163:
- case 164:
+ case 165:
+ case 166:
+ case 160:
+ case 161:
+ case 293:
+ case 162:
+ case 156:
+ case 155:
+ case 157:
case 158:
case 159:
- case 291:
- case 160:
- case 154:
- case 153:
- case 155:
- case 156:
- case 157:
- case 237:
- case 194:
- case 195:
- case 287:
- case 302:
- case 295:
- case 240:
- case 179:
+ case 239:
+ case 196:
+ case 197:
+ case 289:
+ case 304:
+ case 297:
+ case 242:
+ case 181:
return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes);
}
}
@@ -22768,11 +23161,11 @@ var ts;
: declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes);
}
function hasExportDeclarations(node) {
- var body = node.kind === 277 ? node : node.body;
- if (body && (body.kind === 277 || body.kind === 243)) {
+ var body = node.kind === 279 ? node : node.body;
+ if (body && (body.kind === 279 || body.kind === 245)) {
for (var _i = 0, _a = body.statements; _i < _a.length; _i++) {
var stat = _a[_i];
- if (stat.kind === 253 || stat.kind === 252) {
+ if (stat.kind === 255 || stat.kind === 254) {
return true;
}
}
@@ -22798,7 +23191,7 @@ var ts;
}
else {
var pattern = void 0;
- if (node.name.kind === 9) {
+ if (node.name.kind === 10) {
var text = node.name.text;
if (ts.hasZeroOrOneAsteriskCharacter(text)) {
pattern = ts.tryParsePattern(text);
@@ -22840,11 +23233,11 @@ var ts;
var seen = ts.createUnderscoreEscapedMap();
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- if (prop.kind === 275 || prop.name.kind !== 71) {
+ if (prop.kind === 277 || prop.name.kind !== 72) {
continue;
}
var identifier = prop.name;
- var currentKind = prop.kind === 273 || prop.kind === 274 || prop.kind === 154
+ var currentKind = prop.kind === 275 || prop.kind === 276 || prop.kind === 156
? 1
: 2;
var existingKind = seen.get(identifier.escapedText);
@@ -22876,10 +23269,10 @@ var ts;
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 242:
+ case 244:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 277:
+ case 279:
if (ts.isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -22909,7 +23302,7 @@ var ts;
currentFlow = { flags: 2 };
parent = typeAlias;
bind(typeAlias.typeExpression);
- if (!typeAlias.fullName || typeAlias.fullName.kind === 71) {
+ if (!typeAlias.fullName || typeAlias.fullName.kind === 72) {
parent = typeAlias.parent;
bindBlockScopedDeclaration(typeAlias, 524288, 67897832);
}
@@ -22925,8 +23318,8 @@ var ts;
}
function checkStrictModeIdentifier(node) {
if (inStrictMode &&
- node.originalKeywordKind >= 108 &&
- node.originalKeywordKind <= 116 &&
+ node.originalKeywordKind >= 109 &&
+ node.originalKeywordKind <= 117 &&
!ts.isIdentifierName(node) &&
!(node.flags & 4194304)) {
if (!file.parseDiagnostics.length) {
@@ -22954,7 +23347,7 @@ var ts;
}
}
function checkStrictModeDeleteExpression(node) {
- if (inStrictMode && node.expression.kind === 71) {
+ if (inStrictMode && node.expression.kind === 72) {
var span = ts.getErrorSpanForNode(file, node.expression);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode));
}
@@ -22963,7 +23356,7 @@ var ts;
return ts.isIdentifier(node) && (node.escapedText === "eval" || node.escapedText === "arguments");
}
function checkStrictModeEvalOrArguments(contextNode, name) {
- if (name && name.kind === 71) {
+ if (name && name.kind === 72) {
var identifier = name;
if (isEvalOrArgumentsIdentifier(identifier)) {
var span = ts.getErrorSpanForNode(file, name);
@@ -22996,8 +23389,8 @@ var ts;
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2) {
- if (blockScopeContainer.kind !== 277 &&
- blockScopeContainer.kind !== 242 &&
+ if (blockScopeContainer.kind !== 279 &&
+ blockScopeContainer.kind !== 244 &&
!ts.isFunctionLike(blockScopeContainer)) {
var errorSpan = ts.getErrorSpanForNode(file, node);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node)));
@@ -23016,7 +23409,7 @@ var ts;
}
function checkStrictModePrefixUnaryExpression(node) {
if (inStrictMode) {
- if (node.operator === 43 || node.operator === 44) {
+ if (node.operator === 44 || node.operator === 45) {
checkStrictModeEvalOrArguments(node, node.operand);
}
}
@@ -23059,7 +23452,7 @@ var ts;
node.parent = parent;
var saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 145) {
+ if (node.kind > 147) {
var saveParent = parent;
parent = node;
var containerFlags = getContainerFlags(node);
@@ -23117,7 +23510,7 @@ var ts;
}
function bindWorker(node) {
switch (node.kind) {
- case 71:
+ case 72:
if (node.isInJSDocNamespace) {
var parentNode = node.parent;
while (parentNode && !ts.isJSDocTypeAlias(parentNode)) {
@@ -23126,13 +23519,13 @@ var ts;
bindBlockScopedDeclaration(parentNode, 524288, 67897832);
break;
}
- case 99:
- if (currentFlow && (ts.isExpression(node) || parent.kind === 274)) {
+ case 100:
+ if (currentFlow && (ts.isExpression(node) || parent.kind === 276)) {
node.flowNode = currentFlow;
}
return checkStrictModeIdentifier(node);
- case 187:
- case 188:
+ case 189:
+ case 190:
if (currentFlow && isNarrowableReference(node)) {
node.flowNode = currentFlow;
}
@@ -23146,7 +23539,7 @@ var ts;
declareSymbol(file.locals, undefined, node.expression, 1 | 134217728, 67220414);
}
break;
- case 202:
+ case 204:
var specialKind = ts.getAssignmentDeclarationKind(node);
switch (specialKind) {
case 1:
@@ -23170,132 +23563,145 @@ var ts;
case 0:
break;
default:
- ts.Debug.fail("Unknown special property assignment kind");
+ ts.Debug.fail("Unknown binary expression special property assignment kind");
}
return checkStrictModeBinaryExpression(node);
- case 272:
+ case 274:
return checkStrictModeCatchClause(node);
- case 196:
+ case 198:
return checkStrictModeDeleteExpression(node);
case 8:
return checkStrictModeNumericLiteral(node);
- case 201:
+ case 203:
return checkStrictModePostfixUnaryExpression(node);
- case 200:
+ case 202:
return checkStrictModePrefixUnaryExpression(node);
- case 229:
- return checkStrictModeWithStatement(node);
case 231:
+ return checkStrictModeWithStatement(node);
+ case 233:
return checkStrictModeLabeledStatement(node);
- case 176:
+ case 178:
seenThisKeyword = true;
return;
- case 161:
+ case 163:
break;
- case 148:
+ case 150:
return bindTypeParameter(node);
- case 149:
+ case 151:
return bindParameter(node);
- case 235:
+ case 237:
return bindVariableDeclarationOrBindingElement(node);
- case 184:
+ case 186:
node.flowNode = currentFlow;
return bindVariableDeclarationOrBindingElement(node);
- case 152:
- case 151:
- return bindPropertyWorker(node);
- case 273:
- case 274:
- return bindPropertyOrMethodOrAccessor(node, 4, 0);
- case 276:
- return bindPropertyOrMethodOrAccessor(node, 8, 68008959);
- case 158:
- case 159:
- case 160:
- return declareSymbolAndAddToSymbolTable(node, 131072, 0);
case 154:
case 153:
- return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 67212223);
- case 237:
- return bindFunctionDeclaration(node);
- case 155:
- return declareSymbolAndAddToSymbolTable(node, 16384, 0);
+ return bindPropertyWorker(node);
+ case 275:
+ case 276:
+ return bindPropertyOrMethodOrAccessor(node, 4, 0);
+ case 278:
+ return bindPropertyOrMethodOrAccessor(node, 8, 68008959);
+ case 160:
+ case 161:
+ case 162:
+ return declareSymbolAndAddToSymbolTable(node, 131072, 0);
case 156:
- return bindPropertyOrMethodOrAccessor(node, 32768, 67154879);
+ case 155:
+ return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 67212223);
+ case 239:
+ return bindFunctionDeclaration(node);
case 157:
+ return declareSymbolAndAddToSymbolTable(node, 16384, 0);
+ case 158:
+ return bindPropertyOrMethodOrAccessor(node, 32768, 67154879);
+ case 159:
return bindPropertyOrMethodOrAccessor(node, 65536, 67187647);
- case 163:
- case 287:
- case 291:
- case 164:
- return bindFunctionOrConstructorType(node);
+ case 165:
+ case 289:
+ case 293:
case 166:
- case 290:
- case 179:
+ return bindFunctionOrConstructorType(node);
+ case 168:
+ case 292:
+ case 181:
return bindAnonymousTypeWorker(node);
- case 186:
+ case 188:
return bindObjectLiteralExpression(node);
- case 194:
- case 195:
+ case 196:
+ case 197:
return bindFunctionExpression(node);
- case 189:
+ case 191:
+ var assignmentKind = ts.getAssignmentDeclarationKind(node);
+ switch (assignmentKind) {
+ case 7:
+ return bindObjectDefinePropertyAssignment(node);
+ case 8:
+ return bindObjectDefinePropertyExport(node);
+ case 9:
+ return bindObjectDefinePrototypeProperty(node);
+ case 0:
+ break;
+ default:
+ return ts.Debug.fail("Unknown call expression assignment declaration kind");
+ }
if (ts.isInJSFile(node)) {
bindCallExpression(node);
}
break;
- case 207:
- case 238:
+ case 209:
+ case 240:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 239:
- return bindBlockScopedDeclaration(node, 64, 67897736);
- case 240:
- return bindBlockScopedDeclaration(node, 524288, 67897832);
case 241:
- return bindEnumDeclaration(node);
+ return bindBlockScopedDeclaration(node, 64, 67897736);
case 242:
+ return bindBlockScopedDeclaration(node, 524288, 67897832);
+ case 243:
+ return bindEnumDeclaration(node);
+ case 244:
return bindModuleDeclaration(node);
- case 266:
+ case 268:
return bindJsxAttributes(node);
- case 265:
+ case 267:
return bindJsxAttribute(node, 4, 0);
- case 246:
- case 249:
- case 251:
- case 255:
- return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
- case 245:
- return bindNamespaceExportDeclaration(node);
case 248:
- return bindImportClause(node);
+ case 251:
case 253:
+ case 257:
+ return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
+ case 247:
+ return bindNamespaceExportDeclaration(node);
+ case 250:
+ return bindImportClause(node);
+ case 255:
return bindExportDeclaration(node);
- case 252:
+ case 254:
return bindExportAssignment(node);
- case 277:
+ case 279:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 216:
+ case 218:
if (!ts.isFunctionLike(node.parent)) {
return;
}
- case 243:
+ case 245:
return updateStrictModeStatementList(node.statements);
- case 297:
- if (node.parent.kind === 291) {
+ case 299:
+ if (node.parent.kind === 293) {
return bindParameter(node);
}
- if (node.parent.kind !== 290) {
+ if (node.parent.kind !== 292) {
break;
}
- case 303:
+ case 305:
var propTag = node;
- var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 286 ?
+ var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 288 ?
4 | 16777216 :
4;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0);
- case 302:
- case 295:
+ case 304:
+ case 297:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -23373,6 +23779,21 @@ var ts;
}
return true;
}
+ function bindObjectDefinePropertyExport(node) {
+ if (!setCommonJsModuleIndicator(node)) {
+ return;
+ }
+ var symbol = forEachIdentifierInEntityName(node.arguments[0], undefined, function (id, symbol) {
+ if (symbol) {
+ addDeclarationToSymbol(symbol, id, 1536 | 67108864);
+ }
+ return symbol;
+ });
+ if (symbol) {
+ var flags = 4 | 1048576;
+ declareSymbol(symbol.exports, symbol, node, flags, 0);
+ }
+ }
function bindExportsPropertyAssignment(node) {
if (!setCommonJsModuleIndicator(node)) {
return;
@@ -23402,16 +23823,16 @@ var ts;
var flags = ts.exportAssignmentIsAlias(node)
? 2097152
: 4 | 1048576 | 512;
- declareSymbol(file.symbol.exports, file.symbol, node, flags, 0);
+ declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864, 0);
}
function bindThisPropertyAssignment(node) {
ts.Debug.assert(ts.isInJSFile(node));
var thisContainer = ts.getThisContainer(node, false);
switch (thisContainer.kind) {
- case 237:
- case 194:
+ case 239:
+ case 196:
var constructorSymbol = thisContainer.symbol;
- if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 58) {
+ if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 59) {
var l = thisContainer.parent.left;
if (ts.isPropertyAccessEntityNameExpression(l) && ts.isPrototypeAccess(l.expression)) {
constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);
@@ -23422,26 +23843,26 @@ var ts;
declareSymbol(constructorSymbol.members, constructorSymbol, node, 4, 0 & ~4);
}
break;
- case 155:
- case 152:
+ case 157:
case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
var containingClass = thisContainer.parent;
var symbolTable = ts.hasModifier(thisContainer, 32) ? containingClass.symbol.exports : containingClass.symbol.members;
declareSymbol(symbolTable, containingClass.symbol, node, 4, 0, true);
break;
- case 277:
+ case 279:
break;
default:
ts.Debug.fail(ts.Debug.showSyntaxKind(thisContainer));
}
}
function bindSpecialPropertyDeclaration(node) {
- if (node.expression.kind === 99) {
+ if (node.expression.kind === 100) {
bindThisPropertyAssignment(node);
}
- else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 277) {
+ else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 279) {
if (ts.isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
}
@@ -23456,6 +23877,10 @@ var ts;
var lhs = node.left;
bindPropertyAssignment(lhs.expression, lhs, false);
}
+ function bindObjectDefinePrototypeProperty(node) {
+ var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression);
+ bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, true);
+ }
function bindPrototypePropertyAssignment(lhs, parent) {
var classPrototype = lhs.expression;
var constructorFunction = classPrototype.expression;
@@ -23464,6 +23889,12 @@ var ts;
classPrototype.parent = lhs;
bindPropertyAssignment(constructorFunction, lhs, true);
}
+ function bindObjectDefinePropertyAssignment(node) {
+ var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
+ var isToplevel = node.parent.parent.kind === 279;
+ namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false);
+ bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false);
+ }
function bindSpecialPropertyAssignment(node) {
var lhs = node.left;
var parentSymbol = lookupSymbolForPropertyAccess(lhs.expression);
@@ -23483,15 +23914,11 @@ var ts;
node.expression.parent = node;
bindPropertyAssignment(node.expression, node, false);
}
- function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty) {
- var namespaceSymbol = lookupSymbolForPropertyAccess(name);
- var isToplevel = ts.isBinaryExpression(propertyAccess.parent)
- ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 277
- : propertyAccess.parent.parent.kind === 277;
+ function bindPotentiallyMissingNamespaces(namespaceSymbol, entityName, isToplevel, isPrototypeProperty) {
if (isToplevel && !isPrototypeProperty && (!namespaceSymbol || !(namespaceSymbol.flags & 1920))) {
var flags_1 = 1536 | 67108864;
var excludeFlags_1 = 110735 & ~67108864;
- namespaceSymbol = forEachIdentifierInEntityName(propertyAccess.expression, namespaceSymbol, function (id, symbol, parent) {
+ namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function (id, symbol, parent) {
if (symbol) {
addDeclarationToSymbol(symbol, id, flags_1);
return symbol;
@@ -23503,22 +23930,36 @@ var ts;
}
});
}
+ return namespaceSymbol;
+ }
+ function bindPotentiallyNewExpandoMemberToNamespace(declaration, namespaceSymbol, isPrototypeProperty) {
if (!namespaceSymbol || !isExpandoSymbol(namespaceSymbol)) {
return;
}
var symbolTable = isPrototypeProperty ?
(namespaceSymbol.members || (namespaceSymbol.members = ts.createSymbolTable())) :
(namespaceSymbol.exports || (namespaceSymbol.exports = ts.createSymbolTable()));
- var isMethod = ts.isFunctionLikeDeclaration(ts.getAssignedExpandoInitializer(propertyAccess));
+ var isMethod = ts.isFunctionLikeDeclaration(ts.getAssignedExpandoInitializer(declaration));
var includes = isMethod ? 8192 : 4;
var excludes = isMethod ? 67212223 : 0;
- declareSymbol(symbolTable, namespaceSymbol, propertyAccess, includes | 67108864, excludes & ~67108864);
+ declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864, excludes & ~67108864);
+ }
+ function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty) {
+ var namespaceSymbol = lookupSymbolForPropertyAccess(name);
+ var isToplevel = ts.isBinaryExpression(propertyAccess.parent)
+ ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 279
+ : propertyAccess.parent.parent.kind === 279;
+ namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty);
+ bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty);
}
function isExpandoSymbol(symbol) {
if (symbol.flags & (16 | 32 | 1024)) {
return true;
}
var node = symbol.valueDeclaration;
+ if (ts.isCallExpression(node)) {
+ return !!ts.getAssignedExpandoInitializer(node);
+ }
var init = !node ? undefined :
ts.isVariableDeclaration(node) ? node.initializer :
ts.isBinaryExpression(node) ? node.right :
@@ -23527,7 +23968,7 @@ var ts;
init = init && ts.getRightMostAssignedExpression(init);
if (init) {
var isPrototypeAssignment = ts.isPrototypeAccess(ts.isVariableDeclaration(node) ? node.name : ts.isBinaryExpression(node) ? node.left : node);
- return !!ts.getExpandoInitializer(ts.isBinaryExpression(init) && init.operatorToken.kind === 54 ? init.right : init, isPrototypeAssignment);
+ return !!ts.getExpandoInitializer(ts.isBinaryExpression(init) && init.operatorToken.kind === 55 ? init.right : init, isPrototypeAssignment);
}
return false;
}
@@ -23567,7 +24008,7 @@ var ts;
}
}
function bindClassLikeDeclaration(node) {
- if (node.kind === 238) {
+ if (node.kind === 240) {
bindBlockScopedDeclaration(node, 32, 68008383);
}
else {
@@ -23614,7 +24055,7 @@ var ts;
}
}
function bindParameter(node) {
- if (node.kind === 297 && container.kind !== 291) {
+ if (node.kind === 299 && container.kind !== 293) {
return;
}
if (inStrictMode && !(node.flags & 4194304)) {
@@ -23687,7 +24128,7 @@ var ts;
declareSymbolAndAddToSymbolTable(node, 262144, 67635688);
}
}
- else if (node.parent.kind === 174) {
+ else if (node.parent.kind === 176) {
var container_2 = getInferTypeContainer(node.parent);
if (container_2) {
if (!container_2.locals) {
@@ -23712,9 +24153,9 @@ var ts;
return false;
}
if (currentFlow === unreachableFlow) {
- var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 218) ||
- node.kind === 238 ||
- (node.kind === 242 && shouldReportErrorOnModuleDeclaration(node));
+ var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 220) ||
+ node.kind === 240 ||
+ (node.kind === 244 && shouldReportErrorOnModuleDeclaration(node));
if (reportError) {
currentFlow = reportedUnreachableFlow;
if (!options.allowUnreachableCode) {
@@ -23746,12 +24187,12 @@ var ts;
}
function isPurelyTypeDeclaration(s) {
switch (s.kind) {
- case 239:
- case 240:
- return true;
- case 242:
- return getModuleInstanceState(s) !== 1;
case 241:
+ case 242:
+ return true;
+ case 244:
+ return getModuleInstanceState(s) !== 1;
+ case 243:
return ts.hasModifier(s, 2048);
default:
return false;
@@ -23785,58 +24226,58 @@ var ts;
function computeTransformFlagsForNode(node, subtreeFlags) {
var kind = node.kind;
switch (kind) {
- case 189:
+ case 191:
return computeCallExpression(node, subtreeFlags);
- case 190:
+ case 192:
return computeNewExpression(node, subtreeFlags);
- case 242:
+ case 244:
return computeModuleDeclaration(node, subtreeFlags);
- case 193:
- return computeParenthesizedExpression(node, subtreeFlags);
- case 202:
- return computeBinaryExpression(node, subtreeFlags);
- case 219:
- return computeExpressionStatement(node, subtreeFlags);
- case 149:
- return computeParameter(node, subtreeFlags);
case 195:
+ return computeParenthesizedExpression(node, subtreeFlags);
+ case 204:
+ return computeBinaryExpression(node, subtreeFlags);
+ case 221:
+ return computeExpressionStatement(node, subtreeFlags);
+ case 151:
+ return computeParameter(node, subtreeFlags);
+ case 197:
return computeArrowFunction(node, subtreeFlags);
- case 194:
+ case 196:
return computeFunctionExpression(node, subtreeFlags);
- case 237:
+ case 239:
return computeFunctionDeclaration(node, subtreeFlags);
- case 235:
+ case 237:
return computeVariableDeclaration(node, subtreeFlags);
- case 236:
- return computeVariableDeclarationList(node, subtreeFlags);
- case 217:
- return computeVariableStatement(node, subtreeFlags);
- case 231:
- return computeLabeledStatement(node, subtreeFlags);
case 238:
+ return computeVariableDeclarationList(node, subtreeFlags);
+ case 219:
+ return computeVariableStatement(node, subtreeFlags);
+ case 233:
+ return computeLabeledStatement(node, subtreeFlags);
+ case 240:
return computeClassDeclaration(node, subtreeFlags);
- case 207:
- return computeClassExpression(node, subtreeFlags);
- case 271:
- return computeHeritageClause(node, subtreeFlags);
- case 272:
- return computeCatchClause(node, subtreeFlags);
case 209:
+ return computeClassExpression(node, subtreeFlags);
+ case 273:
+ return computeHeritageClause(node, subtreeFlags);
+ case 274:
+ return computeCatchClause(node, subtreeFlags);
+ case 211:
return computeExpressionWithTypeArguments(node, subtreeFlags);
- case 155:
- return computeConstructor(node, subtreeFlags);
- case 152:
- return computePropertyDeclaration(node, subtreeFlags);
- case 154:
- return computeMethod(node, subtreeFlags);
- case 156:
case 157:
+ return computeConstructor(node, subtreeFlags);
+ case 154:
+ return computePropertyDeclaration(node, subtreeFlags);
+ case 156:
+ return computeMethod(node, subtreeFlags);
+ case 158:
+ case 159:
return computeAccessor(node, subtreeFlags);
- case 246:
+ case 248:
return computeImportEquals(node, subtreeFlags);
- case 187:
+ case 189:
return computePropertyAccess(node, subtreeFlags);
- case 188:
+ case 190:
return computeElementAccess(node, subtreeFlags);
default:
return computeOther(node, kind, subtreeFlags);
@@ -23856,7 +24297,7 @@ var ts;
transformFlags |= 8192;
}
}
- if (expression.kind === 91) {
+ if (expression.kind === 92) {
transformFlags |= 16777216;
if (subtreeFlags & 8192) {
transformFlags |= 16384;
@@ -23880,14 +24321,14 @@ var ts;
var transformFlags = subtreeFlags;
var operatorTokenKind = node.operatorToken.kind;
var leftKind = node.left.kind;
- if (operatorTokenKind === 58 && leftKind === 186) {
+ if (operatorTokenKind === 59 && leftKind === 188) {
transformFlags |= 8 | 192 | 3072;
}
- else if (operatorTokenKind === 58 && leftKind === 185) {
+ else if (operatorTokenKind === 59 && leftKind === 187) {
transformFlags |= 192 | 3072;
}
- else if (operatorTokenKind === 40
- || operatorTokenKind === 62) {
+ else if (operatorTokenKind === 41
+ || operatorTokenKind === 63) {
transformFlags |= 32;
}
node.transformFlags = transformFlags | 536870912;
@@ -23921,8 +24362,8 @@ var ts;
var expression = node.expression;
var expressionKind = expression.kind;
var expressionTransformFlags = expression.transformFlags;
- if (expressionKind === 210
- || expressionKind === 192) {
+ if (expressionKind === 212
+ || expressionKind === 194) {
transformFlags |= 3;
}
if (expressionTransformFlags & 1024) {
@@ -23964,10 +24405,10 @@ var ts;
function computeHeritageClause(node, subtreeFlags) {
var transformFlags = subtreeFlags;
switch (node.token) {
- case 85:
+ case 86:
transformFlags |= 192;
break;
- case 108:
+ case 109:
transformFlags |= 3;
break;
default:
@@ -24220,54 +24661,54 @@ var ts;
var transformFlags = subtreeFlags;
var excludeFlags = 637535553;
switch (kind) {
- case 120:
- case 199:
+ case 121:
+ case 201:
transformFlags |= 8 | 16;
break;
- case 192:
- case 210:
- case 306:
+ case 194:
+ case 212:
+ case 308:
transformFlags |= 3;
excludeFlags = 536872257;
break;
- case 114:
- case 112:
+ case 115:
case 113:
- case 117:
- case 124:
- case 76:
- case 241:
- case 276:
- case 211:
- case 132:
+ case 114:
+ case 118:
+ case 125:
+ case 77:
+ case 243:
+ case 278:
+ case 213:
+ case 133:
transformFlags |= 3;
break;
- case 258:
- case 259:
case 260:
- case 10:
case 261:
case 262:
+ case 11:
case 263:
case 264:
case 265:
case 266:
case 267:
case 268:
+ case 269:
+ case 270:
transformFlags |= 4;
break;
- case 13:
case 14:
case 15:
case 16:
- case 204:
- case 191:
- case 274:
- case 115:
- case 212:
+ case 17:
+ case 206:
+ case 193:
+ case 276:
+ case 116:
+ case 214:
transformFlags |= 192;
break;
- case 9:
+ case 10:
if (node.hasExtendedUnicodeEscape) {
transformFlags |= 192;
}
@@ -24277,28 +24718,30 @@ var ts;
transformFlags |= 192;
}
break;
- case 225:
+ case 9:
+ transformFlags |= 8;
+ break;
+ case 227:
if (node.awaitModifier) {
transformFlags |= 8;
}
transformFlags |= 192;
break;
- case 205:
+ case 207:
transformFlags |= 8 | 192 | 4194304;
break;
- case 119:
- case 134:
- case 131:
+ case 120:
case 135:
- case 137:
- case 122:
+ case 146:
+ case 132:
+ case 136:
case 138:
- case 105:
- case 148:
- case 151:
+ case 123:
+ case 139:
+ case 106:
+ case 150:
case 153:
- case 158:
- case 159:
+ case 155:
case 160:
case 161:
case 162:
@@ -24315,57 +24758,59 @@ var ts;
case 173:
case 174:
case 175:
- case 239:
- case 240:
case 176:
case 177:
+ case 241:
+ case 242:
case 178:
case 179:
case 180:
- case 245:
+ case 181:
+ case 182:
+ case 247:
transformFlags = 3;
excludeFlags = -3;
break;
- case 147:
+ case 149:
transformFlags |= 524288;
if (subtreeFlags & 8192) {
transformFlags |= 32768;
}
break;
- case 206:
+ case 208:
transformFlags |= 192 | 131072;
break;
- case 275:
+ case 277:
transformFlags |= 8 | 262144;
break;
- case 97:
+ case 98:
transformFlags |= 192 | 33554432;
excludeFlags = 536872257;
break;
- case 99:
+ case 100:
transformFlags |= 8192;
break;
- case 182:
+ case 184:
transformFlags |= 192 | 2097152;
if (subtreeFlags & 131072) {
transformFlags |= 8 | 262144;
}
excludeFlags = 637666625;
break;
- case 183:
+ case 185:
transformFlags |= 192 | 2097152;
excludeFlags = 637666625;
break;
- case 184:
+ case 186:
transformFlags |= 192;
if (node.dotDotDotToken) {
transformFlags |= 131072;
}
break;
- case 150:
+ case 152:
transformFlags |= 3 | 4096;
break;
- case 186:
+ case 188:
excludeFlags = 638358849;
if (subtreeFlags & 524288) {
transformFlags |= 192;
@@ -24377,31 +24822,31 @@ var ts;
transformFlags |= 8;
}
break;
- case 185:
- case 190:
+ case 187:
+ case 192:
excludeFlags = 637666625;
if (subtreeFlags & 131072) {
transformFlags |= 192;
}
break;
- case 221:
- case 222:
case 223:
case 224:
+ case 225:
+ case 226:
if (subtreeFlags & 1048576) {
transformFlags |= 192;
}
break;
- case 277:
+ case 279:
if (subtreeFlags & 16384) {
transformFlags |= 192;
}
break;
- case 228:
+ case 230:
transformFlags |= 8388608 | 8;
break;
- case 226:
- case 227:
+ case 228:
+ case 229:
transformFlags |= 8388608;
break;
}
@@ -24409,66 +24854,67 @@ var ts;
return transformFlags & ~excludeFlags;
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 161 && kind <= 181) {
+ if (kind >= 163 && kind <= 183) {
return -3;
}
switch (kind) {
- case 189:
- case 190:
- case 185:
+ case 191:
+ case 192:
+ case 187:
return 637666625;
- case 242:
+ case 244:
return 647001409;
- case 149:
+ case 151:
return 637535553;
- case 195:
+ case 197:
return 653604161;
- case 194:
- case 237:
+ case 196:
+ case 239:
return 653620545;
- case 236:
- return 639894849;
case 238:
- case 207:
+ return 639894849;
+ case 240:
+ case 209:
return 638121281;
- case 155:
- return 653616449;
- case 154:
- case 156:
case 157:
return 653616449;
- case 119:
- case 134:
- case 131:
- case 137:
- case 135:
- case 122:
- case 138:
- case 105:
- case 148:
- case 151:
- case 153:
+ case 156:
case 158:
case 159:
+ return 653616449;
+ case 120:
+ case 135:
+ case 146:
+ case 132:
+ case 138:
+ case 136:
+ case 123:
+ case 139:
+ case 106:
+ case 150:
+ case 153:
+ case 155:
case 160:
- case 239:
- case 240:
+ case 161:
+ case 162:
+ case 241:
+ case 242:
return -3;
- case 186:
- return 638358849;
- case 272:
- return 637797697;
- case 182:
- case 183:
- return 637666625;
- case 192:
- case 210:
- case 306:
- case 193:
- case 97:
- return 536872257;
- case 187:
case 188:
+ return 638358849;
+ case 274:
+ return 637797697;
+ case 184:
+ case 185:
+ return 637666625;
+ case 194:
+ case 212:
+ case 308:
+ case 195:
+ case 98:
+ return 536872257;
+ case 189:
+ case 190:
return 570426689;
default:
return 637535553;
@@ -24521,7 +24967,7 @@ var ts;
var shouldBail = visitSymbol(type.symbol);
if (shouldBail)
return;
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
var objectType = type;
var objectFlags = objectType.objectFlags;
if (objectFlags & 4) {
@@ -24537,16 +24983,16 @@ var ts;
visitObjectType(objectType);
}
}
- if (type.flags & 65536) {
+ if (type.flags & 262144) {
visitTypeParameter(type);
}
- if (type.flags & 786432) {
+ if (type.flags & 3145728) {
visitUnionOrIntersectionType(type);
}
- if (type.flags & 1048576) {
+ if (type.flags & 4194304) {
visitIndexType(type);
}
- if (type.flags & 2097152) {
+ if (type.flags & 8388608) {
visitIndexedAccessType(type);
}
}
@@ -24630,7 +25076,7 @@ var ts;
symbol.exports.forEach(visitSymbol);
}
ts.forEach(symbol.declarations, function (d) {
- if (d.type && d.type.kind === 165) {
+ if (d.type && d.type.kind === 167) {
var query = d.type;
var entity = getResolvedSymbol(getFirstIdentifier(query.exprName));
visitSymbol(entity);
@@ -24708,6 +25154,7 @@ var ts;
var noImplicitAny = ts.getStrictOptionValue(compilerOptions, "noImplicitAny");
var noImplicitThis = ts.getStrictOptionValue(compilerOptions, "noImplicitThis");
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
+ var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 32768;
var emitResolver = createResolver();
var nodeBuilder = createNodeBuilder();
var undefinedSymbol = createSymbol(4, "undefined");
@@ -24877,10 +25324,6 @@ var ts;
getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule,
getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintOfTypeParameter, getFirstIdentifier),
getAmbientModules: getAmbientModules,
- getAllAttributesTypeFromJsxOpeningLikeElement: function (nodeIn) {
- var node = ts.getParseTreeNode(nodeIn, ts.isJsxOpeningLikeElement);
- return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined;
- },
getJsxIntrinsicTagNamesAt: getJsxIntrinsicTagNamesAt,
isOptionalParameter: function (nodeIn) {
var node = ts.getParseTreeNode(nodeIn, ts.isParameter);
@@ -24911,6 +25354,7 @@ var ts;
getESSymbolType: function () { return esSymbolType; },
getNeverType: function () { return neverType; },
isSymbolAccessible: isSymbolAccessible,
+ getObjectFlags: ts.getObjectFlags,
isArrayLikeType: isArrayLikeType,
isTypeInvalidDueToUnionDiscriminant: isTypeInvalidDueToUnionDiscriminant,
getAllPossiblePropertiesOfTypes: getAllPossiblePropertiesOfTypes,
@@ -24918,7 +25362,7 @@ var ts;
getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); },
getSuggestionForNonexistentExport: function (node, target) { return getSuggestionForNonexistentExport(node, target); },
getBaseConstraintOfType: getBaseConstraintOfType,
- getDefaultFromTypeParameter: function (type) { return type && type.flags & 65536 ? getDefaultFromTypeParameter(type) : undefined; },
+ getDefaultFromTypeParameter: function (type) { return type && type.flags & 262144 ? getDefaultFromTypeParameter(type) : undefined; },
resolveName: function (name, location, meaning, excludeGlobals) {
return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined, false, excludeGlobals);
},
@@ -24992,35 +25436,41 @@ var ts;
var wildcardType = createIntrinsicType(1, "any");
var errorType = createIntrinsicType(1, "error");
var unknownType = createIntrinsicType(2, "unknown");
- var undefinedType = createIntrinsicType(8192, "undefined");
- var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(8192 | 134217728, "undefined");
- var nullType = createIntrinsicType(16384, "null");
- var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(16384 | 134217728, "null");
+ var undefinedType = createIntrinsicType(32768, "undefined");
+ var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 | 134217728, "undefined");
+ var nullType = createIntrinsicType(65536, "null");
+ var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 | 134217728, "null");
var stringType = createIntrinsicType(4, "string");
var numberType = createIntrinsicType(8, "number");
- var falseType = createIntrinsicType(256, "false");
- var regularFalseType = createIntrinsicType(256, "false");
- var trueType = createIntrinsicType(256, "true");
- var regularTrueType = createIntrinsicType(256, "true");
- falseType.flags |= 33554432;
- trueType.flags |= 33554432;
+ var bigintType = createIntrinsicType(64, "bigint");
+ var falseType = createIntrinsicType(512, "false");
+ var regularFalseType = createIntrinsicType(512, "false");
+ var trueType = createIntrinsicType(512, "true");
+ var regularTrueType = createIntrinsicType(512, "true");
trueType.regularType = regularTrueType;
+ trueType.freshType = trueType;
+ regularTrueType.regularType = regularTrueType;
regularTrueType.freshType = trueType;
falseType.regularType = regularFalseType;
+ falseType.freshType = falseType;
+ regularFalseType.regularType = regularFalseType;
regularFalseType.freshType = falseType;
var booleanType = createBooleanType([regularFalseType, regularTrueType]);
createBooleanType([regularFalseType, trueType]);
createBooleanType([falseType, regularTrueType]);
createBooleanType([falseType, trueType]);
- var esSymbolType = createIntrinsicType(1024, "symbol");
- var voidType = createIntrinsicType(4096, "void");
- var neverType = createIntrinsicType(32768, "never");
- var silentNeverType = createIntrinsicType(32768, "never");
- var implicitNeverType = createIntrinsicType(32768, "never");
- var nonPrimitiveType = createIntrinsicType(16777216, "object");
+ var esSymbolType = createIntrinsicType(4096, "symbol");
+ var voidType = createIntrinsicType(16384, "void");
+ var neverType = createIntrinsicType(131072, "never");
+ var silentNeverType = createIntrinsicType(131072, "never");
+ var implicitNeverType = createIntrinsicType(131072, "never");
+ var nonPrimitiveType = createIntrinsicType(67108864, "object");
var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]);
var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType;
+ var numberOrBigIntType = getUnionType([numberType, bigintType]);
var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+ var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
+ emptyJsxObjectType.objectFlags |= 4096;
var emptyTypeLiteralSymbol = createSymbol(2048, "__type");
emptyTypeLiteralSymbol.members = ts.createSymbolTable();
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
@@ -25031,16 +25481,15 @@ var ts;
var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
- var markerSuperType = createType(65536);
- var markerSubType = createType(65536);
+ var markerSuperType = createType(262144);
+ var markerSubType = createType(262144);
markerSubType.constraint = markerSuperType;
- var markerOtherType = createType(65536);
+ var markerOtherType = createType(262144);
var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType);
var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false);
var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, errorType, undefined, 0, false, false);
var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false);
var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, undefined, 0, false, false);
- var resolvingSignaturesArray = [resolvingSignature];
var enumNumberIndexInfo = createIndexInfo(stringType, true);
var globals = ts.createSymbolTable();
var amalgamatedDuplicates;
@@ -25078,6 +25527,9 @@ var ts;
var deferredGlobalTemplateStringsArrayType;
var deferredGlobalImportMetaType;
var deferredGlobalExtractSymbol;
+ var deferredGlobalExcludeSymbol;
+ var deferredGlobalPickSymbol;
+ var deferredGlobalBigIntType;
var allPotentiallyUnusedIdentifiers = ts.createMap();
var flowLoopStart = 0;
var flowLoopCount = 0;
@@ -25085,6 +25537,7 @@ var ts;
var flowAnalysisDisabled = false;
var emptyStringType = getLiteralType("");
var zeroType = getLiteralType(0);
+ var zeroBigIntType = getLiteralType({ negative: false, base10Value: "0" });
var resolutionTargets = [];
var resolutionResults = [];
var resolutionPropertyNames = [];
@@ -25107,24 +25560,27 @@ var ts;
var typeofEQFacts = ts.createMapFromTemplate({
string: 1,
number: 2,
- boolean: 4,
- symbol: 8,
- undefined: 16384,
- object: 16,
- function: 32
+ bigint: 4,
+ boolean: 8,
+ symbol: 16,
+ undefined: 65536,
+ object: 32,
+ function: 64
});
var typeofNEFacts = ts.createMapFromTemplate({
- string: 128,
- number: 256,
- boolean: 512,
- symbol: 1024,
- undefined: 131072,
- object: 2048,
- function: 4096
+ string: 256,
+ number: 512,
+ bigint: 1024,
+ boolean: 2048,
+ symbol: 4096,
+ undefined: 524288,
+ object: 8192,
+ function: 16384
});
var typeofTypesByName = ts.createMapFromTemplate({
string: stringType,
number: numberType,
+ bigint: bigintType,
boolean: booleanType,
symbol: esSymbolType,
undefined: undefinedType
@@ -25293,7 +25749,7 @@ var ts;
(source.flags | target.flags) & 67108864) {
ts.Debug.assert(source !== target);
if (!(target.flags & 33554432)) {
- target = cloneSymbol(target);
+ target = cloneSymbol(resolveSymbol(target));
}
if (source.flags & 512 && target.flags & 512 && target.constEnumOnlyModule && !source.constEnumOnlyModule) {
target.constEnumOnlyModule = false;
@@ -25385,7 +25841,8 @@ var ts;
}
function mergeSymbolTable(target, source) {
source.forEach(function (sourceSymbol, id) {
- target.set(id, target.has(id) ? mergeSymbol(target.get(id), sourceSymbol) : sourceSymbol);
+ var targetSymbol = target.get(id);
+ target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol) : sourceSymbol);
});
}
function mergeModuleAugmentation(moduleName) {
@@ -25439,7 +25896,7 @@ var ts;
return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 });
}
function isGlobalSourceFile(node) {
- return node.kind === 277 && !ts.isExternalOrCommonJsModule(node);
+ return node.kind === 279 && !ts.isExternalOrCommonJsModule(node);
}
function getSymbol(symbols, name, meaning) {
if (meaning) {
@@ -25485,15 +25942,15 @@ var ts;
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
}
if (declaration.pos <= usage.pos) {
- if (declaration.kind === 184) {
- var errorBindingElement = ts.getAncestor(usage, 184);
+ if (declaration.kind === 186) {
+ var errorBindingElement = ts.getAncestor(usage, 186);
if (errorBindingElement) {
return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) ||
declaration.pos < errorBindingElement.pos;
}
- return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 235), usage);
+ return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 237), usage);
}
- else if (declaration.kind === 235) {
+ else if (declaration.kind === 237) {
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
}
else if (ts.isClassDeclaration(declaration)) {
@@ -25501,10 +25958,10 @@ var ts;
}
return true;
}
- if (usage.parent.kind === 255 || (usage.parent.kind === 252 && usage.parent.isExportEquals)) {
+ if (usage.parent.kind === 257 || (usage.parent.kind === 254 && usage.parent.isExportEquals)) {
return true;
}
- if (usage.kind === 252 && usage.isExportEquals) {
+ if (usage.kind === 254 && usage.isExportEquals) {
return true;
}
var container = ts.getEnclosingBlockScopeContainer(declaration);
@@ -25512,9 +25969,9 @@ var ts;
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) {
var container = ts.getEnclosingBlockScopeContainer(declaration);
switch (declaration.parent.parent.kind) {
- case 217:
- case 223:
+ case 219:
case 225:
+ case 227:
if (isSameScopeDescendentOf(usage, declaration, container)) {
return true;
}
@@ -25532,16 +25989,16 @@ var ts;
return true;
}
var initializerOfProperty = current.parent &&
- current.parent.kind === 152 &&
+ current.parent.kind === 154 &&
current.parent.initializer === current;
if (initializerOfProperty) {
if (ts.hasModifier(current.parent, 32)) {
- if (declaration.kind === 154) {
+ if (declaration.kind === 156) {
return true;
}
}
else {
- var isDeclarationInstanceProperty = declaration.kind === 152 && !ts.hasModifier(declaration, 32);
+ var isDeclarationInstanceProperty = declaration.kind === 154 && !ts.hasModifier(declaration, 32);
if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) {
return true;
}
@@ -25569,11 +26026,11 @@ var ts;
if (result = lookup(location.locals, name, meaning)) {
var useResult = true;
if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) {
- if (meaning & result.flags & 67897832 && lastLocation.kind !== 289) {
+ if (meaning & result.flags & 67897832 && lastLocation.kind !== 291) {
useResult = result.flags & 262144
? lastLocation === location.type ||
- lastLocation.kind === 149 ||
- lastLocation.kind === 148
+ lastLocation.kind === 151 ||
+ lastLocation.kind === 150
: false;
}
if (meaning & result.flags & 3) {
@@ -25584,13 +26041,13 @@ var ts;
}
else if (result.flags & 1) {
useResult =
- lastLocation.kind === 149 ||
+ lastLocation.kind === 151 ||
(lastLocation === location.type &&
!!ts.findAncestor(result.valueDeclaration, ts.isParameter));
}
}
}
- else if (location.kind === 173) {
+ else if (location.kind === 175) {
useResult = lastLocation === location.trueType;
}
if (useResult) {
@@ -25602,13 +26059,13 @@ var ts;
}
}
switch (location.kind) {
- case 277:
+ case 279:
if (!ts.isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 242:
+ case 244:
var moduleExports = getSymbolOfNode(location).exports;
- if (location.kind === 277 || ts.isAmbientModule(location)) {
+ if (location.kind === 279 || ts.isAmbientModule(location)) {
if (result = moduleExports.get("default")) {
var localSymbol = ts.getLocalSymbolForExportDefault(result);
if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) {
@@ -25619,7 +26076,7 @@ var ts;
var moduleExport = moduleExports.get(name);
if (moduleExport &&
moduleExport.flags === 2097152 &&
- ts.getDeclarationOfKind(moduleExport, 255)) {
+ ts.getDeclarationOfKind(moduleExport, 257)) {
break;
}
}
@@ -25632,13 +26089,13 @@ var ts;
}
}
break;
- case 241:
+ case 243:
if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) {
break loop;
}
break;
- case 152:
- case 151:
+ case 154:
+ case 153:
if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32)) {
var ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -25648,9 +26105,9 @@ var ts;
}
}
break;
- case 238:
- case 207:
- case 239:
+ case 240:
+ case 209:
+ case 241:
if (result = lookup(getSymbolOfNode(location).members || emptySymbols, name, meaning & 67897832)) {
if (!isTypeParameterSymbolDeclaredInContainer(result, location)) {
result = undefined;
@@ -25662,7 +26119,7 @@ var ts;
}
break loop;
}
- if (location.kind === 207 && meaning & 32) {
+ if (location.kind === 209 && meaning & 32) {
var className = location.name;
if (className && name === className.escapedText) {
result = location.symbol;
@@ -25670,8 +26127,8 @@ var ts;
}
}
break;
- case 209:
- if (lastLocation === location.expression && location.parent.token === 85) {
+ case 211:
+ if (lastLocation === location.expression && location.parent.token === 86) {
var container = location.parent.parent;
if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 67897832))) {
if (nameNotFoundMessage) {
@@ -25681,28 +26138,28 @@ var ts;
}
}
break;
- case 147:
+ case 149:
grandparent = location.parent.parent;
- if (ts.isClassLike(grandparent) || grandparent.kind === 239) {
+ if (ts.isClassLike(grandparent) || grandparent.kind === 241) {
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 67897832)) {
error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
return undefined;
}
}
break;
- case 154:
- case 153:
- case 155:
case 156:
+ case 155:
case 157:
- case 237:
- case 195:
+ case 158:
+ case 159:
+ case 239:
+ case 197:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 194:
+ case 196:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -25715,16 +26172,16 @@ var ts;
}
}
break;
- case 150:
- if (location.parent && location.parent.kind === 149) {
+ case 152:
+ if (location.parent && location.parent.kind === 151) {
location = location.parent;
}
if (location.parent && ts.isClassElement(location.parent)) {
location = location.parent;
}
break;
- case 302:
- case 295:
+ case 304:
+ case 297:
location = ts.getJSDocHost(location);
break;
}
@@ -25739,7 +26196,7 @@ var ts;
}
if (!result) {
if (lastLocation) {
- ts.Debug.assert(lastLocation.kind === 277);
+ ts.Debug.assert(lastLocation.kind === 279);
if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
return lastLocation.symbol;
}
@@ -25797,8 +26254,7 @@ var ts;
}
}
if (result && isInExternalModule && (meaning & 67220415) === 67220415 && !(originalLocation.flags & 2097152)) {
- var decls = result.declarations;
- if (decls && decls.length === 1 && decls[0].kind === 245) {
+ if (ts.some(result.declarations, function (d) { return ts.isNamespaceExportDeclaration(d) || ts.isSourceFile(d) && !!d.symbol.globalExports; })) {
error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name));
}
}
@@ -25807,12 +26263,12 @@ var ts;
}
function isSelfReferenceLocation(node) {
switch (node.kind) {
- case 237:
- case 238:
case 239:
- case 241:
case 240:
+ case 241:
+ case 243:
case 242:
+ case 244:
return true;
default:
return false;
@@ -25824,7 +26280,7 @@ var ts;
function isTypeParameterSymbolDeclaredInContainer(symbol, container) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
- if (decl.kind === 148) {
+ if (decl.kind === 150) {
var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent;
if (parent === container) {
return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias));
@@ -25872,10 +26328,10 @@ var ts;
}
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
- case 71:
- case 187:
+ case 72:
+ case 189:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
- case 209:
+ case 211:
if (ts.isEntityNameExpression(node.expression)) {
return node.expression;
}
@@ -25940,7 +26396,7 @@ var ts;
}
function checkResolvedBlockScopedVariable(result, errorLocation) {
ts.Debug.assert(!!(result.flags & 2 || result.flags & 32 || result.flags & 384));
- var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 241) || ts.isInJSFile(d) && !!ts.getJSDocEnumTag(d); });
+ var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 243) || ts.isInJSFile(d) && !!ts.getJSDocEnumTag(d); });
if (declaration === undefined)
return ts.Debug.fail("Declaration to checkResolvedBlockScopedVariable is undefined");
if (!(declaration.flags & 4194304) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) {
@@ -25971,13 +26427,13 @@ var ts;
}
function getAnyImportSyntax(node) {
switch (node.kind) {
- case 246:
- return node;
case 248:
+ return node;
+ case 250:
return node.parent;
- case 249:
- return node.parent.parent;
case 251:
+ return node.parent.parent;
+ case 253:
return node.parent.parent.parent;
default:
return undefined;
@@ -25987,7 +26443,7 @@ var ts;
return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration);
}
function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) {
- if (node.moduleReference.kind === 257) {
+ if (node.moduleReference.kind === 259) {
return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)));
}
return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias);
@@ -26146,20 +26602,20 @@ var ts;
function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) {
if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; }
switch (node.kind) {
- case 246:
- return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
case 248:
+ return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
+ case 250:
return getTargetOfImportClause(node, dontRecursivelyResolve);
- case 249:
- return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
case 251:
+ return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
+ case 253:
return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
- case 255:
+ case 257:
return getTargetOfExportSpecifier(node, 67220415 | 67897832 | 1920, dontRecursivelyResolve);
- case 252:
- case 202:
+ case 254:
+ case 204:
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
- case 245:
+ case 247:
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
default:
return ts.Debug.fail();
@@ -26213,10 +26669,10 @@ var ts;
var node = getDeclarationOfAliasSymbol(symbol);
if (!node)
return ts.Debug.fail();
- if (node.kind === 252) {
+ if (node.kind === 254) {
checkExpressionCached(node.expression);
}
- else if (node.kind === 255) {
+ else if (node.kind === 257) {
checkExpressionCached(node.propertyName || node.name);
}
else if (ts.isInternalModuleImportEqualsDeclaration(node)) {
@@ -26225,14 +26681,14 @@ var ts;
}
}
function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, dontResolveAlias) {
- if (entityName.kind === 71 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
+ if (entityName.kind === 72 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 71 || entityName.parent.kind === 146) {
+ if (entityName.kind === 72 || entityName.parent.kind === 148) {
return resolveEntityName(entityName, 1920, false, dontResolveAlias);
}
else {
- ts.Debug.assert(entityName.parent.kind === 246);
+ ts.Debug.assert(entityName.parent.kind === 248);
return resolveEntityName(entityName, 67220415 | 67897832 | 1920, false, dontResolveAlias);
}
}
@@ -26245,7 +26701,7 @@ var ts;
}
var namespaceMeaning = 1920 | (ts.isInJSFile(name) ? meaning & 67220415 : 0);
var symbol;
- if (name.kind === 71) {
+ if (name.kind === 72) {
var message = meaning === namespaceMeaning ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(getFirstIdentifier(name).escapedText);
var symbolFromJSPrototype = ts.isInJSFile(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
symbol = resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, true);
@@ -26253,9 +26709,9 @@ var ts;
return symbolFromJSPrototype;
}
}
- else if (name.kind === 146 || name.kind === 187) {
- var left = name.kind === 146 ? name.left : name.expression;
- var right = name.kind === 146 ? name.right : name.name;
+ else if (name.kind === 148 || name.kind === 189) {
+ var left = name.kind === 148 ? name.left : name.expression;
+ var right = name.kind === 148 ? name.right : name.name;
var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location);
if (!namespace || ts.nodeIsMissing(right)) {
return undefined;
@@ -26330,6 +26786,9 @@ var ts;
}
function getDeclarationOfJSPrototypeContainer(symbol) {
var decl = symbol.parent.valueDeclaration;
+ if (!decl) {
+ return undefined;
+ }
var initializer = ts.isAssignmentDeclaration(decl) ? ts.getAssignedExpandoInitializer(decl) :
ts.hasOnlyExpressionInitializer(decl) ? ts.getDeclaredExpandoInitializer(decl) :
undefined;
@@ -26441,10 +26900,15 @@ var ts;
return getPackagesSet().has(ts.getTypesPackageName(packageName));
}
function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) {
- return moduleSymbol && getMergedSymbol(getCommonJsExportEquals(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias), moduleSymbol)) || moduleSymbol;
+ if (moduleSymbol) {
+ var exportEquals = resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias);
+ var exported = getCommonJsExportEquals(exportEquals, moduleSymbol);
+ return getMergedSymbol(exported) || moduleSymbol;
+ }
+ return undefined;
}
function getCommonJsExportEquals(exported, moduleSymbol) {
- if (!exported || exported === unknownSymbol || moduleSymbol.exports.size === 1) {
+ if (!exported || exported === unknownSymbol || exported === moduleSymbol || moduleSymbol.exports.size === 1 || exported.flags & 2097152) {
return exported;
}
var merged = cloneSymbol(exported);
@@ -26462,7 +26926,7 @@ var ts;
function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias) {
var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
if (!dontResolveAlias && symbol) {
- if (!(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 277)) {
+ if (!(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 279)) {
error(referencingLocation, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol));
return symbol;
}
@@ -26529,7 +26993,7 @@ var ts;
return undefined;
}
var type = getTypeOfSymbol(exportEquals);
- return type.flags & 32764 ? undefined : getPropertyOfType(type, memberName);
+ return type.flags & 131068 ? undefined : getPropertyOfType(type, memberName);
}
function getExportsOfSymbol(symbol) {
return symbol.flags & 32 ? getResolvedMembersOrExportsOfSymbol(symbol, "resolvedExports") :
@@ -26660,7 +27124,7 @@ var ts;
var members = node.members;
for (var _i = 0, members_2 = members; _i < members_2.length; _i++) {
var member = members_2[_i];
- if (member.kind === 155 && ts.nodeIsPresent(member.body)) {
+ if (member.kind === 157 && ts.nodeIsPresent(member.body)) {
return member;
}
}
@@ -26683,7 +27147,7 @@ var ts;
return type;
}
function createObjectType(objectFlags, symbol) {
- var type = createType(131072);
+ var type = createType(524288);
type.objectFlags = objectFlags;
type.symbol = symbol;
type.members = undefined;
@@ -26733,11 +27197,11 @@ var ts;
}
}
switch (location.kind) {
- case 277:
+ case 279:
if (!ts.isExternalOrCommonJsModule(location)) {
break;
}
- case 242:
+ case 244:
if (result = callback(getSymbolOfNode(location).exports)) {
return result;
}
@@ -26787,7 +27251,7 @@ var ts;
&& symbolFromSymbolTable.escapedName !== "default"
&& !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration)))
&& (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))
- && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 255))) {
+ && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 257))) {
var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) {
return [symbolFromSymbolTable];
@@ -26816,7 +27280,7 @@ var ts;
if (symbolFromSymbolTable === symbol) {
return true;
}
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 255)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
+ symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 257)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
if (symbolFromSymbolTable.flags & meaning) {
qualify = true;
return true;
@@ -26830,10 +27294,10 @@ var ts;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
switch (declaration.kind) {
- case 152:
case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
continue;
default:
return false;
@@ -26921,10 +27385,10 @@ var ts;
return node && getSymbolOfNode(node);
}
function hasExternalModuleSymbol(declaration) {
- return ts.isAmbientModule(declaration) || (declaration.kind === 277 && ts.isExternalOrCommonJsModule(declaration));
+ return ts.isAmbientModule(declaration) || (declaration.kind === 279 && ts.isExternalOrCommonJsModule(declaration));
}
function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
- return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 277 && ts.isExternalOrCommonJsModule(declaration));
+ return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 279 && ts.isExternalOrCommonJsModule(declaration));
}
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
var aliasesToMakeVisible;
@@ -26964,13 +27428,13 @@ var ts;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
var meaning;
- if (entityName.parent.kind === 165 ||
+ if (entityName.parent.kind === 167 ||
ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) ||
- entityName.parent.kind === 147) {
+ entityName.parent.kind === 149) {
meaning = 67220415 | 1048576;
}
- else if (entityName.kind === 146 || entityName.kind === 187 ||
- entityName.parent.kind === 246) {
+ else if (entityName.kind === 148 || entityName.kind === 189 ||
+ entityName.parent.kind === 248) {
meaning = 1920;
}
else {
@@ -27015,15 +27479,15 @@ var ts;
function signatureToStringWorker(writer) {
var sigOutput;
if (flags & 262144) {
- sigOutput = kind === 1 ? 164 : 163;
+ sigOutput = kind === 1 ? 166 : 165;
}
else {
- sigOutput = kind === 1 ? 159 : 158;
+ sigOutput = kind === 1 ? 161 : 160;
}
var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512);
var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
- printer.writeNode(4, sig, sourceFile, writer);
+ printer.writeNode(4, sig, sourceFile, ts.getTrailingSemicolonOmittingWriter(writer));
return writer;
}
}
@@ -27087,7 +27551,8 @@ var ts;
getCurrentDirectory: host.getCurrentDirectory && (function () { return host.getCurrentDirectory(); })
} : undefined },
encounteredError: false,
- visitedSymbols: undefined,
+ visitedTypes: undefined,
+ symbolDepth: undefined,
inferTypeParameters: undefined,
approximateLength: 0
};
@@ -27111,48 +27576,55 @@ var ts;
}
if (type.flags & 1) {
context.approximateLength += 3;
- return ts.createKeywordTypeNode(119);
+ return ts.createKeywordTypeNode(120);
}
if (type.flags & 2) {
- return ts.createKeywordTypeNode(142);
+ return ts.createKeywordTypeNode(143);
}
if (type.flags & 4) {
context.approximateLength += 6;
- return ts.createKeywordTypeNode(137);
+ return ts.createKeywordTypeNode(138);
}
if (type.flags & 8) {
context.approximateLength += 6;
- return ts.createKeywordTypeNode(134);
+ return ts.createKeywordTypeNode(135);
+ }
+ if (type.flags & 64) {
+ context.approximateLength += 6;
+ return ts.createKeywordTypeNode(146);
}
if (type.flags & 16) {
context.approximateLength += 7;
- return ts.createKeywordTypeNode(122);
+ return ts.createKeywordTypeNode(123);
}
- if (type.flags & 512 && !(type.flags & 262144)) {
+ if (type.flags & 1024 && !(type.flags & 1048576)) {
var parentSymbol = getParentOfSymbol(type.symbol);
- var parentName = symbolToName(parentSymbol, context, 67897832, false);
- var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type ? parentName : ts.createQualifiedName(parentName, ts.symbolName(type.symbol));
- context.approximateLength += ts.symbolName(type.symbol).length;
- return ts.createTypeReferenceNode(enumLiteralName, undefined);
+ var parentName = symbolToTypeNode(parentSymbol, context, 67897832);
+ var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type
+ ? parentName
+ : appendReferenceToType(parentName, ts.createTypeReferenceNode(ts.symbolName(type.symbol), undefined));
+ return enumLiteralName;
}
- if (type.flags & 544) {
- var name = symbolToName(type.symbol, context, 67897832, false);
- context.approximateLength += ts.symbolName(type.symbol).length;
- return ts.createTypeReferenceNode(name, undefined);
+ if (type.flags & 1056) {
+ return symbolToTypeNode(type.symbol, context, 67897832);
}
- if (type.flags & 64) {
+ if (type.flags & 128) {
context.approximateLength += (type.value.length + 2);
return ts.createLiteralTypeNode(ts.setEmitFlags(ts.createLiteral(type.value), 16777216));
}
- if (type.flags & 128) {
+ if (type.flags & 256) {
context.approximateLength += (("" + type.value).length);
return ts.createLiteralTypeNode((ts.createLiteral(type.value)));
}
- if (type.flags & 256) {
+ if (type.flags & 2048) {
+ context.approximateLength += (ts.pseudoBigIntToString(type.value).length) + 1;
+ return ts.createLiteralTypeNode((ts.createLiteral(type.value)));
+ }
+ if (type.flags & 512) {
context.approximateLength += type.intrinsicName.length;
return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse();
}
- if (type.flags & 2048) {
+ if (type.flags & 8192) {
if (!(context.flags & 1048576)) {
if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
context.approximateLength += 6;
@@ -27163,33 +27635,33 @@ var ts;
}
}
context.approximateLength += 13;
- return ts.createTypeOperatorNode(141, ts.createKeywordTypeNode(138));
- }
- if (type.flags & 4096) {
- context.approximateLength += 4;
- return ts.createKeywordTypeNode(105);
- }
- if (type.flags & 8192) {
- context.approximateLength += 9;
- return ts.createKeywordTypeNode(140);
+ return ts.createTypeOperatorNode(142, ts.createKeywordTypeNode(139));
}
if (type.flags & 16384) {
context.approximateLength += 4;
- return ts.createKeywordTypeNode(95);
+ return ts.createKeywordTypeNode(106);
}
if (type.flags & 32768) {
+ context.approximateLength += 9;
+ return ts.createKeywordTypeNode(141);
+ }
+ if (type.flags & 65536) {
+ context.approximateLength += 4;
+ return ts.createKeywordTypeNode(96);
+ }
+ if (type.flags & 131072) {
context.approximateLength += 5;
- return ts.createKeywordTypeNode(131);
+ return ts.createKeywordTypeNode(132);
}
- if (type.flags & 1024) {
+ if (type.flags & 4096) {
context.approximateLength += 6;
- return ts.createKeywordTypeNode(138);
+ return ts.createKeywordTypeNode(139);
}
- if (type.flags & 16777216) {
+ if (type.flags & 67108864) {
context.approximateLength += 6;
- return ts.createKeywordTypeNode(135);
+ return ts.createKeywordTypeNode(136);
}
- if (type.flags & 65536 && type.isThisType) {
+ if (type.flags & 262144 && type.isThisType) {
if (context.flags & 4194304) {
if (!context.encounteredError && !(context.flags & 32768)) {
context.encounteredError = true;
@@ -27203,16 +27675,16 @@ var ts;
}
var objectFlags = ts.getObjectFlags(type);
if (objectFlags & 4) {
- ts.Debug.assert(!!(type.flags & 131072));
+ ts.Debug.assert(!!(type.flags & 524288));
return typeReferenceToTypeNode(type);
}
- if (type.flags & 65536 || objectFlags & 3) {
- if (type.flags & 65536 && ts.contains(context.inferTypeParameters, type)) {
+ if (type.flags & 262144 || objectFlags & 3) {
+ if (type.flags & 262144 && ts.contains(context.inferTypeParameters, type)) {
context.approximateLength += (ts.symbolName(type.symbol).length + 6);
return ts.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, undefined));
}
if (context.flags & 4 &&
- type.flags & 65536 &&
+ type.flags & 262144 &&
ts.length(type.symbol.declarations) &&
ts.isTypeParameterDeclaration(type.symbol.declarations[0]) &&
typeParameterShadowsNameInScope(type, context) &&
@@ -27231,14 +27703,14 @@ var ts;
return ts.createTypeReferenceNode(ts.createIdentifier(""), typeArgumentNodes);
return symbolToTypeNode(type.aliasSymbol, context, 67897832, typeArgumentNodes);
}
- if (type.flags & (262144 | 524288)) {
- var types = type.flags & 262144 ? formatUnionTypes(type.types) : type.types;
+ if (type.flags & (1048576 | 2097152)) {
+ var types = type.flags & 1048576 ? formatUnionTypes(type.types) : type.types;
if (ts.length(types) === 1) {
return typeToTypeNodeHelper(types[0], context);
}
var typeNodes = mapToTypeNodes(types, context, true);
if (typeNodes && typeNodes.length > 0) {
- var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 262144 ? 171 : 172, typeNodes);
+ var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 ? 173 : 174, typeNodes);
return unionOrIntersectionTypeNode;
}
else {
@@ -27249,22 +27721,22 @@ var ts;
}
}
if (objectFlags & (16 | 32)) {
- ts.Debug.assert(!!(type.flags & 131072));
+ ts.Debug.assert(!!(type.flags & 524288));
return createAnonymousTypeNode(type);
}
- if (type.flags & 1048576) {
+ if (type.flags & 4194304) {
var indexedType = type.type;
context.approximateLength += 6;
var indexTypeNode = typeToTypeNodeHelper(indexedType, context);
return ts.createTypeOperatorNode(indexTypeNode);
}
- if (type.flags & 2097152) {
+ if (type.flags & 8388608) {
var objectTypeNode = typeToTypeNodeHelper(type.objectType, context);
var indexTypeNode = typeToTypeNodeHelper(type.indexType, context);
context.approximateLength += 2;
return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode);
}
- if (type.flags & 4194304) {
+ if (type.flags & 16777216) {
var checkTypeNode = typeToTypeNodeHelper(type.checkType, context);
var saveInferTypeParameters = context.inferTypeParameters;
context.inferTypeParameters = type.root.inferTypeParameters;
@@ -27275,12 +27747,12 @@ var ts;
context.approximateLength += 15;
return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
}
- if (type.flags & 8388608) {
+ if (type.flags & 33554432) {
return typeToTypeNodeHelper(type.typeVariable, context);
}
return ts.Debug.fail("Should be unreachable.");
function createMappedTypeNodeFromType(type) {
- ts.Debug.assert(!!(type.flags & 131072));
+ ts.Debug.assert(!!(type.flags & 524288));
var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined;
var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined;
var appropriateConstraintTypeNode;
@@ -27297,6 +27769,7 @@ var ts;
return ts.setEmitFlags(mappedTypeNode, 1);
}
function createAnonymousTypeNode(type) {
+ var typeId = "" + type.id;
var symbol = type.symbol;
var id;
if (symbol) {
@@ -27306,28 +27779,44 @@ var ts;
var isInstanceType = type === getInferredClassType(symbol) ? 67897832 : 67220415;
return symbolToTypeNode(symbol, context, isInstanceType);
}
- else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 207 && context.flags & 2048) ||
+ else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 209 && context.flags & 2048) ||
symbol.flags & (384 | 512) ||
shouldWriteTypeOfFunctionSymbol()) {
return symbolToTypeNode(symbol, context, 67220415);
}
- else if (context.visitedSymbols && context.visitedSymbols.has(id)) {
+ else if (context.visitedTypes && context.visitedTypes.has(typeId)) {
var typeAlias = getTypeAliasForTypeLiteral(type);
if (typeAlias) {
return symbolToTypeNode(typeAlias, context, 67897832);
}
else {
context.approximateLength += 3;
- return ts.createKeywordTypeNode(119);
+ if (!(context.flags & 1)) {
+ return ts.createTypeReferenceNode(ts.createIdentifier("..."), undefined);
+ }
+ return ts.createKeywordTypeNode(120);
}
}
else {
- if (!context.visitedSymbols) {
- context.visitedSymbols = ts.createMap();
+ if (!context.visitedTypes) {
+ context.visitedTypes = ts.createMap();
}
- context.visitedSymbols.set(id, true);
+ if (!context.symbolDepth) {
+ context.symbolDepth = ts.createMap();
+ }
+ var depth = context.symbolDepth.get(id) || 0;
+ if (depth > 10) {
+ context.approximateLength += 3;
+ if (!(context.flags & 1)) {
+ return ts.createTypeReferenceNode(ts.createIdentifier("..."), undefined);
+ }
+ return ts.createKeywordTypeNode(120);
+ }
+ context.symbolDepth.set(id, depth + 1);
+ context.visitedTypes.set(typeId, true);
var result = createTypeNodeFromObjectType(type);
- context.visitedSymbols.delete(id);
+ context.visitedTypes.delete(typeId);
+ context.symbolDepth.set(id, depth);
return result;
}
}
@@ -27340,10 +27829,10 @@ var ts;
var isNonLocalFunctionSymbol = !!(symbol.flags & 16) &&
(symbol.parent ||
ts.forEach(symbol.declarations, function (declaration) {
- return declaration.parent.kind === 277 || declaration.parent.kind === 243;
+ return declaration.parent.kind === 279 || declaration.parent.kind === 245;
}));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
- return (!!(context.flags & 4096) || (context.visitedSymbols && context.visitedSymbols.has(id))) &&
+ return (!!(context.flags & 4096) || (context.visitedTypes && context.visitedTypes.has(typeId))) &&
(!(context.flags & 8) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
}
}
@@ -27360,12 +27849,12 @@ var ts;
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
var signature = resolved.callSignatures[0];
- var signatureNode = signatureToSignatureDeclarationHelper(signature, 163, context);
+ var signatureNode = signatureToSignatureDeclarationHelper(signature, 165, context);
return signatureNode;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
var signature = resolved.constructSignatures[0];
- var signatureNode = signatureToSignatureDeclarationHelper(signature, 164, context);
+ var signatureNode = signatureToSignatureDeclarationHelper(signature, 166, context);
return signatureNode;
}
}
@@ -27490,11 +27979,11 @@ var ts;
var typeElements = [];
for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) {
var signature = _a[_i];
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 158, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 160, context));
}
for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) {
var signature = _c[_b];
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 159, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 161, context));
}
if (resolvedType.stringIndexInfo) {
var indexInfo = resolvedType.objectFlags & 2048 ?
@@ -27545,12 +28034,12 @@ var ts;
var propertyName = symbolToName(propertySymbol, context, 67220415, true);
context.approximateLength += (ts.symbolName(propertySymbol).length + 1);
context.enclosingDeclaration = saveEnclosingDeclaration;
- var optionalToken = propertySymbol.flags & 16777216 ? ts.createToken(55) : undefined;
+ var optionalToken = propertySymbol.flags & 16777216 ? ts.createToken(56) : undefined;
if (propertySymbol.flags & (16 | 8192) && !getPropertiesOfObjectType(propertyType).length) {
var signatures = getSignaturesOfType(propertyType, 0);
for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) {
var signature = signatures_1[_i];
- var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 153, context);
+ var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 155, context);
methodDeclaration.name = propertyName;
methodDeclaration.questionToken = optionalToken;
if (propertySymbol.valueDeclaration) {
@@ -27562,9 +28051,9 @@ var ts;
else {
var savedFlags = context.flags;
context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048) ? 33554432 : 0;
- var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(119);
+ var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120);
context.flags = savedFlags;
- var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(132)] : undefined;
+ var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(133)] : undefined;
if (modifiers) {
context.approximateLength += 9;
}
@@ -27613,14 +28102,14 @@ var ts;
}
function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) {
var name = ts.getNameFromIndexInfo(indexInfo) || "x";
- var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 137 : 134);
+ var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 138 : 135);
var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined);
var typeNode = typeToTypeNodeHelper(indexInfo.type || anyType, context);
if (!indexInfo.type && !(context.flags & 2097152)) {
context.encounteredError = true;
}
context.approximateLength += (name.length + 4);
- return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(132)] : undefined, [indexingParameter], typeNode);
+ return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(133)] : undefined, [indexingParameter], typeNode);
}
function signatureToSignatureDeclarationHelper(signature, kind, context) {
var typeParameters;
@@ -27631,7 +28120,7 @@ var ts;
else {
typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); });
}
- var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 155); });
+ var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 157); });
if (signature.thisParameter) {
var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context);
parameters.unshift(thisParameter);
@@ -27650,12 +28139,12 @@ var ts;
returnTypeNode = returnType && typeToTypeNodeHelper(returnType, context);
}
if (context.flags & 256) {
- if (returnTypeNode && returnTypeNode.kind === 119) {
+ if (returnTypeNode && returnTypeNode.kind === 120) {
returnTypeNode = undefined;
}
}
else if (!returnTypeNode) {
- returnTypeNode = ts.createKeywordTypeNode(119);
+ returnTypeNode = ts.createKeywordTypeNode(120);
}
context.approximateLength += 3;
return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode, typeArguments);
@@ -27684,9 +28173,9 @@ var ts;
return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
}
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) {
- var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 149);
+ var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 151);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
- parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 297);
+ parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 299);
}
var parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
@@ -27695,16 +28184,16 @@ var ts;
var parameterTypeNode = typeToTypeNodeHelper(parameterType, context);
var modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(ts.getSynthesizedClone) : undefined;
var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 8192;
- var dotDotDotToken = isRest ? ts.createToken(24) : undefined;
+ var dotDotDotToken = isRest ? ts.createToken(25) : undefined;
var name = parameterDeclaration
? parameterDeclaration.name ?
- parameterDeclaration.name.kind === 71 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216) :
- parameterDeclaration.name.kind === 146 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) :
+ parameterDeclaration.name.kind === 72 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216) :
+ parameterDeclaration.name.kind === 148 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) :
cloneBindingName(parameterDeclaration.name) :
ts.symbolName(parameterSymbol)
: ts.symbolName(parameterSymbol);
var isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 4096;
- var questionToken = isOptional ? ts.createToken(55) : undefined;
+ var questionToken = isOptional ? ts.createToken(56) : undefined;
var parameterNode = ts.createParameter(undefined, modifiers, dotDotDotToken, name, questionToken, parameterTypeNode, undefined);
context.approximateLength += ts.symbolName(parameterSymbol).length + 3;
return parameterNode;
@@ -27716,7 +28205,7 @@ var ts;
}
var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, undefined, elideInitializerAndSetEmitFlags);
var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited);
- if (clone.kind === 184) {
+ if (clone.kind === 186) {
clone.initializer = undefined;
}
return ts.setEmitFlags(clone, 1 | 16777216);
@@ -27804,7 +28293,7 @@ var ts;
return top;
}
function getSpecifierForModuleSymbol(symbol, context) {
- var file = ts.getDeclarationOfKind(symbol, 277);
+ var file = ts.getDeclarationOfKind(symbol, 279);
if (file && file.moduleName !== undefined) {
return file.moduleName;
}
@@ -27996,10 +28485,10 @@ var ts;
for (var i = 0; i < types.length; i++) {
var t = types[i];
flags |= t.flags;
- if (!(t.flags & 24576)) {
- if (t.flags & (256 | 512)) {
- var baseType = t.flags & 256 ? booleanType : getBaseTypeOfEnumLiteralType(t);
- if (baseType.flags & 262144) {
+ if (!(t.flags & 98304)) {
+ if (t.flags & (512 | 1024)) {
+ var baseType = t.flags & 512 ? booleanType : getBaseTypeOfEnumLiteralType(t);
+ if (baseType.flags & 1048576) {
var count = baseType.types.length;
if (i + count <= types.length && getRegularTypeOfLiteralType(types[i + count - 1]) === getRegularTypeOfLiteralType(baseType.types[count - 1])) {
result.push(baseType);
@@ -28011,9 +28500,9 @@ var ts;
result.push(t);
}
}
- if (flags & 16384)
+ if (flags & 65536)
result.push(nullType);
- if (flags & 8192)
+ if (flags & 32768)
result.push(undefinedType);
return result || types;
}
@@ -28028,8 +28517,8 @@ var ts;
}
function getTypeAliasForTypeLiteral(type) {
if (type.symbol && type.symbol.flags & 2048) {
- var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 175; });
- if (node.kind === 240) {
+ var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 177; });
+ if (node.kind === 242) {
return getSymbolOfNode(node);
}
}
@@ -28037,11 +28526,11 @@ var ts;
}
function isTopLevelInExternalModuleAugmentation(node) {
return node && node.parent &&
- node.parent.kind === 243 &&
+ node.parent.kind === 245 &&
ts.isExternalModuleAugmentation(node.parent.parent);
}
function isDefaultBindingContext(location) {
- return location.kind === 277 || ts.isAmbientModule(location);
+ return location.kind === 279 || ts.isAmbientModule(location);
}
function getNameOfSymbolAsWritten(symbol, context) {
if (context && symbol.escapedName === "default" && !(context.flags & 16384) &&
@@ -28054,27 +28543,30 @@ var ts;
var declaration = symbol.declarations[0];
var name = ts.getNameOfDeclaration(declaration);
if (name) {
+ if (ts.isCallExpression(declaration) && ts.isBindableObjectDefinePropertyCall(declaration)) {
+ return ts.symbolName(symbol);
+ }
return ts.declarationNameToString(name);
}
- if (declaration.parent && declaration.parent.kind === 235) {
+ if (declaration.parent && declaration.parent.kind === 237) {
return ts.declarationNameToString(declaration.parent.name);
}
switch (declaration.kind) {
- case 207:
- case 194:
- case 195:
+ case 209:
+ case 196:
+ case 197:
if (context && !context.encounteredError && !(context.flags & 131072)) {
context.encounteredError = true;
}
- return declaration.kind === 207 ? "(Anonymous class)" : "(Anonymous function)";
+ return declaration.kind === 209 ? "(Anonymous class)" : "(Anonymous function)";
}
}
var nameType = symbol.nameType;
if (nameType) {
- if (nameType.flags & 64 && !ts.isIdentifierText(nameType.value, compilerOptions.target)) {
+ if (nameType.flags & 128 && !ts.isIdentifierText(nameType.value, compilerOptions.target)) {
return "\"" + ts.escapeString(nameType.value, 34) + "\"";
}
- if (nameType && nameType.flags & 2048) {
+ if (nameType && nameType.flags & 8192) {
return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
}
}
@@ -28091,66 +28583,66 @@ var ts;
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 295:
- case 302:
+ case 297:
+ case 304:
return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent));
- case 184:
+ case 186:
return isDeclarationVisible(node.parent.parent);
- case 235:
+ case 237:
if (ts.isBindingPattern(node.name) &&
!node.name.elements.length) {
return false;
}
- case 242:
- case 238:
- case 239:
+ case 244:
case 240:
- case 237:
case 241:
- case 246:
+ case 242:
+ case 239:
+ case 243:
+ case 248:
if (ts.isExternalModuleAugmentation(node)) {
return true;
}
var parent = getDeclarationContainer(node);
if (!(ts.getCombinedModifierFlags(node) & 1) &&
- !(node.kind !== 246 && parent.kind !== 277 && parent.flags & 4194304)) {
+ !(node.kind !== 248 && parent.kind !== 279 && parent.flags & 4194304)) {
return isGlobalSourceFile(parent);
}
return isDeclarationVisible(parent);
- case 152:
- case 151:
- case 156:
- case 157:
case 154:
case 153:
+ case 158:
+ case 159:
+ case 156:
+ case 155:
if (ts.hasModifier(node, 8 | 16)) {
return false;
}
- case 155:
- case 159:
- case 158:
+ case 157:
+ case 161:
case 160:
- case 149:
- case 243:
- case 163:
- case 164:
- case 166:
case 162:
- case 167:
- case 168:
- case 171:
- case 172:
- case 175:
- return isDeclarationVisible(node.parent);
- case 248:
- case 249:
- case 251:
- return false;
- case 148:
- case 277:
+ case 151:
case 245:
+ case 165:
+ case 166:
+ case 168:
+ case 164:
+ case 169:
+ case 170:
+ case 173:
+ case 174:
+ case 177:
+ return isDeclarationVisible(node.parent);
+ case 250:
+ case 251:
+ case 253:
+ return false;
+ case 150:
+ case 279:
+ case 247:
return true;
- case 252:
+ case 254:
return false;
default:
return false;
@@ -28159,10 +28651,10 @@ var ts;
}
function collectLinkedAliases(node, setVisibility) {
var exportSymbol;
- if (node.parent && node.parent.kind === 252) {
+ if (node.parent && node.parent.kind === 254) {
exportSymbol = resolveName(node, node.escapedText, 67220415 | 67897832 | 1920 | 2097152, undefined, node, false);
}
- else if (node.parent.kind === 255) {
+ else if (node.parent.kind === 257) {
exportSymbol = getTargetOfExportSpecifier(node.parent, 67220415 | 67897832 | 1920 | 2097152);
}
var result;
@@ -28243,12 +28735,12 @@ var ts;
function getDeclarationContainer(node) {
return ts.findAncestor(ts.getRootDeclaration(node), function (node) {
switch (node.kind) {
- case 235:
- case 236:
+ case 237:
+ case 238:
+ case 253:
+ case 252:
case 251:
case 250:
- case 249:
- case 248:
return false;
default:
return true;
@@ -28271,28 +28763,36 @@ var ts;
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
}
function isComputedNonLiteralName(name) {
- return name.kind === 147 && !ts.isStringOrNumericLiteralLike(name.expression);
+ return name.kind === 149 && !ts.isStringOrNumericLiteralLike(name.expression);
}
function getRestType(source, properties, symbol) {
- source = filterType(source, function (t) { return !(t.flags & 24576); });
- if (source.flags & 32768) {
+ source = filterType(source, function (t) { return !(t.flags & 98304); });
+ if (source.flags & 131072) {
return emptyObjectType;
}
- if (source.flags & 262144) {
+ if (source.flags & 1048576) {
return mapType(source, function (t) { return getRestType(t, properties, symbol); });
}
- var members = ts.createSymbolTable();
- var names = ts.createUnderscoreEscapedMap();
- for (var _i = 0, properties_2 = properties; _i < properties_2.length; _i++) {
- var name = properties_2[_i];
- names.set(ts.getTextOfPropertyName(name), true);
+ var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));
+ if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
+ if (omitKeyType.flags & 131072) {
+ return source;
+ }
+ var pickTypeAlias = getGlobalPickSymbol();
+ var excludeTypeAlias = getGlobalExcludeSymbol();
+ if (!pickTypeAlias || !excludeTypeAlias) {
+ return errorType;
+ }
+ var pickKeys = getTypeAliasInstantiation(excludeTypeAlias, [getIndexType(source), omitKeyType]);
+ return getTypeAliasInstantiation(pickTypeAlias, [source, pickKeys]);
}
- for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
- var prop = _b[_a];
- if (!names.has(prop.escapedName)
+ var members = ts.createSymbolTable();
+ for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
+ var prop = _a[_i];
+ if (!isTypeAssignableTo(getLiteralTypeFromProperty(prop, 8576), omitKeyType)
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
&& isSpreadableProperty(prop)) {
- members.set(prop.escapedName, getNonReadonlySymbol(prop));
+ members.set(prop.escapedName, getSpreadSymbol(prop));
}
}
var stringIndexInfo = getIndexInfoOfType(source, 0);
@@ -28311,8 +28811,11 @@ var ts;
if (isTypeAny(parentType)) {
return parentType;
}
+ if (strictNullChecks && declaration.flags & 4194304 && ts.isParameterDeclaration(declaration)) {
+ parentType = getNonNullableType(parentType);
+ }
var type;
- if (pattern.kind === 182) {
+ if (pattern.kind === 184) {
if (declaration.dotDotDotToken) {
if (parentType.flags & 2 || !isValidSpreadType(parentType)) {
error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types);
@@ -28329,48 +28832,9 @@ var ts;
}
else {
var name = declaration.propertyName || declaration.name;
- var isLate = isLateBindableName(name);
- var isWellKnown = ts.isComputedPropertyName(name) && ts.isWellKnownSymbolSyntactically(name.expression);
- if (!isLate && !isWellKnown && isComputedNonLiteralName(name)) {
- var exprType = checkExpression(name.expression);
- if (isTypeAssignableToKind(exprType, 3072)) {
- if (noImplicitAny) {
- error(declaration, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(exprType), typeToString(parentType));
- }
- return anyType;
- }
- var indexerType = isTypeAssignableToKind(exprType, 168) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0);
- if (!indexerType && noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
- if (getIndexTypeOfType(parentType, 1)) {
- error(declaration, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);
- }
- else {
- error(declaration, ts.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(parentType));
- }
- }
- return indexerType || anyType;
- }
- var nameType = isLate ? checkComputedPropertyName(name) : undefined;
- var text = isLate ? getLateBoundNameFromType(nameType) :
- isWellKnown ? ts.getPropertyNameForKnownSymbolName(ts.idText(name.expression.name)) :
- ts.getTextOfPropertyName(name);
- if (strictNullChecks && declaration.flags & 4194304 && ts.isParameterDeclaration(declaration)) {
- parentType = getNonNullableType(parentType);
- }
- if (isLate && nameType && !getPropertyOfType(parentType, text) && isTypeAssignableToKind(nameType, 3072)) {
- if (noImplicitAny) {
- error(declaration, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(nameType), typeToString(parentType));
- }
- return anyType;
- }
- var declaredType = getConstraintForLocation(getTypeOfPropertyOfType(parentType, text), declaration.name);
- type = declaredType && getFlowTypeOfReference(declaration, declaredType) ||
- isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) ||
- getIndexTypeOfType(parentType, 0);
- if (!type) {
- error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name));
- return errorType;
- }
+ var exprType = getLiteralTypeFromPropertyName(name);
+ var declaredType = checkIndexedAccessIndexType(getIndexedAccessType(parentType, exprType, name), name);
+ type = getFlowTypeOfReference(declaration, getConstraintForLocation(declaredType, declaration.name));
}
}
else {
@@ -28397,8 +28861,8 @@ var ts;
}
}
}
- if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & 8192)) {
- type = getTypeWithFacts(type, 131072);
+ if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & 32768)) {
+ type = getTypeWithFacts(type, 524288);
}
return declaration.initializer && !ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration)) ?
getUnionType([type, checkDeclarationInitializer(declaration)], 2) :
@@ -28413,22 +28877,22 @@ var ts;
}
function isNullOrUndefined(node) {
var expr = ts.skipParentheses(node);
- return expr.kind === 95 || expr.kind === 71 && getResolvedSymbol(expr) === undefinedSymbol;
+ return expr.kind === 96 || expr.kind === 72 && getResolvedSymbol(expr) === undefinedSymbol;
}
function isEmptyArrayLiteral(node) {
var expr = ts.skipParentheses(node);
- return expr.kind === 185 && expr.elements.length === 0;
+ return expr.kind === 187 && expr.elements.length === 0;
}
function addOptionality(type, optional) {
if (optional === void 0) { optional = true; }
return strictNullChecks && optional ? getOptionalType(type) : type;
}
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
- if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 224) {
- var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression));
- return indexType.flags & (65536 | 1048576) ? getExtractStringType(indexType) : stringType;
+ if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 226) {
+ var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression)));
+ return indexType.flags & (262144 | 4194304) ? getExtractStringType(indexType) : stringType;
}
- if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 225) {
+ if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 227) {
var forOfStatement = declaration.parent.parent;
return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType;
}
@@ -28442,7 +28906,7 @@ var ts;
return addOptionality(declaredType, isOptional);
}
if ((noImplicitAny || ts.isInJSFile(declaration)) &&
- declaration.kind === 235 && !ts.isBindingPattern(declaration.name) &&
+ declaration.kind === 237 && !ts.isBindingPattern(declaration.name) &&
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 4194304)) {
if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
return autoType;
@@ -28451,10 +28915,10 @@ var ts;
return autoArrayType;
}
}
- if (declaration.kind === 149) {
+ if (declaration.kind === 151) {
var func = declaration.parent;
- if (func.kind === 157 && !hasNonBindableDynamicName(func)) {
- var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 156);
+ if (func.kind === 159 && !hasNonBindableDynamicName(func)) {
+ var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 158);
if (getter) {
var getterSignature = getSignatureFromDeclaration(getter);
var thisParameter = getAccessorThisParameter(func);
@@ -28510,7 +28974,7 @@ var ts;
var types;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- var expression = ts.isBinaryExpression(declaration) ? declaration :
+ var expression = (ts.isBinaryExpression(declaration) || ts.isCallExpression(declaration)) ? declaration :
ts.isPropertyAccessExpression(declaration) ? ts.isBinaryExpression(declaration.parent) ? declaration.parent : declaration :
undefined;
if (!expression) {
@@ -28525,9 +28989,11 @@ var ts;
definedInMethod = true;
}
}
- jsdocType = getJSDocTypeFromAssignmentDeclaration(jsdocType, expression, symbol, declaration);
+ if (!ts.isCallExpression(expression)) {
+ jsdocType = getJSDocTypeFromAssignmentDeclaration(jsdocType, expression, symbol, declaration);
+ }
if (!jsdocType) {
- (types || (types = [])).push(ts.isBinaryExpression(expression) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) : neverType);
+ (types || (types = [])).push((ts.isBinaryExpression(expression) || ts.isCallExpression(expression)) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) : neverType);
}
}
var type = jsdocType;
@@ -28540,11 +29006,11 @@ var ts;
definedInConstructor = true;
}
}
- var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~(24576 | 134217728)); }) ? constructorTypes : types;
+ var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~(98304 | 134217728)); }) ? constructorTypes : types;
type = getUnionType(sourceTypes, 2);
}
var widened = getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor));
- if (filterType(widened, function (t) { return !!(t.flags & ~24576); }) === neverType) {
+ if (filterType(widened, function (t) { return !!(t.flags & ~98304); }) === neverType) {
reportImplicitAny(symbol.valueDeclaration, anyType);
return anyType;
}
@@ -28584,8 +29050,33 @@ var ts;
return declaredType;
}
function getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) {
+ if (ts.isCallExpression(expression)) {
+ if (resolvedSymbol) {
+ return getTypeOfSymbol(resolvedSymbol);
+ }
+ var objectLitType = checkExpressionCached(expression.arguments[2]);
+ var valueType = getTypeOfPropertyOfType(objectLitType, "value");
+ if (valueType) {
+ return valueType;
+ }
+ var getFunc = getTypeOfPropertyOfType(objectLitType, "get");
+ if (getFunc) {
+ var getSig = getSingleCallSignature(getFunc);
+ if (getSig) {
+ return getReturnTypeOfSignature(getSig);
+ }
+ }
+ var setFunc = getTypeOfPropertyOfType(objectLitType, "set");
+ if (setFunc) {
+ var setSig = getSingleCallSignature(setFunc);
+ if (setSig) {
+ return getTypeOfFirstParameterOfSignature(setSig);
+ }
+ }
+ return anyType;
+ }
var type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : getWidenedLiteralType(checkExpressionCached(expression.right));
- if (type.flags & 131072 &&
+ if (type.flags & 524288 &&
kind === 2 &&
symbol.escapedName === "export=") {
var exportedType_1 = resolveStructuredTypeMembers(type);
@@ -28617,9 +29108,9 @@ var ts;
}
function isDeclarationInConstructor(expression) {
var thisContainer = ts.getThisContainer(expression, false);
- return thisContainer.kind === 155 ||
- thisContainer.kind === 237 ||
- (thisContainer.kind === 194 && !ts.isPrototypePropertyAssignment(thisContainer.parent));
+ return thisContainer.kind === 157 ||
+ thisContainer.kind === 239 ||
+ (thisContainer.kind === 196 && !ts.isPrototypePropertyAssignment(thisContainer.parent));
}
function getConstructorDefinedThisAssignmentTypes(types, declarations) {
ts.Debug.assert(types.length === declarations.length);
@@ -28687,7 +29178,7 @@ var ts;
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) {
var elements = pattern.elements;
var lastElement = ts.lastOrUndefined(elements);
- var hasRestElement = !!(lastElement && lastElement.kind === 184 && lastElement.dotDotDotToken);
+ var hasRestElement = !!(lastElement && lastElement.kind === 186 && lastElement.dotDotDotToken);
if (elements.length === 0 || elements.length === 1 && hasRestElement) {
return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType;
}
@@ -28703,7 +29194,7 @@ var ts;
function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {
if (includePatternInType === void 0) { includePatternInType = false; }
if (reportErrors === void 0) { reportErrors = false; }
- return pattern.kind === 182
+ return pattern.kind === 184
? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)
: getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
}
@@ -28715,7 +29206,7 @@ var ts;
if (reportErrors) {
reportErrorsFromWidening(declaration, type);
}
- if (type.flags & 2048 && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) {
+ if (type.flags & 8192 && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) {
type = esSymbolType;
}
return getWidenedType(type);
@@ -28730,7 +29221,7 @@ var ts;
}
function declarationBelongsToPrivateAmbientMember(declaration) {
var root = ts.getRootDeclaration(declaration);
- var memberDeclaration = root.kind === 149 ? root.parent : root;
+ var memberDeclaration = root.kind === 151 ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function tryGetTypeFromEffectiveTypeNode(declaration) {
@@ -28766,12 +29257,12 @@ var ts;
return emptyObjectType;
}
var type_1 = getWidenedLiteralType(checkExpression(jsonSourceFile.statements[0].expression));
- if (type_1.flags & 131072) {
+ if (type_1.flags & 524288) {
return getRegularTypeOfObjectLiteral(type_1);
}
return type_1;
}
- if (declaration.kind === 252) {
+ if (declaration.kind === 254) {
return widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration);
}
if (!pushTypeResolution(symbol, 0)) {
@@ -28779,7 +29270,7 @@ var ts;
}
var type;
if (ts.isInJSFile(declaration) &&
- (ts.isBinaryExpression(declaration) || ts.isPropertyAccessExpression(declaration) && ts.isBinaryExpression(declaration.parent))) {
+ (ts.isCallExpression(declaration) || ts.isBinaryExpression(declaration) || ts.isPropertyAccessExpression(declaration) && ts.isBinaryExpression(declaration.parent))) {
type = getWidenedTypeFromAssignmentDeclaration(symbol);
}
else if (ts.isJSDocPropertyLikeTag(declaration)
@@ -28815,6 +29306,12 @@ var ts;
|| ts.isBindingElement(declaration)) {
type = getWidenedTypeForVariableLikeDeclaration(declaration, true);
}
+ else if (ts.isEnumDeclaration(declaration)) {
+ type = getTypeOfFuncClassEnumModule(symbol);
+ }
+ else if (ts.isEnumMember(declaration)) {
+ type = getTypeOfEnumMember(symbol);
+ }
else {
return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration) + " for " + ts.Debug.showSymbol(symbol));
}
@@ -28825,7 +29322,7 @@ var ts;
}
function getAnnotatedAccessorTypeNode(accessor) {
if (accessor) {
- if (accessor.kind === 156) {
+ if (accessor.kind === 158) {
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
return getterTypeAnnotation;
}
@@ -28852,8 +29349,8 @@ var ts;
return links.type || (links.type = getTypeOfAccessorsWorker(symbol));
}
function getTypeOfAccessorsWorker(symbol) {
- var getter = ts.getDeclarationOfKind(symbol, 156);
- var setter = ts.getDeclarationOfKind(symbol, 157);
+ var getter = ts.getDeclarationOfKind(symbol, 158);
+ var setter = ts.getDeclarationOfKind(symbol, 159);
if (getter && ts.isInJSFile(getter)) {
var jsDocType = getTypeForDeclarationFromJSDocComment(getter);
if (jsDocType) {
@@ -28892,7 +29389,7 @@ var ts;
if (!popTypeResolution()) {
type = anyType;
if (noImplicitAny) {
- var getter_1 = ts.getDeclarationOfKind(symbol, 156);
+ var getter_1 = ts.getDeclarationOfKind(symbol, 158);
error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
}
}
@@ -28900,7 +29397,7 @@ var ts;
}
function getBaseTypeVariableOfClass(symbol) {
var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol));
- return baseConstructorType.flags & 2162688 ? baseConstructorType : undefined;
+ return baseConstructorType.flags & 8650752 ? baseConstructorType : undefined;
}
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
@@ -28931,8 +29428,8 @@ var ts;
if (symbol.flags & 1536 && ts.isShorthandAmbientModuleSymbol(symbol)) {
return anyType;
}
- else if (declaration.kind === 202 ||
- declaration.kind === 187 && declaration.parent.kind === 202) {
+ else if (declaration.kind === 204 ||
+ declaration.kind === 189 && declaration.parent.kind === 204) {
return getWidenedTypeFromAssignmentDeclaration(symbol);
}
else if (symbol.flags & 512 && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) {
@@ -29036,7 +29533,7 @@ var ts;
var target = getTargetType(type);
return target === checkBase || ts.some(getBaseTypes(target), check);
}
- else if (type.flags & 524288) {
+ else if (type.flags & 2097152) {
return ts.some(type.types, check);
}
return false;
@@ -29056,51 +29553,51 @@ var ts;
return undefined;
}
switch (node.kind) {
- case 238:
- case 207:
- case 239:
- case 158:
- case 159:
- case 153:
- case 163:
- case 164:
- case 287:
- case 237:
- case 154:
- case 194:
- case 195:
case 240:
- case 301:
- case 302:
- case 295:
- case 179:
- case 173:
+ case 209:
+ case 241:
+ case 160:
+ case 161:
+ case 155:
+ case 165:
+ case 166:
+ case 289:
+ case 239:
+ case 156:
+ case 196:
+ case 197:
+ case 242:
+ case 303:
+ case 304:
+ case 297:
+ case 181:
+ case 175:
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
- if (node.kind === 179) {
+ if (node.kind === 181) {
return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));
}
- else if (node.kind === 173) {
+ else if (node.kind === 175) {
return ts.concatenate(outerTypeParameters, getInferTypeParameters(node));
}
var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node));
var thisType = includeThisTypes &&
- (node.kind === 238 || node.kind === 207 || node.kind === 239) &&
+ (node.kind === 240 || node.kind === 209 || node.kind === 241) &&
getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
}
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 239);
+ var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 241);
return getOuterTypeParameters(declaration);
}
function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) {
var result;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var node = _a[_i];
- if (node.kind === 239 ||
- node.kind === 238 ||
- node.kind === 207 ||
+ if (node.kind === 241 ||
+ node.kind === 240 ||
+ node.kind === 209 ||
ts.isTypeAlias(node)) {
var declaration = node;
result = appendTypeParameters(result, ts.getEffectiveTypeParameterDeclarations(declaration));
@@ -29123,7 +29620,7 @@ var ts;
if (isValidBaseType(type) && getSignaturesOfType(type, 1).length > 0) {
return true;
}
- if (type.flags & 2162688) {
+ if (type.flags & 8650752) {
var constraint = getBaseConstraintOfType(type);
return !!constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint);
}
@@ -29158,7 +29655,7 @@ var ts;
ts.Debug.assert(!extended.typeArguments);
checkExpression(extended.expression);
}
- if (baseConstructorType.flags & (131072 | 524288)) {
+ if (baseConstructorType.flags & (524288 | 2097152)) {
resolveStructuredTypeMembers(baseConstructorType);
}
if (!popTypeResolution()) {
@@ -29166,7 +29663,18 @@ var ts;
return type.resolvedBaseConstructorType = errorType;
}
if (!(baseConstructorType.flags & 1) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) {
- error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType));
+ var err = error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType));
+ if (baseConstructorType.flags & 262144) {
+ var constraint = getConstraintFromTypeParameter(baseConstructorType);
+ var ctorReturn = unknownType;
+ if (constraint) {
+ var ctorSig = getSignaturesOfType(constraint, 1);
+ if (ctorSig[0]) {
+ ctorReturn = getReturnTypeOfSignature(ctorSig[0]);
+ }
+ }
+ addRelatedInfo(err, ts.createDiagnosticForNode(baseConstructorType.symbol.declarations[0], ts.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString(baseConstructorType.symbol), typeToString(ctorReturn)));
+ }
return type.resolvedBaseConstructorType = errorType;
}
type.resolvedBaseConstructorType = baseConstructorType;
@@ -29195,7 +29703,7 @@ var ts;
function resolveBaseTypesOfClass(type) {
type.resolvedBaseTypes = ts.resolvingEmptyArray;
var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type));
- if (!(baseConstructorType.flags & (131072 | 524288 | 1))) {
+ if (!(baseConstructorType.flags & (524288 | 2097152 | 1))) {
return type.resolvedBaseTypes = ts.emptyArray;
}
var baseTypeNode = getBaseTypeNodeOfClass(type);
@@ -29248,14 +29756,14 @@ var ts;
return true;
}
function isValidBaseType(type) {
- return !!(type.flags & (131072 | 16777216 | 1)) && !isGenericMappedType(type) ||
- !!(type.flags & 524288) && ts.every(type.types, isValidBaseType);
+ return !!(type.flags & (524288 | 67108864 | 1)) && !isGenericMappedType(type) ||
+ !!(type.flags & 2097152) && ts.every(type.types, isValidBaseType);
}
function resolveBaseTypesOfInterface(type) {
type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray;
for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 239 && ts.getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 241 && ts.getInterfaceBaseTypeNodes(declaration)) {
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
var node = _c[_b];
var baseType = getTypeFromTypeNode(node);
@@ -29284,7 +29792,7 @@ var ts;
function isThislessInterface(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 239) {
+ if (declaration.kind === 241) {
if (declaration.flags & 64) {
return false;
}
@@ -29320,7 +29828,7 @@ var ts;
type.instantiations.set(getTypeListId(type.typeParameters), type);
type.target = type;
type.typeArguments = type.typeParameters;
- type.thisType = createType(65536);
+ type.thisType = createType(262144);
type.thisType.isThisType = true;
type.thisType.symbol = symbol;
type.thisType.constraint = type;
@@ -29335,7 +29843,7 @@ var ts;
return errorType;
}
var declaration = ts.find(symbol.declarations, function (d) {
- return ts.isJSDocTypeAlias(d) || d.kind === 240;
+ return ts.isJSDocTypeAlias(d) || d.kind === 242;
});
var typeNode = ts.isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type;
var type = typeNode ? getTypeFromTypeNode(typeNode) : errorType;
@@ -29356,10 +29864,10 @@ var ts;
return links.declaredType;
}
function isStringConcatExpression(expr) {
- if (expr.kind === 9) {
+ if (expr.kind === 10) {
return true;
}
- else if (expr.kind === 202) {
+ else if (expr.kind === 204) {
return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);
}
return false;
@@ -29370,15 +29878,15 @@ var ts;
return !(member.flags & 4194304);
}
switch (expr.kind) {
- case 9:
+ case 10:
case 8:
return true;
- case 200:
- return expr.operator === 38 &&
- expr.operand.kind === 8;
- case 71:
- return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
case 202:
+ return expr.operator === 39 &&
+ expr.operand.kind === 8;
+ case 72:
+ return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
+ case 204:
return isStringConcatExpression(expr);
default:
return false;
@@ -29392,10 +29900,10 @@ var ts;
var hasNonLiteralMember = false;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 241) {
+ if (declaration.kind === 243) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
- if (member.initializer && member.initializer.kind === 9) {
+ if (member.initializer && member.initializer.kind === 10) {
return links.enumKind = 1;
}
if (!isLiteralEnumMember(member)) {
@@ -29407,7 +29915,7 @@ var ts;
return links.enumKind = hasNonLiteralMember ? 0 : 1;
}
function getBaseTypeOfEnumLiteralType(type) {
- return type.flags & 512 && !(type.flags & 262144) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type;
+ return type.flags & 1024 && !(type.flags & 1048576) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type;
}
function getDeclaredTypeOfEnum(symbol) {
var links = getSymbolLinks(symbol);
@@ -29419,7 +29927,7 @@ var ts;
var memberTypeList = [];
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 241) {
+ if (declaration.kind === 243) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
var memberType = getFreshTypeOfLiteralType(getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member)));
@@ -29430,8 +29938,8 @@ var ts;
}
if (memberTypeList.length) {
var enumType_1 = getUnionType(memberTypeList, 1, symbol, undefined);
- if (enumType_1.flags & 262144) {
- enumType_1.flags |= 512;
+ if (enumType_1.flags & 1048576) {
+ enumType_1.flags |= 1024;
enumType_1.symbol = symbol;
}
return links.declaredType = enumType_1;
@@ -29454,7 +29962,7 @@ var ts;
function getDeclaredTypeOfTypeParameter(symbol) {
var links = getSymbolLinks(symbol);
if (!links.declaredType) {
- var type = createType(65536);
+ var type = createType(262144);
type.symbol = symbol;
links.declaredType = type;
}
@@ -29493,22 +30001,23 @@ var ts;
}
function isThislessType(node) {
switch (node.kind) {
- case 119:
- case 142:
- case 137:
- case 134:
- case 122:
+ case 120:
+ case 143:
case 138:
case 135:
- case 105:
- case 140:
- case 95:
- case 131:
- case 180:
+ case 146:
+ case 123:
+ case 139:
+ case 136:
+ case 106:
+ case 141:
+ case 96:
+ case 132:
+ case 182:
return true;
- case 167:
+ case 169:
return isThislessType(node.elementType);
- case 162:
+ case 164:
return !node.typeArguments || node.typeArguments.every(isThislessType);
}
return false;
@@ -29524,7 +30033,7 @@ var ts;
function isThislessFunctionLikeDeclaration(node) {
var returnType = ts.getEffectiveReturnTypeNode(node);
var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
- return (node.kind === 155 || (!!returnType && isThislessType(returnType))) &&
+ return (node.kind === 157 || (!!returnType && isThislessType(returnType))) &&
node.parameters.every(isThislessVariableLikeDeclaration) &&
typeParameters.every(isThislessTypeParameter);
}
@@ -29533,12 +30042,12 @@ var ts;
var declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 152:
- case 151:
- return isThislessVariableLikeDeclaration(declaration);
case 154:
case 153:
+ return isThislessVariableLikeDeclaration(declaration);
+ case 156:
case 155:
+ case 157:
return isThislessFunctionLikeDeclaration(declaration);
}
}
@@ -29576,7 +30085,7 @@ var ts;
return type;
}
function isTypeUsableAsLateBoundName(type) {
- return !!(type.flags & 2240);
+ return !!(type.flags & 8576);
}
function isLateBindableName(node) {
return ts.isComputedPropertyName(node)
@@ -29599,10 +30108,10 @@ var ts;
return ts.isDynamicName(node) && !isLateBindableName(node);
}
function getLateBoundNameFromType(type) {
- if (type.flags & 2048) {
+ if (type.flags & 8192) {
return "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
}
- if (type.flags & (64 | 128)) {
+ if (type.flags & (128 | 256)) {
return ts.escapeLeadingUnderscores("" + type.value);
}
return ts.Debug.fail();
@@ -29710,7 +30219,7 @@ var ts;
return needApparentType ? getApparentType(ref) : ref;
}
}
- else if (type.flags & 524288) {
+ else if (type.flags & 2097152) {
return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); }));
}
return needApparentType ? getApparentType(type) : type;
@@ -29838,7 +30347,7 @@ var ts;
function findMatchingSignature(signatureList, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes) {
for (var _i = 0, signatureList_1 = signatureList; _i < signatureList_1.length; _i++) {
var s = signatureList_1[_i];
- if (compareSignaturesIdentical(s, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes, compareTypesIdentical)) {
+ if (compareSignaturesIdentical(s, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes, partialMatch ? compareTypesSubtypeOf : compareTypesIdentical)) {
return s;
}
}
@@ -29865,8 +30374,7 @@ var ts;
}
return result;
}
- function getUnionSignatures(types, kind) {
- var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); });
+ function getUnionSignatures(signatureLists) {
var result;
for (var i = 0; i < signatureLists.length; i++) {
for (var _i = 0, _a = signatureLists[i]; _i < _a.length; _i++) {
@@ -29907,8 +30415,8 @@ var ts;
return createIndexInfo(getUnionType(indexTypes, 2), isAnyReadonly);
}
function resolveUnionTypeMembers(type) {
- var callSignatures = getUnionSignatures(type.types, 0);
- var constructSignatures = getUnionSignatures(type.types, 1);
+ var callSignatures = getUnionSignatures(ts.map(type.types, function (t) { return getSignaturesOfType(t, 0); }));
+ var constructSignatures = getUnionSignatures(ts.map(type.types, function (t) { return getSignaturesOfType(t, 1); }));
var stringIndexInfo = getUnionIndexInfo(type.types, 0);
var numberIndexInfo = getUnionIndexInfo(type.types, 1);
setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
@@ -29993,7 +30501,7 @@ var ts;
if (symbol.flags & 32) {
var classType = getDeclaredTypeOfClassOrInterface(symbol);
var baseConstructorType = getBaseConstructorTypeOfClass(classType);
- if (baseConstructorType.flags & (131072 | 524288 | 2162688)) {
+ if (baseConstructorType.flags & (524288 | 2097152 | 8650752)) {
members = ts.createSymbolTable(getNamedMembers(members));
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
}
@@ -30022,7 +30530,7 @@ var ts;
var modifiers = getMappedTypeModifiers(type.mappedType);
var readonlyMask = modifiers & 1 ? false : true;
var optionalMask = modifiers & 4 ? 0 : 16777216;
- var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly);
+ var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType, type.constraintType), readonlyMask && indexInfo.isReadonly);
var members = ts.createSymbolTable();
for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) {
var prop = _a[_i];
@@ -30032,6 +30540,7 @@ var ts;
inferredProp.nameType = prop.nameType;
inferredProp.propertyType = getTypeOfSymbol(prop);
inferredProp.mappedType = type.mappedType;
+ inferredProp.constraintType = type.constraintType;
members.set(prop.escapedName, inferredProp);
}
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined);
@@ -30046,11 +30555,11 @@ var ts;
var templateType = getTemplateTypeFromMappedType(type.target || type);
var modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
var templateModifiers = getMappedTypeModifiers(type);
- var include = keyofStringsOnly ? 64 : 2240;
+ var include = keyofStringsOnly ? 128 : 8576;
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) {
var prop = _a[_i];
- addMemberForKeyType(getLiteralTypeFromPropertyName(prop, include));
+ addMemberForKeyType(getLiteralTypeFromProperty(prop, include));
}
if (modifiersType.flags & 1 || getIndexInfoOfType(modifiersType, 0)) {
addMemberForKeyType(stringType);
@@ -30060,15 +30569,14 @@ var ts;
}
}
else {
- var keyType = constraintType.flags & 14745600 ? getApparentType(constraintType) : constraintType;
- var iterationType = keyType.flags & 1048576 ? getIndexType(getApparentType(keyType.type)) : keyType;
+ var iterationType = constraintType.flags & 4194304 ? getIndexType(getApparentType(constraintType.type)) : constraintType;
forEachType(iterationType, addMemberForKeyType);
}
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
function addMemberForKeyType(t) {
var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t]));
var propType = instantiateType(templateType, templateMapper);
- if (t.flags & 2240) {
+ if (t.flags & 8576) {
var propName = getLateBoundNameFromType(t);
var modifiersProp = getPropertyOfType(modifiersType, propName);
var isOptional = !!(templateModifiers & 4 ||
@@ -30077,7 +30585,7 @@ var ts;
!(templateModifiers & 2) && modifiersProp && isReadonlySymbol(modifiersProp));
var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, isReadonly ? 8 : 0);
prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) :
- strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 ? getTypeWithFacts(propType, 131072) :
+ strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 ? getTypeWithFacts(propType, 524288) :
propType;
if (modifiersProp) {
prop.syntheticOrigin = modifiersProp;
@@ -30113,8 +30621,8 @@ var ts;
}
function isMappedTypeWithKeyofConstraintDeclaration(type) {
var constraintDeclaration = getConstraintDeclarationForMappedType(type);
- return constraintDeclaration.kind === 177 &&
- constraintDeclaration.operator === 128;
+ return constraintDeclaration.kind === 179 &&
+ constraintDeclaration.operator === 129;
}
function getModifiersTypeFromMappedType(type) {
if (!type.modifiersType) {
@@ -30124,16 +30632,16 @@ var ts;
else {
var declaredType = getTypeFromMappedTypeNode(type.declaration);
var constraint = getConstraintTypeFromMappedType(declaredType);
- var extendedConstraint = constraint && constraint.flags & 65536 ? getConstraintOfTypeParameter(constraint) : constraint;
- type.modifiersType = extendedConstraint && extendedConstraint.flags & 1048576 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType;
+ var extendedConstraint = constraint && constraint.flags & 262144 ? getConstraintOfTypeParameter(constraint) : constraint;
+ type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType;
}
}
return type.modifiersType;
}
function getMappedTypeModifiers(type) {
var declaration = type.declaration;
- return (declaration.readonlyToken ? declaration.readonlyToken.kind === 38 ? 2 : 1 : 0) |
- (declaration.questionToken ? declaration.questionToken.kind === 38 ? 8 : 4 : 0);
+ return (declaration.readonlyToken ? declaration.readonlyToken.kind === 39 ? 2 : 1 : 0) |
+ (declaration.questionToken ? declaration.questionToken.kind === 39 ? 8 : 4 : 0);
}
function getMappedTypeOptionality(type) {
var modifiers = getMappedTypeModifiers(type);
@@ -30152,7 +30660,7 @@ var ts;
}
function resolveStructuredTypeMembers(type) {
if (!type.members) {
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
if (type.objectFlags & 4) {
resolveTypeReferenceMembers(type);
}
@@ -30169,23 +30677,23 @@ var ts;
resolveMappedTypeMembers(type);
}
}
- else if (type.flags & 262144) {
+ else if (type.flags & 1048576) {
resolveUnionTypeMembers(type);
}
- else if (type.flags & 524288) {
+ else if (type.flags & 2097152) {
resolveIntersectionTypeMembers(type);
}
}
return type;
}
function getPropertiesOfObjectType(type) {
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
return resolveStructuredTypeMembers(type).properties;
}
return ts.emptyArray;
}
function getPropertyOfObjectType(type, name) {
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
var resolved = resolveStructuredTypeMembers(type);
var symbol = resolved.members.get(name);
if (symbol && symbolIsValue(symbol)) {
@@ -30207,7 +30715,7 @@ var ts;
}
}
}
- if (type.flags & 262144) {
+ if (type.flags & 1048576) {
break;
}
}
@@ -30217,12 +30725,13 @@ var ts;
}
function getPropertiesOfType(type) {
type = getApparentType(type);
- return type.flags & 786432 ?
+ return type.flags & 3145728 ?
getPropertiesOfUnionOrIntersectionType(type) :
getPropertiesOfObjectType(type);
}
function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) {
- return obj.properties.some(function (property) {
+ var list = obj.properties;
+ return list.some(function (property) {
var name = property.name && ts.getTextOfPropertyName(property.name);
var expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name);
return !!expected && typeIsLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected);
@@ -30230,7 +30739,7 @@ var ts;
}
function getAllPossiblePropertiesOfTypes(types) {
var unionType = getUnionType(types);
- if (!(unionType.flags & 262144)) {
+ if (!(unionType.flags & 1048576)) {
return getAugmentedPropertiesOfType(unionType);
}
var props = ts.createSymbolTable();
@@ -30248,9 +30757,9 @@ var ts;
return ts.arrayFrom(props.values());
}
function getConstraintOfType(type) {
- return type.flags & 65536 ? getConstraintOfTypeParameter(type) :
- type.flags & 2097152 ? getConstraintOfIndexedAccess(type) :
- type.flags & 4194304 ? getConstraintOfConditionalType(type) :
+ return type.flags & 262144 ? getConstraintOfTypeParameter(type) :
+ type.flags & 8388608 ? getConstraintOfIndexedAccess(type) :
+ type.flags & 16777216 ? getConstraintOfConditionalType(type) :
getBaseConstraintOfType(type);
}
function getConstraintOfTypeParameter(typeParameter) {
@@ -30270,7 +30779,11 @@ var ts;
function getDefaultConstraintOfConditionalType(type) {
if (!type.resolvedDefaultConstraint) {
var rootTrueType = type.root.trueType;
- var rootTrueConstraint = rootTrueType.flags & 8388608 ? rootTrueType.substitute : rootTrueType;
+ var rootTrueConstraint = !(rootTrueType.flags & 33554432)
+ ? rootTrueType
+ : (rootTrueType.substitute).flags & 3
+ ? rootTrueType.typeVariable
+ : getIntersectionType([rootTrueType.substitute, rootTrueType.typeVariable]);
type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
}
return type.resolvedDefaultConstraint;
@@ -30282,7 +30795,7 @@ var ts;
if (constraint) {
var mapper = makeUnaryTypeMapper(type.root.checkType, constraint);
var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
- if (!(instantiated.flags & 32768)) {
+ if (!(instantiated.flags & 131072)) {
return instantiated;
}
}
@@ -30297,19 +30810,19 @@ var ts;
var hasDisjointDomainType = false;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 15794176) {
+ if (t.flags & 63176704) {
var constraint = getConstraintOfType(t);
- while (constraint && constraint.flags & (65536 | 1048576 | 4194304)) {
+ while (constraint && constraint.flags & (262144 | 4194304 | 16777216)) {
constraint = getConstraintOfType(constraint);
}
if (constraint) {
- if (!(constraint.flags & 262144)) {
+ if (!(constraint.flags & 1048576)) {
return undefined;
}
constraints = ts.append(constraints, constraint);
}
}
- else if (t.flags & 16809468) {
+ else if (t.flags & 67238908) {
hasDisjointDomainType = true;
}
}
@@ -30317,7 +30830,7 @@ var ts;
if (hasDisjointDomainType) {
for (var _b = 0, _c = type.types; _b < _c.length; _b++) {
var t = _c[_b];
- if (t.flags & 16809468) {
+ if (t.flags & 67238908) {
constraints = ts.append(constraints, t);
}
}
@@ -30327,11 +30840,11 @@ var ts;
return undefined;
}
function getBaseConstraintOfType(type) {
- if (type.flags & (14745600 | 786432)) {
+ if (type.flags & (58982400 | 3145728)) {
var constraint = getResolvedBaseConstraint(type);
return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined;
}
- return type.flags & 1048576 ? keyofConstraintType : undefined;
+ return type.flags & 4194304 ? keyofConstraintType : undefined;
}
function getBaseConstraintOrType(type) {
return getBaseConstraintOfType(type) || type;
@@ -30367,13 +30880,13 @@ var ts;
return c !== noConstraintType && c !== circularConstraintType ? c : undefined;
}
function computeBaseConstraint(t) {
- if (t.flags & 65536) {
+ if (t.flags & 262144) {
var constraint = getConstraintFromTypeParameter(t);
return t.isThisType || !constraint ?
constraint :
getBaseConstraint(constraint);
}
- if (t.flags & 786432) {
+ if (t.flags & 3145728) {
var types = t.types;
var baseTypes = [];
for (var _i = 0, types_4 = types; _i < types_4.length; _i++) {
@@ -30383,24 +30896,24 @@ var ts;
baseTypes.push(baseType);
}
}
- return t.flags & 262144 && baseTypes.length === types.length ? getUnionType(baseTypes) :
- t.flags & 524288 && baseTypes.length ? getIntersectionType(baseTypes) :
+ return t.flags & 1048576 && baseTypes.length === types.length ? getUnionType(baseTypes) :
+ t.flags & 2097152 && baseTypes.length ? getIntersectionType(baseTypes) :
undefined;
}
- if (t.flags & 1048576) {
+ if (t.flags & 4194304) {
return keyofConstraintType;
}
- if (t.flags & 2097152) {
+ if (t.flags & 8388608) {
var baseObjectType = getBaseConstraint(t.objectType);
var baseIndexType = getBaseConstraint(t.indexType);
var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType, undefined, errorType) : undefined;
return baseIndexedAccess && baseIndexedAccess !== errorType ? getBaseConstraint(baseIndexedAccess) : undefined;
}
- if (t.flags & 4194304) {
+ if (t.flags & 16777216) {
var constraint = getConstraintOfConditionalType(t);
return constraint && getBaseConstraint(constraint);
}
- if (t.flags & 8388608) {
+ if (t.flags & 33554432) {
return getBaseConstraint(t.substitute);
}
return t;
@@ -30454,21 +30967,22 @@ var ts;
return type;
}
function getApparentType(type) {
- var t = type.flags & 15794176 ? getBaseConstraintOfType(type) || emptyObjectType : type;
+ var t = type.flags & 63176704 ? getBaseConstraintOfType(type) || emptyObjectType : type;
return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) :
- t.flags & 524288 ? getApparentTypeOfIntersectionType(t) :
- t.flags & 68 ? globalStringType :
- t.flags & 168 ? globalNumberType :
- t.flags & 272 ? globalBooleanType :
- t.flags & 3072 ? getGlobalESSymbolType(languageVersion >= 2) :
- t.flags & 16777216 ? emptyObjectType :
- t.flags & 1048576 ? keyofConstraintType :
- t;
+ t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
+ t.flags & 132 ? globalStringType :
+ t.flags & 296 ? globalNumberType :
+ t.flags & 2112 ? getGlobalBigIntType(languageVersion >= 6) :
+ t.flags & 528 ? globalBooleanType :
+ t.flags & 12288 ? getGlobalESSymbolType(languageVersion >= 2) :
+ t.flags & 67108864 ? emptyObjectType :
+ t.flags & 4194304 ? keyofConstraintType :
+ t;
}
function createUnionOrIntersectionProperty(containingType, name) {
var props;
var indexTypes;
- var isUnion = containingType.flags & 262144;
+ var isUnion = containingType.flags & 1048576;
var excludeModifiers = isUnion ? 24 : 0;
var commonFlags = isUnion ? 0 : 16777216;
var syntheticFlag = 4;
@@ -30566,7 +31080,7 @@ var ts;
}
function getPropertyOfType(type, name) {
type = getApparentType(type);
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
var resolved = resolveStructuredTypeMembers(type);
var symbol = resolved.members.get(name);
if (symbol && symbolIsValue(symbol)) {
@@ -30584,13 +31098,13 @@ var ts;
}
return getPropertyOfObjectType(globalObjectType, name);
}
- if (type.flags & 786432) {
+ if (type.flags & 3145728) {
return getPropertyOfUnionOrIntersectionType(type, name);
}
return undefined;
}
function getSignaturesOfStructuredType(type, kind) {
- if (type.flags & 917504) {
+ if (type.flags & 3670016) {
var resolved = resolveStructuredTypeMembers(type);
return kind === 0 ? resolved.callSignatures : resolved.constructSignatures;
}
@@ -30600,7 +31114,7 @@ var ts;
return getSignaturesOfStructuredType(getApparentType(type), kind);
}
function getIndexInfoOfStructuredType(type, kind) {
- if (type.flags & 917504) {
+ if (type.flags & 3670016) {
var resolved = resolveStructuredTypeMembers(type);
return kind === 0 ? resolved.stringIndexInfo : resolved.numberIndexInfo;
}
@@ -30648,10 +31162,10 @@ var ts;
return result;
}
function isJSDocOptionalParameter(node) {
- return ts.isInJSFile(node) && (node.type && node.type.kind === 286
+ return ts.isInJSFile(node) && (node.type && node.type.kind === 288
|| ts.getJSDocParameterTags(node).some(function (_a) {
var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 286;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 288;
}));
}
function tryFindAmbientModule(moduleName, withAugmentations) {
@@ -30684,7 +31198,7 @@ var ts;
return false;
}
var isBracketed = node.isBracketed, typeExpression = node.typeExpression;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 286;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 288;
}
function createIdentifierTypePredicate(parameterName, parameterIndex, type) {
return { kind: 1, parameterName: parameterName, parameterIndex: parameterIndex, type: type };
@@ -30705,27 +31219,29 @@ var ts;
}
function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, isJavaScriptImplicitAny) {
var numTypeParameters = ts.length(typeParameters);
- if (numTypeParameters) {
- var numTypeArguments = ts.length(typeArguments);
- if (isJavaScriptImplicitAny || (numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters)) {
- if (!typeArguments) {
- typeArguments = [];
- }
- for (var i = numTypeArguments; i < numTypeParameters; i++) {
- typeArguments[i] = getDefaultTypeArgumentType(isJavaScriptImplicitAny);
- }
- for (var i = numTypeArguments; i < numTypeParameters; i++) {
- var mapper = createTypeMapper(typeParameters, typeArguments);
- var defaultType = getDefaultFromTypeParameter(typeParameters[i]);
- if (isJavaScriptImplicitAny && defaultType && isTypeIdenticalTo(defaultType, emptyObjectType)) {
- defaultType = anyType;
- }
- typeArguments[i] = defaultType ? instantiateType(defaultType, mapper) : getDefaultTypeArgumentType(isJavaScriptImplicitAny);
- }
- typeArguments.length = typeParameters.length;
- }
+ if (!numTypeParameters) {
+ return [];
}
- return typeArguments;
+ var numTypeArguments = ts.length(typeArguments);
+ if (isJavaScriptImplicitAny || (numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters)) {
+ var result = typeArguments ? typeArguments.slice() : [];
+ var baseDefaultType_1 = getDefaultTypeArgumentType(isJavaScriptImplicitAny);
+ var circularityMapper = createTypeMapper(typeParameters, ts.map(typeParameters, function () { return baseDefaultType_1; }));
+ for (var i = numTypeArguments; i < numTypeParameters; i++) {
+ result[i] = instantiateType(getConstraintFromTypeParameter(typeParameters[i]) || baseDefaultType_1, circularityMapper);
+ }
+ for (var i = numTypeArguments; i < numTypeParameters; i++) {
+ var mapper = createTypeMapper(typeParameters, result);
+ var defaultType = getDefaultFromTypeParameter(typeParameters[i]);
+ if (isJavaScriptImplicitAny && defaultType && isTypeIdenticalTo(defaultType, emptyObjectType)) {
+ defaultType = anyType;
+ }
+ result[i] = defaultType ? instantiateType(defaultType, mapper) : baseDefaultType_1;
+ }
+ result.length = typeParameters.length;
+ return result;
+ }
+ return typeArguments && typeArguments.slice();
}
function getSignatureFromDeclaration(declaration) {
var links = getNodeLinks(declaration);
@@ -30757,7 +31273,7 @@ var ts;
else {
parameters.push(paramSymbol);
}
- if (type && type.kind === 180) {
+ if (type && type.kind === 182) {
hasLiteralTypes = true;
}
var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) ||
@@ -30769,16 +31285,16 @@ var ts;
minArgumentCount = parameters.length;
}
}
- if ((declaration.kind === 156 || declaration.kind === 157) &&
+ if ((declaration.kind === 158 || declaration.kind === 159) &&
!hasNonBindableDynamicName(declaration) &&
(!hasThisParameter || !thisParameter)) {
- var otherKind = declaration.kind === 156 ? 157 : 156;
+ var otherKind = declaration.kind === 158 ? 159 : 158;
var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
}
}
- var classType = declaration.kind === 155 ?
+ var classType = declaration.kind === 157 ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
: undefined;
var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
@@ -30828,13 +31344,13 @@ var ts;
if (!node)
return false;
switch (node.kind) {
- case 71:
+ case 72:
return node.escapedText === "arguments" && ts.isExpressionNode(node);
- case 152:
case 154:
case 156:
- case 157:
- return node.name.kind === 147
+ case 158:
+ case 159:
+ return node.name.kind === 149
&& traverse(node.name);
default:
return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
@@ -30906,7 +31422,7 @@ var ts;
function createTypePredicateFromTypePredicateNode(node, func) {
var parameterName = node.parameterName;
var type = getTypeFromTypeNode(node.type);
- if (parameterName.kind === 71) {
+ if (parameterName.kind === 72) {
return createIdentifierTypePredicate(parameterName.escapedText, getTypePredicateParameterIndex(func.parameters, parameterName), type);
}
else {
@@ -30916,7 +31432,7 @@ var ts;
function getTypePredicateParameterIndex(parameterList, parameter) {
for (var i = 0; i < parameterList.length; i++) {
var param = parameterList[i];
- if (param.name.kind === 71 && param.name.escapedText === parameter.escapedText) {
+ if (param.name.kind === 72 && param.name.escapedText === parameter.escapedText) {
return i;
}
}
@@ -30956,7 +31472,7 @@ var ts;
return signature.resolvedReturnType;
}
function getReturnTypeFromAnnotation(declaration) {
- if (declaration.kind === 155) {
+ if (declaration.kind === 157) {
return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));
}
if (ts.isJSDocConstructSignature(declaration)) {
@@ -30966,12 +31482,12 @@ var ts;
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 156 && !hasNonBindableDynamicName(declaration)) {
+ if (declaration.kind === 158 && !hasNonBindableDynamicName(declaration)) {
var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);
if (jsDocType) {
return jsDocType;
}
- var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 157);
+ var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 159);
var setterType = getAnnotatedAccessorType(setter);
if (setterType) {
return setterType;
@@ -31038,7 +31554,7 @@ var ts;
}
function getOrCreateTypeFromSignature(signature) {
if (!signature.isolatedSignatureType) {
- var isConstructor = signature.declaration.kind === 155 || signature.declaration.kind === 159;
+ var isConstructor = signature.declaration.kind === 157 || signature.declaration.kind === 161;
var type = createObjectType(16);
type.members = emptySymbols;
type.properties = ts.emptyArray;
@@ -31052,7 +31568,7 @@ var ts;
return symbol.members.get("__index");
}
function getIndexDeclarationOfSymbol(symbol, kind) {
- var syntaxKind = kind === 1 ? 134 : 137;
+ var syntaxKind = kind === 1 ? 135 : 138;
var indexSymbol = getIndexSymbol(symbol);
if (indexSymbol) {
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
@@ -31079,7 +31595,7 @@ var ts;
return undefined;
}
function getConstraintDeclaration(type) {
- var decl = type.symbol && ts.getDeclarationOfKind(type.symbol, 148);
+ var decl = type.symbol && ts.getDeclarationOfKind(type.symbol, 150);
return decl && ts.getEffectiveConstraintOfTypeParameter(decl);
}
function getInferredTypeParameterConstraint(typeParameter) {
@@ -31087,9 +31603,9 @@ var ts;
if (typeParameter.symbol) {
for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.parent.kind === 174) {
+ if (declaration.parent.kind === 176) {
var grandParent = declaration.parent.parent;
- if (grandParent.kind === 162) {
+ if (grandParent.kind === 164) {
var typeReference = grandParent;
var typeParameters = getTypeParametersForTypeReference(typeReference);
if (typeParameters) {
@@ -31106,7 +31622,7 @@ var ts;
}
}
}
- else if (grandParent.kind === 149 && grandParent.dotDotDotToken) {
+ else if (grandParent.kind === 151 && grandParent.dotDotDotToken) {
inferences = ts.append(inferences, createArrayType(unknownType));
}
}
@@ -31129,7 +31645,7 @@ var ts;
return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- var tp = ts.getDeclarationOfKind(typeParameter.symbol, 148);
+ var tp = ts.getDeclarationOfKind(typeParameter.symbol, 150);
var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent;
return host && getSymbolOfNode(host);
}
@@ -31246,9 +31762,9 @@ var ts;
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 162:
+ case 164:
return node.typeName;
- case 209:
+ case 211:
var expr = node.expression;
if (ts.isEntityNameExpression(expr)) {
return expr;
@@ -31287,7 +31803,7 @@ var ts;
var res = tryGetDeclaredTypeOfSymbol(symbol);
if (res) {
return checkNoTypeArguments(node, symbol) ?
- res.flags & 65536 ? getConstrainedTypeVariable(res, node) : getRegularTypeOfLiteralType(res) :
+ res.flags & 262144 ? getConstrainedTypeVariable(res, node) : getRegularTypeOfLiteralType(res) :
errorType;
}
if (!(symbol.flags & 67220415 && isJSDocTypeReference(node))) {
@@ -31337,13 +31853,13 @@ var ts;
}
}
function getSubstitutionType(typeVariable, substitute) {
- var result = createType(8388608);
+ var result = createType(33554432);
result.typeVariable = typeVariable;
result.substitute = substitute;
return result;
}
function isUnaryTupleTypeNode(node) {
- return node.kind === 168 && node.elementTypes.length === 1;
+ return node.kind === 170 && node.elementTypes.length === 1;
}
function getImpliedConstraint(typeVariable, checkNode, extendsNode) {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) :
@@ -31352,9 +31868,9 @@ var ts;
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
- while (node && !ts.isStatement(node) && node.kind !== 289) {
+ while (node && !ts.isStatement(node) && node.kind !== 291) {
var parent = node.parent;
- if (parent.kind === 173 && node === parent.trueType) {
+ if (parent.kind === 175 && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
if (constraint) {
constraints = ts.append(constraints, constraint);
@@ -31365,7 +31881,7 @@ var ts;
return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable;
}
function isJSDocTypeReference(node) {
- return !!(node.flags & 2097152) && (node.kind === 162 || node.kind === 181);
+ return !!(node.flags & 2097152) && (node.kind === 164 || node.kind === 183);
}
function checkNoTypeArguments(node, symbol) {
if (node.typeArguments) {
@@ -31423,7 +31939,7 @@ var ts;
}
function getTypeFromJSDocNullableTypeNode(node) {
var type = getTypeFromTypeNode(node.type);
- return strictNullChecks ? getNullableType(type, 16384) : type;
+ return strictNullChecks ? getNullableType(type, 65536) : type;
}
function getTypeFromTypeReference(node) {
var links = getNodeLinks(node);
@@ -31460,9 +31976,9 @@ var ts;
for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
var declaration = declarations_3[_i];
switch (declaration.kind) {
- case 238:
- case 239:
+ case 240:
case 241:
+ case 243:
return declaration;
}
}
@@ -31471,7 +31987,7 @@ var ts;
return arity ? emptyGenericType : emptyObjectType;
}
var type = getDeclaredTypeOfSymbol(symbol);
- if (!(type.flags & 131072)) {
+ if (!(type.flags & 524288)) {
error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, ts.symbolName(symbol));
return arity ? emptyGenericType : emptyObjectType;
}
@@ -31547,6 +32063,15 @@ var ts;
function getGlobalExtractSymbol() {
return deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalSymbol("Extract", 524288, ts.Diagnostics.Cannot_find_global_type_0));
}
+ function getGlobalExcludeSymbol() {
+ return deferredGlobalExcludeSymbol || (deferredGlobalExcludeSymbol = getGlobalSymbol("Exclude", 524288, ts.Diagnostics.Cannot_find_global_type_0));
+ }
+ function getGlobalPickSymbol() {
+ return deferredGlobalPickSymbol || (deferredGlobalPickSymbol = getGlobalSymbol("Pick", 524288, ts.Diagnostics.Cannot_find_global_type_0));
+ }
+ function getGlobalBigIntType(reportErrors) {
+ return deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", 0, reportErrors)) || emptyObjectType;
+ }
function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) {
return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType;
}
@@ -31585,7 +32110,7 @@ var ts;
if (arity) {
typeParameters = new Array(arity);
for (var i = 0; i < arity; i++) {
- var typeParameter = typeParameters[i] = createType(65536);
+ var typeParameter = typeParameters[i] = createType(262144);
if (i < maxLength) {
var property = createSymbol(4 | (i >= minLength ? 16777216 : 0), "" + i);
property.type = typeParameter;
@@ -31607,7 +32132,7 @@ var ts;
type.instantiations.set(getTypeListId(type.typeParameters), type);
type.target = type;
type.typeArguments = type.typeParameters;
- type.thisType = createType(65536);
+ type.thisType = createType(262144);
type.thisType.isThisType = true;
type.thisType.constraint = type;
type.declaredProperties = properties;
@@ -31642,8 +32167,8 @@ var ts;
var links = getNodeLinks(node);
if (!links.resolvedType) {
var lastElement = ts.lastOrUndefined(node.elementTypes);
- var restElement_1 = lastElement && lastElement.kind === 170 ? lastElement : undefined;
- var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 169 && n !== restElement_1; }) + 1;
+ var restElement_1 = lastElement && lastElement.kind === 172 ? lastElement : undefined;
+ var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 171 && n !== restElement_1; }) + 1;
var elementTypes = ts.map(node.elementTypes, function (n) {
var type = getTypeFromTypeNode(n);
return n === restElement_1 && getIndexTypeOfType(type, 1) || type;
@@ -31681,16 +32206,17 @@ var ts;
var combined = 0;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 27072 && combined & 27072) {
+ if (t.flags & 109440 && combined & 109440) {
return true;
}
combined |= t.flags;
- if (combined & 24576 && combined & (131072 | 16777216) ||
- combined & 16777216 && combined & (16809468 & ~16777216) ||
- combined & 68 && combined & (16809468 & ~68) ||
- combined & 168 && combined & (16809468 & ~168) ||
- combined & 3072 && combined & (16809468 & ~3072) ||
- combined & 12288 && combined & (16809468 & ~12288)) {
+ if (combined & 98304 && combined & (524288 | 67108864) ||
+ combined & 67108864 && combined & (67238908 & ~67108864) ||
+ combined & 132 && combined & (67238908 & ~132) ||
+ combined & 296 && combined & (67238908 & ~296) ||
+ combined & 2112 && combined & (67238908 & ~2112) ||
+ combined & 12288 && combined & (67238908 & ~12288) ||
+ combined & 49152 && combined & (67238908 & ~49152)) {
return true;
}
}
@@ -31698,16 +32224,14 @@ var ts;
}
function addTypeToUnion(typeSet, includes, type) {
var flags = type.flags;
- if (flags & 262144) {
+ if (flags & 1048576) {
return addTypesToUnion(typeSet, includes, type.types);
}
- if (!(flags & 32768 || flags & 524288 && isEmptyIntersectionType(type))) {
+ if (!(flags & 131072 || flags & 2097152 && isEmptyIntersectionType(type))) {
includes |= flags & ~939524096;
- if (flags & 3) {
- if (type === wildcardType)
- includes |= 268435456;
- }
- else if (!strictNullChecks && flags & 24576) {
+ if (type === wildcardType)
+ includes |= 268435456;
+ if (!strictNullChecks && flags & 98304) {
if (!(flags & 134217728))
includes |= 134217728;
}
@@ -31741,11 +32265,11 @@ var ts;
}
function isSetOfLiteralsFromSameEnum(types) {
var first = types[0];
- if (first.flags & 512) {
+ if (first.flags & 1024) {
var firstEnum = getParentOfSymbol(first.symbol);
for (var i = 1; i < types.length; i++) {
var other = types[i];
- if (!(other.flags & 512) || (firstEnum !== getParentOfSymbol(other.symbol))) {
+ if (!(other.flags & 1024) || (firstEnum !== getParentOfSymbol(other.symbol))) {
return false;
}
}
@@ -31770,10 +32294,11 @@ var ts;
while (i > 0) {
i--;
var t = types[i];
- var remove = t.flags & 64 && includes & 4 ||
- t.flags & 128 && includes & 8 ||
- t.flags & 2048 && includes & 1024 ||
- t.flags & 448 && t.flags & 33554432 && containsType(types, t.regularType);
+ var remove = t.flags & 128 && includes & 4 ||
+ t.flags & 256 && includes & 8 ||
+ t.flags & 2048 && includes & 64 ||
+ t.flags & 8192 && includes & 4096 ||
+ isFreshLiteralType(t) && containsType(types, t.regularType);
if (remove) {
ts.orderedRemoveItemAt(types, i);
}
@@ -31789,25 +32314,27 @@ var ts;
}
var typeSet = [];
var includes = addTypesToUnion(typeSet, 0, types);
- if (includes & 3) {
- return includes & 1 ? includes & 268435456 ? wildcardType : anyType : unknownType;
+ if (unionReduction !== 0) {
+ if (includes & 3) {
+ return includes & 1 ? includes & 268435456 ? wildcardType : anyType : unknownType;
+ }
+ switch (unionReduction) {
+ case 1:
+ if (includes & 8576 | 512) {
+ removeRedundantLiteralTypes(typeSet, includes);
+ }
+ break;
+ case 2:
+ removeSubtypes(typeSet);
+ break;
+ }
+ if (typeSet.length === 0) {
+ return includes & 65536 ? includes & 134217728 ? nullType : nullWideningType :
+ includes & 32768 ? includes & 134217728 ? undefinedType : undefinedWideningType :
+ neverType;
+ }
}
- switch (unionReduction) {
- case 1:
- if (includes & 2240 | 256) {
- removeRedundantLiteralTypes(typeSet, includes);
- }
- break;
- case 2:
- removeSubtypes(typeSet);
- break;
- }
- if (typeSet.length === 0) {
- return includes & 16384 ? includes & 134217728 ? nullType : nullWideningType :
- includes & 8192 ? includes & 134217728 ? undefinedType : undefinedWideningType :
- neverType;
- }
- return getUnionTypeFromSortedList(typeSet, includes & 16748579 ? 0 : 67108864, aliasSymbol, aliasTypeArguments);
+ return getUnionTypeFromSortedList(typeSet, !(includes & 66994211), aliasSymbol, aliasTypeArguments);
}
function getUnionTypePredicate(signatures) {
var first;
@@ -31841,7 +32368,7 @@ var ts;
? ts.isIdentifierTypePredicate(b) && a.parameterIndex === b.parameterIndex
: !ts.isIdentifierTypePredicate(b);
}
- function getUnionTypeFromSortedList(types, unionOfUnitTypes, aliasSymbol, aliasTypeArguments) {
+ function getUnionTypeFromSortedList(types, primitiveTypesOnly, aliasSymbol, aliasTypeArguments) {
if (types.length === 0) {
return neverType;
}
@@ -31851,10 +32378,11 @@ var ts;
var id = getTypeListId(types);
var type = unionTypes.get(id);
if (!type) {
- var propagatedFlags = getPropagatingFlagsOfTypes(types, 24576);
- type = createType(262144 | propagatedFlags | unionOfUnitTypes);
+ var propagatedFlags = getPropagatingFlagsOfTypes(types, 98304);
+ type = createType(1048576 | propagatedFlags);
unionTypes.set(id, type);
type.types = types;
+ type.primitiveTypesOnly = primitiveTypesOnly;
type.aliasSymbol = aliasSymbol;
type.aliasTypeArguments = aliasTypeArguments;
}
@@ -31870,11 +32398,14 @@ var ts;
}
function addTypeToIntersection(typeSet, includes, type) {
var flags = type.flags;
- if (flags & 524288) {
+ if (flags & 2097152) {
return addTypesToIntersection(typeSet, includes, type.types);
}
- if (ts.getObjectFlags(type) & 16 && isEmptyObjectType(type)) {
- includes |= 536870912;
+ if (isEmptyAnonymousObjectType(type)) {
+ if (!(includes & 536870912)) {
+ includes |= 536870912;
+ typeSet.push(type);
+ }
}
else {
includes |= flags & ~939524096;
@@ -31882,7 +32413,7 @@ var ts;
if (type === wildcardType)
includes |= 268435456;
}
- else if ((strictNullChecks || !(flags & 24576)) && !ts.contains(typeSet, type)) {
+ else if ((strictNullChecks || !(flags & 98304)) && !ts.contains(typeSet, type)) {
typeSet.push(type);
}
}
@@ -31900,9 +32431,10 @@ var ts;
while (i > 0) {
i--;
var t = types[i];
- var remove = t.flags & 4 && includes & 64 ||
- t.flags & 8 && includes & 128 ||
- t.flags & 1024 && includes & 2048;
+ var remove = t.flags & 4 && includes & 128 ||
+ t.flags & 8 && includes & 256 ||
+ t.flags & 64 && includes & 2048 ||
+ t.flags & 4096 && includes & 8192;
if (remove) {
ts.orderedRemoveItemAt(types, i);
}
@@ -31912,10 +32444,11 @@ var ts;
for (var _i = 0, unionTypes_1 = unionTypes; _i < unionTypes_1.length; _i++) {
var u = unionTypes_1[_i];
if (!containsType(u.types, type)) {
- var primitive = type.flags & 64 ? stringType :
- type.flags & 128 ? numberType :
- type.flags & 2048 ? esSymbolType :
- undefined;
+ var primitive = type.flags & 128 ? stringType :
+ type.flags & 256 ? numberType :
+ type.flags & 2048 ? bigintType :
+ type.flags & 8192 ? esSymbolType :
+ undefined;
if (!primitive || !containsType(u.types, primitive)) {
return false;
}
@@ -31925,11 +32458,14 @@ var ts;
}
function intersectUnionsOfPrimitiveTypes(types) {
var unionTypes;
- var index = ts.findIndex(types, function (t) { return (t.flags & 67108864) !== 0; });
+ var index = ts.findIndex(types, function (t) { return !!(t.flags & 1048576) && t.primitiveTypesOnly; });
+ if (index < 0) {
+ return false;
+ }
var i = index + 1;
while (i < types.length) {
var t = types[i];
- if (t.flags & 67108864) {
+ if (t.flags & 1048576 && t.primitiveTypesOnly) {
(unionTypes || (unionTypes = [types[index]])).push(t);
ts.orderedRemoveItemAt(types, i);
}
@@ -31953,28 +32489,29 @@ var ts;
}
}
}
- types[index] = getUnionTypeFromSortedList(result, 67108864);
+ types[index] = getUnionTypeFromSortedList(result, true);
return true;
}
function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {
var typeSet = [];
var includes = addTypesToIntersection(typeSet, 0, types);
- if (includes & 32768) {
+ if (includes & 131072) {
return neverType;
}
if (includes & 1) {
return includes & 268435456 ? wildcardType : anyType;
}
- if (!strictNullChecks && includes & 24576) {
- return includes & 8192 ? undefinedType : nullType;
+ if (!strictNullChecks && includes & 98304) {
+ return includes & 32768 ? undefinedType : nullType;
}
- if (includes & 4 && includes & 64 ||
- includes & 8 && includes & 128 ||
- includes & 1024 && includes & 2048) {
+ if (includes & 4 && includes & 128 ||
+ includes & 8 && includes & 256 ||
+ includes & 64 && includes & 2048 ||
+ includes & 4096 && includes & 8192) {
removeRedundantPrimitiveTypes(typeSet, includes);
}
- if (includes & 536870912 && !(includes & 131072)) {
- typeSet.push(emptyObjectType);
+ if (includes & 536870912 && includes & 524288) {
+ ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
}
if (typeSet.length === 0) {
return unknownType;
@@ -31982,19 +32519,19 @@ var ts;
if (typeSet.length === 1) {
return typeSet[0];
}
- if (includes & 262144) {
- if (includes & 67108864 && intersectUnionsOfPrimitiveTypes(typeSet)) {
+ if (includes & 1048576) {
+ if (intersectUnionsOfPrimitiveTypes(typeSet)) {
return getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
}
- var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 262144) !== 0; });
+ var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 1048576) !== 0; });
var unionType = typeSet[unionIndex_1];
return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1, aliasSymbol, aliasTypeArguments);
}
var id = getTypeListId(typeSet);
var type = intersectionTypes.get(id);
if (!type) {
- var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 24576);
- type = createType(524288 | propagatedFlags);
+ var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 98304);
+ type = createType(2097152 | propagatedFlags);
intersectionTypes.set(id, type);
type.types = typeSet;
type.aliasSymbol = aliasSymbol;
@@ -32011,7 +32548,7 @@ var ts;
return links.resolvedType;
}
function createIndexType(type, stringsOnly) {
- var result = createType(1048576);
+ var result = createType(4194304);
result.type = type;
result.stringsOnly = stringsOnly;
return result;
@@ -32021,14 +32558,22 @@ var ts;
type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, true)) :
type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, false));
}
- function getLiteralTypeFromPropertyName(prop, include) {
+ function getLiteralTypeFromPropertyName(name) {
+ return ts.isIdentifier(name) ? getLiteralType(ts.unescapeLeadingUnderscores(name.escapedText)) :
+ getRegularTypeOfLiteralType(ts.isComputedPropertyName(name) ? checkComputedPropertyName(name) : checkExpression(name));
+ }
+ function getBigIntLiteralType(node) {
+ return getLiteralType({
+ negative: false,
+ base10Value: ts.parsePseudoBigInt(node.text)
+ });
+ }
+ function getLiteralTypeFromProperty(prop, include) {
if (!(ts.getDeclarationModifierFlagsFromSymbol(prop) & 24)) {
var type = getLateBoundSymbol(prop).nameType;
if (!type && !ts.isKnownSymbol(prop)) {
var name = prop.valueDeclaration && ts.getNameOfDeclaration(prop.valueDeclaration);
- type = name && ts.isNumericLiteral(name) ? getLiteralType(+name.text) :
- name && name.kind === 147 && ts.isNumericLiteral(name.expression) ? getLiteralType(+name.expression.text) :
- getLiteralType(ts.symbolName(prop));
+ type = name && getLiteralTypeFromPropertyName(name) || getLiteralType(ts.symbolName(prop));
}
if (type && type.flags & include) {
return type;
@@ -32036,8 +32581,8 @@ var ts;
}
return neverType;
}
- function getLiteralTypeFromPropertyNames(type, include) {
- return getUnionType(ts.map(getPropertiesOfType(type), function (t) { return getLiteralTypeFromPropertyName(t, include); }));
+ function getLiteralTypeFromProperties(type, include) {
+ return getUnionType(ts.map(getPropertiesOfType(type), function (t) { return getLiteralTypeFromProperty(t, include); }));
}
function getNonEnumNumberIndexInfo(type) {
var numberIndexInfo = getIndexInfoOfType(type, 1);
@@ -32045,16 +32590,16 @@ var ts;
}
function getIndexType(type, stringsOnly) {
if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
- return type.flags & 262144 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
- type.flags & 524288 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
- maybeTypeOfKind(type, 14745600) ? getIndexTypeForGenericType(type, stringsOnly) :
+ return type.flags & 1048576 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
+ type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
+ maybeTypeOfKind(type, 58982400) ? getIndexTypeForGenericType(type, stringsOnly) :
ts.getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
type.flags & 1 ? keyofConstraintType :
- stringsOnly ? getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromPropertyNames(type, 64) :
- getIndexInfoOfType(type, 0) ? getUnionType([stringType, numberType, getLiteralTypeFromPropertyNames(type, 2048)]) :
- getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromPropertyNames(type, 64 | 2048)]) :
- getLiteralTypeFromPropertyNames(type, 2240);
+ stringsOnly ? getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromProperties(type, 128) :
+ getIndexInfoOfType(type, 0) ? getUnionType([stringType, numberType, getLiteralTypeFromProperties(type, 8192)]) :
+ getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, 128 | 8192)]) :
+ getLiteralTypeFromProperties(type, 8576);
}
function getExtractStringType(type) {
if (keyofStringsOnly) {
@@ -32065,17 +32610,17 @@ var ts;
}
function getIndexTypeOrString(type) {
var indexType = getExtractStringType(getIndexType(type));
- return indexType.flags & 32768 ? stringType : indexType;
+ return indexType.flags & 131072 ? stringType : indexType;
}
function getTypeFromTypeOperatorNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
switch (node.operator) {
- case 128:
+ case 129:
links.resolvedType = getIndexType(getTypeFromTypeNode(node.type));
break;
- case 141:
- links.resolvedType = node.type.kind === 138
+ case 142:
+ links.resolvedType = node.type.kind === 139
? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent))
: errorType;
break;
@@ -32084,7 +32629,7 @@ var ts;
return links.resolvedType;
}
function createIndexedAccessType(objectType, indexType) {
- var type = createType(2097152);
+ var type = createType(8388608);
type.objectType = objectType;
type.indexType = indexType;
return type;
@@ -32096,28 +32641,31 @@ var ts;
if (ts.getObjectFlags(type) & 16384) {
return true;
}
- if (type.flags & 262144) {
+ if (type.flags & 1048576) {
return ts.every(type.types, isJSLiteralType);
}
- if (type.flags & 524288) {
+ if (type.flags & 2097152) {
return ts.some(type.types, isJSLiteralType);
}
- if (type.flags & 15794176) {
+ if (type.flags & 63176704) {
return isJSLiteralType(getResolvedBaseConstraint(type));
}
return false;
}
function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol, missingType) {
- var accessExpression = accessNode && accessNode.kind === 188 ? accessNode : undefined;
- var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) :
- accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ?
- ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) :
- undefined;
+ var accessExpression = accessNode && accessNode.kind === 190 ? accessNode : undefined;
+ var propName = isTypeUsableAsLateBoundName(indexType)
+ ? getLateBoundNameFromType(indexType)
+ : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false)
+ ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name))
+ : accessNode && ts.isPropertyName(accessNode)
+ ? ts.getPropertyNameForPropertyNameNode(accessNode)
+ : undefined;
if (propName !== undefined) {
var prop = getPropertyOfType(objectType, propName);
if (prop) {
if (accessExpression) {
- markPropertyAsReferenced(prop, accessExpression, accessExpression.expression.kind === 99);
+ markPropertyAsReferenced(prop, accessExpression, accessExpression.expression.kind === 100);
if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) {
error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop));
return missingType;
@@ -32133,22 +32681,22 @@ var ts;
}
if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) {
if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; })) {
- var indexNode = accessNode.kind === 188 ? accessNode.argumentExpression : accessNode.indexType;
+ var indexNode = getIndexNodeForAccessExpression(accessNode);
error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType));
}
return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; });
}
}
- if (!(indexType.flags & 24576) && isTypeAssignableToKind(indexType, 68 | 168 | 3072)) {
- if (objectType.flags & (1 | 32768)) {
+ if (!(indexType.flags & 98304) && isTypeAssignableToKind(indexType, 132 | 296 | 12288)) {
+ if (objectType.flags & (1 | 131072)) {
return objectType;
}
- var indexInfo = isTypeAssignableToKind(indexType, 168) && getIndexInfoOfType(objectType, 1) ||
+ var indexInfo = isTypeAssignableToKind(indexType, 296) && getIndexInfoOfType(objectType, 1) ||
getIndexInfoOfType(objectType, 0) ||
undefined;
if (indexInfo) {
if (accessNode && !isTypeAssignableToKind(indexType, 4 | 8)) {
- var indexNode = accessNode.kind === 188 ? accessNode.argumentExpression : accessNode.indexType;
+ var indexNode = getIndexNodeForAccessExpression(accessNode);
error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
}
else if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) {
@@ -32156,7 +32704,7 @@ var ts;
}
return indexInfo.type;
}
- if (indexType.flags & 32768) {
+ if (indexType.flags & 131072) {
return neverType;
}
if (isJSLiteralType(objectType)) {
@@ -32189,8 +32737,8 @@ var ts;
return anyType;
}
if (accessNode) {
- var indexNode = accessNode.kind === 188 ? accessNode.argumentExpression : accessNode.indexType;
- if (indexType.flags & (64 | 128)) {
+ var indexNode = getIndexNodeForAccessExpression(accessNode);
+ if (indexType.flags & (128 | 256)) {
error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType));
}
else if (indexType.flags & (4 | 8)) {
@@ -32205,14 +32753,31 @@ var ts;
}
return missingType;
}
+ function getIndexNodeForAccessExpression(accessNode) {
+ return accessNode.kind === 190
+ ? accessNode.argumentExpression
+ : accessNode.kind === 180
+ ? accessNode.indexType
+ : accessNode.kind === 149
+ ? accessNode.expression
+ : accessNode;
+ }
function isGenericObjectType(type) {
- return maybeTypeOfKind(type, 14745600 | 134217728);
+ return maybeTypeOfKind(type, 58982400 | 134217728);
}
function isGenericIndexType(type) {
- return maybeTypeOfKind(type, 14745600 | 1048576);
+ return maybeTypeOfKind(type, 58982400 | 4194304);
}
function getSimplifiedType(type) {
- return type.flags & 2097152 ? getSimplifiedIndexedAccessType(type) : type;
+ return type.flags & 8388608 ? getSimplifiedIndexedAccessType(type) : type;
+ }
+ function distributeIndexOverObjectType(objectType, indexType) {
+ if (objectType.flags & 1048576) {
+ return mapType(objectType, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType)); });
+ }
+ if (objectType.flags & 2097152) {
+ return getIntersectionType(ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType)); }));
+ }
}
function getSimplifiedIndexedAccessType(type) {
if (type.simplified) {
@@ -32221,21 +32786,19 @@ var ts;
type.simplified = circularConstraintType;
var objectType = getSimplifiedType(type.objectType);
var indexType = getSimplifiedType(type.indexType);
- if (indexType.flags & 262144) {
+ if (indexType.flags & 1048576) {
return type.simplified = mapType(indexType, function (t) { return getSimplifiedType(getIndexedAccessType(objectType, t)); });
}
- if (!(indexType.flags & 15794176)) {
- if (objectType.flags & 262144) {
- return type.simplified = mapType(objectType, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType)); });
- }
- if (objectType.flags & 524288) {
- return type.simplified = getIntersectionType(ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType)); }));
+ if (!(indexType.flags & 63176704)) {
+ var simplified = distributeIndexOverObjectType(objectType, indexType);
+ if (simplified) {
+ return type.simplified = simplified;
}
}
if (isGenericMappedType(objectType)) {
return type.simplified = substituteIndexedMappedType(objectType, type);
}
- if (objectType.flags & 65536) {
+ if (objectType.flags & 262144) {
var constraint = getConstraintOfTypeParameter(objectType);
if (constraint && isGenericMappedType(constraint)) {
return type.simplified = substituteIndexedMappedType(constraint, type);
@@ -32253,7 +32816,7 @@ var ts;
if (objectType === wildcardType || indexType === wildcardType) {
return wildcardType;
}
- if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 188) && isGenericObjectType(objectType)) {
+ if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 180) && isGenericObjectType(objectType)) {
if (objectType.flags & 3) {
return objectType;
}
@@ -32265,7 +32828,7 @@ var ts;
return type;
}
var apparentObjectType = getApparentType(objectType);
- if (indexType.flags & 262144 && !(indexType.flags & 16)) {
+ if (indexType.flags & 1048576 && !(indexType.flags & 16)) {
var propTypes = [];
var wasMissingProp = false;
for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) {
@@ -32294,7 +32857,7 @@ var ts;
var objectType = getTypeFromTypeNode(node.objectType);
var indexType = getTypeFromTypeNode(node.indexType);
var resolved = getIndexedAccessType(objectType, indexType, node);
- links.resolvedType = resolved.flags & 2097152 &&
+ links.resolvedType = resolved.flags & 8388608 &&
resolved.objectType === objectType &&
resolved.indexType === indexType ?
getConstrainedTypeVariable(resolved, node) : resolved;
@@ -32314,7 +32877,7 @@ var ts;
return links.resolvedType;
}
function getActualTypeVariable(type) {
- return type.flags & 8388608 ? type.typeVariable : type;
+ return type.flags & 33554432 ? type.typeVariable : type;
}
function getConditionalType(root, mapper) {
var checkType = instantiateType(root.checkType, mapper);
@@ -32322,7 +32885,7 @@ var ts;
if (checkType === wildcardType || extendsType === wildcardType) {
return wildcardType;
}
- var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 15794176);
+ var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 63176704);
var combinedMapper;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, undefined, 0);
@@ -32347,7 +32910,7 @@ var ts;
}
}
var erasedCheckType = getActualTypeVariable(checkType);
- var result = createType(4194304);
+ var result = createType(16777216);
result.root = root;
result.checkType = erasedCheckType;
result.extendsType = extendsType;
@@ -32379,7 +32942,7 @@ var ts;
return true;
}
while (node) {
- if (node.kind === 173) {
+ if (node.kind === 175) {
if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) {
return true;
}
@@ -32402,7 +32965,7 @@ var ts;
extendsType: getTypeFromTypeNode(node.extendsType),
trueType: getTypeFromTypeNode(node.trueType),
falseType: getTypeFromTypeNode(node.falseType),
- isDistributive: !!(checkType.flags & 65536),
+ isDistributive: !!(checkType.flags & 262144),
inferTypeParameters: getInferTypeParameters(node),
outerTypeParameters: outerTypeParameters,
instantiations: undefined,
@@ -32520,6 +33083,9 @@ var ts;
function getTypeArgumentsForAliasSymbol(symbol) {
return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : undefined;
}
+ function isNonGenericObjectType(type) {
+ return !!(type.flags & 524288) && !isGenericMappedType(type);
+ }
function getSpreadType(left, right, symbol, typeFlags, objectFlags) {
if (left.flags & 1 || right.flags & 1) {
return anyType;
@@ -32527,21 +33093,34 @@ var ts;
if (left.flags & 2 || right.flags & 2) {
return unknownType;
}
- if (left.flags & 32768) {
+ if (left.flags & 131072) {
return right;
}
- if (right.flags & 32768) {
+ if (right.flags & 131072) {
return left;
}
- if (left.flags & 262144) {
+ if (left.flags & 1048576) {
return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); });
}
- if (right.flags & 262144) {
+ if (right.flags & 1048576) {
return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); });
}
- if (right.flags & (272 | 168 | 68 | 544 | 16777216 | 1048576)) {
+ if (right.flags & (528 | 296 | 2112 | 132 | 1056 | 67108864 | 4194304)) {
return left;
}
+ if (isGenericObjectType(left) || isGenericObjectType(right)) {
+ if (isEmptyObjectType(left)) {
+ return right;
+ }
+ if (left.flags & 2097152) {
+ var types = left.types;
+ var lastLeft = types[types.length - 1];
+ if (isNonGenericObjectType(lastLeft) && isNonGenericObjectType(right)) {
+ return getIntersectionType(ts.concatenate(types.slice(0, types.length - 1), [getSpreadType(lastLeft, right, symbol, typeFlags, objectFlags)]));
+ }
+ }
+ return getIntersectionType([left, right]);
+ }
var members = ts.createSymbolTable();
var skippedPrivateMembers = ts.createUnderscoreEscapedMap();
var stringIndexInfo;
@@ -32560,7 +33139,7 @@ var ts;
skippedPrivateMembers.set(rightProp.escapedName, true);
}
else if (isSpreadableProperty(rightProp)) {
- members.set(rightProp.escapedName, getNonReadonlySymbol(rightProp));
+ members.set(rightProp.escapedName, getSpreadSymbol(rightProp));
}
}
for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) {
@@ -32575,7 +33154,7 @@ var ts;
var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations);
var flags = 4 | (leftProp.flags & 16777216);
var result = createSymbol(flags, leftProp.escapedName);
- result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 131072)]);
+ result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 524288)]);
result.leftSpread = leftProp;
result.rightSpread = rightProp;
result.declarations = declarations;
@@ -32584,26 +33163,27 @@ var ts;
}
}
else {
- members.set(leftProp.escapedName, getNonReadonlySymbol(leftProp));
+ members.set(leftProp.escapedName, getSpreadSymbol(leftProp));
}
}
var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo));
- spread.flags |= typeFlags | 268435456;
- spread.objectFlags |= objectFlags | (128 | 1024);
+ spread.flags |= 268435456 | typeFlags;
+ spread.objectFlags |= 128 | 1024 | objectFlags;
return spread;
}
function isSpreadableProperty(prop) {
- return prop.flags & (8192 | 32768)
- ? !prop.declarations.some(function (decl) { return ts.isClassLike(decl.parent); })
- : !(prop.flags & 65536);
+ return !(prop.flags & (8192 | 32768 | 65536)) ||
+ !prop.declarations.some(function (decl) { return ts.isClassLike(decl.parent); });
}
- function getNonReadonlySymbol(prop) {
- if (!isReadonlySymbol(prop)) {
+ function getSpreadSymbol(prop) {
+ var isReadonly = isReadonlySymbol(prop);
+ var isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768);
+ if (!isReadonly && !isSetonlyAccessor) {
return prop;
}
var flags = 4 | (prop.flags & 16777216);
var result = createSymbol(flags, prop.escapedName);
- result.type = getTypeOfSymbol(prop);
+ result.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
result.declarations = prop.declarations;
result.nameType = prop.nameType;
result.syntheticOrigin = prop;
@@ -32622,10 +33202,11 @@ var ts;
return type;
}
function getFreshTypeOfLiteralType(type) {
- if (type.flags & 448 && !(type.flags & 33554432)) {
+ if (type.flags & 2944) {
if (!type.freshType) {
- var freshType = createLiteralType(type.flags | 33554432, type.value, type.symbol);
+ var freshType = createLiteralType(type.flags, type.value, type.symbol);
freshType.regularType = type;
+ freshType.freshType = freshType;
type.freshType = freshType;
}
return type.freshType;
@@ -32633,17 +33214,23 @@ var ts;
return type;
}
function getRegularTypeOfLiteralType(type) {
- return type.flags & 448 && type.flags & 33554432 ? type.regularType :
- type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getRegularTypeOfLiteralType)) :
+ return type.flags & 2944 ? type.regularType :
+ type.flags & 1048576 ? getUnionType(ts.sameMap(type.types, getRegularTypeOfLiteralType)) :
type;
}
+ function isFreshLiteralType(type) {
+ return !!(type.flags & 2944) && type.freshType === type;
+ }
function getLiteralType(value, enumId, symbol) {
- var qualifier = typeof value === "number" ? "#" : "@";
- var key = enumId ? enumId + qualifier + value : qualifier + value;
+ var qualifier = typeof value === "number" ? "#" : typeof value === "string" ? "@" : "n";
+ var key = (enumId ? enumId : "") + qualifier + (typeof value === "object" ? ts.pseudoBigIntToString(value) : value);
var type = literalTypes.get(key);
if (!type) {
- var flags = (typeof value === "number" ? 128 : 64) | (enumId ? 512 : 0);
+ var flags = (typeof value === "number" ? 256 :
+ typeof value === "string" ? 128 : 2048) |
+ (enumId ? 1024 : 0);
literalTypes.set(key, type = createLiteralType(flags, value, symbol));
+ type.regularType = type;
}
return type;
}
@@ -32655,7 +33242,7 @@ var ts;
return links.resolvedType;
}
function createUniqueESSymbolType(symbol) {
- var type = createType(2048);
+ var type = createType(8192);
type.symbol = symbol;
return type;
}
@@ -32670,9 +33257,9 @@ var ts;
function getThisType(node) {
var container = ts.getThisContainer(node, false);
var parent = container && container.parent;
- if (parent && (ts.isClassLike(parent) || parent.kind === 239)) {
+ if (parent && (ts.isClassLike(parent) || parent.kind === 241)) {
if (!ts.hasModifier(container, 32) &&
- (container.kind !== 155 || ts.isNodeDescendantOf(node, container.body))) {
+ (container.kind !== 157 || ts.isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
}
}
@@ -32688,85 +33275,87 @@ var ts;
}
function getTypeFromTypeNode(node) {
switch (node.kind) {
- case 119:
- case 282:
- case 283:
- return anyType;
- case 142:
- return unknownType;
- case 137:
- return stringType;
- case 134:
- return numberType;
- case 122:
- return booleanType;
- case 138:
- return esSymbolType;
- case 105:
- return voidType;
- case 140:
- return undefinedType;
- case 95:
- return nullType;
- case 131:
- return neverType;
- case 135:
- return node.flags & 65536 ? anyType : nonPrimitiveType;
- case 176:
- case 99:
- return getTypeFromThisTypeNode(node);
- case 180:
- return getTypeFromLiteralTypeNode(node);
- case 162:
- return getTypeFromTypeReference(node);
- case 161:
- return booleanType;
- case 209:
- return getTypeFromTypeReference(node);
- case 165:
- return getTypeFromTypeQueryNode(node);
- case 167:
- return getTypeFromArrayTypeNode(node);
- case 168:
- return getTypeFromTupleTypeNode(node);
- case 169:
- return getTypeFromOptionalTypeNode(node);
- case 171:
- return getTypeFromUnionTypeNode(node);
- case 172:
- return getTypeFromIntersectionTypeNode(node);
+ case 120:
case 284:
- return getTypeFromJSDocNullableTypeNode(node);
- case 286:
- return addOptionality(getTypeFromTypeNode(node.type));
- case 175:
- case 170:
case 285:
- case 281:
- return getTypeFromTypeNode(node.type);
- case 288:
- return getTypeFromJSDocVariadicType(node);
- case 163:
- case 164:
- case 166:
- case 290:
- case 287:
- case 291:
- return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
- case 177:
- return getTypeFromTypeOperatorNode(node);
- case 178:
- return getTypeFromIndexedAccessTypeNode(node);
- case 179:
- return getTypeFromMappedTypeNode(node);
- case 173:
- return getTypeFromConditionalTypeNode(node);
- case 174:
- return getTypeFromInferTypeNode(node);
- case 181:
- return getTypeFromImportTypeNode(node);
- case 71:
+ return anyType;
+ case 143:
+ return unknownType;
+ case 138:
+ return stringType;
+ case 135:
+ return numberType;
case 146:
+ return bigintType;
+ case 123:
+ return booleanType;
+ case 139:
+ return esSymbolType;
+ case 106:
+ return voidType;
+ case 141:
+ return undefinedType;
+ case 96:
+ return nullType;
+ case 132:
+ return neverType;
+ case 136:
+ return node.flags & 65536 ? anyType : nonPrimitiveType;
+ case 178:
+ case 100:
+ return getTypeFromThisTypeNode(node);
+ case 182:
+ return getTypeFromLiteralTypeNode(node);
+ case 164:
+ return getTypeFromTypeReference(node);
+ case 163:
+ return booleanType;
+ case 211:
+ return getTypeFromTypeReference(node);
+ case 167:
+ return getTypeFromTypeQueryNode(node);
+ case 169:
+ return getTypeFromArrayTypeNode(node);
+ case 170:
+ return getTypeFromTupleTypeNode(node);
+ case 171:
+ return getTypeFromOptionalTypeNode(node);
+ case 173:
+ return getTypeFromUnionTypeNode(node);
+ case 174:
+ return getTypeFromIntersectionTypeNode(node);
+ case 286:
+ return getTypeFromJSDocNullableTypeNode(node);
+ case 288:
+ return addOptionality(getTypeFromTypeNode(node.type));
+ case 177:
+ case 172:
+ case 287:
+ case 283:
+ return getTypeFromTypeNode(node.type);
+ case 290:
+ return getTypeFromJSDocVariadicType(node);
+ case 165:
+ case 166:
+ case 168:
+ case 292:
+ case 289:
+ case 293:
+ return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
+ case 179:
+ return getTypeFromTypeOperatorNode(node);
+ case 180:
+ return getTypeFromIndexedAccessTypeNode(node);
+ case 181:
+ return getTypeFromMappedTypeNode(node);
+ case 175:
+ return getTypeFromConditionalTypeNode(node);
+ case 176:
+ return getTypeFromInferTypeNode(node);
+ case 183:
+ return getTypeFromImportTypeNode(node);
+ case 72:
+ case 148:
var symbol = getSymbolAtLocation(node);
return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;
default:
@@ -32843,10 +33432,10 @@ var ts;
return function (t) { return t === source ? target : baseMapper(t); };
}
function wildcardMapper(type) {
- return type.flags & 65536 ? wildcardType : type;
+ return type.flags & 262144 ? wildcardType : type;
}
function cloneTypeParameter(typeParameter) {
- var result = createType(65536);
+ var result = createType(262144);
result.symbol = typeParameter.symbol;
result.target = typeParameter;
return result;
@@ -32884,7 +33473,7 @@ var ts;
}
function instantiateSymbol(symbol, mapper) {
var links = getSymbolLinks(symbol);
- if (links.type && !maybeTypeOfKind(links.type, 131072 | 15794176)) {
+ if (links.type && !maybeTypeOfKind(links.type, 524288 | 63176704)) {
return symbol;
}
if (ts.getCheckFlags(symbol) & 1) {
@@ -32950,25 +33539,25 @@ var ts;
return type;
}
function maybeTypeParameterReference(node) {
- return !(node.kind === 146 ||
- node.parent.kind === 162 && node.parent.typeArguments && node === node.parent.typeName);
+ return !(node.kind === 148 ||
+ node.parent.kind === 164 && node.parent.typeArguments && node === node.parent.typeName);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
var container_3 = tp.symbol.declarations[0].parent;
- if (ts.findAncestor(node, function (n) { return n.kind === 216 ? "quit" : n === container_3; })) {
+ if (ts.findAncestor(node, function (n) { return n.kind === 218 ? "quit" : n === container_3; })) {
return !!ts.forEachChild(node, containsReference);
}
}
return true;
function containsReference(node) {
switch (node.kind) {
- case 176:
+ case 178:
return !!tp.isThisType;
- case 71:
+ case 72:
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
getTypeFromTypeNode(node) === tp;
- case 165:
+ case 167:
return true;
}
return !!ts.forEachChild(node, containsReference);
@@ -32976,9 +33565,9 @@ var ts;
}
function getHomomorphicTypeVariable(type) {
var constraintType = getConstraintTypeFromMappedType(type);
- if (constraintType.flags & 1048576) {
+ if (constraintType.flags & 4194304) {
var typeVariable = constraintType.type;
- if (typeVariable.flags & 65536) {
+ if (typeVariable.flags & 262144) {
return typeVariable;
}
}
@@ -32994,7 +33583,7 @@ var ts;
}
type.instantiating = true;
var result = mapType(mappedTypeVariable, function (t) {
- if (t.flags & (3 | 14745600 | 131072 | 524288) && t !== wildcardType) {
+ if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType) {
var replacementMapper = createReplacementMapper(typeVariable, t, mapper);
return isArrayType(t) ? createArrayType(instantiateMappedTypeTemplate(type, numberType, true, replacementMapper)) :
isReadonlyArrayType(t) ? createReadonlyArrayType(instantiateMappedTypeTemplate(type, numberType, true, replacementMapper)) :
@@ -33025,7 +33614,7 @@ var ts;
var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper);
var modifiers = getMappedTypeModifiers(type);
return strictNullChecks && modifiers & 4 && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) :
- strictNullChecks && modifiers & 8 && isOptional ? getTypeWithFacts(propType, 131072) :
+ strictNullChecks && modifiers & 8 && isOptional ? getTypeWithFacts(propType, 524288) :
propType;
}
function instantiateAnonymousType(type, mapper) {
@@ -33063,7 +33652,7 @@ var ts;
if (root.isDistributive) {
var checkType_1 = root.checkType;
var instantiatedType = mapper(checkType_1);
- if (checkType_1 !== instantiatedType && instantiatedType.flags & (262144 | 32768)) {
+ if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 | 131072)) {
return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); });
}
}
@@ -33083,10 +33672,10 @@ var ts;
}
function instantiateTypeWorker(type, mapper) {
var flags = type.flags;
- if (flags & 65536) {
+ if (flags & 262144) {
return mapper(type);
}
- if (flags & 131072) {
+ if (flags & 524288) {
var objectFlags = type.objectFlags;
if (objectFlags & 16) {
return type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations ?
@@ -33102,65 +33691,65 @@ var ts;
}
return type;
}
- if (flags & 262144 && !(flags & 32764)) {
+ if (flags & 1048576 && !(flags & 131068)) {
var types = type.types;
var newTypes = instantiateTypes(types, mapper);
return newTypes !== types ? getUnionType(newTypes, 1, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type;
}
- if (flags & 524288) {
+ if (flags & 2097152) {
var types = type.types;
var newTypes = instantiateTypes(types, mapper);
return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type;
}
- if (flags & 1048576) {
+ if (flags & 4194304) {
return getIndexType(instantiateType(type.type, mapper));
}
- if (flags & 2097152) {
+ if (flags & 8388608) {
return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper));
}
- if (flags & 4194304) {
+ if (flags & 16777216) {
return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper));
}
- if (flags & 8388608) {
+ if (flags & 33554432) {
return instantiateType(type.typeVariable, mapper);
}
return type;
}
function getWildcardInstantiation(type) {
- return type.flags & (32764 | 3 | 32768) ? type :
+ return type.flags & (131068 | 3 | 131072) ? type :
type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper));
}
function instantiateIndexInfo(info, mapper) {
return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 156 || ts.isObjectLiteralMethod(node));
switch (node.kind) {
- case 194:
- case 195:
- case 154:
+ case 196:
+ case 197:
+ case 156:
return isContextSensitiveFunctionLikeDeclaration(node);
- case 186:
+ case 188:
return ts.some(node.properties, isContextSensitive);
- case 185:
+ case 187:
return ts.some(node.elements, isContextSensitive);
- case 203:
+ case 205:
return isContextSensitive(node.whenTrue) ||
isContextSensitive(node.whenFalse);
- case 202:
- return node.operatorToken.kind === 54 &&
+ case 204:
+ return node.operatorToken.kind === 55 &&
(isContextSensitive(node.left) || isContextSensitive(node.right));
- case 273:
+ case 275:
return isContextSensitive(node.initializer);
- case 193:
+ case 195:
return isContextSensitive(node.expression);
- case 266:
- return ts.some(node.properties, isContextSensitive);
- case 265: {
+ case 268:
+ return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive);
+ case 267: {
var initializer = node.initializer;
return !!initializer && isContextSensitive(initializer);
}
- case 268: {
+ case 270: {
var expression = node.expression;
return !!expression && isContextSensitive(expression);
}
@@ -33174,7 +33763,7 @@ var ts;
if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) {
return true;
}
- if (node.kind !== 195) {
+ if (node.kind !== 197) {
var parameter = ts.firstOrUndefined(node.parameters);
if (!(parameter && ts.parameterIsThisKeyword(parameter))) {
return true;
@@ -33184,14 +33773,14 @@ var ts;
}
function hasContextSensitiveReturnExpression(node) {
var body = node.body;
- return body.kind === 216 ? false : isContextSensitive(body);
+ return body.kind === 218 ? false : isContextSensitive(body);
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
isContextSensitiveFunctionLikeDeclaration(func);
}
function getTypeWithoutSignatures(type) {
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
var resolved = resolveStructuredTypeMembers(type);
if (resolved.constructSignatures.length || resolved.callSignatures.length) {
var result = createObjectType(16, type.symbol);
@@ -33202,7 +33791,7 @@ var ts;
return result;
}
}
- else if (type.flags & 524288) {
+ else if (type.flags & 2097152) {
return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures));
}
return type;
@@ -33216,6 +33805,9 @@ var ts;
function compareTypesAssignable(source, target) {
return isTypeRelatedTo(source, target, assignableRelation) ? -1 : 0;
}
+ function compareTypesSubtypeOf(source, target) {
+ return isTypeRelatedTo(source, target, subtypeRelation) ? -1 : 0;
+ }
function isTypeSubtypeOf(source, target) {
return isTypeRelatedTo(source, target, subtypeRelation);
}
@@ -33223,11 +33815,11 @@ var ts;
return isTypeRelatedTo(source, target, assignableRelation);
}
function isTypeDerivedFrom(source, target) {
- return source.flags & 262144 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) :
- target.flags & 262144 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) :
- source.flags & 14745600 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) :
- target === globalObjectType ? !!(source.flags & (131072 | 16777216)) :
- target === globalFunctionType ? !!(source.flags & 131072) && isFunctionObjectType(source) :
+ return source.flags & 1048576 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) :
+ target.flags & 1048576 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) :
+ source.flags & 58982400 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) :
+ target === globalObjectType ? !!(source.flags & (524288 | 67108864)) :
+ target === globalFunctionType ? !!(source.flags & 524288) && isFunctionObjectType(source) :
hasBaseType(source, getTargetType(target));
}
function isTypeComparableTo(source, target) {
@@ -33251,7 +33843,7 @@ var ts;
return false;
}
function isOrHasGenericConditional(type) {
- return !!(type.flags & 4194304 || (type.flags & 524288 && ts.some(type.types, isOrHasGenericConditional)));
+ return !!(type.flags & 16777216 || (type.flags & 2097152 && ts.some(type.types, isOrHasGenericConditional)));
}
function elaborateError(node, source, target, relation, headMessage) {
if (!node || isOrHasGenericConditional(target))
@@ -33260,23 +33852,23 @@ var ts;
return true;
}
switch (node.kind) {
- case 268:
- case 193:
+ case 270:
+ case 195:
return elaborateError(node.expression, source, target, relation, headMessage);
- case 202:
+ case 204:
switch (node.operatorToken.kind) {
- case 58:
- case 26:
+ case 59:
+ case 27:
return elaborateError(node.right, source, target, relation, headMessage);
}
break;
- case 186:
+ case 188:
return elaborateObjectLiteral(node, source, target, relation);
- case 185:
+ case 187:
return elaborateArrayLiteral(node, source, target, relation);
- case 266:
+ case 268:
return elaborateJsxAttributes(node, source, target, relation);
- case 195:
+ case 197:
return elaborateArrowFunction(node, source, target, relation);
}
return false;
@@ -33288,7 +33880,7 @@ var ts;
var signatures = _a[_i];
if (ts.some(signatures, function (s) {
var returnType = getReturnTypeOfSignature(s);
- return !(returnType.flags & (1 | 32768)) && checkTypeRelatedTo(returnType, target, relation, undefined);
+ return !(returnType.flags & (1 | 131072)) && checkTypeRelatedTo(returnType, target, relation, undefined);
})) {
var resultObj = {};
checkTypeAssignableTo(source, target, node, headMessage, undefined, resultObj);
@@ -33337,8 +33929,10 @@ var ts;
var reportedError = false;
for (var status = iterator.next(); !status.done; status = iterator.next()) {
var _a = status.value, prop = _a.errorNode, next = _a.innerExpression, nameType = _a.nameType, errorMessage = _a.errorMessage;
- var sourcePropType = getIndexedAccessType(source, nameType, undefined, errorType);
var targetPropType = getIndexedAccessType(target, nameType, undefined, errorType);
+ if (targetPropType === errorType || targetPropType.flags & 8388608)
+ continue;
+ var sourcePropType = getIndexedAccessType(source, nameType, undefined, errorType);
if (sourcePropType !== errorType && targetPropType !== errorType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, undefined)) {
var elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, undefined);
if (elaborated) {
@@ -33357,7 +33951,7 @@ var ts;
var targetProp = propertyName !== undefined ? getPropertyOfType(target, propertyName) : undefined;
var issuedElaboration = false;
if (!targetProp) {
- var indexInfo = isTypeAssignableToKind(nameType, 168) && getIndexInfoOfType(target, 1) ||
+ var indexInfo = isTypeAssignableToKind(nameType, 296) && getIndexInfoOfType(target, 1) ||
getIndexInfoOfType(target, 0) ||
undefined;
if (indexInfo && indexInfo.declaration && !ts.getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) {
@@ -33368,7 +33962,7 @@ var ts;
if (!issuedElaboration && (targetProp && ts.length(targetProp.declarations) || target.symbol && ts.length(target.symbol.declarations))) {
var targetNode = targetProp && ts.length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0];
if (!ts.getSourceFileOfNode(targetNode).hasNoDefaultLib) {
- addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(targetNode, ts.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & 2048) ? ts.unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target)));
+ addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(targetNode, ts.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & 8192) ? ts.unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target)));
}
}
}
@@ -33459,17 +34053,17 @@ var ts;
prop = _a[_i];
if (ts.isSpreadAssignment(prop))
return [3, 7];
- type = getLiteralTypeFromPropertyName(getSymbolOfNode(prop), 2240);
- if (!type || (type.flags & 32768)) {
+ type = getLiteralTypeFromProperty(getSymbolOfNode(prop), 8576);
+ if (!type || (type.flags & 131072)) {
return [3, 7];
}
_b = prop.kind;
switch (_b) {
- case 157: return [3, 2];
+ case 159: return [3, 2];
+ case 158: return [3, 2];
case 156: return [3, 2];
- case 154: return [3, 2];
- case 274: return [3, 2];
- case 273: return [3, 4];
+ case 276: return [3, 2];
+ case 275: return [3, 4];
}
return [3, 6];
case 2: return [4, { errorNode: prop.name, innerExpression: undefined, nameType: type }];
@@ -33518,8 +34112,8 @@ var ts;
return 0;
}
var kind = target.declaration ? target.declaration.kind : 0;
- var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 154 &&
- kind !== 153 && kind !== 155;
+ var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 156 &&
+ kind !== 155 && kind !== 157;
var result = -1;
var sourceThisType = getThisTypeOfSignature(source);
if (sourceThisType && sourceThisType !== voidType) {
@@ -33544,7 +34138,7 @@ var ts;
var sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
var targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType));
var callbacks = sourceSig && targetSig && !signatureHasTypePredicate(sourceSig) && !signatureHasTypePredicate(targetSig) &&
- (getFalsyFlags(sourceType) & 24576) === (getFalsyFlags(targetType) & 24576);
+ (getFalsyFlags(sourceType) & 98304) === (getFalsyFlags(targetType) & 98304);
var related = callbacks ?
compareSignaturesRelated(targetSig, sourceSig, strictVariance ? 2 : 1, false, reportErrors, errorReporter, compareTypes) :
!callbackCheck && !strictVariance && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors);
@@ -33630,12 +34224,15 @@ var ts;
!t.numberIndexInfo;
}
function isEmptyObjectType(type) {
- return type.flags & 131072 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) :
- type.flags & 16777216 ? true :
- type.flags & 262144 ? ts.some(type.types, isEmptyObjectType) :
- type.flags & 524288 ? ts.every(type.types, isEmptyObjectType) :
+ return type.flags & 524288 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) :
+ type.flags & 67108864 ? true :
+ type.flags & 1048576 ? ts.some(type.types, isEmptyObjectType) :
+ type.flags & 2097152 ? ts.every(type.types, isEmptyObjectType) :
false;
}
+ function isEmptyAnonymousObjectType(type) {
+ return !!(ts.getObjectFlags(type) & 16) && isEmptyObjectType(type);
+ }
function isEnumTypeRelatedTo(sourceSymbol, targetSymbol, errorReporter) {
if (sourceSymbol === targetSymbol) {
return true;
@@ -33672,71 +34269,73 @@ var ts;
function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {
var s = source.flags;
var t = target.flags;
- if (t & 3 || s & 32768 || source === wildcardType)
+ if (t & 3 || s & 131072 || source === wildcardType)
return true;
- if (t & 32768)
+ if (t & 131072)
return false;
- if (s & 68 && t & 4)
+ if (s & 132 && t & 4)
return true;
- if (s & 64 && s & 512 &&
- t & 64 && !(t & 512) &&
+ if (s & 128 && s & 1024 &&
+ t & 128 && !(t & 1024) &&
source.value === target.value)
return true;
- if (s & 168 && t & 8)
+ if (s & 296 && t & 8)
return true;
- if (s & 128 && s & 512 &&
- t & 128 && !(t & 512) &&
+ if (s & 256 && s & 1024 &&
+ t & 256 && !(t & 1024) &&
source.value === target.value)
return true;
- if (s & 272 && t & 16)
+ if (s & 2112 && t & 64)
return true;
- if (s & 3072 && t & 1024)
+ if (s & 528 && t & 16)
+ return true;
+ if (s & 12288 && t & 4096)
return true;
if (s & 32 && t & 32 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
return true;
- if (s & 512 && t & 512) {
- if (s & 262144 && t & 262144 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
+ if (s & 1024 && t & 1024) {
+ if (s & 1048576 && t & 1048576 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
return true;
- if (s & 448 && t & 448 &&
+ if (s & 2944 && t & 2944 &&
source.value === target.value &&
isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter))
return true;
}
- if (s & 8192 && (!strictNullChecks || t & (8192 | 4096)))
+ if (s & 32768 && (!strictNullChecks || t & (32768 | 16384)))
return true;
- if (s & 16384 && (!strictNullChecks || t & 16384))
+ if (s & 65536 && (!strictNullChecks || t & 65536))
return true;
- if (s & 131072 && t & 16777216)
+ if (s & 524288 && t & 67108864)
return true;
- if (s & 2048 || t & 2048)
+ if (s & 8192 || t & 8192)
return false;
if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) {
if (s & 1)
return true;
- if (s & (8 | 128) && !(s & 512) && (t & 32 || t & 128 && t & 512))
+ if (s & (8 | 256) && !(s & 1024) && (t & 32 || t & 256 && t & 1024))
return true;
}
return false;
}
function isTypeRelatedTo(source, target, relation) {
- if (source.flags & 448 && source.flags & 33554432) {
+ if (isFreshLiteralType(source)) {
source = source.regularType;
}
- if (target.flags & 448 && target.flags & 33554432) {
+ if (isFreshLiteralType(target)) {
target = target.regularType;
}
if (source === target ||
- relation === comparableRelation && !(target.flags & 32768) && isSimpleTypeRelatedTo(target, source, relation) ||
+ relation === comparableRelation && !(target.flags & 131072) && isSimpleTypeRelatedTo(target, source, relation) ||
relation !== identityRelation && isSimpleTypeRelatedTo(source, target, relation)) {
return true;
}
- if (source.flags & 131072 && target.flags & 131072) {
+ if (source.flags & 524288 && target.flags & 524288) {
var related = relation.get(getRelationKey(source, target, relation));
if (related !== undefined) {
return related === 1;
}
}
- if (source.flags & 16711680 || target.flags & 16711680) {
+ if (source.flags & 66846720 || target.flags & 66846720) {
return checkTypeRelatedTo(source, target, relation, undefined);
}
return false;
@@ -33746,6 +34345,7 @@ var ts;
}
function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {
var errorInfo;
+ var relatedInfo;
var maybeKeys;
var sourceStack;
var targetStack;
@@ -33753,7 +34353,7 @@ var ts;
var depth = 0;
var expandingFlags = 0;
var overflow = false;
- var isIntersectionConstituent = false;
+ var suppressNextError = false;
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
var result = isRelatedTo(source, target, !!errorNode, headMessage);
if (overflow) {
@@ -33778,15 +34378,27 @@ var ts;
}
}
var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
+ if (relatedInfo) {
+ addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
+ }
if (errorOutputContainer) {
errorOutputContainer.error = diag;
}
diagnostics.add(diag);
}
return result !== 0;
- function reportError(message, arg0, arg1, arg2) {
+ function reportError(message, arg0, arg1, arg2, arg3) {
ts.Debug.assert(!!errorNode);
- errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2);
+ errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2, arg3);
+ }
+ function associateRelatedInfo(info) {
+ ts.Debug.assert(!!errorInfo);
+ if (!relatedInfo) {
+ relatedInfo = [info];
+ }
+ else {
+ relatedInfo.push(info);
+ }
}
function reportRelationError(message, source, target) {
var sourceType = typeToString(source);
@@ -33819,13 +34431,13 @@ var ts;
}
}
function isUnionOrIntersectionTypeWithoutNullableConstituents(type) {
- if (!(type.flags & 786432)) {
+ if (!(type.flags & 3145728)) {
return false;
}
var seenNonNullable = false;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 24576) {
+ if (t.flags & 98304) {
continue;
}
if (seenNonNullable) {
@@ -33835,30 +34447,30 @@ var ts;
}
return false;
}
- function isRelatedTo(source, target, reportErrors, headMessage) {
+ function isRelatedTo(source, target, reportErrors, headMessage, isApparentIntersectionConstituent) {
if (reportErrors === void 0) { reportErrors = false; }
- if (source.flags & 448 && source.flags & 33554432) {
+ if (isFreshLiteralType(source)) {
source = source.regularType;
}
- if (target.flags & 448 && target.flags & 33554432) {
+ if (isFreshLiteralType(target)) {
target = target.regularType;
}
- if (source.flags & 8388608) {
+ if (source.flags & 33554432) {
source = relation === definitelyAssignableRelation ? source.typeVariable : source.substitute;
}
- if (target.flags & 8388608) {
+ if (target.flags & 33554432) {
target = target.typeVariable;
}
- if (source.flags & 2097152) {
+ if (source.flags & 8388608) {
source = getSimplifiedType(source);
}
- if (target.flags & 2097152) {
+ if (target.flags & 8388608) {
target = getSimplifiedType(target);
}
- if (target.flags & 262144 && source.flags & 131072 &&
- target.types.length <= 3 && maybeTypeOfKind(target, 24576)) {
- var nullStrippedTarget = extractTypesOfKind(target, ~24576);
- if (!(nullStrippedTarget.flags & (262144 | 32768))) {
+ if (target.flags & 1048576 && source.flags & 524288 &&
+ target.types.length <= 3 && maybeTypeOfKind(target, 98304)) {
+ var nullStrippedTarget = extractTypesOfKind(target, ~98304);
+ if (!(nullStrippedTarget.flags & (1048576 | 131072))) {
target = nullStrippedTarget;
}
}
@@ -33867,11 +34479,12 @@ var ts;
if (relation === identityRelation) {
return isIdenticalTo(source, target);
}
- if (relation === comparableRelation && !(target.flags & 32768) && isSimpleTypeRelatedTo(target, source, relation) ||
+ if (relation === comparableRelation && !(target.flags & 131072) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1;
- if (isObjectLiteralType(source) && source.flags & 33554432) {
- var discriminantType = target.flags & 262144 ? findMatchingDiscriminantType(source, target) : undefined;
+ var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096);
+ if (isObjectLiteralType(source) && ts.getObjectFlags(source) & 32768) {
+ var discriminantType = target.flags & 1048576 ? findMatchingDiscriminantType(source, target) : undefined;
if (hasExcessProperties(source, target, discriminantType, reportErrors)) {
if (reportErrors) {
reportRelationError(headMessage, source, target);
@@ -33882,11 +34495,11 @@ var ts;
source = getRegularTypeOfObjectLiteral(source);
}
}
- if (relation !== comparableRelation && !isIntersectionConstituent &&
- source.flags & (32764 | 131072 | 524288) && source !== globalObjectType &&
- target.flags & (131072 | 524288) && isWeakType(target) &&
+ if (relation !== comparableRelation && !isApparentIntersectionConstituent &&
+ source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
+ target.flags & (524288 | 2097152) && isWeakType(target) &&
(getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source)) &&
- !hasCommonProperties(source, target)) {
+ !hasCommonProperties(source, target, isComparingJsxAttributes)) {
if (reportErrors) {
var calls = getSignaturesOfType(source, 0);
var constructs = getSignaturesOfType(source, 1);
@@ -33902,47 +34515,47 @@ var ts;
}
var result = 0;
var saveErrorInfo = errorInfo;
- var saveIsIntersectionConstituent = isIntersectionConstituent;
- isIntersectionConstituent = false;
- if (source.flags & 262144) {
+ var isIntersectionConstituent = !!isApparentIntersectionConstituent;
+ if (source.flags & 1048576) {
result = relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 32764)) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 32764));
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068)) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068));
}
else {
- if (target.flags & 262144) {
- result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 32764) && !(target.flags & 32764));
+ if (target.flags & 1048576) {
+ result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 131068) && !(target.flags & 131068));
}
- else if (target.flags & 524288) {
+ else if (target.flags & 2097152) {
isIntersectionConstituent = true;
result = typeRelatedToEachType(source, target, reportErrors);
}
- else if (source.flags & 524288) {
+ else if (source.flags & 2097152) {
result = someTypeRelatedToType(source, target, false);
}
- if (!result && (source.flags & 16711680 || target.flags & 16711680)) {
- if (result = recursiveTypeRelatedTo(source, target, reportErrors)) {
+ if (!result && (source.flags & 66846720 || target.flags & 66846720)) {
+ if (result = recursiveTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent)) {
errorInfo = saveErrorInfo;
}
}
}
- if (!result && source.flags & 524288) {
- var constraint = getUnionConstraintOfIntersection(source, !!(target.flags & 262144));
+ if (!result && source.flags & 2097152) {
+ var constraint = getUnionConstraintOfIntersection(source, !!(target.flags & 1048576));
if (constraint) {
- if (result = isRelatedTo(constraint, target, reportErrors)) {
+ if (result = isRelatedTo(constraint, target, reportErrors, undefined, isIntersectionConstituent)) {
errorInfo = saveErrorInfo;
}
}
}
- isIntersectionConstituent = saveIsIntersectionConstituent;
if (!result && reportErrors) {
- if (source.flags & 131072 && target.flags & 32764) {
+ var maybeSuppress = suppressNextError;
+ suppressNextError = false;
+ if (source.flags & 524288 && target.flags & 131068) {
tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- else if (source.symbol && source.flags & 131072 && globalObjectType === source) {
+ else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
}
- else if (ts.getObjectFlags(source) & 4096 && target.flags & 524288) {
+ else if (isComparingJsxAttributes && target.flags & 2097152) {
var targetTypes = target.types;
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
@@ -33951,6 +34564,9 @@ var ts;
return result;
}
}
+ if (!headMessage && maybeSuppress) {
+ return result;
+ }
reportRelationError(headMessage, source, target);
}
return result;
@@ -33958,10 +34574,10 @@ var ts;
function isIdenticalTo(source, target) {
var result;
var flags = source.flags & target.flags;
- if (flags & 131072 || flags & 2097152 || flags & 4194304 || flags & 1048576 || flags & 8388608) {
- return recursiveTypeRelatedTo(source, target, false);
+ if (flags & 524288 || flags & 8388608 || flags & 16777216 || flags & 4194304 || flags & 33554432) {
+ return recursiveTypeRelatedTo(source, target, false, false);
}
- if (flags & (262144 | 524288)) {
+ if (flags & (1048576 | 2097152)) {
if (result = eachTypeRelatedToSomeType(source, target)) {
if (result &= eachTypeRelatedToSomeType(target, source)) {
return result;
@@ -33974,7 +34590,7 @@ var ts;
if (!noImplicitAny && ts.getObjectFlags(target) & 16384) {
return false;
}
- if (maybeTypeOfKind(target, 131072) && !(ts.getObjectFlags(target) & 512)) {
+ if (maybeTypeOfKind(target, 524288) && !(ts.getObjectFlags(target) & 512)) {
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096);
if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) &&
(isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {
@@ -33984,11 +34600,11 @@ var ts;
return hasExcessProperties(source, discriminant, undefined, reportErrors);
}
var _loop_6 = function (prop) {
- if (!isPropertyFromSpread(prop, source.symbol) && !isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {
+ if (shouldCheckAsExcessProperty(prop, source.symbol) && !isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {
if (reportErrors) {
if (!errorNode)
return { value: ts.Debug.fail() };
- if (ts.isJsxAttributes(errorNode) || ts.isJsxOpeningLikeElement(errorNode)) {
+ if (ts.isJsxAttributes(errorNode) || ts.isJsxOpeningLikeElement(errorNode) || ts.isJsxOpeningLikeElement(errorNode.parent)) {
reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
}
else {
@@ -34023,8 +34639,8 @@ var ts;
}
return false;
}
- function isPropertyFromSpread(prop, container) {
- return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent !== container.valueDeclaration;
+ function shouldCheckAsExcessProperty(prop, container) {
+ return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
}
function eachTypeRelatedToSomeType(source, target) {
var result = -1;
@@ -34041,7 +34657,7 @@ var ts;
}
function typeRelatedToSomeType(source, target, reportErrors) {
var targetTypes = target.types;
- if (target.flags & 262144 && containsType(targetTypes, source)) {
+ if (target.flags & 1048576 && containsType(targetTypes, source)) {
return -1;
}
for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) {
@@ -34062,9 +34678,9 @@ var ts;
}
function findMatchingTypeReferenceOrTypeAliasReference(source, unionTarget) {
var sourceObjectFlags = ts.getObjectFlags(source);
- if (sourceObjectFlags & (4 | 16) && unionTarget.flags & 262144) {
+ if (sourceObjectFlags & (4 | 16) && unionTarget.flags & 1048576) {
return ts.find(unionTarget.types, function (target) {
- if (target.flags & 131072) {
+ if (target.flags & 524288) {
var overlapObjFlags = sourceObjectFlags & ts.getObjectFlags(target);
if (overlapObjFlags & 4) {
return source.target === target.target;
@@ -34091,11 +34707,13 @@ var ts;
}
}
function findMatchingDiscriminantType(source, target) {
- var sourceProperties = getPropertiesOfObjectType(source);
- if (sourceProperties) {
- var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target);
- if (sourcePropertiesFiltered) {
- return discriminateTypeByDiscriminableItems(target, ts.map(sourcePropertiesFiltered, function (p) { return [function () { return getTypeOfSymbol(p); }, p.escapedName]; }), isRelatedTo);
+ if (target.flags & 1048576) {
+ var sourceProperties = getPropertiesOfObjectType(source);
+ if (sourceProperties) {
+ var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target);
+ if (sourcePropertiesFiltered) {
+ return discriminateTypeByDiscriminableItems(target, ts.map(sourcePropertiesFiltered, function (p) { return [function () { return getTypeOfSymbol(p); }, p.escapedName]; }), isRelatedTo);
+ }
}
}
return undefined;
@@ -34105,7 +34723,7 @@ var ts;
var targetTypes = target.types;
for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) {
var targetType = targetTypes_2[_i];
- var related = isRelatedTo(source, targetType, reportErrors);
+ var related = isRelatedTo(source, targetType, reportErrors, undefined, true);
if (!related) {
return 0;
}
@@ -34115,7 +34733,7 @@ var ts;
}
function someTypeRelatedToType(source, target, reportErrors) {
var sourceTypes = source.types;
- if (source.flags & 262144 && containsType(sourceTypes, target)) {
+ if (source.flags & 1048576 && containsType(sourceTypes, target)) {
return -1;
}
var len = sourceTypes.length;
@@ -34140,9 +34758,10 @@ var ts;
}
return result;
}
- function typeArgumentsRelatedTo(source, target, variances, reportErrors) {
- var sources = source.typeArguments || ts.emptyArray;
- var targets = target.typeArguments || ts.emptyArray;
+ function typeArgumentsRelatedTo(sources, targets, variances, reportErrors) {
+ if (sources === void 0) { sources = ts.emptyArray; }
+ if (targets === void 0) { targets = ts.emptyArray; }
+ if (variances === void 0) { variances = ts.emptyArray; }
if (sources.length !== targets.length && relation === identityRelation) {
return 0;
}
@@ -34180,7 +34799,7 @@ var ts;
}
return result;
}
- function recursiveTypeRelatedTo(source, target, reportErrors) {
+ function recursiveTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent) {
if (overflow) {
return 0;
}
@@ -34220,7 +34839,7 @@ var ts;
expandingFlags |= 1;
if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, depth))
expandingFlags |= 2;
- var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors) : 1;
+ var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent) : 1;
expandingFlags = saveExpandingFlags;
depth--;
if (result) {
@@ -34240,21 +34859,21 @@ var ts;
function getConstraintForRelation(type) {
return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type);
}
- function structuredTypeRelatedTo(source, target, reportErrors) {
+ function structuredTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent) {
var flags = source.flags & target.flags;
- if (relation === identityRelation && !(flags & 131072)) {
- if (flags & 1048576) {
+ if (relation === identityRelation && !(flags & 524288)) {
+ if (flags & 4194304) {
return isRelatedTo(source.type, target.type, false);
}
var result_2 = 0;
- if (flags & 2097152) {
+ if (flags & 8388608) {
if (result_2 = isRelatedTo(source.objectType, target.objectType, false)) {
if (result_2 &= isRelatedTo(source.indexType, target.indexType, false)) {
return result_2;
}
}
}
- if (flags & 4194304) {
+ if (flags & 16777216) {
if (source.root.isDistributive === target.root.isDistributive) {
if (result_2 = isRelatedTo(source.checkType, target.checkType, false)) {
if (result_2 &= isRelatedTo(source.extendsType, target.extendsType, false)) {
@@ -34267,7 +34886,7 @@ var ts;
}
}
}
- if (flags & 8388608) {
+ if (flags & 33554432) {
return isRelatedTo(source.substitute, target.substitute, false);
}
return 0;
@@ -34275,8 +34894,18 @@ var ts;
var result;
var originalErrorInfo;
var saveErrorInfo = errorInfo;
- if (target.flags & 65536) {
- if (ts.getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) {
+ if (source.flags & (524288 | 16777216) && source.aliasSymbol &&
+ source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
+ !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
+ var variances = getAliasVariances(source.aliasSymbol);
+ if (result = typeArgumentsRelatedTo(source.aliasTypeArguments, target.aliasTypeArguments, variances, reportErrors)) {
+ return result;
+ }
+ originalErrorInfo = errorInfo;
+ errorInfo = saveErrorInfo;
+ }
+ if (target.flags & 262144) {
+ if (ts.getObjectFlags(source) & 32 && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) {
if (!(getMappedTypeModifiers(source) & 4)) {
var templateType = getTemplateTypeFromMappedType(source);
var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source));
@@ -34286,8 +34915,8 @@ var ts;
}
}
}
- else if (target.flags & 1048576) {
- if (source.flags & 1048576) {
+ else if (target.flags & 4194304) {
+ if (source.flags & 4194304) {
if (result = isRelatedTo(target.type, source.type, false)) {
return result;
}
@@ -34302,7 +34931,7 @@ var ts;
}
}
}
- else if (target.flags & 2097152) {
+ else if (target.flags & 8388608) {
if (relation !== identityRelation && !(isGenericObjectType(target.objectType) && isGenericIndexType(target.indexType))) {
var constraint = getBaseConstraintOfType(target);
if (constraint && constraint !== target) {
@@ -34316,21 +34945,23 @@ var ts;
var template = getTemplateTypeFromMappedType(target);
var modifiers = getMappedTypeModifiers(target);
if (!(modifiers & 8)) {
- if (template.flags & 2097152 && template.objectType === source &&
+ if (template.flags & 8388608 && template.objectType === source &&
template.indexType === getTypeParameterFromMappedType(target)) {
return -1;
}
- if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) {
+ if (!isGenericMappedType(source) && isRelatedTo(getConstraintTypeFromMappedType(target), getIndexType(source))) {
var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target));
var templateType = getTemplateTypeFromMappedType(target);
if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) {
return result;
}
}
+ originalErrorInfo = errorInfo;
+ errorInfo = saveErrorInfo;
}
}
- if (source.flags & 2162688) {
- if (source.flags & 2097152 && target.flags & 2097152) {
+ if (source.flags & 8650752) {
+ if (source.flags & 8388608 && target.flags & 8388608) {
if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) {
result &= isRelatedTo(source.indexType, target.indexType, reportErrors);
}
@@ -34340,28 +34971,29 @@ var ts;
}
}
var constraint = getConstraintForRelation(source);
- if (!constraint || (source.flags & 65536 && constraint.flags & 3)) {
- if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~16777216))) {
+ if (!constraint || (source.flags & 262144 && constraint.flags & 3)) {
+ if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864))) {
errorInfo = saveErrorInfo;
return result;
}
}
- else {
- var instantiated = getTypeWithThisArgument(constraint, source);
- if (result = isRelatedTo(instantiated, target, reportErrors)) {
- errorInfo = saveErrorInfo;
- return result;
- }
+ else if (result = isRelatedTo(constraint, target, false, undefined, isIntersectionConstituent)) {
+ errorInfo = saveErrorInfo;
+ return result;
}
- }
- else if (source.flags & 1048576) {
- if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, undefined, isIntersectionConstituent)) {
errorInfo = saveErrorInfo;
return result;
}
}
else if (source.flags & 4194304) {
- if (target.flags & 4194304) {
+ if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
+ errorInfo = saveErrorInfo;
+ return result;
+ }
+ }
+ else if (source.flags & 16777216) {
+ if (target.flags & 16777216) {
if (isTypeIdenticalTo(source.extendsType, target.extendsType) &&
(isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) {
if (result = isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), reportErrors)) {
@@ -34406,14 +35038,14 @@ var ts;
if (relation === definitelyAssignableRelation && isGenericMappedType(source)) {
return 0;
}
- var sourceIsPrimitive = !!(source.flags & 32764);
+ var sourceIsPrimitive = !!(source.flags & 131068);
if (relation !== identityRelation) {
source = getApparentType(source);
}
if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target &&
!(ts.getObjectFlags(source) & 8192 || ts.getObjectFlags(target) & 8192)) {
var variances = getVariances(source.target);
- if (result = typeArgumentsRelatedTo(source, target, variances, reportErrors)) {
+ if (result = typeArgumentsRelatedTo(source.typeArguments, target.typeArguments, variances, reportErrors)) {
return result;
}
if (variances !== ts.emptyArray && !hasCovariantVoidArgument(target, variances)) {
@@ -34427,7 +35059,7 @@ var ts;
else if (isTupleType(source) && (isArrayType(target) || isReadonlyArrayType(target)) || isArrayType(source) && isReadonlyArrayType(target)) {
return isRelatedTo(getIndexTypeOfType(source, 1) || anyType, getIndexTypeOfType(target, 1) || anyType, reportErrors);
}
- if (source.flags & (131072 | 524288) && target.flags & 131072) {
+ if (source.flags & (524288 | 2097152) && target.flags & 524288) {
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors);
if (result) {
@@ -34473,7 +35105,24 @@ var ts;
var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties);
if (unmatchedProperty) {
if (reportErrors) {
- reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(unmatchedProperty), typeToString(source));
+ var props = ts.arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties));
+ if (!headMessage || (headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code &&
+ headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)) {
+ suppressNextError = true;
+ }
+ if (props.length === 1) {
+ var propName = symbolToString(unmatchedProperty);
+ reportError(ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName, typeToString(source), typeToString(target));
+ if (ts.length(unmatchedProperty.declarations)) {
+ associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
+ }
+ }
+ else if (props.length > 5) {
+ reportError(ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source), typeToString(target), ts.map(props.slice(0, 4), function (p) { return symbolToString(p); }).join(", "), props.length - 4);
+ }
+ else {
+ reportError(ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source), typeToString(target), ts.map(props, function (p) { return symbolToString(p); }).join(", "));
+ }
}
return 0;
}
@@ -34520,8 +35169,8 @@ var ts;
}
}
var properties = getPropertiesOfObjectType(target);
- for (var _b = 0, properties_3 = properties; _b < properties_3.length; _b++) {
- var targetProp = properties_3[_b];
+ for (var _b = 0, properties_2 = properties; _b < properties_2.length; _b++) {
+ var targetProp = properties_2[_b];
if (!(targetProp.flags & 4194304)) {
var sourceProp = getPropertyOfType(source, targetProp.escapedName);
if (sourceProp && sourceProp !== targetProp) {
@@ -34584,7 +35233,7 @@ var ts;
return result;
}
function propertiesIdenticalTo(source, target) {
- if (!(source.flags & 131072 && target.flags & 131072)) {
+ if (!(source.flags & 524288 && target.flags & 524288)) {
return 0;
}
var sourceProperties = getPropertiesOfObjectType(source);
@@ -34694,7 +35343,7 @@ var ts;
if (isIgnoredJsxProperty(source, prop, undefined)) {
continue;
}
- if (prop.nameType && prop.nameType.flags & 2048) {
+ if (prop.nameType && prop.nameType.flags & 8192) {
continue;
}
if (kind === 0 || isNumericLiteralName(prop.escapedName)) {
@@ -34803,20 +35452,19 @@ var ts;
return match || defaultValue;
}
function isWeakType(type) {
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
var resolved = resolveStructuredTypeMembers(type);
return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 &&
!resolved.stringIndexInfo && !resolved.numberIndexInfo &&
resolved.properties.length > 0 &&
ts.every(resolved.properties, function (p) { return !!(p.flags & 16777216); });
}
- if (type.flags & 524288) {
+ if (type.flags & 2097152) {
return ts.every(type.types, isWeakType);
}
return false;
}
- function hasCommonProperties(source, target) {
- var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096);
+ function hasCommonProperties(source, target, isComparingJsxAttributes) {
for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
var prop = _a[_i];
if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {
@@ -34830,45 +35478,54 @@ var ts;
result.objectFlags |= 8192;
return result;
}
+ function getAliasVariances(symbol) {
+ var links = getSymbolLinks(symbol);
+ return getVariancesWorker(links.typeParameters, links, function (_links, param, marker) {
+ var type = getTypeAliasInstantiation(symbol, instantiateTypes(links.typeParameters, makeUnaryTypeMapper(param, marker)));
+ type.aliasTypeArgumentsContainsMarker = true;
+ return type;
+ });
+ }
+ function getVariancesWorker(typeParameters, cache, createMarkerType) {
+ if (typeParameters === void 0) { typeParameters = ts.emptyArray; }
+ var variances = cache.variances;
+ if (!variances) {
+ cache.variances = ts.emptyArray;
+ variances = [];
+ for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
+ var tp = typeParameters_1[_i];
+ var typeWithSuper = createMarkerType(cache, tp, markerSuperType);
+ var typeWithSub = createMarkerType(cache, tp, markerSubType);
+ var variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 : 0) |
+ (isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 : 0);
+ if (variance === 3 && isTypeAssignableTo(createMarkerType(cache, tp, markerOtherType), typeWithSuper)) {
+ variance = 4;
+ }
+ variances.push(variance);
+ }
+ cache.variances = variances;
+ }
+ return variances;
+ }
function getVariances(type) {
if (!strictFunctionTypes) {
return ts.emptyArray;
}
- var typeParameters = type.typeParameters || ts.emptyArray;
- var variances = type.variances;
- if (!variances) {
- if (type === globalArrayType || type === globalReadonlyArrayType) {
- variances = [1];
- }
- else {
- type.variances = ts.emptyArray;
- variances = [];
- for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
- var tp = typeParameters_1[_i];
- var typeWithSuper = getMarkerTypeReference(type, tp, markerSuperType);
- var typeWithSub = getMarkerTypeReference(type, tp, markerSubType);
- var variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 : 0) |
- (isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 : 0);
- if (variance === 3 && isTypeAssignableTo(getMarkerTypeReference(type, tp, markerOtherType), typeWithSuper)) {
- variance = 4;
- }
- variances.push(variance);
- }
- }
- type.variances = variances;
+ if (type === globalArrayType || type === globalReadonlyArrayType) {
+ return ts.emptyArray;
}
- return variances;
+ return getVariancesWorker(type.typeParameters, type, getMarkerTypeReference);
}
function hasCovariantVoidArgument(type, variances) {
for (var i = 0; i < variances.length; i++) {
- if (variances[i] === 1 && type.typeArguments[i].flags & 4096) {
+ if (variances[i] === 1 && type.typeArguments[i].flags & 16384) {
return true;
}
}
return false;
}
function isUnconstrainedTypeParameter(type) {
- return type.flags & 65536 && !getConstraintOfTypeParameter(type);
+ return type.flags & 262144 && !getConstraintOfTypeParameter(type);
}
function isTypeReferenceWithGenericArguments(type) {
return !!(ts.getObjectFlags(type) & 4) && ts.some(type.typeArguments, function (t) { return isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t); });
@@ -34939,13 +35596,13 @@ var ts;
!hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass;
}
function isDeeplyNestedType(type, stack, depth) {
- if (depth >= 5 && type.flags & 131072) {
+ if (depth >= 5 && type.flags & 524288) {
var symbol = type.symbol;
if (symbol) {
var count = 0;
for (var i = 0; i < depth; i++) {
var t = stack[i];
- if (t.flags & 131072 && t.symbol === symbol) {
+ if (t.flags & 524288 && t.symbol === symbol) {
count++;
if (count >= 5)
return true;
@@ -35032,7 +35689,7 @@ var ts;
for (var i = 0; i < targetLen; i++) {
var s = getTypeAtPosition(source, i);
var t = getTypeAtPosition(target, i);
- var related = compareTypes(s, t);
+ var related = compareTypes(t, s);
if (!related) {
return 0;
}
@@ -35073,9 +35730,9 @@ var ts;
if (!strictNullChecks) {
return getSupertypeOrUnion(types);
}
- var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 24576); });
+ var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 98304); });
return primaryTypes.length ?
- getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 24576) :
+ getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 98304) :
getUnionType(types, 2);
}
function getCommonSubtype(types) {
@@ -35089,7 +35746,7 @@ var ts;
}
function isArrayLikeType(type) {
return ts.getObjectFlags(type) & 4 && (type.target === globalArrayType || type.target === globalReadonlyArrayType) ||
- !(type.flags & 24576) && isTypeAssignableTo(type, anyReadonlyArrayType);
+ !(type.flags & 98304) && isTypeAssignableTo(type, anyReadonlyArrayType);
}
function isEmptyArrayLiteralType(type) {
var elementType = isArrayType(type) ? type.typeArguments[0] : undefined;
@@ -35109,35 +35766,37 @@ var ts;
return undefined;
}
function isNeitherUnitTypeNorNever(type) {
- return !(type.flags & (27072 | 32768));
+ return !(type.flags & (109440 | 131072));
}
function isUnitType(type) {
- return !!(type.flags & 27072);
+ return !!(type.flags & 109440);
}
function isLiteralType(type) {
return type.flags & 16 ? true :
- type.flags & 262144 ? type.flags & 512 ? true : ts.every(type.types, isUnitType) :
+ type.flags & 1048576 ? type.flags & 1024 ? true : ts.every(type.types, isUnitType) :
isUnitType(type);
}
function getBaseTypeOfLiteralType(type) {
- return type.flags & 512 ? getBaseTypeOfEnumLiteralType(type) :
- type.flags & 64 ? stringType :
- type.flags & 128 ? numberType :
- type.flags & 256 ? booleanType :
- type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
- type;
+ return type.flags & 1024 ? getBaseTypeOfEnumLiteralType(type) :
+ type.flags & 128 ? stringType :
+ type.flags & 256 ? numberType :
+ type.flags & 2048 ? bigintType :
+ type.flags & 512 ? booleanType :
+ type.flags & 1048576 ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
+ type;
}
function getWidenedLiteralType(type) {
- return type.flags & 512 && type.flags & 33554432 ? getBaseTypeOfEnumLiteralType(type) :
- type.flags & 64 && type.flags & 33554432 ? stringType :
- type.flags & 128 && type.flags & 33554432 ? numberType :
- type.flags & 256 && type.flags & 33554432 ? booleanType :
- type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
- type;
+ return type.flags & 1024 && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) :
+ type.flags & 128 && isFreshLiteralType(type) ? stringType :
+ type.flags & 256 && isFreshLiteralType(type) ? numberType :
+ type.flags & 2048 && isFreshLiteralType(type) ? bigintType :
+ type.flags & 512 && isFreshLiteralType(type) ? booleanType :
+ type.flags & 1048576 ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
+ type;
}
function getWidenedUniqueESSymbolType(type) {
- return type.flags & 2048 ? esSymbolType :
- type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getWidenedUniqueESSymbolType)) :
+ return type.flags & 8192 ? esSymbolType :
+ type.flags & 1048576 ? getUnionType(ts.sameMap(type.types, getWidenedUniqueESSymbolType)) :
type;
}
function getWidenedLiteralLikeTypeForContextualType(type, contextualType) {
@@ -35159,6 +35818,10 @@ var ts;
function getLengthOfTupleType(type) {
return getTypeReferenceArity(type) - (type.target.hasRestElement ? 1 : 0);
}
+ function isZeroBigInt(_a) {
+ var value = _a.value;
+ return value.base10Value === "0";
+ }
function getFalsyFlagsOfTypes(types) {
var result = 0;
for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {
@@ -35168,15 +35831,16 @@ var ts;
return result;
}
function getFalsyFlags(type) {
- return type.flags & 262144 ? getFalsyFlagsOfTypes(type.types) :
- type.flags & 64 ? type.value === "" ? 64 : 0 :
- type.flags & 128 ? type.value === 0 ? 128 : 0 :
- type.flags & 256 ? (type === falseType || type === regularFalseType) ? 256 : 0 :
- type.flags & 29148;
+ return type.flags & 1048576 ? getFalsyFlagsOfTypes(type.types) :
+ type.flags & 128 ? type.value === "" ? 128 : 0 :
+ type.flags & 256 ? type.value === 0 ? 256 : 0 :
+ type.flags & 2048 ? isZeroBigInt(type) ? 2048 : 0 :
+ type.flags & 512 ? (type === falseType || type === regularFalseType) ? 512 : 0 :
+ type.flags & 117724;
}
function removeDefinitelyFalsyTypes(type) {
- return getFalsyFlags(type) & 29120 ?
- filterType(type, function (t) { return !(getFalsyFlags(t) & 29120); }) :
+ return getFalsyFlags(type) & 117632 ?
+ filterType(type, function (t) { return !(getFalsyFlags(t) & 117632); }) :
type;
}
function extractDefinitelyFalsyTypes(type) {
@@ -35185,23 +35849,25 @@ var ts;
function getDefinitelyFalsyPartOfType(type) {
return type.flags & 4 ? emptyStringType :
type.flags & 8 ? zeroType :
- type === regularFalseType ||
- type === falseType ||
- type.flags & (4096 | 8192 | 16384) ||
- type.flags & 64 && type.value === "" ||
- type.flags & 128 && type.value === 0 ? type :
- neverType;
+ type.flags & 64 ? zeroBigIntType :
+ type === regularFalseType ||
+ type === falseType ||
+ type.flags & (16384 | 32768 | 65536) ||
+ type.flags & 128 && type.value === "" ||
+ type.flags & 256 && type.value === 0 ||
+ type.flags & 2048 && isZeroBigInt(type) ? type :
+ neverType;
}
function getNullableType(type, flags) {
- var missing = (flags & ~type.flags) & (8192 | 16384);
+ var missing = (flags & ~type.flags) & (32768 | 65536);
return missing === 0 ? type :
- missing === 8192 ? getUnionType([type, undefinedType]) :
- missing === 16384 ? getUnionType([type, nullType]) :
+ missing === 32768 ? getUnionType([type, undefinedType]) :
+ missing === 65536 ? getUnionType([type, nullType]) :
getUnionType([type, undefinedType, nullType]);
}
function getOptionalType(type) {
ts.Debug.assert(strictNullChecks);
- return type.flags & 8192 ? type : getUnionType([type, undefinedType]);
+ return type.flags & 32768 ? type : getUnionType([type, undefinedType]);
}
function getGlobalNonNullableTypeInstantiation(type) {
if (!deferredGlobalNonNullableTypeAlias) {
@@ -35210,7 +35876,7 @@ var ts;
if (deferredGlobalNonNullableTypeAlias !== unknownSymbol) {
return getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]);
}
- return getTypeWithFacts(type, 524288);
+ return getTypeWithFacts(type, 2097152);
}
function getNonNullableType(type) {
return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type;
@@ -35244,7 +35910,7 @@ var ts;
return members;
}
function getRegularTypeOfObjectLiteral(type) {
- if (!(isObjectLiteralType(type) && type.flags & 33554432)) {
+ if (!(isObjectLiteralType(type) && ts.getObjectFlags(type) & 32768)) {
return type;
}
var regularType = type.regularType;
@@ -35254,7 +35920,7 @@ var ts;
var resolved = type;
var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);
- regularNew.flags = resolved.flags & ~33554432;
+ regularNew.flags = resolved.flags;
regularNew.objectFlags |= 128 | (ts.getObjectFlags(resolved) & 16384);
type.regularType = regularNew;
return regularNew;
@@ -35340,15 +36006,15 @@ var ts;
}
function getWidenedTypeWithContext(type, context) {
if (type.flags & 402653184) {
- if (type.flags & 24576) {
+ if (type.flags & 98304) {
return anyType;
}
if (isObjectLiteralType(type)) {
return getWidenedTypeOfObjectLiteral(type, context);
}
- if (type.flags & 262144) {
+ if (type.flags & 1048576) {
var unionContext_1 = context || createWideningContext(undefined, undefined, type.types);
- var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 24576 ? t : getWidenedTypeWithContext(t, unionContext_1); });
+ var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 98304 ? t : getWidenedTypeWithContext(t, unionContext_1); });
return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 : 1);
}
if (isArrayType(type) || isTupleType(type)) {
@@ -35360,7 +36026,7 @@ var ts;
function reportWideningErrorsInType(type) {
var errorReported = false;
if (type.flags & 134217728) {
- if (type.flags & 262144) {
+ if (type.flags & 1048576) {
if (ts.some(type.types, isEmptyObjectType)) {
errorReported = true;
}
@@ -35403,39 +36069,42 @@ var ts;
}
var diagnostic;
switch (declaration.kind) {
- case 202:
- case 152:
- case 151:
- diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type;
- break;
- case 149:
- diagnostic = declaration.dotDotDotToken ?
- ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type :
- ts.Diagnostics.Parameter_0_implicitly_has_an_1_type;
- break;
- case 184:
- diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
- break;
- case 237:
+ case 204:
case 154:
case 153:
+ diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
+ break;
+ case 151:
+ diagnostic = declaration.dotDotDotToken ?
+ noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage :
+ noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
+ break;
+ case 186:
+ diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
+ break;
+ case 289:
+ error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
+ return;
+ case 239:
case 156:
- case 157:
- case 194:
- case 195:
+ case 155:
+ case 158:
+ case 159:
+ case 196:
+ case 197:
if (noImplicitAny && !declaration.name) {
error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
}
- diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
+ diagnostic = noImplicitAny ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type : ts.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;
break;
- case 179:
+ case 181:
if (noImplicitAny) {
error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
}
return;
default:
- diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type;
+ diagnostic = noImplicitAny ? ts.Diagnostics.Variable_0_implicitly_has_an_1_type : ts.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
}
errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
}
@@ -35510,11 +36179,11 @@ var ts;
}
function couldContainTypeVariables(type) {
var objectFlags = ts.getObjectFlags(type);
- return !!(type.flags & 15794176 ||
+ return !!(type.flags & 63176704 ||
objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeVariables) ||
objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 32) ||
objectFlags & 32 ||
- type.flags & 786432 && couldUnionOrIntersectionContainTypeVariables(type));
+ type.flags & 3145728 && couldUnionOrIntersectionContainTypeVariables(type));
}
function couldUnionOrIntersectionContainTypeVariables(type) {
if (type.couldContainTypeVariables === undefined) {
@@ -35523,12 +36192,12 @@ var ts;
return type.couldContainTypeVariables;
}
function isTypeParameterAtTopLevel(type, typeParameter) {
- return type === typeParameter || !!(type.flags & 786432) && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); });
+ return type === typeParameter || !!(type.flags & 3145728) && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); });
}
function createEmptyObjectTypeFromStringLiteral(type) {
var members = ts.createSymbolTable();
forEachType(type, function (t) {
- if (!(t.flags & 64)) {
+ if (!(t.flags & 128)) {
return;
}
var name = ts.escapeLeadingUnderscores(t.value);
@@ -35543,35 +36212,35 @@ var ts;
var indexInfo = type.flags & 4 ? createIndexInfo(emptyObjectType, false) : undefined;
return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined);
}
- function inferTypeForHomomorphicMappedType(source, target) {
- var key = source.id + "," + target.id;
+ function inferTypeForHomomorphicMappedType(source, target, constraint) {
+ var key = source.id + "," + target.id + "," + constraint.id;
if (reverseMappedCache.has(key)) {
return reverseMappedCache.get(key);
}
reverseMappedCache.set(key, undefined);
- var type = createReverseMappedType(source, target);
+ var type = createReverseMappedType(source, target, constraint);
reverseMappedCache.set(key, type);
return type;
}
- function createReverseMappedType(source, target) {
+ function createReverseMappedType(source, target, constraint) {
var properties = getPropertiesOfType(source);
if (properties.length === 0 && !getIndexInfoOfType(source, 0)) {
return undefined;
}
- for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) {
- var prop = properties_4[_i];
+ for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) {
+ var prop = properties_3[_i];
if (getTypeOfSymbol(prop).flags & 536870912) {
return undefined;
}
}
if (isArrayType(source)) {
- return createArrayType(inferReverseMappedType(source.typeArguments[0], target));
+ return createArrayType(inferReverseMappedType(source.typeArguments[0], target, constraint));
}
if (isReadonlyArrayType(source)) {
- return createReadonlyArrayType(inferReverseMappedType(source.typeArguments[0], target));
+ return createReadonlyArrayType(inferReverseMappedType(source.typeArguments[0], target, constraint));
}
if (isTupleType(source)) {
- var elementTypes = ts.map(source.typeArguments || ts.emptyArray, function (t) { return inferReverseMappedType(t, target); });
+ var elementTypes = ts.map(source.typeArguments || ts.emptyArray, function (t) { return inferReverseMappedType(t, target, constraint); });
var minLength = getMappedTypeModifiers(target) & 4 ?
getTypeReferenceArity(source) - (source.target.hasRestElement ? 1 : 0) : source.target.minLength;
return createTupleType(elementTypes, minLength, source.target.hasRestElement, source.target.associatedNames);
@@ -35579,30 +36248,46 @@ var ts;
var reversed = createObjectType(2048 | 16, undefined);
reversed.source = source;
reversed.mappedType = target;
+ reversed.constraintType = constraint;
return reversed;
}
function getTypeOfReverseMappedSymbol(symbol) {
- return inferReverseMappedType(symbol.propertyType, symbol.mappedType);
+ return inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType);
}
- function inferReverseMappedType(sourceType, target) {
- var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target));
+ function inferReverseMappedType(sourceType, target, constraint) {
+ var typeParameter = getIndexedAccessType(constraint.type, getTypeParameterFromMappedType(target));
var templateType = getTemplateTypeFromMappedType(target);
var inference = createInferenceInfo(typeParameter);
inferTypes([inference], sourceType, templateType);
return getTypeFromInference(inference);
}
- function getUnmatchedProperty(source, target, requireOptionalProperties) {
- var properties = target.flags & 524288 ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target);
- for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) {
- var targetProp = properties_5[_i];
- if (requireOptionalProperties || !(targetProp.flags & 16777216)) {
- var sourceProp = getPropertyOfType(source, targetProp.escapedName);
- if (!sourceProp) {
- return targetProp;
- }
+ function getUnmatchedProperties(source, target, requireOptionalProperties) {
+ var properties, _i, properties_4, targetProp, sourceProp;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ properties = target.flags & 2097152 ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target);
+ _i = 0, properties_4 = properties;
+ _a.label = 1;
+ case 1:
+ if (!(_i < properties_4.length)) return [3, 4];
+ targetProp = properties_4[_i];
+ if (!(requireOptionalProperties || !(targetProp.flags & 16777216))) return [3, 3];
+ sourceProp = getPropertyOfType(source, targetProp.escapedName);
+ if (!!sourceProp) return [3, 3];
+ return [4, targetProp];
+ case 2:
+ _a.sent();
+ _a.label = 3;
+ case 3:
+ _i++;
+ return [3, 1];
+ case 4: return [2];
}
- }
- return undefined;
+ });
+ }
+ function getUnmatchedProperty(source, target, requireOptionalProperties) {
+ return getUnmatchedProperties(source, target, requireOptionalProperties).next().value;
}
function tupleTypesDefinitelyUnrelated(source, target) {
return target.target.minLength > source.target.minLength ||
@@ -35645,8 +36330,8 @@ var ts;
}
return;
}
- if (source.flags & 262144 && target.flags & 262144 && !(source.flags & 512 && target.flags & 512) ||
- source.flags & 524288 && target.flags & 524288) {
+ if (source.flags & 1048576 && target.flags & 1048576 && !(source.flags & 1024 && target.flags & 1024) ||
+ source.flags & 2097152 && target.flags & 2097152) {
if (source === target) {
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
var t = _a[_i];
@@ -35661,7 +36346,7 @@ var ts;
(matchingTypes || (matchingTypes = [])).push(t);
inferFromTypes(t, t);
}
- else if (t.flags & (128 | 64)) {
+ else if (t.flags & (256 | 128)) {
var b = getBaseTypeOfLiteralType(t);
if (typeIdenticalToSomeType(b, target.types)) {
(matchingTypes || (matchingTypes = [])).push(t, b);
@@ -35673,8 +36358,8 @@ var ts;
target = removeTypesFromUnionOrIntersection(target, matchingTypes);
}
}
- if (target.flags & 2162688) {
- if (source.flags & 536870912 || source === silentNeverType) {
+ if (target.flags & 8650752) {
+ if (source.flags & 536870912 || source === silentNeverType || (priority & 8 && (source === autoType || source === autoArrayType))) {
return;
}
var inference = getInferenceInfoForType(target);
@@ -35694,12 +36379,27 @@ var ts;
inference.candidates = ts.appendIfUnique(inference.candidates, candidate);
}
}
- if (!(priority & 8) && target.flags & 65536 && !isTypeParameterAtTopLevel(originalTarget, target)) {
+ if (!(priority & 8) && target.flags & 262144 && !isTypeParameterAtTopLevel(originalTarget, target)) {
inference.topLevel = false;
}
}
return;
}
+ else {
+ var simplified = getSimplifiedType(target);
+ if (simplified !== target) {
+ inferFromTypesOnce(source, simplified);
+ }
+ else if (target.flags & 8388608) {
+ var indexType = getSimplifiedType(target.indexType);
+ if (indexType.flags & 63176704) {
+ var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType), indexType);
+ if (simplified_1 && simplified_1 !== target) {
+ inferFromTypesOnce(source, simplified_1);
+ }
+ }
+ }
+ }
}
if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target) {
var sourceTypes = source.typeArguments || ts.emptyArray;
@@ -35715,12 +36415,12 @@ var ts;
}
}
}
- else if (source.flags & 1048576 && target.flags & 1048576) {
+ else if (source.flags & 4194304 && target.flags & 4194304) {
contravariant = !contravariant;
inferFromTypes(source.type, target.type);
contravariant = !contravariant;
}
- else if ((isLiteralType(source) || source.flags & 4) && target.flags & 1048576) {
+ else if ((isLiteralType(source) || source.flags & 4) && target.flags & 4194304) {
var empty = createEmptyObjectTypeFromStringLiteral(source);
contravariant = !contravariant;
var savePriority = priority;
@@ -35729,20 +36429,20 @@ var ts;
priority = savePriority;
contravariant = !contravariant;
}
- else if (source.flags & 2097152 && target.flags & 2097152) {
+ else if (source.flags & 8388608 && target.flags & 8388608) {
inferFromTypes(source.objectType, target.objectType);
inferFromTypes(source.indexType, target.indexType);
}
- else if (source.flags & 4194304 && target.flags & 4194304) {
+ else if (source.flags & 16777216 && target.flags & 16777216) {
inferFromTypes(source.checkType, target.checkType);
inferFromTypes(source.extendsType, target.extendsType);
inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target));
inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target));
}
- else if (target.flags & 4194304) {
+ else if (target.flags & 16777216) {
inferFromTypes(source, getUnionType([getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]));
}
- else if (target.flags & 786432) {
+ else if (target.flags & 3145728) {
var targetTypes = target.types;
var typeVariableCount = 0;
var typeVariable = void 0;
@@ -35763,7 +36463,7 @@ var ts;
priority = savePriority;
}
}
- else if (source.flags & 262144) {
+ else if (source.flags & 1048576) {
var sourceTypes = source.types;
for (var _e = 0, sourceTypes_3 = sourceTypes; _e < sourceTypes_3.length; _e++) {
var sourceType = sourceTypes_3[_e];
@@ -35771,21 +36471,21 @@ var ts;
}
}
else {
- if (!(priority & 32 && source.flags & (524288 | 15794176))) {
+ if (!(priority & 32 && source.flags & (2097152 | 63176704))) {
var apparentSource = getApparentType(source);
- if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (131072 | 524288))) {
+ if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 | 2097152))) {
allowComplexConstraintInference = false;
return inferFromTypes(apparentSource, target);
}
source = apparentSource;
}
- if (source.flags & (131072 | 524288)) {
+ if (source.flags & (524288 | 2097152)) {
var key = source.id + "," + target.id;
if (visited && visited.get(key)) {
return;
}
(visited || (visited = ts.createMap())).set(key, true);
- var isNonConstructorObject = target.flags & 131072 &&
+ var isNonConstructorObject = target.flags & 524288 &&
!(ts.getObjectFlags(target) & 16 && target.symbol && target.symbol.flags & 32);
var symbol = isNonConstructorObject ? target.symbol : undefined;
if (symbol) {
@@ -35801,6 +36501,13 @@ var ts;
}
}
}
+ function inferFromTypesOnce(source, target) {
+ var key = source.id + "," + target.id;
+ if (!visited || !visited.get(key)) {
+ (visited || (visited = ts.createMap())).set(key, true);
+ inferFromTypes(source, target);
+ }
+ }
}
function inferFromContravariantTypes(source, target) {
if (strictFunctionTypes || priority & 64) {
@@ -35813,7 +36520,7 @@ var ts;
}
}
function getInferenceInfoForType(type) {
- if (type.flags & 2162688) {
+ if (type.flags & 8650752) {
for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {
var inference = inferences_1[_i];
if (type === inference.typeParameter) {
@@ -35823,6 +36530,38 @@ var ts;
}
return undefined;
}
+ function inferFromMappedTypeConstraint(source, target, constraintType) {
+ if (constraintType.flags & 1048576) {
+ var result = false;
+ for (var _i = 0, _a = constraintType.types; _i < _a.length; _i++) {
+ var type = _a[_i];
+ result = inferFromMappedTypeConstraint(source, target, type) || result;
+ }
+ return result;
+ }
+ if (constraintType.flags & 4194304) {
+ var inference = getInferenceInfoForType(constraintType.type);
+ if (inference && !inference.isFixed) {
+ var inferredType = inferTypeForHomomorphicMappedType(source, target, constraintType);
+ if (inferredType) {
+ var savePriority = priority;
+ priority |= 2;
+ inferFromTypes(inferredType, inference.typeParameter);
+ priority = savePriority;
+ }
+ }
+ return true;
+ }
+ if (constraintType.flags & 262144) {
+ var savePriority = priority;
+ priority |= 4;
+ inferFromTypes(getIndexType(source), constraintType);
+ priority = savePriority;
+ inferFromTypes(getUnionType(ts.map(getPropertiesOfType(source), getTypeOfSymbol)), getTemplateTypeFromMappedType(target));
+ return true;
+ }
+ return false;
+ }
function inferFromObjectTypes(source, target) {
if (isGenericMappedType(source) && isGenericMappedType(target)) {
inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
@@ -35830,25 +36569,7 @@ var ts;
}
if (ts.getObjectFlags(target) & 32) {
var constraintType = getConstraintTypeFromMappedType(target);
- if (constraintType.flags & 1048576) {
- var inference = getInferenceInfoForType(constraintType.type);
- if (inference && !inference.isFixed) {
- var inferredType = inferTypeForHomomorphicMappedType(source, target);
- if (inferredType) {
- var savePriority = priority;
- priority |= 2;
- inferFromTypes(inferredType, inference.typeParameter);
- priority = savePriority;
- }
- }
- return;
- }
- if (constraintType.flags & 65536) {
- var savePriority = priority;
- priority |= 4;
- inferFromTypes(getIndexType(source), constraintType);
- priority = savePriority;
- inferFromTypes(getUnionType(ts.map(getPropertiesOfType(source), getTypeOfSymbol)), getTemplateTypeFromMappedType(target));
+ if (inferFromMappedTypeConstraint(source, target, constraintType)) {
return;
}
}
@@ -35887,8 +36608,8 @@ var ts;
}
}
var properties = getPropertiesOfObjectType(target);
- for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) {
- var targetProp = properties_6[_i];
+ for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) {
+ var targetProp = properties_5[_i];
var sourceProp = getPropertyOfType(source, targetProp.escapedName);
if (sourceProp) {
inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));
@@ -35910,7 +36631,7 @@ var ts;
if (!skipParameters) {
var saveBivariant = bivariant;
var kind = target.declaration ? target.declaration.kind : 0;
- bivariant = bivariant || kind === 154 || kind === 153 || kind === 155;
+ bivariant = bivariant || kind === 156 || kind === 155 || kind === 157;
forEachMatchingParameterType(source, target, inferFromContravariantTypes);
bivariant = saveBivariant;
}
@@ -35960,11 +36681,11 @@ var ts;
reducedTypes.push(t);
}
}
- return type.flags & 262144 ? getUnionType(reducedTypes) : getIntersectionType(reducedTypes);
+ return type.flags & 1048576 ? getUnionType(reducedTypes) : getIntersectionType(reducedTypes);
}
function hasPrimitiveConstraint(type) {
var constraint = getConstraintOfTypeParameter(type);
- return !!constraint && maybeTypeOfKind(constraint.flags & 4194304 ? getDefaultConstraintOfConditionalType(constraint) : constraint, 32764 | 1048576);
+ return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 | 4194304);
}
function isObjectLiteralType(type) {
return !!(ts.getObjectFlags(type) & 128);
@@ -36004,7 +36725,7 @@ var ts;
var inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : undefined;
if (inference.contraCandidates) {
var inferredContravariantType = getContravariantInference(inference);
- inferredType = inferredCovariantType && !(inferredCovariantType.flags & 32768) &&
+ inferredType = inferredCovariantType && !(inferredCovariantType.flags & 131072) &&
isTypeSubtypeOf(inferredCovariantType, inferredContravariantType) ?
inferredCovariantType : inferredContravariantType;
}
@@ -36054,17 +36775,17 @@ var ts;
case "console":
return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;
case "$":
- return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery;
+ return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig;
case "describe":
case "suite":
case "it":
case "test":
- return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha;
+ return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig;
case "process":
case "require":
case "Buffer":
case "module":
- return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode;
+ return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig;
case "Map":
case "Set":
case "Promise":
@@ -36086,23 +36807,23 @@ var ts;
return links.resolvedSymbol;
}
function isInTypeQuery(node) {
- return !!ts.findAncestor(node, function (n) { return n.kind === 165 ? true : n.kind === 71 || n.kind === 146 ? false : "quit"; });
+ return !!ts.findAncestor(node, function (n) { return n.kind === 167 ? true : n.kind === 72 || n.kind === 148 ? false : "quit"; });
}
function getFlowCacheKey(node) {
- if (node.kind === 71) {
+ if (node.kind === 72) {
var symbol = getResolvedSymbol(node);
return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined;
}
- if (node.kind === 99) {
+ if (node.kind === 100) {
return "0";
}
- if (node.kind === 187) {
+ if (node.kind === 189) {
var key = getFlowCacheKey(node.expression);
return key && key + "." + ts.idText(node.name);
}
- if (node.kind === 184) {
+ if (node.kind === 186) {
var container = node.parent.parent;
- var key = container.kind === 184 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer));
+ var key = container.kind === 186 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer));
var text = getBindingElementNameText(node);
var result = key && text && (key + "." + text);
return result;
@@ -36111,14 +36832,14 @@ var ts;
}
function getBindingElementNameText(element) {
var parent = element.parent;
- if (parent.kind === 182) {
+ if (parent.kind === 184) {
var name = element.propertyName || element.name;
switch (name.kind) {
- case 71:
+ case 72:
return ts.idText(name);
- case 147:
+ case 149:
return ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined;
- case 9:
+ case 10:
case 8:
return name.text;
default:
@@ -36131,29 +36852,29 @@ var ts;
}
function isMatchingReference(source, target) {
switch (source.kind) {
- case 71:
- return target.kind === 71 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
- (target.kind === 235 || target.kind === 184) &&
+ case 72:
+ return target.kind === 72 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
+ (target.kind === 237 || target.kind === 186) &&
getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
- case 99:
- return target.kind === 99;
- case 97:
- return target.kind === 97;
- case 187:
- case 188:
+ case 100:
+ return target.kind === 100;
+ case 98:
+ return target.kind === 98;
+ case 189:
+ case 190:
return (ts.isPropertyAccessExpression(target) || ts.isElementAccessExpression(target)) &&
getAccessedPropertyName(source) === getAccessedPropertyName(target) &&
isMatchingReference(source.expression, target.expression);
- case 184:
- if (target.kind !== 187)
+ case 186:
+ if (target.kind !== 189)
return false;
var t = target;
if (t.name.escapedText !== getBindingElementNameText(source))
return false;
- if (source.parent.parent.kind === 184 && isMatchingReference(source.parent.parent, t.expression)) {
+ if (source.parent.parent.kind === 186 && isMatchingReference(source.parent.parent, t.expression)) {
return true;
}
- if (source.parent.parent.kind === 235) {
+ if (source.parent.parent.kind === 237) {
var maybeId = source.parent.parent.initializer;
return !!maybeId && isMatchingReference(maybeId, t.expression);
}
@@ -36166,7 +36887,7 @@ var ts;
undefined;
}
function containsMatchingReference(source, target) {
- while (source.kind === 187) {
+ while (source.kind === 189) {
source = source.expression;
if (isMatchingReference(source, target)) {
return true;
@@ -36175,23 +36896,23 @@ var ts;
return false;
}
function containsMatchingReferenceDiscriminant(source, target) {
- return target.kind === 187 &&
+ return target.kind === 189 &&
containsMatchingReference(source, target.expression) &&
isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText);
}
function getDeclaredTypeOfReference(expr) {
- if (expr.kind === 71) {
+ if (expr.kind === 72) {
return getTypeOfSymbol(getResolvedSymbol(expr));
}
- if (expr.kind === 187) {
+ if (expr.kind === 189) {
var type = getDeclaredTypeOfReference(expr.expression);
return type && getTypeOfPropertyOfType(type, expr.name.escapedText);
}
return undefined;
}
function isDiscriminantType(type) {
- if (type.flags & 262144) {
- if (type.flags & (16 | 512)) {
+ if (type.flags & 1048576) {
+ if (type.flags & (16 | 1024)) {
return true;
}
var combined = 0;
@@ -36199,14 +36920,14 @@ var ts;
var t = _a[_i];
combined |= t.flags;
}
- if (combined & 27072 && !(combined & 15794176)) {
+ if (combined & 109440 && !(combined & 63176704)) {
return true;
}
}
return false;
}
function isDiscriminantProperty(type, name) {
- if (type && type.flags & 262144) {
+ if (type && type.flags & 1048576) {
var prop = getUnionOrIntersectionProperty(type, name);
if (prop && ts.getCheckFlags(prop) & 2) {
if (prop.isDiscriminantProperty === undefined) {
@@ -36217,6 +36938,10 @@ var ts;
}
return false;
}
+ function hasNarrowableDeclaredType(expr) {
+ var type = getDeclaredTypeOfReference(expr);
+ return !!(type && type.flags & 1048576);
+ }
function findDiscriminantProperties(sourceProperties, target) {
var result;
for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) {
@@ -36243,7 +36968,7 @@ var ts;
}
}
}
- if (callExpression.expression.kind === 187 &&
+ if (callExpression.expression.kind === 189 &&
isOrContainsMatchingReference(reference, callExpression.expression.expression)) {
return true;
}
@@ -36257,7 +36982,7 @@ var ts;
return flow.id;
}
function typeMaybeAssignableTo(source, target) {
- if (!(source.flags & 262144)) {
+ if (!(source.flags & 1048576)) {
return isTypeAssignableTo(source, target);
}
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
@@ -36270,11 +36995,11 @@ var ts;
}
function getAssignmentReducedType(declaredType, assignedType) {
if (declaredType !== assignedType) {
- if (assignedType.flags & 32768) {
+ if (assignedType.flags & 131072) {
return assignedType;
}
var reducedType = filterType(declaredType, function (t) { return typeMaybeAssignableTo(assignedType, t); });
- if (assignedType.flags & 33554432 && assignedType.flags & 256) {
+ if (assignedType.flags & 512 && isFreshLiteralType(assignedType)) {
reducedType = mapType(reducedType, getFreshTypeOfLiteralType);
}
if (isTypeAssignableTo(assignedType, reducedType)) {
@@ -36299,57 +37024,66 @@ var ts;
function getTypeFacts(type) {
var flags = type.flags;
if (flags & 4) {
- return strictNullChecks ? 4079361 : 4194049;
- }
- if (flags & 64) {
- var isEmpty = type.value === "";
- return strictNullChecks ?
- isEmpty ? 3030785 : 1982209 :
- isEmpty ? 3145473 : 4194049;
- }
- if (flags & (8 | 32)) {
- return strictNullChecks ? 4079234 : 4193922;
+ return strictNullChecks ? 16317953 : 16776705;
}
if (flags & 128) {
+ var isEmpty = type.value === "";
+ return strictNullChecks ?
+ isEmpty ? 12123649 : 7929345 :
+ isEmpty ? 12582401 : 16776705;
+ }
+ if (flags & (8 | 32)) {
+ return strictNullChecks ? 16317698 : 16776450;
+ }
+ if (flags & 256) {
var isZero = type.value === 0;
return strictNullChecks ?
- isZero ? 3030658 : 1982082 :
- isZero ? 3145346 : 4193922;
+ isZero ? 12123394 : 7929090 :
+ isZero ? 12582146 : 16776450;
+ }
+ if (flags & 64) {
+ return strictNullChecks ? 16317188 : 16775940;
+ }
+ if (flags & 2048) {
+ var isZero = isZeroBigInt(type);
+ return strictNullChecks ?
+ isZero ? 12122884 : 7928580 :
+ isZero ? 12581636 : 16775940;
}
if (flags & 16) {
- return strictNullChecks ? 4078980 : 4193668;
+ return strictNullChecks ? 16316168 : 16774920;
}
- if (flags & 272) {
+ if (flags & 528) {
return strictNullChecks ?
- (type === falseType || type === regularFalseType) ? 3030404 : 1981828 :
- (type === falseType || type === regularFalseType) ? 3145092 : 4193668;
+ (type === falseType || type === regularFalseType) ? 12121864 : 7927560 :
+ (type === falseType || type === regularFalseType) ? 12580616 : 16774920;
}
- if (flags & 131072) {
+ if (flags & 524288) {
return ts.getObjectFlags(type) & 16 && isEmptyObjectType(type) ?
- strictNullChecks ? 4079615 : 4194303 :
+ strictNullChecks ? 16318463 : 16777215 :
isFunctionObjectType(type) ?
- strictNullChecks ? 1970144 : 4181984 :
- strictNullChecks ? 1972176 : 4184016;
+ strictNullChecks ? 7880640 : 16728000 :
+ strictNullChecks ? 7888800 : 16736160;
}
- if (flags & (4096 | 8192)) {
- return 2457472;
+ if (flags & (16384 | 32768)) {
+ return 9830144;
}
- if (flags & 16384) {
- return 2340752;
+ if (flags & 65536) {
+ return 9363232;
}
- if (flags & 3072) {
- return strictNullChecks ? 1981320 : 4193160;
+ if (flags & 12288) {
+ return strictNullChecks ? 7925520 : 16772880;
}
- if (flags & 16777216) {
- return strictNullChecks ? 1972176 : 4184016;
+ if (flags & 67108864) {
+ return strictNullChecks ? 7888800 : 16736160;
}
- if (flags & 15794176) {
+ if (flags & 63176704) {
return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType);
}
- if (flags & 786432) {
+ if (flags & 3145728) {
return getTypeFactsOfTypes(type.types);
}
- return 4194303;
+ return 16777215;
}
function getTypeWithFacts(type, include) {
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
@@ -36357,7 +37091,7 @@ var ts;
function getTypeWithDefault(type, defaultExpression) {
if (defaultExpression) {
var defaultType = getTypeOfExpression(defaultExpression);
- return getUnionType([getTypeWithFacts(type, 131072), defaultType]);
+ return getUnionType([getTypeWithFacts(type, 524288), defaultType]);
}
return type;
}
@@ -36377,15 +37111,15 @@ var ts;
return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || errorType);
}
function getAssignedTypeOfBinaryExpression(node) {
- var isDestructuringDefaultAssignment = node.parent.kind === 185 && isDestructuringAssignmentTarget(node.parent) ||
- node.parent.kind === 273 && isDestructuringAssignmentTarget(node.parent.parent);
+ var isDestructuringDefaultAssignment = node.parent.kind === 187 && isDestructuringAssignmentTarget(node.parent) ||
+ node.parent.kind === 275 && isDestructuringAssignmentTarget(node.parent.parent);
return isDestructuringDefaultAssignment ?
getTypeWithDefault(getAssignedType(node), node.right) :
getTypeOfExpression(node.right);
}
function isDestructuringAssignmentTarget(parent) {
- return parent.parent.kind === 202 && parent.parent.left === parent ||
- parent.parent.kind === 225 && parent.parent.initializer === parent;
+ return parent.parent.kind === 204 && parent.parent.left === parent ||
+ parent.parent.kind === 227 && parent.parent.initializer === parent;
}
function getAssignedTypeOfArrayLiteralElement(node, element) {
return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));
@@ -36402,21 +37136,21 @@ var ts;
function getAssignedType(node) {
var parent = node.parent;
switch (parent.kind) {
- case 224:
+ case 226:
return stringType;
- case 225:
+ case 227:
return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType;
- case 202:
+ case 204:
return getAssignedTypeOfBinaryExpression(parent);
- case 196:
+ case 198:
return undefinedType;
- case 185:
+ case 187:
return getAssignedTypeOfArrayLiteralElement(parent, node);
- case 206:
+ case 208:
return getAssignedTypeOfSpreadExpression(parent);
- case 273:
+ case 275:
return getAssignedTypeOfPropertyAssignment(parent);
- case 274:
+ case 276:
return getAssignedTypeOfShorthandPropertyAssignment(parent);
}
return errorType;
@@ -36424,7 +37158,7 @@ var ts;
function getInitialTypeOfBindingElement(node) {
var pattern = node.parent;
var parentType = getInitialType(pattern.parent);
- var type = pattern.kind === 182 ?
+ var type = pattern.kind === 184 ?
getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) :
!node.dotDotDotToken ?
getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) :
@@ -36439,39 +37173,39 @@ var ts;
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 224) {
+ if (node.parent.parent.kind === 226) {
return stringType;
}
- if (node.parent.parent.kind === 225) {
+ if (node.parent.parent.kind === 227) {
return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType;
}
return errorType;
}
function getInitialType(node) {
- return node.kind === 235 ?
+ return node.kind === 237 ?
getInitialTypeOfVariableDeclaration(node) :
getInitialTypeOfBindingElement(node);
}
function getInitialOrAssignedType(node, reference) {
- return getConstraintForLocation(node.kind === 235 || node.kind === 184 ?
+ return getConstraintForLocation(node.kind === 237 || node.kind === 186 ?
getInitialType(node) :
getAssignedType(node), reference);
}
function isEmptyArrayAssignment(node) {
- return node.kind === 235 && node.initializer &&
+ return node.kind === 237 && node.initializer &&
isEmptyArrayLiteral(node.initializer) ||
- node.kind !== 184 && node.parent.kind === 202 &&
+ node.kind !== 186 && node.parent.kind === 204 &&
isEmptyArrayLiteral(node.parent.right);
}
function getReferenceCandidate(node) {
switch (node.kind) {
- case 193:
+ case 195:
return getReferenceCandidate(node.expression);
- case 202:
+ case 204:
switch (node.operatorToken.kind) {
- case 58:
+ case 59:
return getReferenceCandidate(node.left);
- case 26:
+ case 27:
return getReferenceCandidate(node.right);
}
}
@@ -36479,13 +37213,13 @@ var ts;
}
function getReferenceRoot(node) {
var parent = node.parent;
- return parent.kind === 193 ||
- parent.kind === 202 && parent.operatorToken.kind === 58 && parent.left === node ||
- parent.kind === 202 && parent.operatorToken.kind === 26 && parent.right === node ?
+ return parent.kind === 195 ||
+ parent.kind === 204 && parent.operatorToken.kind === 59 && parent.left === node ||
+ parent.kind === 204 && parent.operatorToken.kind === 27 && parent.right === node ?
getReferenceRoot(parent) : node;
}
function getTypeOfSwitchClause(clause) {
- if (clause.kind === 269) {
+ if (clause.kind === 271) {
return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
}
return neverType;
@@ -36505,8 +37239,8 @@ var ts;
var witnesses = [];
for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) {
var clause = _a[_i];
- if (clause.kind === 269) {
- if (clause.expression.kind === 9) {
+ if (clause.kind === 271) {
+ if (clause.expression.kind === 10) {
witnesses.push(clause.expression.text);
continue;
}
@@ -36517,13 +37251,13 @@ var ts;
return witnesses;
}
function eachTypeContainedIn(source, types) {
- return source.flags & 262144 ? !ts.forEach(source.types, function (t) { return !ts.contains(types, t); }) : ts.contains(types, source);
+ return source.flags & 1048576 ? !ts.forEach(source.types, function (t) { return !ts.contains(types, t); }) : ts.contains(types, source);
}
function isTypeSubsetOf(source, target) {
- return source === target || target.flags & 262144 && isTypeSubsetOfUnion(source, target);
+ return source === target || target.flags & 1048576 && isTypeSubsetOfUnion(source, target);
}
function isTypeSubsetOfUnion(source, target) {
- if (source.flags & 262144) {
+ if (source.flags & 1048576) {
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
var t = _a[_i];
if (!containsType(target.types, t)) {
@@ -36532,30 +37266,30 @@ var ts;
}
return true;
}
- if (source.flags & 512 && getBaseTypeOfEnumLiteralType(source) === target) {
+ if (source.flags & 1024 && getBaseTypeOfEnumLiteralType(source) === target) {
return true;
}
return containsType(target.types, source);
}
function forEachType(type, f) {
- return type.flags & 262144 ? ts.forEach(type.types, f) : f(type);
+ return type.flags & 1048576 ? ts.forEach(type.types, f) : f(type);
}
function everyType(type, f) {
- return type.flags & 262144 ? ts.every(type.types, f) : f(type);
+ return type.flags & 1048576 ? ts.every(type.types, f) : f(type);
}
function filterType(type, f) {
- if (type.flags & 262144) {
+ if (type.flags & 1048576) {
var types = type.types;
var filtered = ts.filter(types, f);
- return filtered === types ? type : getUnionTypeFromSortedList(filtered, type.flags & 67108864);
+ return filtered === types ? type : getUnionTypeFromSortedList(filtered, type.primitiveTypesOnly);
}
return f(type) ? type : neverType;
}
function mapType(type, mapper, noReductions) {
- if (type.flags & 32768) {
+ if (type.flags & 131072) {
return type;
}
- if (!(type.flags & 262144)) {
+ if (!(type.flags & 1048576)) {
return mapper(type);
}
var types = type.types;
@@ -36582,12 +37316,14 @@ var ts;
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) {
- if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 64) ||
- isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 128)) {
+ if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 128) ||
+ isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 256) ||
+ isTypeSubsetOf(bigintType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 2048)) {
return mapType(typeWithPrimitives, function (t) {
- return t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 64) :
- t.flags & 8 ? extractTypesOfKind(typeWithLiterals, 8 | 128) :
- t;
+ return t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 128) :
+ t.flags & 8 ? extractTypesOfKind(typeWithLiterals, 8 | 256) :
+ t.flags & 64 ? extractTypesOfKind(typeWithLiterals, 64 | 2048) :
+ t;
});
}
return typeWithPrimitives;
@@ -36614,9 +37350,9 @@ var ts;
return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
}
function createFinalArrayType(elementType) {
- return elementType.flags & 32768 ?
+ return elementType.flags & 131072 ?
autoArrayType :
- createArrayType(elementType.flags & 262144 ?
+ createArrayType(elementType.flags & 1048576 ?
getUnionType(elementType.types, 2) :
elementType);
}
@@ -36633,7 +37369,7 @@ var ts;
var hasEvolvingArrayType = false;
for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
var t = types_13[_i];
- if (!(t.flags & 32768)) {
+ if (!(t.flags & 131072)) {
if (!(ts.getObjectFlags(t) & 256)) {
return false;
}
@@ -36650,15 +37386,15 @@ var ts;
function isEvolvingArrayOperationTarget(node) {
var root = getReferenceRoot(node);
var parent = root.parent;
- var isLengthPushOrUnshift = parent.kind === 187 && (parent.name.escapedText === "length" ||
- parent.parent.kind === 189 && ts.isPushOrUnshiftIdentifier(parent.name));
- var isElementAssignment = parent.kind === 188 &&
+ var isLengthPushOrUnshift = parent.kind === 189 && (parent.name.escapedText === "length" ||
+ parent.parent.kind === 191 && ts.isPushOrUnshiftIdentifier(parent.name));
+ var isElementAssignment = parent.kind === 190 &&
parent.expression === root &&
- parent.parent.kind === 202 &&
- parent.parent.operatorToken.kind === 58 &&
+ parent.parent.kind === 204 &&
+ parent.parent.operatorToken.kind === 59 &&
parent.parent.left === parent &&
!ts.isAssignmentTarget(parent.parent) &&
- isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 168);
+ isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 296);
return isLengthPushOrUnshift || isElementAssignment;
}
function maybeTypePredicateCall(node) {
@@ -36669,7 +37405,7 @@ var ts;
return links.maybeTypePredicate;
}
function getMaybeTypePredicate(node) {
- if (node.expression.kind !== 97) {
+ if (node.expression.kind !== 98) {
var funcType = checkNonNullExpression(node.expression);
if (funcType !== silentNeverType) {
var apparentType = getApparentType(funcType);
@@ -36691,14 +37427,14 @@ var ts;
if (flowAnalysisDisabled) {
return errorType;
}
- if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 33492479)) {
+ if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943)) {
return declaredType;
}
var sharedFlowStart = sharedFlowCount;
var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
sharedFlowCount = sharedFlowStart;
- var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType);
- if (reference.parent && reference.parent.kind === 211 && getTypeWithFacts(resultType, 524288).flags & 32768) {
+ var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
+ if (reference.parent && reference.parent.kind === 213 && getTypeWithFacts(resultType, 2097152).flags & 131072) {
return declaredType;
}
return resultType;
@@ -36761,9 +37497,9 @@ var ts;
else if (flags & 2) {
var container = flow.container;
if (container && container !== flowContainer &&
- reference.kind !== 187 &&
- reference.kind !== 188 &&
- reference.kind !== 99) {
+ reference.kind !== 189 &&
+ reference.kind !== 190 &&
+ reference.kind !== 100) {
flow = container.flowNode;
continue;
}
@@ -36795,7 +37531,7 @@ var ts;
var assignedType = getBaseTypeOfLiteralType(getInitialOrAssignedType(node, reference));
return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
}
- if (declaredType.flags & 262144) {
+ if (declaredType.flags & 1048576) {
return getAssignmentReducedType(declaredType, getInitialOrAssignedType(node, reference));
}
return declaredType;
@@ -36803,18 +37539,21 @@ var ts;
if (containsMatchingReference(reference, node)) {
if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) {
var init = ts.getDeclaredExpandoInitializer(node);
- if (init && (init.kind === 194 || init.kind === 195)) {
+ if (init && (init.kind === 196 || init.kind === 197)) {
return getTypeAtFlowNode(flow.antecedent);
}
}
return declaredType;
}
+ if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 226 && isMatchingReference(reference, node.parent.parent.expression)) {
+ return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)));
+ }
return undefined;
}
function getTypeAtFlowArrayMutation(flow) {
if (declaredType === autoType || declaredType === autoArrayType) {
var node = flow.node;
- var expr = node.kind === 189 ?
+ var expr = node.kind === 191 ?
node.expression.expression :
node.left.expression;
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
@@ -36822,7 +37561,7 @@ var ts;
var type = getTypeFromFlowType(flowType);
if (ts.getObjectFlags(type) & 256) {
var evolvedType_1 = type;
- if (node.kind === 189) {
+ if (node.kind === 191) {
for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
var arg = _a[_i];
evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg);
@@ -36830,7 +37569,7 @@ var ts;
}
else {
var indexType = getContextFreeTypeOfExpression(node.left.argumentExpression);
- if (isTypeAssignableToKind(indexType, 168)) {
+ if (isTypeAssignableToKind(indexType, 296)) {
evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right);
}
}
@@ -36844,7 +37583,7 @@ var ts;
function getTypeAtFlowCondition(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
var type = getTypeFromFlowType(flowType);
- if (type.flags & 32768) {
+ if (type.flags & 131072) {
return flowType;
}
var assumeTrue = (flow.flags & 32) !== 0;
@@ -36854,7 +37593,7 @@ var ts;
return flowType;
}
var incomplete = isIncomplete(flowType);
- var resultType = incomplete && narrowedType.flags & 32768 ? silentNeverType : narrowedType;
+ var resultType = incomplete && narrowedType.flags & 131072 ? silentNeverType : narrowedType;
return createFlowType(resultType, incomplete);
}
function getTypeAtSwitchClause(flow) {
@@ -36870,7 +37609,7 @@ var ts;
else if (isMatchingReferenceDiscriminant(expr, type)) {
type = narrowTypeByDiscriminant(type, expr, function (t) { return narrowTypeBySwitchOnDiscriminant(t, flow.switchStatement, flow.clauseStart, flow.clauseEnd); });
}
- else if (expr.kind === 197 && isMatchingReference(reference, expr.expression)) {
+ else if (expr.kind === 199 && isMatchingReference(reference, expr.expression)) {
type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
}
return createFlowType(type, isIncomplete(flowType));
@@ -36952,8 +37691,8 @@ var ts;
return result;
}
function isMatchingReferenceDiscriminant(expr, computedType) {
- if (!(computedType.flags & 262144) ||
- expr.kind !== 187 && expr.kind !== 188) {
+ if (!(computedType.flags & 1048576) ||
+ expr.kind !== 189 && expr.kind !== 190) {
return false;
}
var access = expr;
@@ -36974,10 +37713,10 @@ var ts;
}
function narrowTypeByTruthiness(type, expr, assumeTrue) {
if (isMatchingReference(reference, expr)) {
- return getTypeWithFacts(type, assumeTrue ? 1048576 : 2097152);
+ return getTypeWithFacts(type, assumeTrue ? 4194304 : 8388608);
}
if (isMatchingReferenceDiscriminant(expr, declaredType)) {
- return narrowTypeByDiscriminant(type, expr, function (t) { return getTypeWithFacts(t, assumeTrue ? 1048576 : 2097152); });
+ return narrowTypeByDiscriminant(type, expr, function (t) { return getTypeWithFacts(t, assumeTrue ? 4194304 : 8388608); });
}
if (containsMatchingReferenceDiscriminant(reference, expr)) {
return declaredType;
@@ -36995,7 +37734,7 @@ var ts;
return !assumeTrue;
}
function narrowByInKeyword(type, literal, assumeTrue) {
- if ((type.flags & (262144 | 131072)) || (type.flags & 65536 && type.isThisType)) {
+ if ((type.flags & (1048576 | 524288)) || (type.flags & 262144 && type.isThisType)) {
var propName_1 = ts.escapeLeadingUnderscores(literal.text);
return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); });
}
@@ -37003,19 +37742,19 @@ var ts;
}
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
switch (expr.operatorToken.kind) {
- case 58:
+ case 59:
return narrowTypeByTruthiness(type, expr.left, assumeTrue);
- case 32:
case 33:
case 34:
case 35:
+ case 36:
var operator_1 = expr.operatorToken.kind;
var left_1 = getReferenceCandidate(expr.left);
var right_1 = getReferenceCandidate(expr.right);
- if (left_1.kind === 197 && ts.isStringLiteralLike(right_1)) {
+ if (left_1.kind === 199 && ts.isStringLiteralLike(right_1)) {
return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue);
}
- if (right_1.kind === 197 && ts.isStringLiteralLike(left_1)) {
+ if (right_1.kind === 199 && ts.isStringLiteralLike(left_1)) {
return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue);
}
if (isMatchingReference(reference, left_1)) {
@@ -37034,15 +37773,15 @@ var ts;
return declaredType;
}
break;
- case 93:
+ case 94:
return narrowTypeByInstanceof(type, expr, assumeTrue);
- case 92:
+ case 93:
var target = getReferenceCandidate(expr.right);
if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) {
return narrowByInKeyword(type, expr.left, assumeTrue);
}
break;
- case 26:
+ case 27:
return narrowType(type, expr.right, assumeTrue);
}
return type;
@@ -37051,28 +37790,28 @@ var ts;
if (type.flags & 1) {
return type;
}
- if (operator === 33 || operator === 35) {
+ if (operator === 34 || operator === 36) {
assumeTrue = !assumeTrue;
}
var valueType = getTypeOfExpression(value);
- if (valueType.flags & 24576) {
+ if (valueType.flags & 98304) {
if (!strictNullChecks) {
return type;
}
- var doubleEquals = operator === 32 || operator === 33;
+ var doubleEquals = operator === 33 || operator === 34;
var facts = doubleEquals ?
- assumeTrue ? 65536 : 524288 :
- valueType.flags & 16384 ?
- assumeTrue ? 32768 : 262144 :
- assumeTrue ? 16384 : 131072;
+ assumeTrue ? 262144 : 2097152 :
+ valueType.flags & 65536 ?
+ assumeTrue ? 131072 : 1048576 :
+ assumeTrue ? 65536 : 524288;
return getTypeWithFacts(type, facts);
}
- if (type.flags & 16909315) {
+ if (type.flags & 67637251) {
return type;
}
if (assumeTrue) {
var narrowedType = filterType(type, function (t) { return areTypesComparable(t, valueType); });
- return narrowedType.flags & 32768 ? type : replacePrimitivesWithLiterals(narrowedType, valueType);
+ return narrowedType.flags & 131072 ? type : replacePrimitivesWithLiterals(narrowedType, valueType);
}
if (isUnitType(valueType)) {
var regularType_1 = getRegularTypeOfLiteralType(valueType);
@@ -37083,20 +37822,20 @@ var ts;
function narrowTypeByTypeof(type, typeOfExpr, operator, literal, assumeTrue) {
var target = getReferenceCandidate(typeOfExpr.expression);
if (!isMatchingReference(reference, target)) {
- if (containsMatchingReference(reference, target)) {
+ if (containsMatchingReference(reference, target) && hasNarrowableDeclaredType(target)) {
return declaredType;
}
return type;
}
- if (operator === 33 || operator === 35) {
+ if (operator === 34 || operator === 36) {
assumeTrue = !assumeTrue;
}
if (type.flags & 1 && literal.text === "function") {
return type;
}
var facts = assumeTrue ?
- typeofEQFacts.get(literal.text) || 64 :
- typeofNEFacts.get(literal.text) || 8192;
+ typeofEQFacts.get(literal.text) || 128 :
+ typeofNEFacts.get(literal.text) || 32768;
return getTypeWithFacts(assumeTrue ? mapType(type, narrowTypeForTypeof) : type, facts);
function narrowTypeForTypeof(type) {
if (type.flags & 2 && literal.text === "object") {
@@ -37110,7 +37849,7 @@ var ts;
if (isTypeSubtypeOf(targetType, type)) {
return targetType;
}
- if (type.flags & 15794176) {
+ if (type.flags & 63176704) {
var constraint = getBaseConstraintOfType(type) || anyType;
if (isTypeSubtypeOf(targetType, constraint)) {
return getIntersectionType([type, targetType]);
@@ -37128,13 +37867,37 @@ var ts;
var clauseTypes = switchTypes.slice(clauseStart, clauseEnd);
var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType);
var discriminantType = getUnionType(clauseTypes);
- var caseType = discriminantType.flags & 32768 ? neverType :
+ var caseType = discriminantType.flags & 131072 ? neverType :
replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType);
if (!hasDefaultClause) {
return caseType;
}
var defaultType = filterType(type, function (t) { return !(isUnitType(t) && ts.contains(switchTypes, getRegularTypeOfLiteralType(t))); });
- return caseType.flags & 32768 ? defaultType : getUnionType([caseType, defaultType]);
+ return caseType.flags & 131072 ? defaultType : getUnionType([caseType, defaultType]);
+ }
+ function getImpliedTypeFromTypeofCase(type, text) {
+ switch (text) {
+ case "function":
+ return type.flags & 1 ? type : globalFunctionType;
+ case "object":
+ return type.flags & 2 ? getUnionType([nonPrimitiveType, nullType]) : type;
+ default:
+ return typeofTypesByName.get(text) || type;
+ }
+ }
+ function narrowTypeForTypeofSwitch(candidate) {
+ return function (type) {
+ if (isTypeSubtypeOf(candidate, type)) {
+ return candidate;
+ }
+ if (type.flags & 63176704) {
+ var constraint = getBaseConstraintOfType(type) || anyType;
+ if (isTypeSubtypeOf(candidate, constraint)) {
+ return getIntersectionType([type, candidate]);
+ }
+ }
+ return type;
+ };
}
function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement);
@@ -37156,31 +37919,19 @@ var ts;
clauseWitnesses = switchWitnesses.slice(clauseStart, clauseEnd);
switchFacts = getFactsFromTypeofSwitch(clauseStart, clauseEnd, switchWitnesses, hasDefaultClause);
}
- if (!(hasDefaultClause || (type.flags & 262144))) {
- var impliedType = getTypeWithFacts(getUnionType(clauseWitnesses.map(function (text) { return typeofTypesByName.get(text) || neverType; })), switchFacts);
- if (impliedType.flags & 262144) {
- impliedType = getAssignmentReducedType(impliedType, getBaseConstraintOfType(type) || type);
- }
- if (!(impliedType.flags & 32768)) {
- if (isTypeSubtypeOf(impliedType, type)) {
- return impliedType;
- }
- if (type.flags & 15794176) {
- var constraint = getBaseConstraintOfType(type) || anyType;
- if (isTypeSubtypeOf(impliedType, constraint)) {
- return getIntersectionType([type, impliedType]);
- }
- }
- }
+ if (hasDefaultClause) {
+ return filterType(type, function (t) { return (getTypeFacts(t) & switchFacts) === switchFacts; });
}
- return hasDefaultClause ?
- filterType(type, function (t) { return (getTypeFacts(t) & switchFacts) === switchFacts; }) :
- getTypeWithFacts(type, switchFacts);
+ var impliedType = getTypeWithFacts(getUnionType(clauseWitnesses.map(function (text) { return getImpliedTypeFromTypeofCase(type, text); })), switchFacts);
+ if (impliedType.flags & 1048576) {
+ impliedType = getAssignmentReducedType(impliedType, getBaseConstraintOrType(type));
+ }
+ return getTypeWithFacts(mapType(type, narrowTypeForTypeofSwitch(impliedType)), switchFacts);
}
function narrowTypeByInstanceof(type, expr, assumeTrue) {
var left = getReferenceCandidate(expr.left);
if (!isMatchingReference(reference, left)) {
- if (containsMatchingReference(reference, left)) {
+ if (containsMatchingReference(reference, left) && hasNarrowableDeclaredType(left)) {
return declaredType;
}
return type;
@@ -37212,9 +37963,9 @@ var ts;
if (!assumeTrue) {
return filterType(type, function (t) { return !isRelated(t, candidate); });
}
- if (type.flags & 262144) {
+ if (type.flags & 1048576) {
var assignableType = filterType(type, function (t) { return isRelated(t, candidate); });
- if (!(assignableType.flags & 32768)) {
+ if (!(assignableType.flags & 131072)) {
return assignableType;
}
}
@@ -37248,7 +37999,7 @@ var ts;
}
else {
var invokedExpression = ts.skipParentheses(callExpression.expression);
- if (invokedExpression.kind === 188 || invokedExpression.kind === 187) {
+ if (invokedExpression.kind === 190 || invokedExpression.kind === 189) {
var accessExpression = invokedExpression;
var possibleReference = ts.skipParentheses(accessExpression.expression);
if (isMatchingReference(reference, possibleReference)) {
@@ -37263,20 +38014,20 @@ var ts;
}
function narrowType(type, expr, assumeTrue) {
switch (expr.kind) {
- case 71:
- case 99:
- case 97:
- case 187:
- case 188:
- return narrowTypeByTruthiness(type, expr, assumeTrue);
+ case 72:
+ case 100:
+ case 98:
case 189:
+ case 190:
+ return narrowTypeByTruthiness(type, expr, assumeTrue);
+ case 191:
return narrowTypeByTypePredicate(type, expr, assumeTrue);
- case 193:
+ case 195:
return narrowType(type, expr.expression, assumeTrue);
- case 202:
+ case 204:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 200:
- if (expr.operator === 51) {
+ case 202:
+ if (expr.operator === 52) {
return narrowType(type, expr.operand, !assumeTrue);
}
break;
@@ -37286,7 +38037,7 @@ var ts;
}
function getTypeOfSymbolAtLocation(symbol, location) {
symbol = symbol.exportSymbol || symbol;
- if (location.kind === 71) {
+ if (location.kind === 72) {
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(location)) {
location = location.parent;
}
@@ -37302,9 +38053,9 @@ var ts;
function getControlFlowContainer(node) {
return ts.findAncestor(node.parent, function (node) {
return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
- node.kind === 243 ||
- node.kind === 277 ||
- node.kind === 152;
+ node.kind === 245 ||
+ node.kind === 279 ||
+ node.kind === 154;
});
}
function isParameterAssigned(symbol) {
@@ -37322,10 +38073,10 @@ var ts;
return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 8388608); });
}
function markParameterAssignments(node) {
- if (node.kind === 71) {
+ if (node.kind === 72) {
if (ts.isAssignmentTarget(node)) {
var symbol = getResolvedSymbol(node);
- if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 149) {
+ if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 151) {
symbol.isAssigned = true;
}
}
@@ -37339,21 +38090,21 @@ var ts;
}
function removeOptionalityFromDeclaredType(declaredType, declaration) {
var annotationIncludesUndefined = strictNullChecks &&
- declaration.kind === 149 &&
+ declaration.kind === 151 &&
declaration.initializer &&
- getFalsyFlags(declaredType) & 8192 &&
- !(getFalsyFlags(checkExpression(declaration.initializer)) & 8192);
- return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072) : declaredType;
+ getFalsyFlags(declaredType) & 32768 &&
+ !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768);
+ return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288) : declaredType;
}
function isConstraintPosition(node) {
var parent = node.parent;
- return parent.kind === 187 ||
- parent.kind === 189 && parent.expression === node ||
- parent.kind === 188 && parent.expression === node ||
- parent.kind === 184 && parent.name === node && !!parent.initializer;
+ return parent.kind === 189 ||
+ parent.kind === 191 && parent.expression === node ||
+ parent.kind === 190 && parent.expression === node ||
+ parent.kind === 186 && parent.name === node && !!parent.initializer;
}
function typeHasNullableConstraint(type) {
- return type.flags & 14745600 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 24576);
+ return type.flags & 58982400 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 98304);
}
function getConstraintForLocation(type, node) {
if (type && isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) {
@@ -37374,7 +38125,7 @@ var ts;
if (symbol === argumentsSymbol) {
var container = ts.getContainingFunction(node);
if (languageVersion < 2) {
- if (container.kind === 195) {
+ if (container.kind === 197) {
error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
}
else if (ts.hasModifier(container, 256)) {
@@ -37390,7 +38141,7 @@ var ts;
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
var declaration = localOrExportSymbol.valueDeclaration;
if (localOrExportSymbol.flags & 32) {
- if (declaration.kind === 238
+ if (declaration.kind === 240
&& ts.nodeIsDecorated(declaration)) {
var container = ts.getContainingClass(node);
while (container !== undefined) {
@@ -37402,11 +38153,11 @@ var ts;
container = ts.getContainingClass(container);
}
}
- else if (declaration.kind === 207) {
+ else if (declaration.kind === 209) {
var container = ts.getThisContainer(node, false);
- while (container.kind !== 277) {
+ while (container.kind !== 279) {
if (container.parent === declaration) {
- if (container.kind === 152 && ts.hasModifier(container, 32)) {
+ if (container.kind === 154 && ts.hasModifier(container, 32)) {
getNodeLinks(declaration).flags |= 16777216;
getNodeLinks(node).flags |= 33554432;
}
@@ -37445,28 +38196,28 @@ var ts;
if (!declaration) {
return type;
}
- var isParameter = ts.getRootDeclaration(declaration).kind === 149;
+ var isParameter = ts.getRootDeclaration(declaration).kind === 151;
var declarationContainer = getControlFlowContainer(declaration);
var flowContainer = getControlFlowContainer(node);
var isOuterVariable = flowContainer !== declarationContainer;
var isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
var isModuleExports = symbol.flags & 134217728;
- while (flowContainer !== declarationContainer && (flowContainer.kind === 194 ||
- flowContainer.kind === 195 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 196 ||
+ flowContainer.kind === 197 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
(isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports ||
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 3) !== 0 ||
- isInTypeQuery(node) || node.parent.kind === 255) ||
- node.parent.kind === 211 ||
- declaration.kind === 235 && declaration.exclamationToken ||
+ isInTypeQuery(node) || node.parent.kind === 257) ||
+ node.parent.kind === 213 ||
+ declaration.kind === 237 && declaration.exclamationToken ||
declaration.flags & 4194304;
var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) :
type === autoType || type === autoArrayType ? undefinedType :
getOptionalType(type);
var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized);
- if (type === autoType || type === autoArrayType) {
+ if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
if (flowType === autoType || flowType === autoArrayType) {
if (noImplicitAny) {
error(ts.getNameOfDeclaration(declaration), ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType));
@@ -37475,7 +38226,7 @@ var ts;
return convertAutoToAny(flowType);
}
}
- else if (!assumeInitialized && !(getFalsyFlags(type) & 8192) && getFalsyFlags(flowType) & 8192) {
+ else if (!assumeInitialized && !(getFalsyFlags(type) & 32768) && getFalsyFlags(flowType) & 32768) {
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
return type;
}
@@ -37490,7 +38241,7 @@ var ts;
function checkNestedBlockScopedBinding(node, symbol) {
if (languageVersion >= 2 ||
(symbol.flags & (2 | 32)) === 0 ||
- symbol.valueDeclaration.parent.kind === 272) {
+ symbol.valueDeclaration.parent.kind === 274) {
return;
}
var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -37508,7 +38259,7 @@ var ts;
if (usedInFunction) {
var capturesBlockScopeBindingInLoopBody = true;
if (ts.isForStatement(container) &&
- ts.getAncestor(symbol.valueDeclaration, 236).parent === container) {
+ ts.getAncestor(symbol.valueDeclaration, 238).parent === container) {
var part = getPartOfForStatementContainingNode(node.parent, container);
if (part) {
var links = getNodeLinks(part);
@@ -37524,8 +38275,8 @@ var ts;
getNodeLinks(current).flags |= 65536;
}
}
- if (container.kind === 223 &&
- ts.getAncestor(symbol.valueDeclaration, 236).parent === container &&
+ if (container.kind === 225 &&
+ ts.getAncestor(symbol.valueDeclaration, 238).parent === container &&
isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 4194304;
}
@@ -37541,16 +38292,16 @@ var ts;
}
function isAssignedInBodyOfForStatement(node, container) {
var current = node;
- while (current.parent.kind === 193) {
+ while (current.parent.kind === 195) {
current = current.parent;
}
var isAssigned = false;
if (ts.isAssignmentTarget(current)) {
isAssigned = true;
}
- else if ((current.parent.kind === 200 || current.parent.kind === 201)) {
+ else if ((current.parent.kind === 202 || current.parent.kind === 203)) {
var expr = current.parent;
- isAssigned = expr.operator === 43 || expr.operator === 44;
+ isAssigned = expr.operator === 44 || expr.operator === 45;
}
if (!isAssigned) {
return false;
@@ -37559,7 +38310,7 @@ var ts;
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2;
- if (container.kind === 152 || container.kind === 155) {
+ if (container.kind === 154 || container.kind === 157) {
var classNode = container.parent;
getNodeLinks(classNode).flags |= 4;
}
@@ -37603,32 +38354,32 @@ var ts;
function checkThisExpression(node) {
var container = ts.getThisContainer(node, true);
var capturedByArrowFunction = false;
- if (container.kind === 155) {
+ if (container.kind === 157) {
checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);
}
- if (container.kind === 195) {
+ if (container.kind === 197) {
container = ts.getThisContainer(container, false);
capturedByArrowFunction = true;
}
switch (container.kind) {
- case 242:
+ case 244:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 241:
+ case 243:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 155:
+ case 157:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
- case 152:
- case 151:
+ case 154:
+ case 153:
if (ts.hasModifier(container, 32)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);
}
break;
- case 147:
+ case 149:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -37637,9 +38388,15 @@ var ts;
}
var type = tryGetThisTypeAt(node, container);
if (!type && noImplicitThis) {
- error(node, capturedByArrowFunction && container.kind === 277 ?
+ var diag = error(node, capturedByArrowFunction && container.kind === 279 ?
ts.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any :
ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);
+ if (!ts.isSourceFile(container)) {
+ var outsideThis = tryGetThisTypeAt(container);
+ if (outsideThis) {
+ addRelatedInfo(diag, ts.createDiagnosticForNode(container, ts.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container));
+ }
+ }
}
return type || anyType;
}
@@ -37659,7 +38416,7 @@ var ts;
}
}
else if (isInJS &&
- (container.kind === 194 || container.kind === 237) &&
+ (container.kind === 196 || container.kind === 239) &&
ts.getJSDocClassTag(container)) {
var classType = getJSClassType(container.symbol);
if (classType) {
@@ -37684,7 +38441,7 @@ var ts;
}
}
function getClassNameFromPrototypeMethod(container) {
- if (container.kind === 194 &&
+ if (container.kind === 196 &&
ts.isBinaryExpression(container.parent) &&
ts.getAssignmentDeclarationKind(container.parent) === 3) {
return container.parent
@@ -37692,23 +38449,42 @@ var ts;
.expression
.expression;
}
- else if (container.kind === 154 &&
- container.parent.kind === 186 &&
+ else if (container.kind === 156 &&
+ container.parent.kind === 188 &&
ts.isBinaryExpression(container.parent.parent) &&
ts.getAssignmentDeclarationKind(container.parent.parent) === 6) {
return container.parent.parent.left.expression;
}
- else if (container.kind === 194 &&
- container.parent.kind === 273 &&
- container.parent.parent.kind === 186 &&
+ else if (container.kind === 196 &&
+ container.parent.kind === 275 &&
+ container.parent.parent.kind === 188 &&
ts.isBinaryExpression(container.parent.parent.parent) &&
ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6) {
return container.parent.parent.parent.left.expression;
}
+ else if (container.kind === 196 &&
+ ts.isPropertyAssignment(container.parent) &&
+ ts.isIdentifier(container.parent.name) &&
+ (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") &&
+ ts.isObjectLiteralExpression(container.parent.parent) &&
+ ts.isCallExpression(container.parent.parent.parent) &&
+ container.parent.parent.parent.arguments[2] === container.parent.parent &&
+ ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 9) {
+ return container.parent.parent.parent.arguments[0].expression;
+ }
+ else if (ts.isMethodDeclaration(container) &&
+ ts.isIdentifier(container.name) &&
+ (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") &&
+ ts.isObjectLiteralExpression(container.parent) &&
+ ts.isCallExpression(container.parent.parent) &&
+ container.parent.parent.arguments[2] === container.parent &&
+ ts.getAssignmentDeclarationKind(container.parent.parent) === 9) {
+ return container.parent.parent.arguments[0].expression;
+ }
}
function getTypeForThisExpressionFromJSDoc(node) {
var jsdocType = ts.getJSDocType(node);
- if (jsdocType && jsdocType.kind === 287) {
+ if (jsdocType && jsdocType.kind === 289) {
var jsDocFunctionType = jsdocType;
if (jsDocFunctionType.parameters.length > 0 &&
jsDocFunctionType.parameters[0].name &&
@@ -37722,14 +38498,14 @@ var ts;
}
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
- return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 149; });
+ return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 151; });
}
function checkSuperExpression(node) {
- var isCallExpression = node.parent.kind === 189 && node.parent.expression === node;
+ var isCallExpression = node.parent.kind === 191 && node.parent.expression === node;
var container = ts.getSuperContainer(node, true);
var needToCaptureLexicalThis = false;
if (!isCallExpression) {
- while (container && container.kind === 195) {
+ while (container && container.kind === 197) {
container = ts.getSuperContainer(container, true);
needToCaptureLexicalThis = languageVersion < 2;
}
@@ -37737,14 +38513,14 @@ var ts;
var canUseSuperExpression = isLegalUsageOfSuperExpression(container);
var nodeCheckFlag = 0;
if (!canUseSuperExpression) {
- var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 147; });
- if (current && current.kind === 147) {
+ var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 149; });
+ if (current && current.kind === 149) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);
}
else if (isCallExpression) {
error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);
}
- else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 186)) {
+ else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 188)) {
error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
}
else {
@@ -37752,7 +38528,7 @@ var ts;
}
return errorType;
}
- if (!isCallExpression && container.kind === 155) {
+ if (!isCallExpression && container.kind === 157) {
checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
}
if (ts.hasModifier(container, 32) || isCallExpression) {
@@ -37762,7 +38538,7 @@ var ts;
nodeCheckFlag = 256;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 154 && ts.hasModifier(container, 256)) {
+ if (container.kind === 156 && ts.hasModifier(container, 256)) {
if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096;
}
@@ -37773,7 +38549,7 @@ var ts;
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 186) {
+ if (container.parent.kind === 188) {
if (languageVersion < 2) {
error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
return errorType;
@@ -37792,7 +38568,7 @@ var ts;
if (!baseClassType) {
return errorType;
}
- if (container.kind === 155 && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 157 && isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
return errorType;
}
@@ -37804,24 +38580,24 @@ var ts;
return false;
}
if (isCallExpression) {
- return container.kind === 155;
+ return container.kind === 157;
}
else {
- if (ts.isClassLike(container.parent) || container.parent.kind === 186) {
+ if (ts.isClassLike(container.parent) || container.parent.kind === 188) {
if (ts.hasModifier(container, 32)) {
- return container.kind === 154 ||
- container.kind === 153 ||
- container.kind === 156 ||
- container.kind === 157;
+ return container.kind === 156 ||
+ container.kind === 155 ||
+ container.kind === 158 ||
+ container.kind === 159;
}
else {
- return container.kind === 154 ||
+ return container.kind === 156 ||
+ container.kind === 155 ||
+ container.kind === 158 ||
+ container.kind === 159 ||
+ container.kind === 154 ||
container.kind === 153 ||
- container.kind === 156 ||
- container.kind === 157 ||
- container.kind === 152 ||
- container.kind === 151 ||
- container.kind === 155;
+ container.kind === 157;
}
}
}
@@ -37829,10 +38605,10 @@ var ts;
}
}
function getContainingObjectLiteral(func) {
- return (func.kind === 154 ||
- func.kind === 156 ||
- func.kind === 157) && func.parent.kind === 186 ? func.parent :
- func.kind === 194 && func.parent.kind === 273 ? func.parent.parent :
+ return (func.kind === 156 ||
+ func.kind === 158 ||
+ func.kind === 159) && func.parent.kind === 188 ? func.parent :
+ func.kind === 196 && func.parent.kind === 275 ? func.parent.parent :
undefined;
}
function getThisTypeArgument(type) {
@@ -37840,11 +38616,11 @@ var ts;
}
function getThisTypeFromContextualType(type) {
return mapType(type, function (t) {
- return t.flags & 524288 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t);
+ return t.flags & 2097152 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t);
});
}
function getContextualThisParameterType(func) {
- if (func.kind === 195) {
+ if (func.kind === 197) {
return undefined;
}
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
@@ -37868,7 +38644,7 @@ var ts;
if (thisType) {
return instantiateType(thisType, getContextualMapper(containingLiteral));
}
- if (literal.parent.kind !== 273) {
+ if (literal.parent.kind !== 275) {
break;
}
literal = literal.parent.parent;
@@ -37877,9 +38653,9 @@ var ts;
return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral);
}
var parent = func.parent;
- if (parent.kind === 202 && parent.operatorToken.kind === 58) {
+ if (parent.kind === 204 && parent.operatorToken.kind === 59) {
var target = parent.left;
- if (target.kind === 187 || target.kind === 188) {
+ if (target.kind === 189 || target.kind === 190) {
var expression = target.expression;
if (inJs && ts.isIdentifier(expression)) {
var sourceFile = ts.getSourceFileOfNode(parent);
@@ -37929,7 +38705,7 @@ var ts;
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 149) {
+ if (declaration.kind === 151) {
var type = getContextuallyTypedParameterType(declaration);
if (type) {
return type;
@@ -37941,7 +38717,7 @@ var ts;
if (ts.isBindingPattern(declaration.parent)) {
var parentDeclaration = declaration.parent.parent;
var name = declaration.propertyName || declaration.name;
- if (parentDeclaration.kind !== 184) {
+ if (parentDeclaration.kind !== 186) {
var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration);
if (parentTypeNode && !ts.isBindingPattern(name)) {
var text = ts.getTextOfPropertyName(name);
@@ -38024,10 +38800,13 @@ var ts;
}
function getContextualTypeForArgumentAtIndex(callTarget, argIndex) {
var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget);
+ if (ts.isJsxOpeningLikeElement(callTarget) && argIndex === 0) {
+ return getEffectiveFirstArgumentForJsxSignature(signature, callTarget);
+ }
return getTypeAtPosition(signature, argIndex);
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 191) {
+ if (template.parent.kind === 193) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return undefined;
@@ -38036,7 +38815,7 @@ var ts;
var binaryExpression = node.parent;
var left = binaryExpression.left, operatorToken = binaryExpression.operatorToken, right = binaryExpression.right;
switch (operatorToken.kind) {
- case 58:
+ case 59:
if (node !== right) {
return undefined;
}
@@ -38045,12 +38824,12 @@ var ts;
return undefined;
}
return contextSensitive === true ? getTypeOfExpression(left) : contextSensitive;
- case 54:
+ case 55:
var type = getContextualType(binaryExpression);
return !type && node === right && !ts.isDefaultedExpandoInitializer(binaryExpression) ?
getTypeOfExpression(left) : type;
- case 53:
- case 26:
+ case 54:
+ case 27:
return node === right ? getContextualType(binaryExpression) : undefined;
default:
return undefined;
@@ -38113,13 +38892,17 @@ var ts;
}
var thisType = checkThisExpression(thisAccess.expression);
return thisType && getTypeOfPropertyOfContextualType(thisType, thisAccess.name.escapedText) || false;
+ case 7:
+ case 8:
+ case 9:
+ return ts.Debug.fail("Does not apply");
default:
return ts.Debug.assertNever(kind);
}
}
function getTypeOfPropertyOfContextualType(type, name) {
return mapType(type, function (t) {
- if (t.flags & 917504) {
+ if (t.flags & 3670016) {
var prop = getPropertyOfType(t, name);
if (prop) {
return getTypeOfSymbol(prop);
@@ -38130,8 +38913,8 @@ var ts;
return restType;
}
}
- return isNumericLiteralName(name) && getIndexTypeOfContextualType(type, 1) ||
- getIndexTypeOfContextualType(type, 0);
+ return isNumericLiteralName(name) && getIndexTypeOfContextualType(t, 1) ||
+ getIndexTypeOfContextualType(t, 0);
}
return undefined;
}, true);
@@ -38164,7 +38947,6 @@ var ts;
}
function getContextualTypeForElementExpression(arrayContextualType, index) {
return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index)
- || getIndexTypeOfContextualType(arrayContextualType, 1)
|| getIteratedTypeOrElementType(arrayContextualType, undefined, false, false, false));
}
function getContextualTypeForConditionalOperand(node) {
@@ -38198,33 +38980,34 @@ var ts;
}
function isPossiblyDiscriminantValue(node) {
switch (node.kind) {
- case 9:
+ case 10:
case 8:
- case 13:
- case 101:
- case 86:
- case 95:
- case 71:
- case 140:
+ case 9:
+ case 14:
+ case 102:
+ case 87:
+ case 96:
+ case 72:
+ case 141:
return true;
- case 187:
- case 193:
+ case 189:
+ case 195:
return isPossiblyDiscriminantValue(node.expression);
- case 268:
+ case 270:
return !node.expression || isPossiblyDiscriminantValue(node.expression);
}
return false;
}
function discriminateContextualTypeByObjectMembers(node, contextualType) {
- return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 273 && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);
+ return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 275 && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);
}
function discriminateContextualTypeByJSXAttributes(node, contextualType) {
- return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 265 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);
+ return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 267 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);
}
function getApparentTypeOfContextualType(node) {
var contextualType = getContextualType(node);
contextualType = contextualType && mapType(contextualType, getApparentType);
- if (contextualType && contextualType.flags & 262144) {
+ if (contextualType && contextualType.flags & 1048576) {
if (ts.isObjectLiteralExpression(node)) {
return discriminateContextualTypeByObjectMembers(node, contextualType);
}
@@ -38243,53 +39026,53 @@ var ts;
}
var parent = node.parent;
switch (parent.kind) {
- case 235:
- case 149:
- case 152:
+ case 237:
case 151:
- case 184:
+ case 154:
+ case 153:
+ case 186:
return getContextualTypeForInitializerExpression(node);
- case 195:
- case 228:
+ case 197:
+ case 230:
return getContextualTypeForReturnExpression(node);
- case 205:
+ case 207:
return getContextualTypeForYieldOperand(parent);
- case 199:
+ case 201:
return getContextualTypeForAwaitOperand(parent);
- case 189:
- case 190:
- return getContextualTypeForArgument(parent, node);
+ case 191:
case 192:
- case 210:
+ return getContextualTypeForArgument(parent, node);
+ case 194:
+ case 212:
return getTypeFromTypeNode(parent.type);
- case 202:
+ case 204:
return getContextualTypeForBinaryOperand(node);
- case 273:
- case 274:
- return getContextualTypeForObjectLiteralElement(parent);
case 275:
+ case 276:
+ return getContextualTypeForObjectLiteralElement(parent);
+ case 277:
return getApparentTypeOfContextualType(parent.parent);
- case 185: {
+ case 187: {
var arrayLiteral = parent;
var type = getApparentTypeOfContextualType(arrayLiteral);
return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node));
}
- case 203:
+ case 205:
return getContextualTypeForConditionalOperand(node);
- case 214:
- ts.Debug.assert(parent.parent.kind === 204);
+ case 216:
+ ts.Debug.assert(parent.parent.kind === 206);
return getContextualTypeForSubstitutionExpression(parent.parent, node);
- case 193: {
+ case 195: {
var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined;
return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent);
}
- case 268:
+ case 270:
return getContextualTypeForJsxExpression(parent);
- case 265:
case 267:
+ case 269:
return getContextualTypeForJsxAttribute(parent);
- case 260:
- case 259:
+ case 262:
+ case 261:
return getContextualJsxElementAttributesType(parent);
}
return undefined;
@@ -38302,58 +39085,10 @@ var ts;
if (ts.isJsxOpeningElement(node) && node.parent.contextualType) {
return node.parent.contextualType;
}
- if (isJsxIntrinsicIdentifier(node.tagName)) {
- return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node);
- }
- var valueType = checkExpression(node.tagName);
- if (isTypeAny(valueType)) {
- return anyType;
- }
- var isJs = ts.isInJSFile(node);
- return mapType(valueType, function (t) { return getJsxSignaturesParameterTypes(t, isJs, node); });
+ return getContextualTypeForArgumentAtIndex(node, 0);
}
- function getJsxSignaturesParameterTypes(valueType, isJs, context) {
- if (valueType.flags & 4) {
- return anyType;
- }
- else if (valueType.flags & 64) {
- var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, context);
- if (intrinsicElementsType !== errorType) {
- var stringLiteralTypeName = valueType.value;
- var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
- if (intrinsicProp) {
- return getTypeOfSymbol(intrinsicProp);
- }
- var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0);
- if (indexSignatureType) {
- return indexSignatureType;
- }
- }
- return anyType;
- }
- var signatures = getSignaturesOfType(valueType, 1);
- var ctor = true;
- if (signatures.length === 0) {
- signatures = getSignaturesOfType(valueType, 0);
- ctor = false;
- if (signatures.length === 0) {
- return errorType;
- }
- }
- var links = getNodeLinks(context);
- if (!links.resolvedSignatures) {
- links.resolvedSignatures = ts.createMap();
- }
- var cacheKey = "" + getTypeId(valueType);
- var cachedResolved = links.resolvedSignatures.get(cacheKey);
- if (cachedResolved && cachedResolved !== resolvingSignaturesArray) {
- signatures = cachedResolved;
- }
- else if (!cachedResolved) {
- links.resolvedSignatures.set(cacheKey, resolvingSignaturesArray);
- links.resolvedSignatures.set(cacheKey, signatures = instantiateJsxSignatures(context, signatures));
- }
- return getUnionType(ts.map(signatures, ctor ? function (t) { return getJsxPropsTypeFromClassType(t, isJs, context, false); } : function (t) { return getJsxPropsTypeFromCallSignature(t, context); }), 0);
+ function getEffectiveFirstArgumentForJsxSignature(signature, node) {
+ return getJsxReferenceKind(node) !== 0 ? getJsxPropsTypeFromCallSignature(signature, node) : getJsxPropsTypeFromClassType(signature, node);
}
function getJsxPropsTypeFromCallSignature(sig, context) {
var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, emptyObjectType);
@@ -38368,22 +39103,40 @@ var ts;
var instanceType = getReturnTypeOfSignature(sig);
return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation);
}
+ function getStaticTypeOfReferencedJsxConstructor(context) {
+ if (isJsxIntrinsicIdentifier(context.tagName)) {
+ var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(context);
+ var fakeSignature = createSignatureForJSXIntrinsic(context, result);
+ return getOrCreateTypeFromSignature(fakeSignature);
+ }
+ var tagType = checkExpressionCached(context.tagName);
+ if (tagType.flags & 128) {
+ var result = getIntrinsicAttributesTypeFromStringLiteralType(tagType, context);
+ if (!result) {
+ return errorType;
+ }
+ var fakeSignature = createSignatureForJSXIntrinsic(context, result);
+ return getOrCreateTypeFromSignature(fakeSignature);
+ }
+ return tagType;
+ }
function getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType) {
var managedSym = getJsxLibraryManagedAttributes(ns);
if (managedSym) {
var declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
+ var ctorType = getStaticTypeOfReferencedJsxConstructor(context);
if (ts.length(declaredManagedType.typeParameters) >= 2) {
- var args = fillMissingTypeArguments([checkExpressionCached(context.tagName), attributesType], declaredManagedType.typeParameters, 2, ts.isInJSFile(context));
+ var args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.typeParameters, 2, ts.isInJSFile(context));
return createTypeReference(declaredManagedType, args);
}
else if (ts.length(declaredManagedType.aliasTypeArguments) >= 2) {
- var args = fillMissingTypeArguments([checkExpressionCached(context.tagName), attributesType], declaredManagedType.aliasTypeArguments, 2, ts.isInJSFile(context));
+ var args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.aliasTypeArguments, 2, ts.isInJSFile(context));
return getTypeAliasInstantiation(declaredManagedType.aliasSymbol, args);
}
}
return attributesType;
}
- function getJsxPropsTypeFromClassType(sig, isJs, context, reportErrors) {
+ function getJsxPropsTypeFromClassType(sig, context) {
var ns = getJsxNamespaceAt(context);
var forcedLookupLocation = getJsxElementPropertiesName(ns);
var attributesType = forcedLookupLocation === undefined
@@ -38392,7 +39145,7 @@ var ts;
? getReturnTypeOfSignature(sig)
: getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation);
if (!attributesType) {
- if (reportErrors && !!forcedLookupLocation && !!ts.length(context.attributes.properties)) {
+ if (!!forcedLookupLocation && !!ts.length(context.attributes.properties)) {
error(context, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(forcedLookupLocation));
}
return emptyObjectType;
@@ -38408,7 +39161,7 @@ var ts;
var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
var hostClassType = getReturnTypeOfSignature(sig);
apparentAttributesType = intersectTypes(typeParams
- ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isJs))
+ ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), ts.isInJSFile(context)))
: intrinsicClassAttribs, apparentAttributesType);
}
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
@@ -38441,7 +39194,7 @@ var ts;
return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount;
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 194 || node.kind === 195;
+ return node.kind === 196 || node.kind === 197;
}
function getContextualSignatureForFunctionLikeDeclaration(node) {
return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
@@ -38454,7 +39207,7 @@ var ts;
getApparentTypeOfContextualType(node);
}
function getContextualSignature(node) {
- ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 156 || ts.isObjectLiteralMethod(node));
var typeTagSignature = getSignatureOfTypeTag(node);
if (typeTagSignature) {
return typeTagSignature;
@@ -38463,7 +39216,7 @@ var ts;
if (!type) {
return undefined;
}
- if (!(type.flags & 262144)) {
+ if (!(type.flags & 1048576)) {
return getContextualCallSignature(type, node);
}
var signatureList;
@@ -38498,8 +39251,8 @@ var ts;
return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false, false);
}
function hasDefaultValue(node) {
- return (node.kind === 184 && !!node.initializer) ||
- (node.kind === 202 && node.operatorToken.kind === 58);
+ return (node.kind === 186 && !!node.initializer) ||
+ (node.kind === 204 && node.operatorToken.kind === 59);
}
function checkArrayLiteral(node, checkMode, forceTuple) {
var elements = node.elements;
@@ -38510,7 +39263,7 @@ var ts;
var contextualType = getApparentTypeOfContextualType(node);
for (var index = 0; index < elementCount; index++) {
var e = elements[index];
- if (inDestructuringPattern && e.kind === 206) {
+ if (inDestructuringPattern && e.kind === 208) {
var restArrayType = checkExpression(e.expression, checkMode, forceTuple);
var restElementType = getIndexTypeOfType(restArrayType, 1) ||
getIteratedTypeOrElementType(restArrayType, undefined, false, false, false);
@@ -38523,12 +39276,12 @@ var ts;
var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType, forceTuple);
elementTypes.push(type);
}
- if (index < elementCount - 1 && e.kind === 206) {
+ if (index < elementCount - 1 && e.kind === 208) {
hasNonEndingSpreadElement = true;
}
}
if (!hasNonEndingSpreadElement) {
- var hasRestElement = elementCount > 0 && elements[elementCount - 1].kind === 206;
+ var hasRestElement = elementCount > 0 && elements[elementCount - 1].kind === 208;
var minLength = elementCount - (hasRestElement ? 1 : 0);
var tupleResult = void 0;
if (inDestructuringPattern && minLength > 0) {
@@ -38550,15 +39303,15 @@ var ts;
if (contextualType && forEachType(contextualType, isTupleLikeType)) {
var minLength = elementCount - (hasRestElement ? 1 : 0);
var pattern = contextualType.pattern;
- if (!hasRestElement && pattern && (pattern.kind === 183 || pattern.kind === 185)) {
+ if (!hasRestElement && pattern && (pattern.kind === 185 || pattern.kind === 187)) {
var patternElements = pattern.elements;
for (var i = elementCount; i < patternElements.length; i++) {
var e = patternElements[i];
if (hasDefaultValue(e)) {
elementTypes.push(contextualType.typeArguments[i]);
}
- else if (i < patternElements.length - 1 || !(e.kind === 184 && e.dotDotDotToken || e.kind === 206)) {
- if (e.kind !== 208) {
+ else if (i < patternElements.length - 1 || !(e.kind === 186 && e.dotDotDotToken || e.kind === 208)) {
+ if (e.kind !== 210) {
error(e, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
}
elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType);
@@ -38576,19 +39329,19 @@ var ts;
}
function isNumericName(name) {
switch (name.kind) {
- case 147:
+ case 149:
return isNumericComputedName(name);
- case 71:
+ case 72:
return isNumericLiteralName(name.escapedText);
case 8:
- case 9:
+ case 10:
return isNumericLiteralName(name.text);
default:
return false;
}
}
function isNumericComputedName(name) {
- return isTypeAssignableToKind(checkComputedPropertyName(name), 168);
+ return isTypeAssignableToKind(checkComputedPropertyName(name), 296);
}
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
@@ -38600,8 +39353,8 @@ var ts;
var links = getNodeLinks(node.expression);
if (!links.resolvedType) {
links.resolvedType = checkExpression(node.expression);
- if (links.resolvedType.flags & 24576 ||
- !isTypeAssignableToKind(links.resolvedType, 68 | 168 | 3072) &&
+ if (links.resolvedType.flags & 98304 ||
+ !isTypeAssignableToKind(links.resolvedType, 132 | 296 | 12288) &&
!isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
}
@@ -38627,10 +39380,10 @@ var ts;
var propertiesTable;
var propertiesArray = [];
var spread = emptyObjectType;
- var propagatedFlags = 33554432;
+ var propagatedFlags = 0;
var contextualType = getApparentTypeOfContextualType(node);
var contextualTypeHasPattern = contextualType && contextualType.pattern &&
- (contextualType.pattern.kind === 182 || contextualType.pattern.kind === 186);
+ (contextualType.pattern.kind === 184 || contextualType.pattern.kind === 188);
var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node);
var enumTag = ts.getJSDocEnumTag(node);
var isJSObjectLiteral = !contextualType && isInJavascript && !enumTag;
@@ -38643,13 +39396,13 @@ var ts;
for (var i = 0; i < node.properties.length; i++) {
var memberDecl = node.properties[i];
var member = getSymbolOfNode(memberDecl);
- var computedNameType = memberDecl.name && memberDecl.name.kind === 147 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ?
+ var computedNameType = memberDecl.name && memberDecl.name.kind === 149 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ?
checkComputedPropertyName(memberDecl.name) : undefined;
- if (memberDecl.kind === 273 ||
- memberDecl.kind === 274 ||
+ if (memberDecl.kind === 275 ||
+ memberDecl.kind === 276 ||
ts.isObjectLiteralMethod(memberDecl)) {
- var type = memberDecl.kind === 273 ? checkPropertyAssignment(memberDecl, checkMode) :
- memberDecl.kind === 274 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) :
+ var type = memberDecl.kind === 275 ? checkPropertyAssignment(memberDecl, checkMode) :
+ memberDecl.kind === 276 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) :
checkObjectLiteralMethod(memberDecl, checkMode);
if (isInJavascript) {
var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
@@ -38662,7 +39415,7 @@ var ts;
}
}
typeFlags |= type.flags;
- var nameType = computedNameType && computedNameType.flags & 2240 ?
+ var nameType = computedNameType && computedNameType.flags & 8576 ?
computedNameType : undefined;
var prop = nameType ?
createSymbol(4 | member.flags, getLateBoundNameFromType(nameType), 1024) :
@@ -38671,8 +39424,8 @@ var ts;
prop.nameType = nameType;
}
if (inDestructuringPattern) {
- var isOptional = (memberDecl.kind === 273 && hasDefaultValue(memberDecl.initializer)) ||
- (memberDecl.kind === 274 && memberDecl.objectAssignmentInitializer);
+ var isOptional = (memberDecl.kind === 275 && hasDefaultValue(memberDecl.initializer)) ||
+ (memberDecl.kind === 276 && memberDecl.objectAssignmentInitializer);
if (isOptional) {
prop.flags |= 16777216;
}
@@ -38695,12 +39448,12 @@ var ts;
prop.target = member;
member = prop;
}
- else if (memberDecl.kind === 275) {
+ else if (memberDecl.kind === 277) {
if (languageVersion < 2) {
checkExternalEmitHelpers(memberDecl, 2);
}
if (propertiesArray.length > 0) {
- spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 0);
+ spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 32768);
propertiesArray = [];
propertiesTable = ts.createSymbolTable();
hasComputedStringProperty = false;
@@ -38712,15 +39465,15 @@ var ts;
error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);
return errorType;
}
- spread = getSpreadType(spread, type, node.symbol, propagatedFlags, 0);
+ spread = getSpreadType(spread, type, node.symbol, propagatedFlags, 32768);
offset = i + 1;
continue;
}
else {
- ts.Debug.assert(memberDecl.kind === 156 || memberDecl.kind === 157);
+ ts.Debug.assert(memberDecl.kind === 158 || memberDecl.kind === 159);
checkNodeDeferred(memberDecl);
}
- if (computedNameType && !(computedNameType.flags & 2240)) {
+ if (computedNameType && !(computedNameType.flags & 8576)) {
if (isTypeAssignableTo(computedNameType, stringNumberSymbolType)) {
if (isTypeAssignableTo(computedNameType, numberType)) {
hasComputedNumberProperty = true;
@@ -38752,7 +39505,7 @@ var ts;
}
if (spread !== emptyObjectType) {
if (propertiesArray.length > 0) {
- spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 0);
+ spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 32768);
}
return spread;
}
@@ -38761,9 +39514,8 @@ var ts;
var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined;
var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined;
var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
- var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 33554432;
- result.flags |= 268435456 | freshObjectLiteralFlag | (typeFlags & 939524096);
- result.objectFlags |= 128;
+ result.flags |= 268435456 | typeFlags & 939524096;
+ result.objectFlags |= 128 | freshObjectLiteralFlag;
if (isJSObjectLiteral) {
result.objectFlags |= 16384;
}
@@ -38773,52 +39525,51 @@ var ts;
if (inDestructuringPattern) {
result.pattern = node;
}
- if (!(result.flags & 24576)) {
- propagatedFlags |= (result.flags & 939524096);
- }
+ propagatedFlags |= result.flags & 939524096;
return result;
}
}
function isValidSpreadType(type) {
- return !!(type.flags & (3 | 16777216) ||
- getFalsyFlags(type) & 29120 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
- type.flags & 131072 && !isGenericMappedType(type) ||
- type.flags & 786432 && ts.every(type.types, isValidSpreadType));
+ return !!(type.flags & (3 | 67108864 | 524288 | 58982400) ||
+ getFalsyFlags(type) & 117632 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
+ type.flags & 3145728 && ts.every(type.types, isValidSpreadType));
}
function checkJsxSelfClosingElementDeferred(node) {
- checkJsxOpeningLikeElementOrOpeningFragment(node, 0);
+ checkJsxOpeningLikeElementOrOpeningFragment(node);
}
function checkJsxSelfClosingElement(node, _checkMode) {
checkNodeDeferred(node);
return getJsxElementTypeAt(node) || anyType;
}
function checkJsxElementDeferred(node) {
- checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement, 0);
+ checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement);
if (isJsxIntrinsicIdentifier(node.closingElement.tagName)) {
getIntrinsicTagSymbol(node.closingElement);
}
else {
checkExpression(node.closingElement.tagName);
}
+ checkJsxChildren(node);
}
function checkJsxElement(node, _checkMode) {
checkNodeDeferred(node);
return getJsxElementTypeAt(node) || anyType;
}
- function checkJsxFragment(node, checkMode) {
- checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode);
+ function checkJsxFragment(node) {
+ checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment);
if (compilerOptions.jsx === 2 && (compilerOptions.jsxFactory || ts.getSourceFileOfNode(node).pragmas.has("jsx"))) {
error(node, compilerOptions.jsxFactory
? ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory
: ts.Diagnostics.JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma);
}
+ checkJsxChildren(node);
return getJsxElementTypeAt(node) || anyType;
}
function isUnhyphenatedJsxName(name) {
return !ts.stringContains(name, "-");
}
function isJsxIntrinsicIdentifier(tagName) {
- return tagName.kind === 71 && ts.isIntrinsicJsxName(tagName.escapedText);
+ return tagName.kind === 72 && ts.isIntrinsicJsxName(tagName.escapedText);
}
function checkJsxAttribute(node, checkMode) {
return node.initializer
@@ -38828,18 +39579,19 @@ var ts;
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
var attributes = openingLikeElement.attributes;
var attributesTable = ts.createSymbolTable();
- var spread = emptyObjectType;
+ var spread = emptyJsxObjectType;
var hasSpreadAnyType = false;
var typeToIntersect;
var explicitlySpecifyChildrenAttribute = false;
- var propagatingFlags = 0;
+ var typeFlags = 0;
+ var objectFlags = 4096;
var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {
var attributeDecl = _a[_i];
var member = attributeDecl.symbol;
if (ts.isJsxAttribute(attributeDecl)) {
var exprType = checkJsxAttribute(attributeDecl, checkMode);
- propagatingFlags |= (exprType.flags & 939524096);
+ typeFlags |= exprType.flags & 939524096;
var attributeSymbol = createSymbol(4 | 33554432 | member.flags, member.escapedName);
attributeSymbol.declarations = member.declarations;
attributeSymbol.parent = member.parent;
@@ -38854,9 +39606,9 @@ var ts;
}
}
else {
- ts.Debug.assert(attributeDecl.kind === 267);
+ ts.Debug.assert(attributeDecl.kind === 269);
if (attributesTable.size > 0) {
- spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, propagatingFlags, 4096);
+ spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, typeFlags, objectFlags);
attributesTable = ts.createSymbolTable();
}
var exprType = checkExpressionCached(attributeDecl.expression, checkMode);
@@ -38864,7 +39616,7 @@ var ts;
hasSpreadAnyType = true;
}
if (isValidSpreadType(exprType)) {
- spread = getSpreadType(spread, exprType, openingLikeElement.symbol, propagatingFlags, 4096);
+ spread = getSpreadType(spread, exprType, attributes.symbol, typeFlags, objectFlags);
}
else {
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
@@ -38873,10 +39625,10 @@ var ts;
}
if (!hasSpreadAnyType) {
if (attributesTable.size > 0) {
- spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, propagatingFlags, 4096);
+ spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, typeFlags, objectFlags);
}
}
- var parent = openingLikeElement.parent.kind === 258 ? openingLikeElement.parent : undefined;
+ var parent = openingLikeElement.parent.kind === 260 ? openingLikeElement.parent : undefined;
if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) {
var childrenTypes = checkJsxChildren(parent, checkMode);
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
@@ -38891,20 +39643,21 @@ var ts;
(getArrayLiteralTupleTypeIfApplicable(childrenTypes, childrenContextualType, false) || createArrayType(getUnionType(childrenTypes)));
var childPropMap = ts.createSymbolTable();
childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol);
- spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, undefined, undefined), attributes.symbol, propagatingFlags, 4096);
+ spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, undefined, undefined), attributes.symbol, typeFlags, objectFlags);
}
}
if (hasSpreadAnyType) {
return anyType;
}
- if (typeToIntersect && spread !== emptyObjectType) {
+ if (typeToIntersect && spread !== emptyJsxObjectType) {
return getIntersectionType([typeToIntersect, spread]);
}
- return typeToIntersect || (spread === emptyObjectType ? createJsxAttributesType() : spread);
+ return typeToIntersect || (spread === emptyJsxObjectType ? createJsxAttributesType() : spread);
function createJsxAttributesType() {
+ objectFlags |= freshObjectLiteralFlag;
var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, undefined, undefined);
- result.flags |= (propagatingFlags |= 268435456);
- result.objectFlags |= 128 | 4096;
+ result.flags |= 268435456 | typeFlags;
+ result.objectFlags |= 128 | objectFlags;
return result;
}
}
@@ -38912,7 +39665,7 @@ var ts;
var childrenTypes = [];
for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
var child = _a[_i];
- if (child.kind === 10) {
+ if (child.kind === 11) {
if (!child.containsOnlyWhiteSpaces) {
childrenTypes.push(stringType);
}
@@ -38961,56 +39714,6 @@ var ts;
}
return links.resolvedSymbol;
}
- function instantiateJsxSignatures(node, signatures) {
- var instantiatedSignatures = [];
- var candidateForTypeArgumentError;
- var hasTypeArgumentError = !!node.typeArguments;
- for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) {
- var signature = signatures_3[_i];
- if (signature.typeParameters) {
- var isJavascript = ts.isInJSFile(node);
- var typeArgumentInstantiated = getJsxSignatureTypeArgumentInstantiation(signature, node, isJavascript, false);
- if (typeArgumentInstantiated) {
- hasTypeArgumentError = false;
- instantiatedSignatures.push(typeArgumentInstantiated);
- }
- else {
- if (node.typeArguments && hasCorrectTypeArgumentArity(signature, node.typeArguments)) {
- candidateForTypeArgumentError = signature;
- }
- var inferenceContext = createInferenceContext(signature.typeParameters, signature, isJavascript ? 2 : 0);
- var typeArguments = inferJsxTypeArguments(signature, node, inferenceContext);
- instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript));
- }
- }
- else {
- instantiatedSignatures.push(signature);
- }
- }
- if (node.typeArguments && hasTypeArgumentError) {
- if (candidateForTypeArgumentError) {
- checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, true);
- }
- else if (node.typeArguments.length !== 0) {
- diagnostics.add(getTypeArgumentArityError(node, signatures, node.typeArguments));
- }
- }
- return instantiatedSignatures;
- }
- function getJsxSignatureTypeArgumentInstantiation(signature, node, isJavascript, reportErrors) {
- if (reportErrors === void 0) { reportErrors = false; }
- if (!node.typeArguments) {
- return;
- }
- if (!hasCorrectTypeArgumentArity(signature, node.typeArguments)) {
- return;
- }
- var args = checkTypeArguments(signature, node.typeArguments, reportErrors);
- if (!args) {
- return;
- }
- return getSignatureInstantiation(signature, args, isJavascript);
- }
function getJsxNamespaceAt(location) {
var links = location && getNodeLinks(location);
if (links && links.jsxNamespace) {
@@ -39060,157 +39763,54 @@ var ts;
function getJsxElementChildrenPropertyName(jsxNamespace) {
return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace);
}
- function getApparentTypeOfJsxPropsType(propsType) {
- if (!propsType) {
- return undefined;
- }
- if (propsType.flags & 524288) {
- var propsApparentType = [];
- for (var _i = 0, _a = propsType.types; _i < _a.length; _i++) {
- var t = _a[_i];
- propsApparentType.push(getApparentType(t));
- }
- return getIntersectionType(propsApparentType);
- }
- return getApparentType(propsType);
- }
- function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) {
- ts.Debug.assert(!(elementType.flags & 262144));
- if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) {
- var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement);
- if (jsxStatelessElementType) {
- var callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, undefined, false);
- if (callSignature !== unknownSignature) {
- var callReturnType = callSignature && getReturnTypeOfSignature(callSignature);
- var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0]));
- paramType = getApparentTypeOfJsxPropsType(paramType);
- if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
- var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement);
- if (intrinsicAttributes !== errorType) {
- paramType = intersectTypes(intrinsicAttributes, paramType);
- }
- return paramType;
- }
- }
- }
- }
- return undefined;
- }
- function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) {
- ts.Debug.assert(!(elementType.flags & 262144));
- if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) {
- var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement);
- if (jsxStatelessElementType) {
- var candidatesOutArray = [];
- getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray, false);
- var result = void 0;
- var allMatchingAttributesType = void 0;
- for (var _i = 0, candidatesOutArray_1 = candidatesOutArray; _i < candidatesOutArray_1.length; _i++) {
- var candidate = candidatesOutArray_1[_i];
- var callReturnType = getReturnTypeOfSignature(candidate);
- var paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0]));
- paramType = getApparentTypeOfJsxPropsType(paramType);
- if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
- var shouldBeCandidate = true;
- for (var _a = 0, _b = openingLikeElement.attributes.properties; _a < _b.length; _a++) {
- var attribute = _b[_a];
- if (ts.isJsxAttribute(attribute) &&
- isUnhyphenatedJsxName(attribute.name.escapedText) &&
- !getPropertyOfType(paramType, attribute.name.escapedText)) {
- shouldBeCandidate = false;
- break;
- }
- }
- if (shouldBeCandidate) {
- result = intersectTypes(result, paramType);
- }
- allMatchingAttributesType = intersectTypes(allMatchingAttributesType, paramType);
- }
- }
- if (!result) {
- result = allMatchingAttributesType;
- }
- var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement);
- if (intrinsicAttributes !== errorType) {
- result = intersectTypes(intrinsicAttributes, result);
- }
- return result;
- }
- }
- return undefined;
- }
- function getInstantiatedJsxSignatures(openingLikeElement, elementType, reportErrors) {
- var links = getNodeLinks(openingLikeElement);
- if (!links.resolvedSignatures) {
- links.resolvedSignatures = ts.createMap();
- }
- var cacheKey = "" + getTypeId(elementType);
- if (links.resolvedSignatures.get(cacheKey) && links.resolvedSignatures.get(cacheKey) === resolvingSignaturesArray) {
- return;
- }
- else if (links.resolvedSignatures.get(cacheKey)) {
- return links.resolvedSignatures.get(cacheKey);
- }
- links.resolvedSignatures.set(cacheKey, resolvingSignaturesArray);
+ function getUninstantiatedJsxSignaturesOfType(elementType) {
var signatures = getSignaturesOfType(elementType, 1);
if (signatures.length === 0) {
signatures = getSignaturesOfType(elementType, 0);
- if (signatures.length === 0) {
- if (reportErrors) {
- error(openingLikeElement.tagName, ts.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts.getTextOfNode(openingLikeElement.tagName));
- }
+ }
+ if (signatures.length === 0 && elementType.flags & 1048576) {
+ signatures = getUnionSignatures(ts.map(elementType.types, getUninstantiatedJsxSignaturesOfType));
+ }
+ return signatures;
+ }
+ function getIntrinsicAttributesTypeFromStringLiteralType(type, location) {
+ var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location);
+ if (intrinsicElementsType !== errorType) {
+ var stringLiteralTypeName = type.value;
+ var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
+ if (intrinsicProp) {
+ return getTypeOfSymbol(intrinsicProp);
+ }
+ var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0);
+ if (indexSignatureType) {
+ return indexSignatureType;
+ }
+ return undefined;
+ }
+ return anyType;
+ }
+ function checkJsxReturnAssignableToAppropriateBound(refKind, elemInstanceType, openingLikeElement) {
+ if (refKind === 1) {
+ var sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement);
+ if (sfcReturnConstraint) {
+ checkTypeRelatedTo(elemInstanceType, sfcReturnConstraint, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);
+ }
+ }
+ else if (refKind === 0) {
+ var classConstraint = getJsxElementClassTypeAt(openingLikeElement);
+ if (classConstraint) {
+ checkTypeRelatedTo(elemInstanceType, classConstraint, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);
+ }
+ }
+ else {
+ var sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement);
+ var classConstraint = getJsxElementClassTypeAt(openingLikeElement);
+ if (!sfcReturnConstraint || !classConstraint) {
return;
}
+ var combined = getUnionType([sfcReturnConstraint, classConstraint]);
+ checkTypeRelatedTo(elemInstanceType, combined, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);
}
- var results = instantiateJsxSignatures(openingLikeElement, signatures);
- links.resolvedSignatures.set(cacheKey, results);
- return results;
- }
- function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) {
- if (elementType.flags & 262144) {
- var types = elementType.types;
- return getUnionType(types.map(function (type) {
- return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType);
- }), 2);
- }
- if (isTypeAny(elementType)) {
- return elementType;
- }
- else if (elementType.flags & 4) {
- return anyType;
- }
- else if (elementType.flags & 64) {
- var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, openingLikeElement);
- if (intrinsicElementsType !== errorType) {
- var stringLiteralTypeName = elementType.value;
- var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
- if (intrinsicProp) {
- return getTypeOfSymbol(intrinsicProp);
- }
- var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0);
- if (indexSignatureType) {
- return indexSignatureType;
- }
- error(openingLikeElement, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements);
- }
- return anyType;
- }
- var instantiatedSignatures = getInstantiatedJsxSignatures(openingLikeElement, elementType, true);
- if (!ts.length(instantiatedSignatures)) {
- return errorType;
- }
- var elemInstanceType = getUnionType(instantiatedSignatures.map(getReturnTypeOfSignature), 2);
- var statelessAttributesType = shouldIncludeAllStatelessAttributesType ?
- tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) :
- defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType);
- if (statelessAttributesType) {
- return statelessAttributesType;
- }
- if (elementClassType) {
- checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);
- }
- var isJs = ts.isInJSFile(openingLikeElement);
- return getUnionType(instantiatedSignatures.map(function (sig) { return getJsxPropsTypeFromClassType(sig, isJs, openingLikeElement, true); }));
}
function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName));
@@ -39229,30 +39829,6 @@ var ts;
}
return links.resolvedJsxElementAttributesType;
}
- function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) {
- return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxElementClassTypeAt(node));
- }
- function getAllAttributesTypeFromJsxOpeningLikeElement(node) {
- if (isJsxIntrinsicIdentifier(node.tagName)) {
- return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node);
- }
- else {
- return getCustomJsxElementAttributesType(node, true);
- }
- }
- function getAttributesTypeFromJsxOpeningLikeElement(node) {
- if (isJsxIntrinsicIdentifier(node.tagName)) {
- return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node);
- }
- else {
- return getCustomJsxElementAttributesType(node, false);
- }
- }
- function getJsxAttributePropertySymbol(attrib) {
- var attributesType = getAttributesTypeFromJsxOpeningLikeElement(attrib.parent.parent);
- var prop = getPropertyOfType(attributesType, attrib.name.escapedText);
- return prop || unknownSymbol;
- }
function getJsxElementClassTypeAt(location) {
var type = getJsxType(JsxNames.ElementClass, location);
if (type === errorType)
@@ -39282,7 +39858,7 @@ var ts;
}
}
}
- function checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode) {
+ function checkJsxOpeningLikeElementOrOpeningFragment(node) {
var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(node);
if (isNodeOpeningLikeElement) {
checkGrammarJsxElement(node);
@@ -39299,14 +39875,12 @@ var ts;
}
}
if (isNodeOpeningLikeElement) {
- checkJsxAttributesAssignableToTagNameAttributes(node, checkMode);
- }
- else {
- checkJsxChildren(node.parent);
+ var sig = getResolvedSignature(node);
+ checkJsxReturnAssignableToAppropriateBound(getJsxReferenceKind(node), getReturnTypeOfSignature(sig), node);
}
}
function isKnownProperty(targetType, name, isComparingJsxAttributes) {
- if (targetType.flags & 131072) {
+ if (targetType.flags & 524288) {
var resolved = resolveStructuredTypeMembers(targetType);
if (resolved.stringIndexInfo ||
resolved.numberIndexInfo && isNumericLiteralName(name) ||
@@ -39315,7 +39889,7 @@ var ts;
return true;
}
}
- else if (targetType.flags & 786432) {
+ else if (targetType.flags & 3145728) {
for (var _i = 0, _a = targetType.types; _i < _a.length; _i++) {
var t = _a[_i];
if (isKnownProperty(t, name, isComparingJsxAttributes)) {
@@ -39323,36 +39897,12 @@ var ts;
}
}
}
- else if (targetType.flags & 4194304) {
+ else if (targetType.flags & 16777216) {
return isKnownProperty(targetType.root.trueType, name, isComparingJsxAttributes) ||
isKnownProperty(targetType.root.falseType, name, isComparingJsxAttributes);
}
return false;
}
- function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement, checkMode) {
- var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ?
- getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) :
- getCustomJsxElementAttributesType(openingLikeElement, false);
- var sourceAttributesType = checkExpressionCached(openingLikeElement.attributes, checkMode);
- var isSourceAttributeTypeAssignableToTarget = isTypeAssignableTo(sourceAttributesType, targetAttributesType);
- if (isSourceAttributeTypeAssignableToTarget && !isTypeAny(sourceAttributesType) && !isTypeAny(targetAttributesType)) {
- for (var _i = 0, _a = openingLikeElement.attributes.properties; _i < _a.length; _i++) {
- var attribute = _a[_i];
- if (!ts.isJsxAttribute(attribute)) {
- continue;
- }
- var attrName = attribute.name;
- var isNotIgnoredJsxProperty = (isUnhyphenatedJsxName(ts.idText(attrName)) || !!(getPropertyOfType(targetAttributesType, attrName.escapedText)));
- if (isNotIgnoredJsxProperty && !isKnownProperty(targetAttributesType, attrName.escapedText, true)) {
- error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attrName), typeToString(targetAttributesType));
- break;
- }
- }
- }
- else if (!isSourceAttributeTypeAssignableToTarget) {
- checkTypeAssignableToAndOptionallyElaborate(sourceAttributesType, targetAttributesType, openingLikeElement.tagName, openingLikeElement.attributes);
- }
- }
function checkJsxExpression(node, checkMode) {
if (node.expression) {
var type = checkExpression(node.expression, checkMode);
@@ -39380,7 +39930,7 @@ var ts;
}
function checkPropertyAccessibility(node, isSuper, type, prop) {
var flags = ts.getDeclarationModifierFlagsFromSymbol(prop);
- var errorNode = node.kind === 146 ? node.right : node.kind === 181 ? node : node.name;
+ var errorNode = node.kind === 148 ? node.right : node.kind === 183 ? node : node.name;
if (ts.getCheckFlags(prop) & 256) {
error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type));
return false;
@@ -39429,12 +39979,12 @@ var ts;
return false;
}
var thisType = getTypeFromTypeNode(thisParameter.type);
- enclosingClass = ((thisType.flags & 65536) ? getConstraintOfTypeParameter(thisType) : thisType);
+ enclosingClass = ((thisType.flags & 262144) ? getConstraintOfTypeParameter(thisType) : thisType);
}
if (flags & 32) {
return true;
}
- if (type.flags & 65536) {
+ if (type.flags & 262144) {
type = type.isThisType ? getConstraintOfTypeParameter(type) : getBaseConstraintOfType(type);
}
if (!type || !hasBaseType(type, enclosingClass)) {
@@ -39453,19 +40003,26 @@ var ts;
function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) {
return checkNonNullType(checkExpression(node), node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic);
}
+ function getNonNullableTypeIfNeeded(type) {
+ var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304;
+ if (kind) {
+ return getNonNullableType(type);
+ }
+ return type;
+ }
function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) {
if (type.flags & 2) {
error(node, ts.Diagnostics.Object_is_of_type_unknown);
return errorType;
}
- var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 24576;
+ var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304;
if (kind) {
- error(node, kind & 8192 ? kind & 16384 ?
+ error(node, kind & 32768 ? kind & 65536 ?
(nullOrUndefinedDiagnostic || ts.Diagnostics.Object_is_possibly_null_or_undefined) :
(undefinedDiagnostic || ts.Diagnostics.Object_is_possibly_undefined) :
(nullDiagnostic || ts.Diagnostics.Object_is_possibly_null));
var t = getNonNullableType(type);
- return t.flags & (24576 | 32768) ? errorType : t;
+ return t.flags & (98304 | 131072) ? errorType : t;
}
return type;
}
@@ -39498,7 +40055,7 @@ var ts;
return anyType;
}
if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) {
- reportNonexistentProperty(right, leftType.flags & 65536 && leftType.isThisType ? apparentType : leftType);
+ reportNonexistentProperty(right, leftType.flags & 262144 && leftType.isThisType ? apparentType : leftType);
}
return errorType;
}
@@ -39509,9 +40066,9 @@ var ts;
}
else {
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
- markPropertyAsReferenced(prop, node, left.kind === 99);
+ markPropertyAsReferenced(prop, node, left.kind === 100);
getNodeLinks(node).resolvedSymbol = prop;
- checkPropertyAccessibility(node, left.kind === 97, apparentType, prop);
+ checkPropertyAccessibility(node, left.kind === 98, apparentType, prop);
if (assignmentKind) {
if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) {
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right));
@@ -39520,17 +40077,17 @@ var ts;
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
- if (node.kind !== 187 ||
+ if (node.kind !== 189 ||
assignmentKind === 1 ||
- prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 262144)) {
+ prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 1048576)) {
return propType;
}
var assumeUninitialized = false;
- if (strictNullChecks && strictPropertyInitialization && left.kind === 99) {
+ if (strictNullChecks && strictPropertyInitialization && left.kind === 100) {
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
- if (flowContainer.kind === 155 && flowContainer.parent === declaration.parent) {
+ if (flowContainer.kind === 157 && flowContainer.parent === declaration.parent) {
assumeUninitialized = true;
}
}
@@ -39542,7 +40099,7 @@ var ts;
assumeUninitialized = true;
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
- if (assumeUninitialized && !(getFalsyFlags(propType) & 8192) && getFalsyFlags(flowType) & 8192) {
+ if (assumeUninitialized && !(getFalsyFlags(propType) & 32768) && getFalsyFlags(flowType) & 32768) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop));
return propType;
}
@@ -39560,8 +40117,8 @@ var ts;
&& !isPropertyDeclaredInAncestorClass(prop)) {
diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
}
- else if (valueDeclaration.kind === 238 &&
- node.parent.kind !== 162 &&
+ else if (valueDeclaration.kind === 240 &&
+ node.parent.kind !== 164 &&
!(valueDeclaration.flags & 4194304) &&
!isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);
@@ -39573,9 +40130,9 @@ var ts;
function isInPropertyInitializer(node) {
return !!ts.findAncestor(node, function (node) {
switch (node.kind) {
- case 152:
+ case 154:
return true;
- case 273:
+ case 275:
return false;
default:
return ts.isExpressionNode(node) ? false : "quit";
@@ -39608,7 +40165,7 @@ var ts;
function reportNonexistentProperty(propNode, containingType) {
var errorInfo;
var relatedInfo;
- if (containingType.flags & 262144 && !(containingType.flags & 32764)) {
+ if (containingType.flags & 1048576 && !(containingType.flags & 131068)) {
for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
var subtype = _a[_i];
if (!getPropertyOfType(subtype, propNode.escapedText)) {
@@ -39698,16 +40255,16 @@ var ts;
}
function isValidPropertyAccess(node, propertyName) {
switch (node.kind) {
- case 187:
- return isValidPropertyAccessWithType(node, node.expression.kind === 97, propertyName, getWidenedType(checkExpression(node.expression)));
- case 146:
+ case 189:
+ return isValidPropertyAccessWithType(node, node.expression.kind === 98, propertyName, getWidenedType(checkExpression(node.expression)));
+ case 148:
return isValidPropertyAccessWithType(node, false, propertyName, getWidenedType(checkExpression(node.left)));
- case 181:
+ case 183:
return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node));
}
}
function isValidPropertyAccessForCompletions(node, type, property) {
- return isValidPropertyAccessWithType(node, node.kind !== 181 && node.expression.kind === 97, property.escapedName, type)
+ return isValidPropertyAccessWithType(node, node.kind !== 183 && node.expression.kind === 98, property.escapedName, type)
&& (!(property.flags & 8192) || isValidMethodAccess(property, type));
}
function isValidMethodAccess(method, actualThisType) {
@@ -39733,17 +40290,17 @@ var ts;
}
var prop = getPropertyOfType(type, propertyName);
return prop ? checkPropertyAccessibility(node, isSuper, type, prop)
- : ts.isInJSFile(node) && (type.flags & 262144) !== 0 && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, isSuper, propertyName, elementType); });
+ : ts.isInJSFile(node) && (type.flags & 1048576) !== 0 && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, isSuper, propertyName, elementType); });
}
function getForInVariableSymbol(node) {
var initializer = node.initializer;
- if (initializer.kind === 236) {
+ if (initializer.kind === 238) {
var variable = initializer.declarations[0];
if (variable && !ts.isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
}
}
- else if (initializer.kind === 71) {
+ else if (initializer.kind === 72) {
return getResolvedSymbol(initializer);
}
return undefined;
@@ -39753,13 +40310,13 @@ var ts;
}
function isForInVariableForNumericPropertyNames(expr) {
var e = ts.skipParentheses(expr);
- if (e.kind === 71) {
+ if (e.kind === 72) {
var symbol = getResolvedSymbol(e);
if (symbol.flags & 3) {
var child = expr;
var node = expr.parent;
while (node) {
- if (node.kind === 224 &&
+ if (node.kind === 226 &&
child === node.statement &&
getForInVariableSymbol(node) === symbol &&
hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
@@ -39777,7 +40334,7 @@ var ts;
var indexExpression = node.argumentExpression;
if (!indexExpression) {
var sourceFile = ts.getSourceFileOfNode(node);
- if (node.parent.kind === 190 && node.parent.expression === node) {
+ if (node.parent.kind === 192 && node.parent.expression === node) {
var start = ts.skipTrivia(sourceFile.text, node.expression.end);
var end = node.end;
grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
@@ -39793,7 +40350,7 @@ var ts;
if (objectType === errorType || objectType === silentNeverType) {
return objectType;
}
- if (isConstEnumObjectType(objectType) && indexExpression.kind !== 9) {
+ if (isConstEnumObjectType(objectType) && indexExpression.kind !== 10) {
error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal);
return errorType;
}
@@ -39806,7 +40363,7 @@ var ts;
if (!ts.isWellKnownSymbolSyntactically(expression)) {
return false;
}
- if ((expressionType.flags & 3072) === 0) {
+ if ((expressionType.flags & 12288) === 0) {
if (reportError) {
error(expression, ts.Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, ts.getTextOfNode(expression));
}
@@ -39830,16 +40387,19 @@ var ts;
return true;
}
function callLikeExpressionMayHaveTypeArguments(node) {
- return ts.isCallOrNewExpression(node);
+ return ts.isCallOrNewExpression(node) || ts.isTaggedTemplateExpression(node) || ts.isJsxOpeningLikeElement(node);
}
function resolveUntypedCall(node) {
if (callLikeExpressionMayHaveTypeArguments(node)) {
ts.forEach(node.typeArguments, checkSourceElement);
}
- if (node.kind === 191) {
+ if (node.kind === 193) {
checkExpression(node.template);
}
- else if (node.kind !== 150) {
+ else if (ts.isJsxOpeningLikeElement(node)) {
+ checkExpression(node.attributes);
+ }
+ else if (node.kind !== 152) {
ts.forEach(node.arguments, function (argument) {
checkExpression(argument);
});
@@ -39858,8 +40418,8 @@ var ts;
var specializedIndex = -1;
var spliceIndex;
ts.Debug.assert(!result.length);
- for (var _i = 0, signatures_4 = signatures; _i < signatures_4.length; _i++) {
- var signature = signatures_4[_i];
+ for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) {
+ var signature = signatures_3[_i];
var symbol = signature.declaration && getSymbolOfNode(signature.declaration);
var parent = signature.declaration && signature.declaration.parent;
if (!lastSymbol || symbol === lastSymbol) {
@@ -39888,36 +40448,47 @@ var ts;
}
}
function isSpreadArgument(arg) {
- return !!arg && (arg.kind === 206 || arg.kind === 213 && arg.isSpread);
+ return !!arg && (arg.kind === 208 || arg.kind === 215 && arg.isSpread);
}
function getSpreadArgumentIndex(args) {
return ts.findIndex(args, isSpreadArgument);
}
+ function acceptsVoid(t) {
+ return !!(t.flags & 16384);
+ }
function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) {
if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; }
- if (ts.isJsxOpeningLikeElement(node)) {
- return true;
- }
var argCount;
var callIsIncomplete = false;
- if (node.kind === 191) {
+ var effectiveParameterCount = getParameterCount(signature);
+ var effectiveMinimumArguments = getMinArgumentCount(signature);
+ if (node.kind === 193) {
argCount = args.length;
- if (node.template.kind === 204) {
+ if (node.template.kind === 206) {
var lastSpan = ts.last(node.template.templateSpans);
callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated;
}
else {
var templateLiteral = node.template;
- ts.Debug.assert(templateLiteral.kind === 13);
+ ts.Debug.assert(templateLiteral.kind === 14);
callIsIncomplete = !!templateLiteral.isUnterminated;
}
}
- else if (node.kind === 150) {
+ else if (node.kind === 152) {
argCount = getDecoratorArgumentCount(node, signature);
}
+ else if (ts.isJsxOpeningLikeElement(node)) {
+ callIsIncomplete = node.attributes.end === node.end;
+ if (callIsIncomplete) {
+ return true;
+ }
+ argCount = effectiveMinimumArguments === 0 ? args.length : 1;
+ effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1;
+ effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1);
+ }
else {
if (!node.arguments) {
- ts.Debug.assert(node.kind === 190);
+ ts.Debug.assert(node.kind === 192);
return getMinArgumentCount(signature) === 0;
}
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -39927,11 +40498,19 @@ var ts;
return spreadArgIndex >= getMinArgumentCount(signature) && (hasEffectiveRestParameter(signature) || spreadArgIndex < getParameterCount(signature));
}
}
- if (!hasEffectiveRestParameter(signature) && argCount > getParameterCount(signature)) {
+ if (!hasEffectiveRestParameter(signature) && argCount > effectiveParameterCount) {
return false;
}
- var hasEnoughArguments = argCount >= getMinArgumentCount(signature);
- return callIsIncomplete || hasEnoughArguments;
+ if (callIsIncomplete || argCount >= effectiveMinimumArguments) {
+ return true;
+ }
+ for (var i = argCount; i < effectiveMinimumArguments; i++) {
+ var type = getTypeAtPosition(signature, i);
+ if (filterType(type, acceptsVoid).flags & 131072) {
+ return false;
+ }
+ }
+ return true;
}
function hasCorrectTypeArgumentArity(signature, typeArguments) {
var numTypeParameters = ts.length(signature.typeParameters);
@@ -39940,7 +40519,7 @@ var ts;
(typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters);
}
function getSingleCallSignature(type) {
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
var resolved = resolveStructuredTypeMembers(type);
if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 &&
resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
@@ -39960,12 +40539,9 @@ var ts;
}
return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJSFile(contextualSignature.declaration));
}
- function inferJsxTypeArguments(signature, node, context) {
- var skipContextParamType = getTypeAtPosition(signature, 0);
- var checkAttrTypeSkipContextSensitive = checkExpressionWithContextualType(node.attributes, skipContextParamType, identityMapper);
- inferTypes(context.inferences, checkAttrTypeSkipContextSensitive, skipContextParamType);
- var paramType = getTypeAtPosition(signature, 0);
- var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context);
+ function inferJsxTypeArguments(node, signature, excludeArgument, context) {
+ var paramType = getEffectiveFirstArgumentForJsxSignature(signature, node);
+ var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, excludeArgument && excludeArgument[0] !== undefined ? identityMapper : context);
inferTypes(context.inferences, checkAttrType, paramType);
return getInferredTypes(context);
}
@@ -39976,7 +40552,10 @@ var ts;
inference.inferredType = undefined;
}
}
- if (node.kind !== 150) {
+ if (ts.isJsxOpeningLikeElement(node)) {
+ return inferJsxTypeArguments(node, signature, excludeArgument, context);
+ }
+ if (node.kind !== 152) {
var contextualType = getContextualType(node);
if (contextualType) {
var instantiatedType = instantiateType(contextualType, cloneTypeMapper(getContextualMapper(node)));
@@ -39998,7 +40577,7 @@ var ts;
var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;
for (var i = 0; i < argCount; i++) {
var arg = args[i];
- if (arg.kind !== 208) {
+ if (arg.kind !== 210) {
var paramType = getTypeAtPosition(signature, i);
var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : context;
var argType = checkExpressionWithContextualType(arg, paramType, mapper);
@@ -40012,7 +40591,7 @@ var ts;
return getInferredTypes(context);
}
function getArrayifiedType(type) {
- if (forEachType(type, function (t) { return !(t.flags & (1 | 15794176) || isArrayType(t) || isTupleType(t)); })) {
+ if (forEachType(type, function (t) { return !(t.flags & (1 | 63176704) || isArrayType(t) || isTupleType(t)); })) {
return createArrayType(getIndexTypeOfType(type, 1) || errorType);
}
return type;
@@ -40021,13 +40600,13 @@ var ts;
if (index >= argCount - 1) {
var arg = args[argCount - 1];
if (isSpreadArgument(arg)) {
- return arg.kind === 213 ?
+ return arg.kind === 215 ?
createArrayType(arg.type) :
getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context));
}
}
var contextualType = getIndexTypeOfType(restType, 1) || anyType;
- var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 32764 | 1048576);
+ var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 | 4194304);
var types = [];
var spreadIndex = -1;
for (var i = index; i < argCount; i++) {
@@ -40063,29 +40642,30 @@ var ts;
}
return typeArgumentTypes;
}
- function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation) {
- var callIsIncomplete = node.attributes.end === node.end;
- if (callIsIncomplete) {
- return true;
+ function getJsxReferenceKind(node) {
+ if (isJsxIntrinsicIdentifier(node.tagName)) {
+ return 2;
}
- var headMessage = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1;
- var paramType = getTypeAtPosition(signature, 0);
- var attributesType = checkExpressionWithContextualType(node.attributes, paramType, undefined);
- var argProperties = getPropertiesOfType(attributesType);
- for (var _i = 0, argProperties_1 = argProperties; _i < argProperties_1.length; _i++) {
- var arg = argProperties_1[_i];
- if (!getPropertyOfType(paramType, arg.escapedName) && isUnhyphenatedJsxName(arg.escapedName)) {
- return false;
- }
+ var tagType = getApparentType(checkExpression(node.tagName));
+ if (ts.length(getSignaturesOfType(tagType, 1))) {
+ return 0;
}
- return checkTypeRelatedTo(attributesType, paramType, relation, undefined, headMessage);
+ if (ts.length(getSignaturesOfType(tagType, 0))) {
+ return 1;
+ }
+ return 2;
+ }
+ function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, excludeArgument, reportErrors) {
+ var paramType = getEffectiveFirstArgumentForJsxSignature(signature, node);
+ var attributesType = checkExpressionWithContextualType(node.attributes, paramType, excludeArgument && excludeArgument[0] ? identityMapper : undefined);
+ return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes);
}
function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) {
if (ts.isJsxOpeningLikeElement(node)) {
- return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation);
+ return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, excludeArgument, reportErrors);
}
var thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 190) {
+ if (thisType && thisType !== voidType && node.kind !== 192) {
var thisArgumentNode = getThisArgumentOfCall(node);
var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
var errorNode = reportErrors ? (thisArgumentNode || node) : undefined;
@@ -40099,7 +40679,7 @@ var ts;
var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;
for (var i = 0; i < argCount; i++) {
var arg = args[i];
- if (arg.kind !== 208) {
+ if (arg.kind !== 210) {
var paramType = getTypeAtPosition(signature, i);
var argType = checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
var checkArgType = excludeArgument ? getRegularTypeOfObjectLiteral(argType) : argType;
@@ -40116,36 +40696,36 @@ var ts;
return true;
}
function getThisArgumentOfCall(node) {
- if (node.kind === 189) {
+ if (node.kind === 191) {
var callee = ts.skipOuterExpressions(node.expression);
- if (callee.kind === 187 || callee.kind === 188) {
+ if (callee.kind === 189 || callee.kind === 190) {
return callee.expression;
}
}
}
function createSyntheticExpression(parent, type, isSpread) {
- var result = ts.createNode(213, parent.pos, parent.end);
+ var result = ts.createNode(215, parent.pos, parent.end);
result.parent = parent;
result.type = type;
result.isSpread = isSpread || false;
return result;
}
function getEffectiveCallArguments(node) {
- if (node.kind === 191) {
+ if (node.kind === 193) {
var template = node.template;
var args_4 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())];
- if (template.kind === 204) {
+ if (template.kind === 206) {
ts.forEach(template.templateSpans, function (span) {
args_4.push(span.expression);
});
}
return args_4;
}
- if (node.kind === 150) {
+ if (node.kind === 152) {
return getEffectiveDecoratorArguments(node);
}
if (ts.isJsxOpeningLikeElement(node)) {
- return node.attributes.properties.length > 0 ? [node.attributes] : ts.emptyArray;
+ return node.attributes.properties.length > 0 || (ts.isJsxOpeningElement(node) && node.parent.children.length > 0) ? [node.attributes] : ts.emptyArray;
}
var args = node.arguments || ts.emptyArray;
var length = args.length;
@@ -40165,23 +40745,23 @@ var ts;
var parent = node.parent;
var expr = node.expression;
switch (parent.kind) {
- case 238:
- case 207:
+ case 240:
+ case 209:
return [
createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent)))
];
- case 149:
+ case 151:
var func = parent.parent;
return [
- createSyntheticExpression(expr, parent.parent.kind === 155 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
+ createSyntheticExpression(expr, parent.parent.kind === 157 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),
createSyntheticExpression(expr, anyType),
createSyntheticExpression(expr, numberType)
];
- case 152:
case 154:
case 156:
- case 157:
- var hasPropDesc = parent.kind !== 152 && languageVersion !== 0;
+ case 158:
+ case 159:
+ var hasPropDesc = parent.kind !== 154 && languageVersion !== 0;
return [
createSyntheticExpression(expr, getParentTypeOfClassElement(parent)),
createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)),
@@ -40192,16 +40772,16 @@ var ts;
}
function getDecoratorArgumentCount(node, signature) {
switch (node.parent.kind) {
- case 238:
- case 207:
+ case 240:
+ case 209:
return 1;
- case 152:
- return 2;
case 154:
+ return 2;
case 156:
- case 157:
+ case 158:
+ case 159:
return languageVersion === 0 || signature.parameters.length <= 2 ? 2 : 3;
- case 149:
+ case 151:
return 3;
default:
return ts.Debug.fail();
@@ -40214,8 +40794,8 @@ var ts;
var aboveArgCount = Number.POSITIVE_INFINITY;
var argCount = args.length;
var closestSignature;
- for (var _i = 0, signatures_5 = signatures; _i < signatures_5.length; _i++) {
- var sig = signatures_5[_i];
+ for (var _i = 0, signatures_4 = signatures; _i < signatures_4.length; _i++) {
+ var sig = signatures_4[_i];
var minCount = getMinArgumentCount(sig);
var maxCount = getParameterCount(sig);
if (minCount < argCount && minCount > belowArgCount)
@@ -40259,8 +40839,8 @@ var ts;
function getTypeArgumentArityError(node, signatures, typeArguments) {
var min = Infinity;
var max = -Infinity;
- for (var _i = 0, signatures_6 = signatures; _i < signatures_6.length; _i++) {
- var sig = signatures_6[_i];
+ for (var _i = 0, signatures_5 = signatures; _i < signatures_5.length; _i++) {
+ var sig = signatures_5[_i];
min = Math.min(min, getMinTypeArgumentCount(sig.typeParameters));
max = Math.max(max, ts.length(sig.typeParameters));
}
@@ -40268,20 +40848,23 @@ var ts;
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length);
}
function resolveCall(node, signatures, candidatesOutArray, isForSignatureHelp, fallbackError) {
- var isTaggedTemplate = node.kind === 191;
- var isDecorator = node.kind === 150;
+ var isTaggedTemplate = node.kind === 193;
+ var isDecorator = node.kind === 152;
var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
+ var reportErrors = !candidatesOutArray;
var typeArguments;
if (!isDecorator) {
typeArguments = node.typeArguments;
- if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 97) {
+ if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 98) {
ts.forEach(typeArguments, checkSourceElement);
}
}
var candidates = candidatesOutArray || [];
reorderCandidates(signatures, candidates);
if (!candidates.length) {
- diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Call_target_does_not_contain_any_signatures));
+ if (reportErrors) {
+ diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Call_target_does_not_contain_any_signatures));
+ }
return resolveErrorCall(node);
}
var args = getEffectiveCallArguments(node);
@@ -40291,7 +40874,7 @@ var ts;
var candidateForArgumentArityError;
var candidateForTypeArgumentError;
var result;
- var signatureHelpTrailingComma = isForSignatureHelp && node.kind === 189 && node.arguments.hasTrailingComma;
+ var signatureHelpTrailingComma = isForSignatureHelp && node.kind === 191 && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma);
}
@@ -40301,28 +40884,27 @@ var ts;
if (result) {
return result;
}
- if (candidateForArgumentError) {
- if (isJsxOpeningOrSelfClosingElement) {
- return candidateForArgumentError;
+ if (reportErrors) {
+ if (candidateForArgumentError) {
+ checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true);
}
- checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true);
- }
- else if (candidateForArgumentArityError) {
- diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args));
- }
- else if (candidateForTypeArgumentError) {
- checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, true, fallbackError);
- }
- else {
- var signaturesWithCorrectTypeArgumentArity = ts.filter(signatures, function (s) { return hasCorrectTypeArgumentArity(s, typeArguments); });
- if (signaturesWithCorrectTypeArgumentArity.length === 0) {
- diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments));
+ else if (candidateForArgumentArityError) {
+ diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args));
}
- else if (!isDecorator) {
- diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args));
+ else if (candidateForTypeArgumentError) {
+ checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, true, fallbackError);
}
- else if (fallbackError) {
- diagnostics.add(ts.createDiagnosticForNode(node, fallbackError));
+ else {
+ var signaturesWithCorrectTypeArgumentArity = ts.filter(signatures, function (s) { return hasCorrectTypeArgumentArity(s, typeArguments); });
+ if (signaturesWithCorrectTypeArgumentArity.length === 0) {
+ diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments));
+ }
+ else if (!isDecorator) {
+ diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args));
+ }
+ else if (fallbackError) {
+ diagnostics.add(ts.createDiagnosticForNode(node, fallbackError));
+ }
}
}
return produceDiagnostics || !args ? resolveErrorCall(node) : getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray);
@@ -40499,7 +41081,7 @@ var ts;
return maxParamsIndex;
}
function resolveCallExpression(node, candidatesOutArray, isForSignatureHelp) {
- if (node.expression.kind === 97) {
+ if (node.expression.kind === 98) {
var superType = checkSuperExpression(node.expression);
if (isTypeAny(superType)) {
for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
@@ -40539,7 +41121,7 @@ var ts;
}
else {
var relatedInformation = void 0;
- if (node.arguments.length === 1 && isTypeAssertion(ts.first(node.arguments))) {
+ if (node.arguments.length === 1) {
var text = ts.getSourceFileOfNode(node).text;
if (ts.isLineBreak(text.charCodeAt(ts.skipTrivia(text, node.expression.end, true) - 1))) {
relatedInformation = ts.createDiagnosticForNode(node.expression, ts.Diagnostics.It_is_highly_likely_that_you_are_missing_a_semicolon);
@@ -40556,8 +41138,8 @@ var ts;
return resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp);
}
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
- return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & 65536 ||
- !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (262144 | 32768)) && isTypeAssignableTo(funcType, globalFunctionType);
+ return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & 262144 ||
+ !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (1048576 | 131072)) && isTypeAssignableTo(funcType, globalFunctionType);
}
function resolveNewExpression(node, candidatesOutArray, isForSignatureHelp) {
if (node.arguments && languageVersion < 1) {
@@ -40614,7 +41196,7 @@ var ts;
return false;
}
var firstBase = baseTypes[0];
- if (firstBase.flags & 524288) {
+ if (firstBase.flags & 2097152) {
var types = firstBase.types;
var mixinCount = ts.countWhere(types, isMixinConstructorType);
var i = 0;
@@ -40705,16 +41287,16 @@ var ts;
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 238:
- case 207:
+ case 240:
+ case 209:
return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 149:
+ case 151:
return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 152:
- return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
case 154:
+ return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
case 156:
- case 157:
+ case 158:
+ case 159:
return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
default:
return ts.Debug.fail();
@@ -40747,6 +41329,50 @@ var ts;
}
return resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp, headMessage);
}
+ function createSignatureForJSXIntrinsic(node, result) {
+ var namespace = getJsxNamespaceAt(node);
+ var exports = namespace && getExportsOfSymbol(namespace);
+ var typeSymbol = exports && getSymbol(exports, JsxNames.Element, 67897832);
+ var returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 67897832, node);
+ var declaration = ts.createFunctionTypeNode(undefined, [ts.createParameter(undefined, undefined, undefined, "props", undefined, nodeBuilder.typeToTypeNode(result, node))], returnNode ? ts.createTypeReferenceNode(returnNode, undefined) : ts.createKeywordTypeNode(120));
+ var parameterSymbol = createSymbol(1, "props");
+ parameterSymbol.type = result;
+ return createSignature(declaration, undefined, undefined, [parameterSymbol], typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType, undefined, 1, false, false);
+ }
+ function resolveJsxOpeningLikeElement(node, candidatesOutArray, isForSignatureHelp) {
+ if (isJsxIntrinsicIdentifier(node.tagName)) {
+ var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node);
+ var fakeSignature = createSignatureForJSXIntrinsic(node, result);
+ checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), undefined), result, node.tagName, node.attributes);
+ return fakeSignature;
+ }
+ var exprTypes = checkExpression(node.tagName);
+ var apparentType = getApparentType(exprTypes);
+ if (apparentType === errorType) {
+ return resolveErrorCall(node);
+ }
+ if (exprTypes.flags & 128) {
+ var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(exprTypes, node);
+ if (!intrinsicType) {
+ error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, exprTypes.value, "JSX." + JsxNames.IntrinsicElements);
+ return resolveUntypedCall(node);
+ }
+ else {
+ var fakeSignature = createSignatureForJSXIntrinsic(node, intrinsicType);
+ checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), undefined), intrinsicType, node.tagName, node.attributes);
+ return fakeSignature;
+ }
+ }
+ var signatures = getUninstantiatedJsxSignaturesOfType(apparentType);
+ if (exprTypes.flags & 4 || isUntypedFunctionCall(exprTypes, apparentType, signatures.length, 0)) {
+ return resolveUntypedCall(node);
+ }
+ if (signatures.length === 0) {
+ error(node.tagName, ts.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts.getTextOfNode(node.tagName));
+ return resolveErrorCall(node);
+ }
+ return resolveCall(node, signatures, candidatesOutArray, isForSignatureHelp);
+ }
function isPotentiallyUncalledDecorator(decorator, signatures) {
return signatures.length && ts.every(signatures, function (signature) {
return signature.minArgumentCount === 0 &&
@@ -40754,38 +41380,19 @@ var ts;
signature.parameters.length < getDecoratorArgumentCount(decorator, signature);
});
}
- function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray, isForSignatureHelp) {
- ts.Debug.assert(!(elementType.flags & 262144));
- var callSignatures = elementType && getSignaturesOfType(elementType, 0);
- if (callSignatures && callSignatures.length > 0) {
- return resolveCall(openingLikeElement, callSignatures, candidatesOutArray, isForSignatureHelp);
- }
- return undefined;
- }
function resolveSignature(node, candidatesOutArray, isForSignatureHelp) {
switch (node.kind) {
- case 189:
- return resolveCallExpression(node, candidatesOutArray, isForSignatureHelp);
- case 190:
- return resolveNewExpression(node, candidatesOutArray, isForSignatureHelp);
case 191:
+ return resolveCallExpression(node, candidatesOutArray, isForSignatureHelp);
+ case 192:
+ return resolveNewExpression(node, candidatesOutArray, isForSignatureHelp);
+ case 193:
return resolveTaggedTemplateExpression(node, candidatesOutArray, isForSignatureHelp);
- case 150:
+ case 152:
return resolveDecorator(node, candidatesOutArray, isForSignatureHelp);
- case 260:
- case 259:
- var exprTypes = checkExpression(node.tagName);
- return forEachType(exprTypes, function (exprType) {
- var sfcResult = getResolvedJsxStatelessFunctionSignature(node, exprType, candidatesOutArray, isForSignatureHelp);
- if (sfcResult && sfcResult !== unknownSignature) {
- return sfcResult;
- }
- var sigs = getInstantiatedJsxSignatures(node, exprType);
- if (candidatesOutArray && ts.length(sigs)) {
- candidatesOutArray.push.apply(candidatesOutArray, sigs);
- }
- return ts.length(sigs) ? sigs[0] : unknownSignature;
- }) || unknownSignature;
+ case 262:
+ case 261:
+ return resolveJsxOpeningLikeElement(node, candidatesOutArray, isForSignatureHelp);
}
throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
}
@@ -40817,7 +41424,7 @@ var ts;
return false;
}
function isJSConstructorType(type) {
- if (type.flags & 131072) {
+ if (type.flags & 524288) {
var resolved = resolveStructuredTypeMembers(type);
return resolved.callSignatures.length === 1 && isJSConstructor(resolved.callSignatures[0].declaration);
}
@@ -40852,10 +41459,10 @@ var ts;
return false;
}
var parent = node.parent;
- while (parent && parent.kind === 187) {
+ while (parent && parent.kind === 189) {
parent = parent.parent;
}
- if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 58) {
+ if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 59) {
var right = ts.getInitializerOfBinaryExpression(parent);
return ts.isObjectLiteralExpression(right) && right;
}
@@ -40876,18 +41483,18 @@ var ts;
if (!checkGrammarTypeArguments(node, node.typeArguments))
checkGrammarArguments(node.arguments);
var signature = getResolvedSignature(node);
- if (node.expression.kind === 97) {
+ if (node.expression.kind === 98) {
return voidType;
}
- if (node.kind === 190) {
+ if (node.kind === 192) {
var declaration = signature.declaration;
if (declaration &&
- declaration.kind !== 155 &&
- declaration.kind !== 159 &&
- declaration.kind !== 164 &&
+ declaration.kind !== 157 &&
+ declaration.kind !== 161 &&
+ declaration.kind !== 166 &&
!ts.isJSDocConstructSignature(declaration)) {
var funcSymbol = checkExpression(node.expression).symbol;
- if (!funcSymbol && node.expression.kind === 71) {
+ if (!funcSymbol && node.expression.kind === 72) {
funcSymbol = getResolvedSymbol(node.expression);
}
var type = funcSymbol && getJSClassType(funcSymbol);
@@ -40904,7 +41511,7 @@ var ts;
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
}
var returnType = getReturnTypeOfSignature(signature);
- if (returnType.flags & 3072 && isSymbolOrSymbolForCall(node)) {
+ if (returnType.flags & 12288 && isSymbolOrSymbolForCall(node)) {
return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent));
}
var jsAssignmentType;
@@ -40947,7 +41554,7 @@ var ts;
for (var i = 1; i < node.arguments.length; ++i) {
checkExpressionCached(node.arguments[i]);
}
- if (specifierType.flags & 8192 || specifierType.flags & 16384 || !isTypeAssignableTo(specifierType, stringType)) {
+ if (specifierType.flags & 32768 || specifierType.flags & 65536 || !isTypeAssignableTo(specifierType, stringType)) {
error(specifier, ts.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType));
}
var moduleSymbol = resolveExternalModuleName(node, specifier);
@@ -40997,9 +41604,9 @@ var ts;
return false;
}
var targetDeclarationKind = resolvedRequire.flags & 16
- ? 237
+ ? 239
: resolvedRequire.flags & 3
- ? 235
+ ? 237
: 0;
if (targetDeclarationKind !== 0) {
var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
@@ -41034,10 +41641,10 @@ var ts;
}
function checkMetaProperty(node) {
checkGrammarMetaProperty(node);
- if (node.keywordToken === 94) {
+ if (node.keywordToken === 95) {
return checkNewTargetMetaProperty(node);
}
- if (node.keywordToken === 91) {
+ if (node.keywordToken === 92) {
return checkImportMetaProperty(node);
}
return ts.Debug.assertNever(node.keywordToken);
@@ -41048,7 +41655,7 @@ var ts;
error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
return errorType;
}
- else if (container.kind === 155) {
+ else if (container.kind === 157) {
var symbol = getSymbolOfNode(container.parent);
return getTypeOfSymbol(symbol);
}
@@ -41216,7 +41823,7 @@ var ts;
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
- if (element.name.kind === 71) {
+ if (element.name.kind === 72) {
getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
}
else {
@@ -41230,7 +41837,7 @@ var ts;
if (!links.type) {
links.type = contextualType;
var decl = parameter.valueDeclaration;
- if (decl.name.kind !== 71) {
+ if (decl.name.kind !== 72) {
if (links.type === emptyObjectType) {
links.type = getTypeFromBindingPattern(decl.name);
}
@@ -41275,7 +41882,7 @@ var ts;
}
var functionFlags = ts.getFunctionFlags(func);
var type;
- if (func.body.kind !== 216) {
+ if (func.body.kind !== 218) {
type = checkExpressionCached(func.body, checkMode);
if (functionFlags & 2) {
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
@@ -41364,18 +41971,18 @@ var ts;
var facts = 0;
if (hasDefault) {
for (var i = end; i < witnesses.length; i++) {
- facts |= typeofNEFacts.get(witnesses[i]) || 8192;
+ facts |= typeofNEFacts.get(witnesses[i]) || 32768;
}
for (var i = start; i < end; i++) {
facts &= ~(typeofNEFacts.get(witnesses[i]) || 0);
}
for (var i = 0; i < start; i++) {
- facts |= typeofNEFacts.get(witnesses[i]) || 8192;
+ facts |= typeofNEFacts.get(witnesses[i]) || 32768;
}
}
else {
for (var i = start; i < end; i++) {
- facts |= typeofEQFacts.get(witnesses[i]) || 64;
+ facts |= typeofEQFacts.get(witnesses[i]) || 128;
}
for (var i = 0; i < start; i++) {
facts &= ~(typeofEQFacts.get(witnesses[i]) || 0);
@@ -41387,12 +41994,12 @@ var ts;
if (!node.possiblyExhaustive) {
return false;
}
- if (node.expression.kind === 197) {
+ if (node.expression.kind === 199) {
var operandType = getTypeOfExpression(node.expression.expression);
var witnesses = getSwitchClauseTypeOfWitnesses(node);
var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, true);
var type_5 = getBaseConstraintOfType(operandType) || operandType;
- return !!(filterType(type_5, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 32768);
+ return !!(filterType(type_5, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072);
}
var type = getTypeOfExpression(node.expression);
if (!isLiteralType(type)) {
@@ -41408,7 +42015,7 @@ var ts;
if (!(func.flags & 128)) {
return false;
}
- if (ts.some(func.body.statements, function (statement) { return statement.kind === 230 && isExhaustiveSwitchStatement(statement); })) {
+ if (ts.some(func.body.statements, function (statement) { return statement.kind === 232 && isExhaustiveSwitchStatement(statement); })) {
return false;
}
return true;
@@ -41425,7 +42032,7 @@ var ts;
if (functionFlags & 2) {
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
}
- if (type.flags & 32768) {
+ if (type.flags & 131072) {
hasReturnOfTypeNever = true;
}
ts.pushIfUnique(aggregatedTypes, type);
@@ -41445,11 +42052,11 @@ var ts;
}
function mayReturnNever(func) {
switch (func.kind) {
- case 194:
- case 195:
+ case 196:
+ case 197:
return true;
- case 154:
- return func.parent.kind === 186;
+ case 156:
+ return func.parent.kind === 188;
default:
return false;
}
@@ -41458,14 +42065,14 @@ var ts;
if (!produceDiagnostics) {
return;
}
- if (returnType && maybeTypeOfKind(returnType, 1 | 4096)) {
+ if (returnType && maybeTypeOfKind(returnType, 1 | 16384)) {
return;
}
- if (func.kind === 153 || ts.nodeIsMissing(func.body) || func.body.kind !== 216 || !functionHasImplicitReturn(func)) {
+ if (func.kind === 155 || ts.nodeIsMissing(func.body) || func.body.kind !== 218 || !functionHasImplicitReturn(func)) {
return;
}
var hasExplicitReturn = func.flags & 256;
- if (returnType && returnType.flags & 32768) {
+ if (returnType && returnType.flags & 131072) {
error(ts.getEffectiveReturnTypeNode(func), ts.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);
}
else if (returnType && !hasExplicitReturn) {
@@ -41488,7 +42095,7 @@ var ts;
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
- ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 156 || ts.isObjectLiteralMethod(node));
checkNodeDeferred(node);
if (checkMode === 1 && isContextSensitive(node)) {
if (!ts.getEffectiveReturnTypeNode(node) && hasContextSensitiveReturnExpression(node)) {
@@ -41505,7 +42112,7 @@ var ts;
return anyFunctionType;
}
var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 194) {
+ if (!hasGrammarError && node.kind === 196) {
checkGrammarForGenerator(node);
}
var links = getNodeLinks(node);
@@ -41546,7 +42153,7 @@ var ts;
getAwaitedType(type) || errorType : type;
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 156 || ts.isObjectLiteralMethod(node));
var functionFlags = ts.getFunctionFlags(node);
var returnOrPromisedType = getReturnOrPromisedType(node, functionFlags);
if ((functionFlags & 1) === 0) {
@@ -41556,7 +42163,7 @@ var ts;
if (!ts.getEffectiveReturnTypeNode(node)) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 216) {
+ if (node.body.kind === 218) {
checkSourceElement(node.body);
}
else {
@@ -41574,26 +42181,54 @@ var ts;
}
}
function checkArithmeticOperandType(operand, type, diagnostic) {
- if (!isTypeAssignableToKind(type, 168)) {
+ if (!isTypeAssignableTo(type, numberOrBigIntType)) {
error(operand, diagnostic);
return false;
}
return true;
}
+ function isReadonlyAssignmentDeclaration(d) {
+ if (!ts.isCallExpression(d)) {
+ return false;
+ }
+ if (!ts.isBindableObjectDefinePropertyCall(d)) {
+ return false;
+ }
+ var objectLitType = checkExpressionCached(d.arguments[2]);
+ var valueType = getTypeOfPropertyOfType(objectLitType, "value");
+ if (valueType) {
+ var writableProp = getPropertyOfType(objectLitType, "writable");
+ var writableType = writableProp && getTypeOfSymbol(writableProp);
+ if (!writableType || writableType === falseType || writableType === regularFalseType) {
+ return true;
+ }
+ if (writableProp && writableProp.valueDeclaration && ts.isPropertyAssignment(writableProp.valueDeclaration)) {
+ var initializer = writableProp.valueDeclaration.initializer;
+ var rawOriginalType = checkExpression(initializer);
+ if (rawOriginalType === falseType || rawOriginalType === regularFalseType) {
+ return true;
+ }
+ }
+ return false;
+ }
+ var setProp = getPropertyOfType(objectLitType, "set");
+ return !setProp;
+ }
function isReadonlySymbol(symbol) {
return !!(ts.getCheckFlags(symbol) & 8 ||
symbol.flags & 4 && ts.getDeclarationModifierFlagsFromSymbol(symbol) & 64 ||
symbol.flags & 3 && getDeclarationNodeFlagsFromSymbol(symbol) & 2 ||
symbol.flags & 98304 && !(symbol.flags & 65536) ||
- symbol.flags & 8);
+ symbol.flags & 8 ||
+ ts.some(symbol.declarations, isReadonlyAssignmentDeclaration));
}
function isReferenceToReadonlyEntity(expr, symbol) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 &&
- (expr.kind === 187 || expr.kind === 188) &&
- expr.expression.kind === 99) {
+ (expr.kind === 189 || expr.kind === 190) &&
+ expr.expression.kind === 100) {
var func = ts.getContainingFunction(expr);
- if (!(func && func.kind === 155)) {
+ if (!(func && func.kind === 157)) {
return true;
}
return !symbol.valueDeclaration || !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
@@ -41603,13 +42238,13 @@ var ts;
return false;
}
function isReferenceThroughNamespaceImport(expr) {
- if (expr.kind === 187 || expr.kind === 188) {
+ if (expr.kind === 189 || expr.kind === 190) {
var node = ts.skipParentheses(expr.expression);
- if (node.kind === 71) {
+ if (node.kind === 72) {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol.flags & 2097152) {
var declaration = getDeclarationOfAliasSymbol(symbol);
- return !!declaration && declaration.kind === 249;
+ return !!declaration && declaration.kind === 251;
}
}
}
@@ -41617,7 +42252,7 @@ var ts;
}
function checkReferenceExpression(expr, invalidReferenceMessage) {
var node = ts.skipOuterExpressions(expr, 2 | 1);
- if (node.kind !== 71 && node.kind !== 187 && node.kind !== 188) {
+ if (node.kind !== 72 && node.kind !== 189 && node.kind !== 190) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -41626,7 +42261,7 @@ var ts;
function checkDeleteExpression(node) {
checkExpression(node.expression);
var expr = ts.skipParentheses(node.expression);
- if (expr.kind !== 187 && expr.kind !== 188) {
+ if (expr.kind !== 189 && expr.kind !== 190) {
error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference);
return booleanType;
}
@@ -41662,36 +42297,51 @@ var ts;
if (operandType === silentNeverType) {
return silentNeverType;
}
- if (node.operand.kind === 8) {
- if (node.operator === 38) {
- return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text));
- }
- else if (node.operator === 37) {
- return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text));
- }
+ switch (node.operand.kind) {
+ case 8:
+ switch (node.operator) {
+ case 39:
+ return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text));
+ case 38:
+ return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text));
+ }
+ break;
+ case 9:
+ if (node.operator === 39) {
+ return getFreshTypeOfLiteralType(getLiteralType({
+ negative: true,
+ base10Value: ts.parsePseudoBigInt(node.operand.text)
+ }));
+ }
}
switch (node.operator) {
- case 37:
case 38:
- case 52:
+ case 39:
+ case 53:
checkNonNullType(operandType, node.operand);
- if (maybeTypeOfKind(operandType, 3072)) {
+ if (maybeTypeOfKind(operandType, 12288)) {
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
}
- return numberType;
- case 51:
+ if (node.operator === 38) {
+ if (maybeTypeOfKind(operandType, 2112)) {
+ error(node.operand, ts.Diagnostics.Operator_0_cannot_be_applied_to_type_1, ts.tokenToString(node.operator), typeToString(operandType));
+ }
+ return numberType;
+ }
+ return getUnaryResultType(operandType);
+ case 52:
checkTruthinessExpression(node.operand);
- var facts = getTypeFacts(operandType) & (1048576 | 2097152);
- return facts === 1048576 ? falseType :
- facts === 2097152 ? trueType :
+ var facts = getTypeFacts(operandType) & (4194304 | 8388608);
+ return facts === 4194304 ? falseType :
+ facts === 8388608 ? trueType :
booleanType;
- case 43:
case 44:
- var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);
+ case 45:
+ var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type);
if (ok) {
checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access);
}
- return numberType;
+ return getUnaryResultType(operandType);
}
return errorType;
}
@@ -41700,17 +42350,25 @@ var ts;
if (operandType === silentNeverType) {
return silentNeverType;
}
- var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);
+ var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type);
if (ok) {
checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access);
}
+ return getUnaryResultType(operandType);
+ }
+ function getUnaryResultType(operandType) {
+ if (maybeTypeOfKind(operandType, 2112)) {
+ return isTypeAssignableToKind(operandType, 3) || maybeTypeOfKind(operandType, 296)
+ ? numberOrBigIntType
+ : bigintType;
+ }
return numberType;
}
function maybeTypeOfKind(type, kind) {
if (type.flags & kind & ~134217728 || kind & 134217728 && isGenericMappedType(type)) {
return true;
}
- if (type.flags & 786432) {
+ if (type.flags & 3145728) {
var types = type.types;
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
var t = types_15[_i];
@@ -41725,21 +42383,22 @@ var ts;
if (source.flags & kind) {
return true;
}
- if (strict && source.flags & (3 | 4096 | 8192 | 16384)) {
+ if (strict && source.flags & (3 | 16384 | 32768 | 65536)) {
return false;
}
- return !!(kind & 168) && isTypeAssignableTo(source, numberType) ||
- !!(kind & 68) && isTypeAssignableTo(source, stringType) ||
- !!(kind & 272) && isTypeAssignableTo(source, booleanType) ||
- !!(kind & 4096) && isTypeAssignableTo(source, voidType) ||
- !!(kind & 32768) && isTypeAssignableTo(source, neverType) ||
- !!(kind & 16384) && isTypeAssignableTo(source, nullType) ||
- !!(kind & 8192) && isTypeAssignableTo(source, undefinedType) ||
- !!(kind & 1024) && isTypeAssignableTo(source, esSymbolType) ||
- !!(kind & 16777216) && isTypeAssignableTo(source, nonPrimitiveType);
+ return !!(kind & 296) && isTypeAssignableTo(source, numberType) ||
+ !!(kind & 2112) && isTypeAssignableTo(source, bigintType) ||
+ !!(kind & 132) && isTypeAssignableTo(source, stringType) ||
+ !!(kind & 528) && isTypeAssignableTo(source, booleanType) ||
+ !!(kind & 16384) && isTypeAssignableTo(source, voidType) ||
+ !!(kind & 131072) && isTypeAssignableTo(source, neverType) ||
+ !!(kind & 65536) && isTypeAssignableTo(source, nullType) ||
+ !!(kind & 32768) && isTypeAssignableTo(source, undefinedType) ||
+ !!(kind & 4096) && isTypeAssignableTo(source, esSymbolType) ||
+ !!(kind & 67108864) && isTypeAssignableTo(source, nonPrimitiveType);
}
function allTypesAssignableToKind(source, kind, strict) {
- return source.flags & 262144 ?
+ return source.flags & 1048576 ?
ts.every(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
isTypeAssignableToKind(source, kind, strict);
}
@@ -41754,7 +42413,7 @@ var ts;
return silentNeverType;
}
if (!isTypeAny(leftType) &&
- allTypesAssignableToKind(leftType, 32764)) {
+ allTypesAssignableToKind(leftType, 131068)) {
error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
}
if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
@@ -41768,10 +42427,10 @@ var ts;
}
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
- if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 168 | 3072))) {
+ if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 | 12288))) {
error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol);
}
- if (!isTypeAssignableToKind(rightType, 16777216 | 14745600)) {
+ if (!isTypeAssignableToKind(rightType, 67108864 | 58982400)) {
error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
}
return booleanType;
@@ -41781,17 +42440,17 @@ var ts;
if (strictNullChecks && properties.length === 0) {
return checkNonNullType(sourceType, node);
}
- for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
- var p = properties_7[_i];
+ for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) {
+ var p = properties_6[_i];
checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties, rightIsThis);
}
return sourceType;
}
function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties, rightIsThis) {
if (rightIsThis === void 0) { rightIsThis = false; }
- if (property.kind === 273 || property.kind === 274) {
+ if (property.kind === 275 || property.kind === 276) {
var name = property.name;
- if (name.kind === 147) {
+ if (name.kind === 149) {
checkComputedPropertyName(name);
}
if (isComputedNonLiteralName(name)) {
@@ -41799,13 +42458,13 @@ var ts;
}
var type = getTypeOfObjectLiteralDestructuringProperty(objectLiteralType, name, property, rightIsThis);
if (type) {
- return checkDestructuringAssignment(property.kind === 274 ? property : property.initializer, type);
+ return checkDestructuringAssignment(property.kind === 276 ? property : property.initializer, type);
}
else {
error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name));
}
}
- else if (property.kind === 275) {
+ else if (property.kind === 277) {
if (languageVersion < 6) {
checkExternalEmitHelpers(property, 4);
}
@@ -41854,8 +42513,8 @@ var ts;
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {
var elements = node.elements;
var element = elements[elementIndex];
- if (element.kind !== 208) {
- if (element.kind !== 206) {
+ if (element.kind !== 210) {
+ if (element.kind !== 208) {
var propName = "" + elementIndex;
var type = isTypeAny(sourceType) ? sourceType :
everyType(sourceType, isTupleLikeType) ? getTupleElementType(sourceType, elementIndex) :
@@ -41877,7 +42536,7 @@ var ts;
}
else {
var restExpression = element.expression;
- if (restExpression.kind === 202 && restExpression.operatorToken.kind === 58) {
+ if (restExpression.kind === 204 && restExpression.operatorToken.kind === 59) {
error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);
}
else {
@@ -41894,12 +42553,12 @@ var ts;
}
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {
var target;
- if (exprOrAssignment.kind === 274) {
+ if (exprOrAssignment.kind === 276) {
var prop = exprOrAssignment;
if (prop.objectAssignmentInitializer) {
if (strictNullChecks &&
- !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 8192)) {
- sourceType = getTypeWithFacts(sourceType, 131072);
+ !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 32768)) {
+ sourceType = getTypeWithFacts(sourceType, 524288);
}
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
}
@@ -41908,21 +42567,21 @@ var ts;
else {
target = exprOrAssignment;
}
- if (target.kind === 202 && target.operatorToken.kind === 58) {
+ if (target.kind === 204 && target.operatorToken.kind === 59) {
checkBinaryExpression(target, checkMode);
target = target.left;
}
- if (target.kind === 186) {
+ if (target.kind === 188) {
return checkObjectLiteralAssignment(target, sourceType, rightIsThis);
}
- if (target.kind === 185) {
+ if (target.kind === 187) {
return checkArrayLiteralAssignment(target, sourceType, checkMode);
}
return checkReferenceAssignment(target, sourceType, checkMode);
}
function checkReferenceAssignment(target, sourceType, checkMode) {
var targetType = checkExpression(target, checkMode);
- var error = target.parent.kind === 275 ?
+ var error = target.parent.kind === 277 ?
ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access :
ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;
if (checkReferenceExpression(target, error)) {
@@ -41933,55 +42592,56 @@ var ts;
function isSideEffectFree(node) {
node = ts.skipParentheses(node);
switch (node.kind) {
- case 71:
- case 9:
- case 12:
- case 191:
- case 204:
+ case 72:
+ case 10:
case 13:
+ case 193:
+ case 206:
+ case 14:
case 8:
- case 101:
- case 86:
- case 95:
- case 140:
- case 194:
- case 207:
- case 195:
- case 185:
- case 186:
+ case 9:
+ case 102:
+ case 87:
+ case 96:
+ case 141:
+ case 196:
+ case 209:
case 197:
- case 211:
- case 259:
- case 258:
+ case 187:
+ case 188:
+ case 199:
+ case 213:
+ case 261:
+ case 260:
return true;
- case 203:
+ case 205:
return isSideEffectFree(node.whenTrue) &&
isSideEffectFree(node.whenFalse);
- case 202:
+ case 204:
if (ts.isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) &&
isSideEffectFree(node.right);
- case 200:
- case 201:
+ case 202:
+ case 203:
switch (node.operator) {
- case 51:
- case 37:
- case 38:
case 52:
+ case 38:
+ case 39:
+ case 53:
return true;
}
return false;
- case 198:
- case 192:
- case 210:
+ case 200:
+ case 194:
+ case 212:
default:
return false;
}
}
function isTypeEqualityComparableTo(source, target) {
- return (target.flags & 24576) !== 0 || isTypeComparableTo(source, target);
+ return (target.flags & 98304) !== 0 || isTypeComparableTo(source, target);
}
function checkBinaryExpression(node, checkMode) {
if (ts.isInJSFile(node) && ts.getAssignedExpandoInitializer(node)) {
@@ -41991,11 +42651,11 @@ var ts;
}
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
var operator = operatorToken.kind;
- if (operator === 58 && (left.kind === 186 || left.kind === 185)) {
- return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 99);
+ if (operator === 59 && (left.kind === 188 || left.kind === 187)) {
+ return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 100);
}
var leftType;
- if (operator === 53 || operator === 54) {
+ if (operator === 54 || operator === 55) {
leftType = checkTruthinessExpression(left, checkMode);
}
else {
@@ -42003,61 +42663,82 @@ var ts;
}
var rightType = checkExpression(right, checkMode);
switch (operator) {
- case 39:
case 40:
- case 61:
- case 62:
case 41:
+ case 62:
case 63:
case 42:
case 64:
- case 38:
- case 60:
- case 45:
+ case 43:
case 65:
+ case 39:
+ case 61:
case 46:
case 66:
case 47:
case 67:
- case 49:
- case 69:
- case 50:
- case 70:
case 48:
case 68:
+ case 50:
+ case 70:
+ case 51:
+ case 71:
+ case 49:
+ case 69:
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
var suggestedOperator = void 0;
- if ((leftType.flags & 272) &&
- (rightType.flags & 272) &&
+ if ((leftType.flags & 528) &&
+ (rightType.flags & 528) &&
(suggestedOperator = getSuggestedBooleanOperator(operatorToken.kind)) !== undefined) {
error(errorNode || operatorToken, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(operatorToken.kind), ts.tokenToString(suggestedOperator));
+ return numberType;
}
else {
- var leftOk = checkArithmeticOperandType(left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type);
- var rightOk = checkArithmeticOperandType(right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type);
- if (leftOk && rightOk) {
- checkAssignmentOperator(numberType);
+ var leftOk = checkArithmeticOperandType(left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type);
+ var rightOk = checkArithmeticOperandType(right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type);
+ var resultType_1;
+ if ((isTypeAssignableToKind(leftType, 3) && isTypeAssignableToKind(rightType, 3)) ||
+ !(maybeTypeOfKind(leftType, 2112) || maybeTypeOfKind(rightType, 2112))) {
+ resultType_1 = numberType;
}
+ else if (isTypeAssignableToKind(leftType, 2112) && isTypeAssignableToKind(rightType, 2112)) {
+ switch (operator) {
+ case 48:
+ case 68:
+ reportOperatorError();
+ }
+ resultType_1 = bigintType;
+ }
+ else {
+ reportOperatorError();
+ resultType_1 = errorType;
+ }
+ if (leftOk && rightOk) {
+ checkAssignmentOperator(resultType_1);
+ }
+ return resultType_1;
}
- return numberType;
- case 37:
- case 59:
+ case 38:
+ case 60:
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
- if (!isTypeAssignableToKind(leftType, 68) && !isTypeAssignableToKind(rightType, 68)) {
+ if (!isTypeAssignableToKind(leftType, 132) && !isTypeAssignableToKind(rightType, 132)) {
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
}
var resultType = void 0;
- if (isTypeAssignableToKind(leftType, 168, true) && isTypeAssignableToKind(rightType, 168, true)) {
+ if (isTypeAssignableToKind(leftType, 296, true) && isTypeAssignableToKind(rightType, 296, true)) {
resultType = numberType;
}
- else if (isTypeAssignableToKind(leftType, 68, true) || isTypeAssignableToKind(rightType, 68, true)) {
+ else if (isTypeAssignableToKind(leftType, 2112, true) && isTypeAssignableToKind(rightType, 2112, true)) {
+ resultType = bigintType;
+ }
+ else if (isTypeAssignableToKind(leftType, 132, true) || isTypeAssignableToKind(rightType, 132, true)) {
resultType = stringType;
}
else if (isTypeAny(leftType) || isTypeAny(rightType)) {
@@ -42070,26 +42751,27 @@ var ts;
reportOperatorError();
return anyType;
}
- if (operator === 59) {
+ if (operator === 60) {
checkAssignmentOperator(resultType);
}
return resultType;
- case 27:
- case 29:
+ case 28:
case 30:
case 31:
+ case 32:
if (checkForDisallowedESSymbolOperand(operator)) {
leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left));
rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right));
- if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) {
+ if (!(isTypeComparableTo(leftType, rightType) || isTypeComparableTo(rightType, leftType) ||
+ (isTypeAssignableTo(leftType, numberOrBigIntType) && isTypeAssignableTo(rightType, numberOrBigIntType)))) {
reportOperatorError();
}
}
return booleanType;
- case 32:
case 33:
case 34:
case 35:
+ case 36:
var leftIsLiteral = isLiteralType(leftType);
var rightIsLiteral = isLiteralType(rightType);
if (!leftIsLiteral || !rightIsLiteral) {
@@ -42100,19 +42782,19 @@ var ts;
reportOperatorError();
}
return booleanType;
- case 93:
+ case 94:
return checkInstanceOfExpression(left, right, leftType, rightType);
- case 92:
+ case 93:
return checkInExpression(left, right, leftType, rightType);
- case 53:
- return getTypeFacts(leftType) & 1048576 ?
+ case 54:
+ return getTypeFacts(leftType) & 4194304 ?
getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) :
leftType;
- case 54:
- return getTypeFacts(leftType) & 2097152 ?
+ case 55:
+ return getTypeFacts(leftType) & 8388608 ?
getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2) :
leftType;
- case 58:
+ case 59:
var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0;
checkAssignmentDeclaration(declKind, right);
if (isAssignmentDeclaration(declKind)) {
@@ -42122,7 +42804,7 @@ var ts;
checkAssignmentOperator(rightType);
return getRegularTypeOfObjectLiteral(rightType);
}
- case 26:
+ case 27:
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) {
error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
}
@@ -42148,11 +42830,11 @@ var ts;
}
}
function isEvalNode(node) {
- return node.kind === 71 && node.escapedText === "eval";
+ return node.kind === 72 && node.escapedText === "eval";
}
function checkForDisallowedESSymbolOperand(operator) {
- var offendingSymbolOperand = maybeTypeOfKind(leftType, 3072) ? left :
- maybeTypeOfKind(rightType, 3072) ? right :
+ var offendingSymbolOperand = maybeTypeOfKind(leftType, 12288) ? left :
+ maybeTypeOfKind(rightType, 12288) ? right :
undefined;
if (offendingSymbolOperand) {
error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));
@@ -42162,15 +42844,15 @@ var ts;
}
function getSuggestedBooleanOperator(operator) {
switch (operator) {
+ case 50:
+ case 70:
+ return 55;
+ case 51:
+ case 71:
+ return 36;
case 49:
case 69:
return 54;
- case 50:
- case 70:
- return 35;
- case 48:
- case 68:
- return 53;
default:
return undefined;
}
@@ -42210,11 +42892,11 @@ var ts;
}
function tryGiveBetterPrimaryError(errNode, leftStr, rightStr) {
switch (operatorToken.kind) {
- case 34:
- case 32:
- return error(errNode, ts.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap, "false", leftStr, rightStr);
case 35:
case 33:
+ return error(errNode, ts.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap, "false", leftStr, rightStr);
+ case 36:
+ case 34:
return error(errNode, ts.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap, "true", leftStr, rightStr);
}
return undefined;
@@ -42278,14 +42960,14 @@ var ts;
}
function checkTemplateExpression(node) {
ts.forEach(node.templateSpans, function (templateSpan) {
- if (maybeTypeOfKind(checkExpression(templateSpan.expression), 3072)) {
+ if (maybeTypeOfKind(checkExpression(templateSpan.expression), 12288)) {
error(templateSpan.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String);
}
});
return stringType;
}
function getContextNode(node) {
- if (node.kind === 266 && !ts.isJsxSelfClosingElement(node.parent)) {
+ if (node.kind === 268 && !ts.isJsxSelfClosingElement(node.parent)) {
return node.parent.parent;
}
return node;
@@ -42318,7 +43000,7 @@ var ts;
}
function isTypeAssertion(node) {
node = ts.skipParentheses(node);
- return node.kind === 192 || node.kind === 210;
+ return node.kind === 194 || node.kind === 212;
}
function checkDeclarationInitializer(declaration) {
var initializer = ts.getEffectiveInitializer(declaration);
@@ -42327,7 +43009,7 @@ var ts;
ts.isDeclarationReadonly(declaration) ||
isTypeAssertion(initializer) ? type : getWidenedLiteralType(type);
if (ts.isInJSFile(declaration)) {
- if (widened.flags & 24576) {
+ if (widened.flags & 98304) {
reportImplicitAny(declaration, anyType);
return anyType;
}
@@ -42340,21 +43022,23 @@ var ts;
}
function isLiteralOfContextualType(candidateType, contextualType) {
if (contextualType) {
- if (contextualType.flags & 786432) {
+ if (contextualType.flags & 3145728) {
var types = contextualType.types;
return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); });
}
- if (contextualType.flags & 14745600) {
+ if (contextualType.flags & 58982400) {
var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType;
- return maybeTypeOfKind(constraint, 4) && maybeTypeOfKind(candidateType, 64) ||
- maybeTypeOfKind(constraint, 8) && maybeTypeOfKind(candidateType, 128) ||
- maybeTypeOfKind(constraint, 1024) && maybeTypeOfKind(candidateType, 2048) ||
+ return maybeTypeOfKind(constraint, 4) && maybeTypeOfKind(candidateType, 128) ||
+ maybeTypeOfKind(constraint, 8) && maybeTypeOfKind(candidateType, 256) ||
+ maybeTypeOfKind(constraint, 64) && maybeTypeOfKind(candidateType, 2048) ||
+ maybeTypeOfKind(constraint, 4096) && maybeTypeOfKind(candidateType, 8192) ||
isLiteralOfContextualType(candidateType, constraint);
}
- return !!(contextualType.flags & (64 | 1048576) && maybeTypeOfKind(candidateType, 64) ||
- contextualType.flags & 128 && maybeTypeOfKind(candidateType, 128) ||
+ return !!(contextualType.flags & (128 | 4194304) && maybeTypeOfKind(candidateType, 128) ||
contextualType.flags & 256 && maybeTypeOfKind(candidateType, 256) ||
- contextualType.flags & 2048 && maybeTypeOfKind(candidateType, 2048));
+ contextualType.flags & 2048 && maybeTypeOfKind(candidateType, 2048) ||
+ contextualType.flags & 512 && maybeTypeOfKind(candidateType, 512) ||
+ contextualType.flags & 8192 && maybeTypeOfKind(candidateType, 8192));
}
return false;
}
@@ -42367,14 +43051,14 @@ var ts;
getWidenedLiteralLikeTypeForContextualType(type, contextualType);
}
function checkPropertyAssignment(node, checkMode) {
- if (node.name.kind === 147) {
+ if (node.name.kind === 149) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, checkMode);
}
function checkObjectLiteralMethod(node, checkMode) {
checkGrammarMethod(node);
- if (node.name.kind === 147) {
+ if (node.name.kind === 149) {
checkComputedPropertyName(node.name);
}
var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -42397,14 +43081,14 @@ var ts;
}
function getTypeOfExpression(node, cache) {
var expr = ts.skipParentheses(node);
- if (expr.kind === 189 && expr.expression.kind !== 97 && !ts.isRequireCall(expr, true) && !isSymbolOrSymbolForCall(expr)) {
+ if (expr.kind === 191 && expr.expression.kind !== 98 && !ts.isRequireCall(expr, true) && !isSymbolOrSymbolForCall(expr)) {
var funcType = checkNonNullExpression(expr.expression);
var signature = getSingleCallSignature(funcType);
if (signature && !signature.typeParameters) {
return getReturnTypeOfSignature(signature);
}
}
- else if (expr.kind === 192 || expr.kind === 210) {
+ else if (expr.kind === 194 || expr.kind === 212) {
return getTypeFromTypeNode(expr.type);
}
return cache ? checkExpressionCached(node) : checkExpression(node);
@@ -42422,7 +43106,7 @@ var ts;
}
function checkExpression(node, checkMode, forceTuple) {
var type;
- if (node.kind === 146) {
+ if (node.kind === 148) {
type = checkQualifiedName(node);
}
else {
@@ -42430,10 +43114,10 @@ var ts;
type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode);
}
if (isConstEnumObjectType(type)) {
- var ok = (node.parent.kind === 187 && node.parent.expression === node) ||
- (node.parent.kind === 188 && node.parent.expression === node) ||
- ((node.kind === 71 || node.kind === 146) && isInRightSideOfImportOrExportAssignment(node) ||
- (node.parent.kind === 165 && node.parent.exprName === node));
+ var ok = (node.parent.kind === 189 && node.parent.expression === node) ||
+ (node.parent.kind === 190 && node.parent.expression === node) ||
+ ((node.kind === 72 || node.kind === 148) && isInRightSideOfImportOrExportAssignment(node) ||
+ (node.parent.kind === 167 && node.parent.exprName === node));
if (!ok) {
error(node, ts.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);
}
@@ -42449,93 +43133,96 @@ var ts;
}
function checkExpressionWorker(node, checkMode, forceTuple) {
switch (node.kind) {
- case 71:
+ case 72:
return checkIdentifier(node);
- case 99:
+ case 100:
return checkThisExpression(node);
- case 97:
+ case 98:
return checkSuperExpression(node);
- case 95:
+ case 96:
return nullWideningType;
- case 13:
- case 9:
+ case 14:
+ case 10:
return getFreshTypeOfLiteralType(getLiteralType(node.text));
case 8:
checkGrammarNumericLiteral(node);
return getFreshTypeOfLiteralType(getLiteralType(+node.text));
- case 101:
+ case 9:
+ checkGrammarBigIntLiteral(node);
+ return getFreshTypeOfLiteralType(getBigIntLiteralType(node));
+ case 102:
return trueType;
- case 86:
+ case 87:
return falseType;
- case 204:
+ case 206:
return checkTemplateExpression(node);
- case 12:
+ case 13:
return globalRegExpType;
- case 185:
- return checkArrayLiteral(node, checkMode, forceTuple);
- case 186:
- return checkObjectLiteral(node, checkMode);
case 187:
- return checkPropertyAccessExpression(node);
+ return checkArrayLiteral(node, checkMode, forceTuple);
case 188:
- return checkIndexedAccess(node);
+ return checkObjectLiteral(node, checkMode);
case 189:
- if (node.expression.kind === 91) {
+ return checkPropertyAccessExpression(node);
+ case 190:
+ return checkIndexedAccess(node);
+ case 191:
+ if (node.expression.kind === 92) {
return checkImportCallExpression(node);
}
- case 190:
- return checkCallExpression(node);
- case 191:
- return checkTaggedTemplateExpression(node);
- case 193:
- return checkParenthesizedExpression(node, checkMode);
- case 207:
- return checkClassExpression(node);
- case 194:
- case 195:
- return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
- case 197:
- return checkTypeOfExpression(node);
case 192:
- case 210:
- return checkAssertion(node);
- case 211:
- return checkNonNullAssertion(node);
- case 212:
- return checkMetaProperty(node);
+ return checkCallExpression(node);
+ case 193:
+ return checkTaggedTemplateExpression(node);
+ case 195:
+ return checkParenthesizedExpression(node, checkMode);
+ case 209:
+ return checkClassExpression(node);
case 196:
- return checkDeleteExpression(node);
- case 198:
- return checkVoidExpression(node);
+ case 197:
+ return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
case 199:
- return checkAwaitExpression(node);
- case 200:
- return checkPrefixUnaryExpression(node);
- case 201:
- return checkPostfixUnaryExpression(node);
- case 202:
- return checkBinaryExpression(node, checkMode);
- case 203:
- return checkConditionalExpression(node, checkMode);
- case 206:
- return checkSpreadExpression(node, checkMode);
- case 208:
- return undefinedWideningType;
- case 205:
- return checkYieldExpression(node);
+ return checkTypeOfExpression(node);
+ case 194:
+ case 212:
+ return checkAssertion(node);
case 213:
+ return checkNonNullAssertion(node);
+ case 214:
+ return checkMetaProperty(node);
+ case 198:
+ return checkDeleteExpression(node);
+ case 200:
+ return checkVoidExpression(node);
+ case 201:
+ return checkAwaitExpression(node);
+ case 202:
+ return checkPrefixUnaryExpression(node);
+ case 203:
+ return checkPostfixUnaryExpression(node);
+ case 204:
+ return checkBinaryExpression(node, checkMode);
+ case 205:
+ return checkConditionalExpression(node, checkMode);
+ case 208:
+ return checkSpreadExpression(node, checkMode);
+ case 210:
+ return undefinedWideningType;
+ case 207:
+ return checkYieldExpression(node);
+ case 215:
return node.type;
- case 268:
+ case 270:
return checkJsxExpression(node, checkMode);
- case 258:
- return checkJsxElement(node, checkMode);
- case 259:
- return checkJsxSelfClosingElement(node, checkMode);
- case 262:
- return checkJsxFragment(node, checkMode);
- case 266:
- return checkJsxAttributes(node, checkMode);
case 260:
+ return checkJsxElement(node, checkMode);
+ case 261:
+ return checkJsxSelfClosingElement(node, checkMode);
+ case 264:
+ return checkJsxFragment(node);
+ case 268:
+ return checkJsxAttributes(node, checkMode);
+ case 262:
ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
return errorType;
@@ -42567,7 +43254,7 @@ var ts;
checkVariableLikeDeclaration(node);
var func = ts.getContainingFunction(node);
if (ts.hasModifier(node, 92)) {
- if (!(func.kind === 155 && ts.nodeIsPresent(func.body))) {
+ if (!(func.kind === 157 && ts.nodeIsPresent(func.body))) {
error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
}
@@ -42578,10 +43265,10 @@ var ts;
if (func.parameters.indexOf(node) !== 0) {
error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText);
}
- if (func.kind === 155 || func.kind === 159 || func.kind === 164) {
+ if (func.kind === 157 || func.kind === 161 || func.kind === 166) {
error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
- if (func.kind === 195) {
+ if (func.kind === 197) {
error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
}
}
@@ -42632,13 +43319,13 @@ var ts;
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
- case 195:
- case 158:
- case 237:
- case 194:
- case 163:
- case 154:
- case 153:
+ case 197:
+ case 160:
+ case 239:
+ case 196:
+ case 165:
+ case 156:
+ case 155:
var parent = node.parent;
if (node === parent.type) {
return parent;
@@ -42652,11 +43339,11 @@ var ts;
continue;
}
var name = element.name;
- if (name.kind === 71 && name.escapedText === predicateVariableName) {
+ if (name.kind === 72 && name.escapedText === predicateVariableName) {
error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName);
return true;
}
- else if (name.kind === 183 || name.kind === 182) {
+ else if (name.kind === 185 || name.kind === 184) {
if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) {
return true;
}
@@ -42664,12 +43351,12 @@ var ts;
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 160) {
+ if (node.kind === 162) {
checkGrammarIndexSignature(node);
}
- else if (node.kind === 163 || node.kind === 237 || node.kind === 164 ||
- node.kind === 158 || node.kind === 155 ||
- node.kind === 159) {
+ else if (node.kind === 165 || node.kind === 239 || node.kind === 166 ||
+ node.kind === 160 || node.kind === 157 ||
+ node.kind === 161) {
checkGrammarFunctionLikeDeclaration(node);
}
var functionFlags = ts.getFunctionFlags(node);
@@ -42694,10 +43381,10 @@ var ts;
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
if (noImplicitAny && !returnTypeNode) {
switch (node.kind) {
- case 159:
+ case 161:
error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 158:
+ case 160:
error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -42721,7 +43408,7 @@ var ts;
checkAsyncFunctionReturnType(node, returnTypeNode);
}
}
- if (node.kind !== 160 && node.kind !== 287) {
+ if (node.kind !== 162 && node.kind !== 289) {
registerForUnusedIdentifiersCheck(node);
}
}
@@ -42731,7 +43418,7 @@ var ts;
var staticNames = ts.createUnderscoreEscapedMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 155) {
+ if (member.kind === 157) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var param = _c[_b];
if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) {
@@ -42746,16 +43433,16 @@ var ts;
var memberName = name && ts.getPropertyNameForPropertyNameNode(name);
if (name && memberName) {
switch (member.kind) {
- case 156:
+ case 158:
addName(names, name, memberName, 1);
break;
- case 157:
+ case 159:
addName(names, name, memberName, 2);
break;
- case 152:
+ case 154:
addName(names, name, memberName, 3);
break;
- case 154:
+ case 156:
addName(names, name, memberName, 4);
break;
}
@@ -42807,15 +43494,15 @@ var ts;
var names = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 151) {
+ if (member.kind === 153) {
var memberName = void 0;
var name = member.name;
switch (name.kind) {
- case 9:
+ case 10:
case 8:
memberName = name.text;
break;
- case 71:
+ case 72:
memberName = ts.idText(name);
break;
default:
@@ -42832,7 +43519,7 @@ var ts;
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 239) {
+ if (node.kind === 241) {
var nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -42847,7 +43534,7 @@ var ts;
var declaration = decl;
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
switch (declaration.parameters[0].type.kind) {
- case 137:
+ case 138:
if (!seenStringIndexer) {
seenStringIndexer = true;
}
@@ -42855,7 +43542,7 @@ var ts;
error(declaration, ts.Diagnostics.Duplicate_string_index_signature);
}
break;
- case 134:
+ case 135:
if (!seenNumericIndexer) {
seenNumericIndexer = true;
}
@@ -42877,7 +43564,7 @@ var ts;
if (!checkGrammarMethod(node))
checkGrammarComputedPropertyName(node.name);
checkFunctionOrMethodDeclaration(node);
- if (ts.hasModifier(node, 128) && node.kind === 154 && node.body) {
+ if (ts.hasModifier(node, 128) && node.kind === 156 && node.body) {
error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
}
}
@@ -42898,7 +43585,7 @@ var ts;
return;
}
function isInstancePropertyWithInitializer(n) {
- return n.kind === 152 &&
+ return n.kind === 154 &&
!ts.hasModifier(n, 32) &&
!!n.initializer;
}
@@ -42918,7 +43605,7 @@ var ts;
var superCallStatement = void 0;
for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) {
var statement = statements_2[_i];
- if (statement.kind === 219 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 221 && ts.isSuperCall(statement.expression)) {
superCallStatement = statement;
break;
}
@@ -42942,18 +43629,18 @@ var ts;
checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 156) {
+ if (node.kind === 158) {
if (!(node.flags & 4194304) && ts.nodeIsPresent(node.body) && (node.flags & 128)) {
if (!(node.flags & 256)) {
error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 147) {
+ if (node.name.kind === 149) {
checkComputedPropertyName(node.name);
}
if (!hasNonBindableDynamicName(node)) {
- var otherKind = node.kind === 156 ? 157 : 156;
+ var otherKind = node.kind === 158 ? 159 : 158;
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
if (otherAccessor) {
var nodeFlags = ts.getModifierFlags(node);
@@ -42969,7 +43656,7 @@ var ts;
}
}
var returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 156) {
+ if (node.kind === 158) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
@@ -43017,7 +43704,7 @@ var ts;
}
function checkTypeReferenceNode(node) {
checkGrammarTypeArguments(node, node.typeArguments);
- if (node.kind === 162 && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) {
+ if (node.kind === 164 && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) {
grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
}
var type = getTypeFromTypeReference(node);
@@ -43064,7 +43751,7 @@ var ts;
var seenOptionalElement = false;
for (var i = 0; i < elementTypes.length; i++) {
var e = elementTypes[i];
- if (e.kind === 170) {
+ if (e.kind === 172) {
if (i !== elementTypes.length - 1) {
grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type);
break;
@@ -43073,7 +43760,7 @@ var ts;
error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type);
}
}
- else if (e.kind === 169) {
+ else if (e.kind === 171) {
seenOptionalElement = true;
}
else if (seenOptionalElement) {
@@ -43088,19 +43775,19 @@ var ts;
ts.forEach(node.types, checkSourceElement);
}
function checkIndexedAccessIndexType(type, accessNode) {
- if (!(type.flags & 2097152)) {
+ if (!(type.flags & 8388608)) {
return type;
}
var objectType = type.objectType;
var indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) {
- if (accessNode.kind === 188 && ts.isAssignmentTarget(accessNode) &&
+ if (accessNode.kind === 190 && ts.isAssignmentTarget(accessNode) &&
ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) {
error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return type;
}
- if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 168)) {
+ if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 296)) {
return type;
}
error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType));
@@ -43132,7 +43819,7 @@ var ts;
ts.forEachChild(node, checkSourceElement);
}
function checkInferType(node) {
- if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 173 && n.parent.extendsType === n; })) {
+ if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 175 && n.parent.extendsType === n; })) {
grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
}
checkSourceElement(node.typeParameter);
@@ -43147,9 +43834,9 @@ var ts;
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
var flags = ts.getCombinedModifierFlags(n);
- if (n.parent.kind !== 239 &&
- n.parent.kind !== 238 &&
- n.parent.kind !== 207 &&
+ if (n.parent.kind !== 241 &&
+ n.parent.kind !== 240 &&
+ n.parent.kind !== 209 &&
n.flags & 4194304) {
if (!(flags & 2) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) {
flags |= 1;
@@ -43229,7 +43916,7 @@ var ts;
if (node.name && subsequentName &&
(ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) ||
!ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) {
- var reportError = (node.kind === 154 || node.kind === 153) &&
+ var reportError = (node.kind === 156 || node.kind === 155) &&
ts.hasModifier(node, 32) !== ts.hasModifier(subsequentNode, 32);
if (reportError) {
var diagnostic = ts.hasModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
@@ -43262,11 +43949,11 @@ var ts;
var current = declarations_4[_i];
var node = current;
var inAmbientContext = node.flags & 4194304;
- var inAmbientContextOrInterface = node.parent.kind === 239 || node.parent.kind === 166 || inAmbientContext;
+ var inAmbientContextOrInterface = node.parent.kind === 241 || node.parent.kind === 168 || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = undefined;
}
- if (node.kind === 237 || node.kind === 154 || node.kind === 153 || node.kind === 155) {
+ if (node.kind === 239 || node.kind === 156 || node.kind === 155 || node.kind === 157) {
var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
allNodeFlags &= currentNodeFlags;
@@ -43317,8 +44004,8 @@ var ts;
if (bodyDeclaration) {
var signatures = getSignaturesOfSymbol(symbol);
var bodySignature = getSignatureFromDeclaration(bodyDeclaration);
- for (var _a = 0, signatures_7 = signatures; _a < signatures_7.length; _a++) {
- var signature = signatures_7[_a];
+ for (var _a = 0, signatures_6 = signatures; _a < signatures_6.length; _a++) {
+ var signature = signatures_6[_a];
if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation);
break;
@@ -43379,36 +44066,36 @@ var ts;
function getDeclarationSpaces(decl) {
var d = decl;
switch (d.kind) {
- case 239:
- case 240:
- case 302:
- case 295:
- return 2;
+ case 241:
case 242:
+ case 304:
+ case 297:
+ return 2;
+ case 244:
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0
? 4 | 1
: 4;
- case 238:
- case 241:
+ case 240:
+ case 243:
return 2 | 1;
- case 277:
+ case 279:
return 2 | 1 | 4;
- case 252:
+ case 254:
if (!ts.isEntityNameExpression(d.expression)) {
return 1;
}
d = d.expression;
- case 246:
- case 249:
case 248:
+ case 251:
+ case 250:
var result_4 = 0;
var target = resolveAlias(getSymbolOfNode(d));
ts.forEach(target.declarations, function (d) { result_4 |= getDeclarationSpaces(d); });
return result_4;
- case 235:
- case 184:
case 237:
- case 251:
+ case 186:
+ case 239:
+ case 253:
return 1;
default:
return ts.Debug.fail(ts.Debug.showSyntaxKind(d));
@@ -43441,7 +44128,7 @@ var ts;
}
return undefined;
}
- var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 524288);
+ var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 2097152);
if (isTypeAny(onfulfilledParameterType)) {
return undefined;
}
@@ -43465,7 +44152,7 @@ var ts;
if (isTypeAny(type)) {
return typeAsAwaitable.awaitedTypeOfType = type;
}
- if (type.flags & 262144) {
+ if (type.flags & 1048576) {
var types = void 0;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var constituentType = _a[_i];
@@ -43528,7 +44215,7 @@ var ts;
var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 67220415, true);
var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;
if (promiseConstructorType === errorType) {
- if (promiseConstructorName.kind === 71 && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) {
+ if (promiseConstructorName.kind === 72 && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) {
error(returnTypeNode, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
}
else {
@@ -43563,22 +44250,22 @@ var ts;
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
var errorInfo;
switch (node.parent.kind) {
- case 238:
+ case 240:
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 149:
+ case 151:
expectedReturnType = voidType;
errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
break;
- case 152:
+ case 154:
expectedReturnType = voidType;
errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
- case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -43595,7 +44282,7 @@ var ts;
if (!typeName)
return;
var rootName = getFirstIdentifier(typeName);
- var meaning = (typeName.kind === 71 ? 67897832 : 1920) | 2097152;
+ var meaning = (typeName.kind === 72 ? 67897832 : 1920) | 2097152;
var rootSymbol = resolveName(rootName, rootName.escapedText, meaning, undefined, undefined, true);
if (rootSymbol
&& rootSymbol.flags & 2097152
@@ -43613,43 +44300,48 @@ var ts;
function getEntityNameForDecoratorMetadata(node) {
if (node) {
switch (node.kind) {
- case 172:
- case 171:
- var commonEntityName = void 0;
- for (var _i = 0, _a = node.types; _i < _a.length; _i++) {
- var typeNode = _a[_i];
- while (typeNode.kind === 175) {
- typeNode = typeNode.type;
- }
- if (typeNode.kind === 131) {
- continue;
- }
- if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 140)) {
- continue;
- }
- var individualEntityName = getEntityNameForDecoratorMetadata(typeNode);
- if (!individualEntityName) {
- return undefined;
- }
- if (commonEntityName) {
- if (!ts.isIdentifier(commonEntityName) ||
- !ts.isIdentifier(individualEntityName) ||
- commonEntityName.escapedText !== individualEntityName.escapedText) {
- return undefined;
- }
- }
- else {
- commonEntityName = individualEntityName;
- }
- }
- return commonEntityName;
+ case 174:
+ case 173:
+ return getEntityNameForDecoratorMetadataFromTypeList(node.types);
case 175:
+ return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]);
+ case 177:
return getEntityNameForDecoratorMetadata(node.type);
- case 162:
+ case 164:
return node.typeName;
}
}
}
+ function getEntityNameForDecoratorMetadataFromTypeList(types) {
+ var commonEntityName;
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
+ var typeNode = types_16[_i];
+ while (typeNode.kind === 177) {
+ typeNode = typeNode.type;
+ }
+ if (typeNode.kind === 132) {
+ continue;
+ }
+ if (!strictNullChecks && (typeNode.kind === 96 || typeNode.kind === 141)) {
+ continue;
+ }
+ var individualEntityName = getEntityNameForDecoratorMetadata(typeNode);
+ if (!individualEntityName) {
+ return undefined;
+ }
+ if (commonEntityName) {
+ if (!ts.isIdentifier(commonEntityName) ||
+ !ts.isIdentifier(individualEntityName) ||
+ commonEntityName.escapedText !== individualEntityName.escapedText) {
+ return undefined;
+ }
+ }
+ else {
+ commonEntityName = individualEntityName;
+ }
+ }
+ return commonEntityName;
+ }
function getParameterTypeNodeForDecoratorCheck(node) {
var typeNode = ts.getEffectiveTypeAnnotationNode(node);
return ts.isRestParameter(node) ? ts.getRestParameterElementType(typeNode) : typeNode;
@@ -43666,13 +44358,13 @@ var ts;
}
var firstDecorator = node.decorators[0];
checkExternalEmitHelpers(firstDecorator, 8);
- if (node.kind === 149) {
+ if (node.kind === 151) {
checkExternalEmitHelpers(firstDecorator, 32);
}
if (compilerOptions.emitDecoratorMetadata) {
checkExternalEmitHelpers(firstDecorator, 16);
switch (node.kind) {
- case 238:
+ case 240:
var constructor = ts.getFirstConstructorWithBody(node);
if (constructor) {
for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) {
@@ -43681,23 +44373,23 @@ var ts;
}
}
break;
- case 156:
- case 157:
- var otherKind = node.kind === 156 ? 157 : 156;
+ case 158:
+ case 159:
+ var otherKind = node.kind === 158 ? 159 : 158;
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
break;
- case 154:
+ case 156:
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
}
markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node));
break;
- case 152:
+ case 154:
markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node));
break;
- case 149:
+ case 151:
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));
var containingSignature = node.parent;
for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) {
@@ -43746,16 +44438,22 @@ var ts;
return;
}
if (!containsArgumentsReference(decl)) {
- error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 146 ? node.name.right : node.name));
+ error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 148 ? node.name.right : node.name));
}
else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node &&
node.typeExpression && node.typeExpression.type &&
!isArrayType(getTypeFromTypeNode(node.typeExpression.type))) {
- error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 146 ? node.name.right : node.name));
+ error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 148 ? node.name.right : node.name));
}
}
}
}
+ function checkJSDocFunctionType(node) {
+ if (produceDiagnostics && !node.type && !ts.isJSDocConstructSignature(node)) {
+ reportImplicitAny(node, anyType);
+ }
+ checkSignatureDeclaration(node);
+ }
function checkJSDocAugmentsTag(node) {
var classLike = ts.getJSDocHost(node);
if (!ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {
@@ -43778,9 +44476,9 @@ var ts;
}
function getIdentifierFromEntityNameExpression(node) {
switch (node.kind) {
- case 71:
+ case 72:
return node;
- case 187:
+ case 189:
return node.name;
default:
return undefined;
@@ -43790,7 +44488,7 @@ var ts;
checkDecorators(node);
checkSignatureDeclaration(node);
var functionFlags = ts.getFunctionFlags(node);
- if (node.name && node.name.kind === 147) {
+ if (node.name && node.name.kind === 149) {
checkComputedPropertyName(node.name);
}
if (!hasNonBindableDynamicName(node)) {
@@ -43806,7 +44504,7 @@ var ts;
}
}
}
- var body = node.kind === 153 ? undefined : node.body;
+ var body = node.kind === 155 ? undefined : node.body;
checkSourceElement(body);
if ((functionFlags & 1) === 0) {
var returnOrPromisedType = getReturnOrPromisedType(node, functionFlags);
@@ -43842,42 +44540,42 @@ var ts;
for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) {
var node = potentiallyUnusedIdentifiers_1[_i];
switch (node.kind) {
- case 238:
- case 207:
+ case 240:
+ case 209:
checkUnusedClassMembers(node, addDiagnostic);
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 239:
+ case 241:
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 277:
- case 242:
- case 216:
+ case 279:
case 244:
- case 223:
- case 224:
+ case 218:
+ case 246:
case 225:
+ case 226:
+ case 227:
checkUnusedLocalsAndParameters(node, addDiagnostic);
break;
- case 155:
- case 194:
- case 237:
- case 195:
- case 154:
- case 156:
case 157:
+ case 196:
+ case 239:
+ case 197:
+ case 156:
+ case 158:
+ case 159:
if (node.body) {
checkUnusedLocalsAndParameters(node, addDiagnostic);
}
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 153:
- case 158:
- case 159:
- case 163:
- case 164:
- case 240:
- case 174:
+ case 155:
+ case 160:
+ case 161:
+ case 165:
+ case 166:
+ case 242:
+ case 176:
checkUnusedTypeParameters(node, addDiagnostic);
break;
default:
@@ -43898,11 +44596,11 @@ var ts;
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
switch (member.kind) {
- case 154:
- case 152:
case 156:
- case 157:
- if (member.kind === 157 && member.symbol.flags & 32768) {
+ case 154:
+ case 158:
+ case 159:
+ if (member.kind === 159 && member.symbol.flags & 32768) {
break;
}
var symbol = getSymbolOfNode(member);
@@ -43910,7 +44608,7 @@ var ts;
addDiagnostic(member, 0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
}
break;
- case 155:
+ case 157:
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) {
@@ -43918,8 +44616,8 @@ var ts;
}
}
break;
- case 160:
- case 215:
+ case 162:
+ case 217:
break;
default:
ts.Debug.fail();
@@ -43928,9 +44626,9 @@ var ts;
}
}
function checkUnusedTypeParameters(node, addDiagnostic) {
- if (node.flags & 4194304 || node.kind !== 174 && ts.last(getSymbolOfNode(node).declarations) !== node)
+ if (node.flags & 4194304 || node.kind !== 176 && ts.last(getSymbolOfNode(node).declarations) !== node)
return;
- if (node.kind === 174) {
+ if (node.kind === 176) {
var typeParameter = node.typeParameter;
if (isTypeParameterUnused(typeParameter)) {
addDiagnostic(node, 1, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name)));
@@ -43945,7 +44643,7 @@ var ts;
continue;
var name = ts.idText(typeParameter.name);
var parent = typeParameter.parent;
- if (parent.kind !== 174 && parent.typeParameters.every(isTypeParameterUnused)) {
+ if (parent.kind !== 176 && parent.typeParameters.every(isTypeParameterUnused)) {
if (seenParentsWithEveryUnused.tryAdd(parent)) {
var range = ts.isJSDocTemplateTag(parent)
? ts.rangeOfNode(parent)
@@ -44025,7 +44723,7 @@ var ts;
var importDecl = importClause.parent;
var nDeclarations = (importClause.name ? 1 : 0) +
(importClause.namedBindings ?
- (importClause.namedBindings.kind === 249 ? 1 : importClause.namedBindings.elements.length)
+ (importClause.namedBindings.kind === 251 ? 1 : importClause.namedBindings.elements.length)
: 0);
if (nDeclarations === unuseds.length) {
addDiagnostic(importDecl, 0, unuseds.length === 1
@@ -44043,7 +44741,7 @@ var ts;
var bindingPattern = _a[0], bindingElements = _a[1];
var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 : 0;
if (bindingPattern.elements.length === bindingElements.length) {
- if (bindingElements.length === 1 && bindingPattern.parent.kind === 235 && bindingPattern.parent.parent.kind === 236) {
+ if (bindingElements.length === 1 && bindingPattern.parent.kind === 237 && bindingPattern.parent.parent.kind === 238) {
addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
}
else {
@@ -44064,7 +44762,7 @@ var ts;
if (declarationList.declarations.length === declarations.length) {
addDiagnostic(declarationList, 0, declarations.length === 1
? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name))
- : ts.createDiagnosticForNode(declarationList.parent.kind === 217 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
+ : ts.createDiagnosticForNode(declarationList.parent.kind === 219 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
}
else {
for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
@@ -44076,23 +44774,23 @@ var ts;
}
function bindingNameText(name) {
switch (name.kind) {
- case 71:
+ case 72:
return ts.idText(name);
- case 183:
- case 182:
+ case 185:
+ case 184:
return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name);
default:
return ts.Debug.assertNever(name);
}
}
function isImportedDeclaration(node) {
- return node.kind === 248 || node.kind === 251 || node.kind === 249;
+ return node.kind === 250 || node.kind === 253 || node.kind === 251;
}
function importClauseFromImported(decl) {
- return decl.kind === 248 ? decl : decl.kind === 249 ? decl.parent : decl.parent.parent;
+ return decl.kind === 250 ? decl : decl.kind === 251 ? decl.parent : decl.parent.parent;
}
function checkBlock(node) {
- if (node.kind === 216) {
+ if (node.kind === 218) {
checkGrammarStatementInAmbientContext(node);
}
if (ts.isFunctionOrModuleBlock(node)) {
@@ -44121,19 +44819,19 @@ var ts;
if (!(identifier && identifier.escapedText === name)) {
return false;
}
- if (node.kind === 152 ||
- node.kind === 151 ||
- node.kind === 154 ||
+ if (node.kind === 154 ||
node.kind === 153 ||
node.kind === 156 ||
- node.kind === 157) {
+ node.kind === 155 ||
+ node.kind === 158 ||
+ node.kind === 159) {
return false;
}
if (node.flags & 4194304) {
return false;
}
var root = ts.getRootDeclaration(node);
- if (root.kind === 149 && ts.nodeIsMissing(root.parent.body)) {
+ if (root.kind === 151 && ts.nodeIsMissing(root.parent.body)) {
return false;
}
return true;
@@ -44141,7 +44839,7 @@ var ts;
function checkIfThisIsCapturedInEnclosingScope(node) {
ts.findAncestor(node, function (current) {
if (getNodeCheckFlags(current) & 4) {
- var isDeclaration_1 = node.kind !== 71;
+ var isDeclaration_1 = node.kind !== 72;
if (isDeclaration_1) {
error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);
}
@@ -44156,7 +44854,7 @@ var ts;
function checkIfNewTargetIsCapturedInEnclosingScope(node) {
ts.findAncestor(node, function (current) {
if (getNodeCheckFlags(current) & 8) {
- var isDeclaration_2 = node.kind !== 71;
+ var isDeclaration_2 = node.kind !== 72;
if (isDeclaration_2) {
error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference);
}
@@ -44179,7 +44877,7 @@ var ts;
return;
}
var parent = getDeclarationContainer(node);
- if (parent.kind === 277 && ts.isExternalOrCommonJsModule(parent)) {
+ if (parent.kind === 279 && ts.isExternalOrCommonJsModule(parent)) {
error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name));
}
}
@@ -44191,7 +44889,7 @@ var ts;
return;
}
var parent = getDeclarationContainer(node);
- if (parent.kind === 277 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) {
+ if (parent.kind === 279 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) {
error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name));
}
}
@@ -44199,7 +44897,7 @@ var ts;
if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) {
return;
}
- if (node.kind === 235 && !node.initializer) {
+ if (node.kind === 237 && !node.initializer) {
return;
}
var symbol = getSymbolOfNode(node);
@@ -44211,15 +44909,15 @@ var ts;
localDeclarationSymbol !== symbol &&
localDeclarationSymbol.flags & 2) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) {
- var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 236);
- var container = varDeclList.parent.kind === 217 && varDeclList.parent.parent
+ var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 238);
+ var container = varDeclList.parent.kind === 219 && varDeclList.parent.parent
? varDeclList.parent.parent
: undefined;
var namesShareScope = container &&
- (container.kind === 216 && ts.isFunctionLike(container.parent) ||
- container.kind === 243 ||
- container.kind === 242 ||
- container.kind === 277);
+ (container.kind === 218 && ts.isFunctionLike(container.parent) ||
+ container.kind === 245 ||
+ container.kind === 244 ||
+ container.kind === 279);
if (!namesShareScope) {
var name = symbolToString(localDeclarationSymbol);
error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name);
@@ -44229,7 +44927,7 @@ var ts;
}
}
function checkParameterInitializer(node) {
- if (ts.getRootDeclaration(node).kind !== 149) {
+ if (ts.getRootDeclaration(node).kind !== 151) {
return;
}
var func = ts.getContainingFunction(node);
@@ -44238,10 +44936,10 @@ var ts;
if (ts.isTypeNode(n) || ts.isDeclarationName(n)) {
return;
}
- if (n.kind === 187) {
+ if (n.kind === 189) {
return visit(n.expression);
}
- else if (n.kind === 71) {
+ else if (n.kind === 72) {
var symbol = resolveName(n, n.escapedText, 67220415 | 2097152, undefined, undefined, false);
if (!symbol || symbol === unknownSymbol || !symbol.valueDeclaration) {
return;
@@ -44252,8 +44950,8 @@ var ts;
}
var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
if (enclosingContainer === func) {
- if (symbol.valueDeclaration.kind === 149 ||
- symbol.valueDeclaration.kind === 184) {
+ if (symbol.valueDeclaration.kind === 151 ||
+ symbol.valueDeclaration.kind === 186) {
if (symbol.valueDeclaration.pos < node.pos) {
return;
}
@@ -44262,7 +44960,7 @@ var ts;
return "quit";
}
return ts.isFunctionLike(current.parent) ||
- (current.parent.kind === 152 &&
+ (current.parent.kind === 154 &&
!(ts.hasModifier(current.parent, 32)) &&
ts.isClassLike(current.parent.parent));
})) {
@@ -44288,17 +44986,17 @@ var ts;
if (!node.name) {
return;
}
- if (node.name.kind === 147) {
+ if (node.name.kind === 149) {
checkComputedPropertyName(node.name);
if (node.initializer) {
checkExpressionCached(node.initializer);
}
}
- if (node.kind === 184) {
- if (node.parent.kind === 182 && languageVersion < 6) {
+ if (node.kind === 186) {
+ if (node.parent.kind === 184 && languageVersion < 6) {
checkExternalEmitHelpers(node, 4);
}
- if (node.propertyName && node.propertyName.kind === 147) {
+ if (node.propertyName && node.propertyName.kind === 149) {
checkComputedPropertyName(node.propertyName);
}
var parent = node.parent.parent;
@@ -44310,23 +45008,23 @@ var ts;
var property = getPropertyOfType(parentType, nameText);
markPropertyAsReferenced(property, undefined, false);
if (parent.initializer && property) {
- checkPropertyAccessibility(parent, parent.initializer.kind === 97, parentType, property);
+ checkPropertyAccessibility(parent, parent.initializer.kind === 98, parentType, property);
}
}
}
}
if (ts.isBindingPattern(node.name)) {
- if (node.name.kind === 183 && languageVersion < 2 && compilerOptions.downlevelIteration) {
+ if (node.name.kind === 185 && languageVersion < 2 && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512);
}
ts.forEach(node.name.elements, checkSourceElement);
}
- if (node.initializer && ts.getRootDeclaration(node).kind === 149 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
+ if (node.initializer && ts.getRootDeclaration(node).kind === 151 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
return;
}
if (ts.isBindingPattern(node.name)) {
- if (node.initializer && node.parent.parent.kind !== 224) {
+ if (node.initializer && node.parent.parent.kind !== 226) {
var initializerType = checkExpressionCached(node.initializer);
if (strictNullChecks && node.name.elements.length === 0) {
checkNonNullType(initializerType, node);
@@ -44347,11 +45045,16 @@ var ts;
ts.isObjectLiteralExpression(initializer) &&
(initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) &&
ts.hasEntries(symbol.exports);
- if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 224) {
+ if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 226) {
checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, undefined);
checkParameterInitializer(node);
}
}
+ if (symbol.declarations.length > 1) {
+ if (ts.some(symbol.declarations, function (d) { return d !== node && ts.isVariableLike(d) && !areDeclarationFlagsIdentical(d, node); })) {
+ error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
+ }
+ }
}
else {
var declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));
@@ -44364,13 +45067,12 @@ var ts;
checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(node.initializer), declarationType, node, node.initializer, undefined);
}
if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
- error(ts.getNameOfDeclaration(symbol.valueDeclaration), ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
}
}
- if (node.kind !== 152 && node.kind !== 151) {
+ if (node.kind !== 154 && node.kind !== 153) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 235 || node.kind === 184) {
+ if (node.kind === 237 || node.kind === 186) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
@@ -44379,14 +45081,14 @@ var ts;
}
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) {
var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration);
- var message = nextDeclaration.kind === 152 || nextDeclaration.kind === 151
+ var message = nextDeclaration.kind === 154 || nextDeclaration.kind === 153
? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2
: ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;
error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType));
}
function areDeclarationFlagsIdentical(left, right) {
- if ((left.kind === 149 && right.kind === 235) ||
- (left.kind === 235 && right.kind === 149)) {
+ if ((left.kind === 151 && right.kind === 237) ||
+ (left.kind === 237 && right.kind === 151)) {
return true;
}
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
@@ -44421,7 +45123,7 @@ var ts;
checkGrammarStatementInAmbientContext(node);
checkTruthinessExpression(node.expression);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 218) {
+ if (node.thenStatement.kind === 220) {
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -44438,19 +45140,19 @@ var ts;
}
function checkTruthinessExpression(node, checkMode) {
var type = checkExpression(node, checkMode);
- if (type.flags & 4096) {
+ if (type.flags & 16384) {
error(node, ts.Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness);
}
return type;
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 236) {
+ if (node.initializer && node.initializer.kind === 238) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 236) {
+ if (node.initializer.kind === 238) {
ts.forEach(node.initializer.declarations, checkVariableDeclaration);
}
else {
@@ -44477,13 +45179,13 @@ var ts;
else if (compilerOptions.downlevelIteration && languageVersion < 2) {
checkExternalEmitHelpers(node, 256);
}
- if (node.initializer.kind === 236) {
+ if (node.initializer.kind === 238) {
checkForInOrForOfVariableDeclaration(node);
}
else {
var varExpr = node.initializer;
var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier);
- if (varExpr.kind === 185 || varExpr.kind === 186) {
+ if (varExpr.kind === 187 || varExpr.kind === 188) {
checkDestructuringAssignment(varExpr, iteratedType || errorType);
}
else {
@@ -44501,8 +45203,8 @@ var ts;
}
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
- var rightType = checkNonNullExpression(node.expression);
- if (node.initializer.kind === 236) {
+ var rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression));
+ if (node.initializer.kind === 238) {
var variable = node.initializer.declarations[0];
if (variable && ts.isBindingPattern(variable.name)) {
error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
@@ -44512,7 +45214,7 @@ var ts;
else {
var varExpr = node.initializer;
var leftType = checkExpression(varExpr);
- if (varExpr.kind === 185 || varExpr.kind === 186) {
+ if (varExpr.kind === 187 || varExpr.kind === 188) {
error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
}
else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {
@@ -44522,7 +45224,7 @@ var ts;
checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access);
}
}
- if (rightType === neverType || !isTypeAssignableToKind(rightType, 16777216 | 14745600)) {
+ if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 | 58982400)) {
error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType));
}
checkSourceElement(node.statement);
@@ -44564,14 +45266,14 @@ var ts;
var reportedError = false;
var hasStringConstituent = false;
if (allowStringInput) {
- if (arrayType.flags & 262144) {
+ if (arrayType.flags & 1048576) {
var arrayTypes = inputType.types;
- var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 68); });
+ var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 132); });
if (filteredTypes !== arrayTypes) {
arrayType = getUnionType(filteredTypes, 2);
}
}
- else if (arrayType.flags & 68) {
+ else if (arrayType.flags & 132) {
arrayType = neverType;
}
hasStringConstituent = arrayType !== inputType;
@@ -44582,7 +45284,7 @@ var ts;
reportedError = true;
}
}
- if (arrayType.flags & 32768) {
+ if (arrayType.flags & 131072) {
return stringType;
}
}
@@ -44607,7 +45309,7 @@ var ts;
}
var arrayElementType = getIndexTypeOfType(arrayType, 1);
if (hasStringConstituent && arrayElementType) {
- if (arrayElementType.flags & 68) {
+ if (arrayElementType.flags & 132) {
return stringType;
}
return getUnionType([arrayElementType, stringType], 2);
@@ -44740,7 +45442,7 @@ var ts;
var unwrappedReturnType = (ts.getFunctionFlags(func) & 3) === 2
? getPromisedTypeOfPromise(returnType)
: returnType;
- return !!unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 4096 | 3);
+ return !!unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 16384 | 3);
}
function checkReturnStatement(node) {
if (checkGrammarStatementInAmbientContext(node)) {
@@ -44755,17 +45457,17 @@ var ts;
var returnType = getReturnTypeOfSignature(signature);
var functionFlags = ts.getFunctionFlags(func);
var isGenerator = functionFlags & 1;
- if (strictNullChecks || node.expression || returnType.flags & 32768) {
+ if (strictNullChecks || node.expression || returnType.flags & 131072) {
var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
if (isGenerator) {
return;
}
- else if (func.kind === 157) {
+ else if (func.kind === 159) {
if (node.expression) {
error(node, ts.Diagnostics.Setters_cannot_return_a_value);
}
}
- else if (func.kind === 155) {
+ else if (func.kind === 157) {
if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) {
error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -44783,7 +45485,7 @@ var ts;
}
}
}
- else if (func.kind !== 155 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) {
+ else if (func.kind !== 157 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) {
error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -44808,7 +45510,7 @@ var ts;
var expressionType = checkExpression(node.expression);
var expressionIsLiteral = isLiteralType(expressionType);
ts.forEach(node.caseBlock.clauses, function (clause) {
- if (clause.kind === 270 && !hasDuplicateDefaultClause) {
+ if (clause.kind === 272 && !hasDuplicateDefaultClause) {
if (firstDefaultClause === undefined) {
firstDefaultClause = clause;
}
@@ -44820,7 +45522,7 @@ var ts;
hasDuplicateDefaultClause = true;
}
}
- if (produceDiagnostics && clause.kind === 269) {
+ if (produceDiagnostics && clause.kind === 271) {
var caseType = checkExpression(clause.expression);
var caseIsLiteral = isLiteralType(caseType);
var comparedExpressionType = expressionType;
@@ -44844,7 +45546,7 @@ var ts;
if (ts.isFunctionLike(current)) {
return "quit";
}
- if (current.kind === 231 && current.label.escapedText === node.label.escapedText) {
+ if (current.kind === 233 && current.label.escapedText === node.label.escapedText) {
grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label));
return true;
}
@@ -44939,8 +45641,8 @@ var ts;
}
var errorNode;
if (propDeclaration && name &&
- (propDeclaration.kind === 202 ||
- name.kind === 147 ||
+ (propDeclaration.kind === 204 ||
+ name.kind === 149 ||
prop.parent === containingType.symbol)) {
errorNode = propDeclaration;
}
@@ -44964,6 +45666,7 @@ var ts;
case "any":
case "unknown":
case "number":
+ case "bigint":
case "boolean":
case "string":
case "symbol":
@@ -45125,10 +45828,10 @@ var ts;
else {
checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
}
- if (baseConstructorType.flags & 2162688 && !isMixinConstructorType(staticType)) {
+ if (baseConstructorType.flags & 8650752 && !isMixinConstructorType(staticType)) {
error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);
}
- if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 2162688)) {
+ if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 8650752)) {
var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode);
if (ts.forEach(constructors, function (sig) { return !isJSConstructor(sig.declaration) && getReturnTypeOfSignature(sig) !== baseType_1; })) {
error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type);
@@ -45213,7 +45916,7 @@ var ts;
}
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
return ts.filter(symbol.declarations, function (d) {
- return d.kind === 238 || d.kind === 239;
+ return d.kind === 240 || d.kind === 241;
});
}
function checkKindsOfPropertyMemberOverrides(type, baseType) {
@@ -45231,7 +45934,7 @@ var ts;
if (derived === base) {
var derivedClassDecl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128))) {
- if (derivedClassDecl.kind === 207) {
+ if (derivedClassDecl.kind === 209) {
error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType));
}
else {
@@ -45278,8 +45981,8 @@ var ts;
for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) {
var base = baseTypes_2[_i];
var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType));
- for (var _a = 0, properties_8 = properties; _a < properties_8.length; _a++) {
- var prop = properties_8[_a];
+ for (var _a = 0, properties_7 = properties; _a < properties_7.length; _a++) {
+ var prop = properties_7[_a];
var existing = seen.get(prop.escapedName);
if (!existing) {
seen.set(prop.escapedName, { prop: prop, containingType: base });
@@ -45310,7 +46013,7 @@ var ts;
var propName = member.name;
if (ts.isIdentifier(propName)) {
var type = getTypeOfSymbol(getSymbolOfNode(member));
- if (!(type.flags & 3 || getFalsyFlags(type) & 8192)) {
+ if (!(type.flags & 3 || getFalsyFlags(type) & 32768)) {
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
}
@@ -45320,7 +46023,7 @@ var ts;
}
}
function isInstancePropertyWithoutInitializer(node) {
- return node.kind === 152 &&
+ return node.kind === 154 &&
!ts.hasModifier(node, 32 | 128) &&
!node.exclamationToken &&
!node.initializer;
@@ -45331,7 +46034,7 @@ var ts;
reference.parent = constructor;
reference.flowNode = constructor.returnFlowNode;
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
- return !(getFalsyFlags(flowType) & 8192);
+ return !(getFalsyFlags(flowType) & 32768);
}
function checkInterfaceDeclaration(node) {
if (!checkGrammarDecoratorsAndModifiers(node))
@@ -45342,7 +46045,7 @@ var ts;
checkExportsOnMergedDeclarations(node);
var symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(symbol);
- var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 239);
+ var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 241);
if (node === firstInterfaceDecl) {
var type = getDeclaredTypeOfSymbol(symbol);
var typeWithThis = getTypeWithThisArgument(type);
@@ -45438,60 +46141,60 @@ var ts;
return value;
function evaluate(expr) {
switch (expr.kind) {
- case 200:
+ case 202:
var value_2 = evaluate(expr.operand);
if (typeof value_2 === "number") {
switch (expr.operator) {
- case 37: return value_2;
- case 38: return -value_2;
- case 52: return ~value_2;
+ case 38: return value_2;
+ case 39: return -value_2;
+ case 53: return ~value_2;
}
}
break;
- case 202:
+ case 204:
var left = evaluate(expr.left);
var right = evaluate(expr.right);
if (typeof left === "number" && typeof right === "number") {
switch (expr.operatorToken.kind) {
- case 49: return left | right;
- case 48: return left & right;
- case 46: return left >> right;
- case 47: return left >>> right;
- case 45: return left << right;
- case 50: return left ^ right;
- case 39: return left * right;
- case 41: return left / right;
- case 37: return left + right;
- case 38: return left - right;
- case 42: return left % right;
- case 40: return Math.pow(left, right);
+ case 50: return left | right;
+ case 49: return left & right;
+ case 47: return left >> right;
+ case 48: return left >>> right;
+ case 46: return left << right;
+ case 51: return left ^ right;
+ case 40: return left * right;
+ case 42: return left / right;
+ case 38: return left + right;
+ case 39: return left - right;
+ case 43: return left % right;
+ case 41: return Math.pow(left, right);
}
}
- else if (typeof left === "string" && typeof right === "string" && expr.operatorToken.kind === 37) {
+ else if (typeof left === "string" && typeof right === "string" && expr.operatorToken.kind === 38) {
return left + right;
}
break;
- case 9:
+ case 10:
return expr.text;
case 8:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 193:
+ case 195:
return evaluate(expr.expression);
- case 71:
+ case 72:
var identifier = expr;
if (isInfinityOrNaNString(identifier.escapedText)) {
return +(identifier.escapedText);
}
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
- case 188:
- case 187:
+ case 190:
+ case 189:
var ex = expr;
if (isConstantMemberAccess(ex)) {
var type = getTypeOfExpression(ex.expression);
if (type.symbol && type.symbol.flags & 384) {
var name = void 0;
- if (ex.kind === 187) {
+ if (ex.kind === 189) {
name = ex.name.escapedText;
}
else {
@@ -45522,10 +46225,10 @@ var ts;
}
}
function isConstantMemberAccess(node) {
- return node.kind === 71 ||
- node.kind === 187 && isConstantMemberAccess(node.expression) ||
- node.kind === 188 && isConstantMemberAccess(node.expression) &&
- node.argumentExpression.kind === 9;
+ return node.kind === 72 ||
+ node.kind === 189 && isConstantMemberAccess(node.expression) ||
+ node.kind === 190 && isConstantMemberAccess(node.expression) &&
+ node.argumentExpression.kind === 10;
}
function checkEnumDeclaration(node) {
if (!produceDiagnostics) {
@@ -45553,7 +46256,7 @@ var ts;
}
var seenEnumMissingInitialInitializer_1 = false;
ts.forEach(enumSymbol.declarations, function (declaration) {
- if (declaration.kind !== 241) {
+ if (declaration.kind !== 243) {
return false;
}
var enumDeclaration = declaration;
@@ -45576,8 +46279,8 @@ var ts;
var declarations = symbol.declarations;
for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
var declaration = declarations_8[_i];
- if ((declaration.kind === 238 ||
- (declaration.kind === 237 && ts.nodeIsPresent(declaration.body))) &&
+ if ((declaration.kind === 240 ||
+ (declaration.kind === 239 && ts.nodeIsPresent(declaration.body))) &&
!(declaration.flags & 4194304)) {
return declaration;
}
@@ -45612,7 +46315,7 @@ var ts;
return;
}
if (!checkGrammarDecoratorsAndModifiers(node)) {
- if (!inAmbientContext && node.name.kind === 9) {
+ if (!inAmbientContext && node.name.kind === 10) {
grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names);
}
}
@@ -45635,7 +46338,7 @@ var ts;
error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
- var mergedClass = ts.getDeclarationOfKind(symbol, 238);
+ var mergedClass = ts.getDeclarationOfKind(symbol, 240);
if (mergedClass &&
inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768;
@@ -45678,22 +46381,22 @@ var ts;
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 217:
+ case 219:
for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 252:
- case 253:
+ case 254:
+ case 255:
grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 246:
- case 247:
+ case 248:
+ case 249:
grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 184:
- case 235:
+ case 186:
+ case 237:
var name = node.name;
if (ts.isBindingPattern(name)) {
for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {
@@ -45702,12 +46405,12 @@ var ts;
}
break;
}
- case 238:
- case 241:
- case 237:
- case 239:
- case 242:
case 240:
+ case 243:
+ case 239:
+ case 241:
+ case 244:
+ case 242:
if (isGlobalAugmentation) {
return;
}
@@ -45715,7 +46418,7 @@ var ts;
if (symbol) {
var reportError = !(symbol.flags & 33554432);
if (!reportError) {
- reportError = ts.isExternalModuleAugmentation(symbol.parent.declarations[0]);
+ reportError = !!symbol.parent && ts.isExternalModuleAugmentation(symbol.parent.declarations[0]);
}
}
break;
@@ -45723,17 +46426,17 @@ var ts;
}
function getFirstIdentifier(node) {
switch (node.kind) {
- case 71:
+ case 72:
return node;
- case 146:
+ case 148:
do {
node = node.left;
- } while (node.kind !== 71);
+ } while (node.kind !== 72);
return node;
- case 187:
+ case 189:
do {
node = node.expression;
- } while (node.kind !== 71);
+ } while (node.kind !== 72);
return node;
}
}
@@ -45746,9 +46449,9 @@ var ts;
error(moduleName, ts.Diagnostics.String_literal_expected);
return false;
}
- var inAmbientExternalModule = node.parent.kind === 243 && ts.isAmbientModule(node.parent.parent);
- if (node.parent.kind !== 277 && !inAmbientExternalModule) {
- error(moduleName, node.kind === 253 ?
+ var inAmbientExternalModule = node.parent.kind === 245 && ts.isAmbientModule(node.parent.parent);
+ if (node.parent.kind !== 279 && !inAmbientExternalModule) {
+ error(moduleName, node.kind === 255 ?
ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
@@ -45769,13 +46472,13 @@ var ts;
(symbol.flags & 67897832 ? 67897832 : 0) |
(symbol.flags & 1920 ? 1920 : 0);
if (target.flags & excludedMeanings) {
- var message = node.kind === 255 ?
+ var message = node.kind === 257 ?
ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
}
if (compilerOptions.isolatedModules
- && node.kind === 255
+ && node.kind === 257
&& !(target.flags & 67220415)
&& !(node.flags & 4194304)) {
error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided);
@@ -45801,7 +46504,7 @@ var ts;
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 249) {
+ if (importClause.namedBindings.kind === 251) {
checkImportBinding(importClause.namedBindings);
}
else {
@@ -45824,7 +46527,7 @@ var ts;
if (ts.hasModifier(node, 1)) {
markExportAsReferenced(node);
}
- if (node.moduleReference.kind !== 257) {
+ if (node.moduleReference.kind !== 259) {
var target = resolveAlias(getSymbolOfNode(node));
if (target !== unknownSymbol) {
if (target.flags & 67220415) {
@@ -45855,10 +46558,10 @@ var ts;
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause) {
ts.forEach(node.exportClause.elements, checkExportSpecifier);
- var inAmbientExternalModule = node.parent.kind === 243 && ts.isAmbientModule(node.parent.parent);
- var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 243 &&
+ var inAmbientExternalModule = node.parent.kind === 245 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 245 &&
!node.moduleSpecifier && node.flags & 4194304;
- if (node.parent.kind !== 277 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
+ if (node.parent.kind !== 279 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
}
@@ -45874,7 +46577,7 @@ var ts;
}
}
function checkGrammarModuleElementContext(node, errorMessage) {
- var isInAppropriateContext = node.parent.kind === 277 || node.parent.kind === 243 || node.parent.kind === 242;
+ var isInAppropriateContext = node.parent.kind === 279 || node.parent.kind === 245 || node.parent.kind === 244;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -45900,8 +46603,8 @@ var ts;
if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) {
return;
}
- var container = node.parent.kind === 277 ? node.parent : node.parent.parent;
- if (container.kind === 242 && !ts.isAmbientModule(container)) {
+ var container = node.parent.kind === 279 ? node.parent : node.parent.parent;
+ if (container.kind === 244 && !ts.isAmbientModule(container)) {
if (node.isExportEquals) {
error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
}
@@ -45913,7 +46616,7 @@ var ts;
if (!checkGrammarDecoratorsAndModifiers(node) && ts.hasModifiers(node)) {
grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers);
}
- if (node.expression.kind === 71) {
+ if (node.expression.kind === 72) {
markExportAsReferenced(node);
if (ts.getEmitDeclarations(compilerOptions)) {
collectLinkedAliases(node.expression, true);
@@ -45980,7 +46683,7 @@ var ts;
return !ts.isAccessor(declaration);
}
function isNotOverload(declaration) {
- return (declaration.kind !== 237 && declaration.kind !== 154) ||
+ return (declaration.kind !== 239 && declaration.kind !== 156) ||
!!declaration.body;
}
function checkSourceElement(node) {
@@ -45996,157 +46699,157 @@ var ts;
var kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 242:
- case 238:
+ case 244:
+ case 240:
+ case 241:
case 239:
- case 237:
cancellationToken.throwIfCancellationRequested();
}
}
switch (kind) {
- case 148:
+ case 150:
return checkTypeParameter(node);
- case 149:
- return checkParameter(node);
- case 152:
case 151:
- return checkPropertyDeclaration(node);
- case 163:
- case 164:
- case 158:
- case 159:
- case 160:
- return checkSignatureDeclaration(node);
+ return checkParameter(node);
case 154:
case 153:
- return checkMethodDeclaration(node);
- case 155:
- return checkConstructorDeclaration(node);
- case 156:
- case 157:
- return checkAccessorDeclaration(node);
- case 162:
- return checkTypeReferenceNode(node);
- case 161:
- return checkTypePredicate(node);
+ return checkPropertyDeclaration(node);
case 165:
- return checkTypeQuery(node);
case 166:
- return checkTypeLiteral(node);
+ case 160:
+ case 161:
+ case 162:
+ return checkSignatureDeclaration(node);
+ case 156:
+ case 155:
+ return checkMethodDeclaration(node);
+ case 157:
+ return checkConstructorDeclaration(node);
+ case 158:
+ case 159:
+ return checkAccessorDeclaration(node);
+ case 164:
+ return checkTypeReferenceNode(node);
+ case 163:
+ return checkTypePredicate(node);
case 167:
- return checkArrayType(node);
+ return checkTypeQuery(node);
case 168:
+ return checkTypeLiteral(node);
+ case 169:
+ return checkArrayType(node);
+ case 170:
return checkTupleType(node);
+ case 173:
+ case 174:
+ return checkUnionOrIntersectionType(node);
+ case 177:
case 171:
case 172:
- return checkUnionOrIntersectionType(node);
- case 175:
- case 169:
- case 170:
return checkSourceElement(node.type);
- case 176:
+ case 178:
return checkThisType(node);
- case 177:
+ case 179:
return checkTypeOperator(node);
- case 173:
+ case 175:
return checkConditionalType(node);
- case 174:
+ case 176:
return checkInferType(node);
- case 181:
+ case 183:
return checkImportType(node);
- case 293:
- return checkJSDocAugmentsTag(node);
- case 302:
case 295:
- return checkJSDocTypeAliasTag(node);
- case 301:
- return checkJSDocTemplateTag(node);
- case 300:
- return checkJSDocTypeTag(node);
+ return checkJSDocAugmentsTag(node);
+ case 304:
case 297:
+ return checkJSDocTypeAliasTag(node);
+ case 303:
+ return checkJSDocTemplateTag(node);
+ case 302:
+ return checkJSDocTypeTag(node);
+ case 299:
return checkJSDocParameterTag(node);
+ case 289:
+ checkJSDocFunctionType(node);
case 287:
- checkSignatureDeclaration(node);
- case 285:
+ case 286:
case 284:
- case 282:
- case 283:
- case 290:
+ case 285:
+ case 292:
checkJSDocTypeIsInJsFile(node);
ts.forEachChild(node, checkSourceElement);
return;
- case 288:
+ case 290:
checkJSDocVariadicType(node);
return;
- case 281:
+ case 283:
return checkSourceElement(node.type);
- case 178:
+ case 180:
return checkIndexedAccessType(node);
- case 179:
+ case 181:
return checkMappedType(node);
- case 237:
- return checkFunctionDeclaration(node);
- case 216:
- case 243:
- return checkBlock(node);
- case 217:
- return checkVariableStatement(node);
- case 219:
- return checkExpressionStatement(node);
- case 220:
- return checkIfStatement(node);
- case 221:
- return checkDoStatement(node);
- case 222:
- return checkWhileStatement(node);
- case 223:
- return checkForStatement(node);
- case 224:
- return checkForInStatement(node);
- case 225:
- return checkForOfStatement(node);
- case 226:
- case 227:
- return checkBreakOrContinueStatement(node);
- case 228:
- return checkReturnStatement(node);
- case 229:
- return checkWithStatement(node);
- case 230:
- return checkSwitchStatement(node);
- case 231:
- return checkLabeledStatement(node);
- case 232:
- return checkThrowStatement(node);
- case 233:
- return checkTryStatement(node);
- case 235:
- return checkVariableDeclaration(node);
- case 184:
- return checkBindingElement(node);
- case 238:
- return checkClassDeclaration(node);
case 239:
- return checkInterfaceDeclaration(node);
- case 240:
- return checkTypeAliasDeclaration(node);
- case 241:
- return checkEnumDeclaration(node);
- case 242:
- return checkModuleDeclaration(node);
- case 247:
- return checkImportDeclaration(node);
- case 246:
- return checkImportEqualsDeclaration(node);
- case 253:
- return checkExportDeclaration(node);
- case 252:
- return checkExportAssignment(node);
+ return checkFunctionDeclaration(node);
case 218:
+ case 245:
+ return checkBlock(node);
+ case 219:
+ return checkVariableStatement(node);
+ case 221:
+ return checkExpressionStatement(node);
+ case 222:
+ return checkIfStatement(node);
+ case 223:
+ return checkDoStatement(node);
+ case 224:
+ return checkWhileStatement(node);
+ case 225:
+ return checkForStatement(node);
+ case 226:
+ return checkForInStatement(node);
+ case 227:
+ return checkForOfStatement(node);
+ case 228:
+ case 229:
+ return checkBreakOrContinueStatement(node);
+ case 230:
+ return checkReturnStatement(node);
+ case 231:
+ return checkWithStatement(node);
+ case 232:
+ return checkSwitchStatement(node);
+ case 233:
+ return checkLabeledStatement(node);
case 234:
+ return checkThrowStatement(node);
+ case 235:
+ return checkTryStatement(node);
+ case 237:
+ return checkVariableDeclaration(node);
+ case 186:
+ return checkBindingElement(node);
+ case 240:
+ return checkClassDeclaration(node);
+ case 241:
+ return checkInterfaceDeclaration(node);
+ case 242:
+ return checkTypeAliasDeclaration(node);
+ case 243:
+ return checkEnumDeclaration(node);
+ case 244:
+ return checkModuleDeclaration(node);
+ case 249:
+ return checkImportDeclaration(node);
+ case 248:
+ return checkImportEqualsDeclaration(node);
+ case 255:
+ return checkExportDeclaration(node);
+ case 254:
+ return checkExportAssignment(node);
+ case 220:
+ case 236:
checkGrammarStatementInAmbientContext(node);
return;
- case 256:
+ case 258:
return checkMissingDeclaration(node);
}
}
@@ -46218,23 +46921,23 @@ var ts;
}
links.deferredNodes.forEach(function (node) {
switch (node.kind) {
- case 194:
- case 195:
- case 154:
- case 153:
+ case 196:
+ case 197:
+ case 156:
+ case 155:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 156:
- case 157:
+ case 158:
+ case 159:
checkAccessorDeclaration(node);
break;
- case 207:
+ case 209:
checkClassExpressionDeferred(node);
break;
- case 259:
+ case 261:
checkJsxSelfClosingElementDeferred(node);
break;
- case 258:
+ case 260:
checkJsxElementDeferred(node);
break;
}
@@ -46269,6 +46972,7 @@ var ts;
ts.clear(potentialThisCollisions);
ts.clear(potentialNewTargetCollisions);
ts.forEach(node.statements, checkSourceElement);
+ checkSourceElement(node.endOfFileToken);
checkDeferredNodes(node);
if (ts.isExternalOrCommonJsModule(node)) {
registerForUnusedIdentifiersCheck(node);
@@ -46347,24 +47051,27 @@ var ts;
copySymbols(location.locals, meaning);
}
switch (location.kind) {
- case 242:
+ case 279:
+ if (!ts.isExternalOrCommonJsModule(location))
+ break;
+ case 244:
copySymbols(getSymbolOfNode(location).exports, meaning & 2623475);
break;
- case 241:
+ case 243:
copySymbols(getSymbolOfNode(location).exports, meaning & 8);
break;
- case 207:
+ case 209:
var className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 238:
- case 239:
+ case 240:
+ case 241:
if (!isStatic) {
copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 67897832);
}
break;
- case 194:
+ case 196:
var funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -46396,33 +47103,33 @@ var ts;
}
}
function isTypeDeclarationName(name) {
- return name.kind === 71 &&
+ return name.kind === 72 &&
isTypeDeclaration(name.parent) &&
name.parent.name === name;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 148:
- case 238:
- case 239:
+ case 150:
case 240:
case 241:
+ case 242:
+ case 243:
return true;
default:
return false;
}
}
function isTypeReferenceIdentifier(node) {
- while (node.parent.kind === 146) {
+ while (node.parent.kind === 148) {
node = node.parent;
}
- return node.parent.kind === 162;
+ return node.parent.kind === 164;
}
function isHeritageClauseElementIdentifier(node) {
- while (node.parent.kind === 187) {
+ while (node.parent.kind === 189) {
node = node.parent;
}
- return node.parent.kind === 209;
+ return node.parent.kind === 211;
}
function forEachEnclosingClass(node, callback) {
var result;
@@ -46450,13 +47157,13 @@ var ts;
return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; });
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 146) {
+ while (nodeOnRightSide.parent.kind === 148) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 246) {
+ if (nodeOnRightSide.parent.kind === 248) {
return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined;
}
- if (nodeOnRightSide.parent.kind === 252) {
+ if (nodeOnRightSide.parent.kind === 254) {
return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined;
}
return undefined;
@@ -46482,7 +47189,7 @@ var ts;
node = parent;
parent = parent.parent;
}
- if (parent && parent.kind === 181 && parent.qualifier === node) {
+ if (parent && parent.kind === 183 && parent.qualifier === node) {
return parent;
}
return undefined;
@@ -46492,21 +47199,21 @@ var ts;
return getSymbolOfNode(entityName.parent);
}
if (ts.isInJSFile(entityName) &&
- entityName.parent.kind === 187 &&
+ entityName.parent.kind === 189 &&
entityName.parent === entityName.parent.parent.left) {
var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName);
if (specialPropertyAssignmentSymbol) {
return specialPropertyAssignmentSymbol;
}
}
- if (entityName.parent.kind === 252 && ts.isEntityNameExpression(entityName)) {
+ if (entityName.parent.kind === 254 && ts.isEntityNameExpression(entityName)) {
var success = resolveEntityName(entityName, 67220415 | 67897832 | 1920 | 2097152, true);
if (success && success !== unknownSymbol) {
return success;
}
}
else if (!ts.isPropertyAccessExpression(entityName) && isInRightSideOfImportOrExportAssignment(entityName)) {
- var importEqualsDeclaration = ts.getAncestor(entityName, 246);
+ var importEqualsDeclaration = ts.getAncestor(entityName, 248);
ts.Debug.assert(importEqualsDeclaration !== undefined);
return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true);
}
@@ -46523,7 +47230,7 @@ var ts;
}
if (isHeritageClauseElementIdentifier(entityName)) {
var meaning = 0;
- if (entityName.parent.kind === 209) {
+ if (entityName.parent.kind === 211) {
meaning = 67897832;
if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning |= 67220415;
@@ -46538,10 +47245,10 @@ var ts;
return entityNameSymbol;
}
}
- if (entityName.parent.kind === 297) {
+ if (entityName.parent.kind === 299) {
return ts.getParameterSymbolFromJSDoc(entityName.parent);
}
- if (entityName.parent.kind === 148 && entityName.parent.parent.kind === 301) {
+ if (entityName.parent.kind === 150 && entityName.parent.parent.kind === 303) {
ts.Debug.assert(!ts.isInJSFile(entityName));
var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent);
return typeParameter && typeParameter.symbol;
@@ -46550,19 +47257,19 @@ var ts;
if (ts.nodeIsMissing(entityName)) {
return undefined;
}
- if (entityName.kind === 71) {
+ if (entityName.kind === 72) {
if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) {
var symbol = getIntrinsicTagSymbol(entityName.parent);
return symbol === unknownSymbol ? undefined : symbol;
}
return resolveEntityName(entityName, 67220415, false, true);
}
- else if (entityName.kind === 187 || entityName.kind === 146) {
+ else if (entityName.kind === 189 || entityName.kind === 148) {
var links = getNodeLinks(entityName);
if (links.resolvedSymbol) {
return links.resolvedSymbol;
}
- if (entityName.kind === 187) {
+ if (entityName.kind === 189) {
checkPropertyAccessExpression(entityName);
}
else {
@@ -46572,19 +47279,16 @@ var ts;
}
}
else if (isTypeReferenceIdentifier(entityName)) {
- var meaning = entityName.parent.kind === 162 ? 67897832 : 1920;
+ var meaning = entityName.parent.kind === 164 ? 67897832 : 1920;
return resolveEntityName(entityName, meaning, false, true);
}
- else if (entityName.parent.kind === 265) {
- return getJsxAttributePropertySymbol(entityName.parent);
- }
- if (entityName.parent.kind === 161) {
+ if (entityName.parent.kind === 163) {
return resolveEntityName(entityName, 1);
}
return undefined;
}
function getSymbolAtLocation(node) {
- if (node.kind === 277) {
+ if (node.kind === 279) {
return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined;
}
var parent = node.parent;
@@ -46598,12 +47302,12 @@ var ts;
else if (ts.isLiteralComputedPropertyDeclarationName(node)) {
return getSymbolOfNode(parent.parent);
}
- if (node.kind === 71) {
+ if (node.kind === 72) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
}
- else if (parent.kind === 184 &&
- grandParent.kind === 182 &&
+ else if (parent.kind === 186 &&
+ grandParent.kind === 184 &&
node === parent.propertyName) {
var typeOfPattern = getTypeOfNode(grandParent);
var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText);
@@ -46613,11 +47317,11 @@ var ts;
}
}
switch (node.kind) {
- case 71:
- case 187:
- case 146:
+ case 72:
+ case 189:
+ case 148:
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
- case 99:
+ case 100:
var container = ts.getThisContainer(node, false);
if (ts.isFunctionLike(container)) {
var sig = getSignatureFromDeclaration(container);
@@ -46628,24 +47332,27 @@ var ts;
if (ts.isInExpressionContext(node)) {
return checkExpression(node).symbol;
}
- case 176:
+ case 178:
return getTypeFromThisTypeNode(node).symbol;
- case 97:
+ case 98:
return checkExpression(node).symbol;
- case 123:
+ case 124:
var constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 155) {
+ if (constructorDeclaration && constructorDeclaration.kind === 157) {
return constructorDeclaration.parent.symbol;
}
return undefined;
- case 9:
- case 13:
+ case 10:
+ case 14:
if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
- ((node.parent.kind === 247 || node.parent.kind === 253) && node.parent.moduleSpecifier === node) ||
+ ((node.parent.kind === 249 || node.parent.kind === 255) && node.parent.moduleSpecifier === node) ||
((ts.isInJSFile(node) && ts.isRequireCall(node.parent, false)) || ts.isImportCall(node.parent)) ||
(ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) {
return resolveExternalModuleName(node, node);
}
+ if (ts.isCallExpression(parent) && ts.isBindableObjectDefinePropertyCall(parent) && parent.arguments[1] === node) {
+ return getSymbolOfNode(parent);
+ }
case 8:
var objectType = ts.isElementAccessExpression(parent)
? parent.argumentExpression === node ? getTypeOfExpression(parent.expression) : undefined
@@ -46653,19 +47360,21 @@ var ts;
? getTypeFromTypeNode(grandParent.objectType)
: undefined;
return objectType && getPropertyOfType(objectType, ts.escapeLeadingUnderscores(node.text));
- case 79:
- case 89:
- case 36:
- case 75:
+ case 80:
+ case 90:
+ case 37:
+ case 76:
return getSymbolOfNode(node.parent);
- case 181:
+ case 183:
return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal) : undefined;
+ case 85:
+ return ts.isExportAssignment(node.parent) ? ts.Debug.assertDefined(node.parent.symbol) : undefined;
default:
return undefined;
}
}
function getShorthandAssignmentValueSymbol(location) {
- if (location && location.kind === 274) {
+ if (location && location.kind === 276) {
return resolveEntityName(location.name, 67220415 | 2097152);
}
return undefined;
@@ -46721,20 +47430,20 @@ var ts;
return errorType;
}
function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) {
- ts.Debug.assert(expr.kind === 186 || expr.kind === 185);
- if (expr.parent.kind === 225) {
+ ts.Debug.assert(expr.kind === 188 || expr.kind === 187);
+ if (expr.parent.kind === 227) {
var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 202) {
+ if (expr.parent.kind === 204) {
var iteratedType = getTypeOfExpression(expr.parent.right);
return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 273) {
+ if (expr.parent.kind === 275) {
var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent);
return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || errorType, expr.parent);
}
- ts.Debug.assert(expr.parent.kind === 185);
+ ts.Debug.assert(expr.parent.kind === 187);
var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent);
var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || errorType, expr.parent, false, false) || errorType;
return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || errorType);
@@ -46758,14 +47467,14 @@ var ts;
function getClassElementPropertyKeyType(element) {
var name = element.name;
switch (name.kind) {
- case 71:
+ case 72:
return getLiteralType(ts.idText(name));
case 8:
- case 9:
+ case 10:
return getLiteralType(name.text);
- case 147:
+ case 149:
var nameType = checkComputedPropertyName(name);
- return isTypeAssignableToKind(nameType, 3072) ? nameType : stringType;
+ return isTypeAssignableToKind(nameType, 12288) ? nameType : stringType;
default:
ts.Debug.fail("Unsupported property name.");
return errorType;
@@ -46817,7 +47526,7 @@ var ts;
if (!ts.isGeneratedIdentifier(nodeIn)) {
var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
- var isPropertyName_1 = node.parent.kind === 187 && node.parent.name === node;
+ var isPropertyName_1 = node.parent.kind === 189 && node.parent.name === node;
return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol;
}
}
@@ -46859,7 +47568,7 @@ var ts;
}
var parentSymbol_1 = getParentOfSymbol(symbol);
if (parentSymbol_1) {
- if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 277) {
+ if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 279) {
var symbolFile = parentSymbol_1.valueDeclaration;
var referenceFile = ts.getSourceFileOfNode(node);
var symbolIsUmdExport = symbolFile !== referenceFile;
@@ -46893,7 +47602,7 @@ var ts;
else if (nodeLinks_1.flags & 262144) {
var isDeclaredInLoop = nodeLinks_1.flags & 524288;
var inLoopInitializer = ts.isIterationStatement(container, false);
- var inLoopBodyBlock = container.kind === 216 && ts.isIterationStatement(container.parent, false);
+ var inLoopBodyBlock = container.kind === 218 && ts.isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));
}
else {
@@ -46929,18 +47638,18 @@ var ts;
}
function isValueAliasDeclaration(node) {
switch (node.kind) {
- case 246:
case 248:
- case 249:
+ case 250:
case 251:
- case 255:
- return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
case 253:
+ case 257:
+ return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
+ case 255:
var exportClause = node.exportClause;
return !!exportClause && ts.some(exportClause.elements, isValueAliasDeclaration);
- case 252:
+ case 254:
return node.expression
- && node.expression.kind === 71
+ && node.expression.kind === 72
? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol)
: true;
}
@@ -46948,7 +47657,7 @@ var ts;
}
function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration);
- if (node === undefined || node.parent.kind !== 277 || !ts.isInternalModuleImportEqualsDeclaration(node)) {
+ if (node === undefined || node.parent.kind !== 279 || !ts.isInternalModuleImportEqualsDeclaration(node)) {
return false;
}
var isValue = isAliasResolvedToValue(getSymbolOfNode(node));
@@ -46972,7 +47681,8 @@ var ts;
return true;
}
var target = getSymbolLinks(symbol).target;
- if (target && ts.getModifierFlags(node) & 1 && target.flags & 67220415) {
+ if (target && ts.getModifierFlags(node) & 1 &&
+ target.flags & 67220415 && (compilerOptions.preserveConstEnums || !isConstEnumOrConstEnumOnlyModule(target))) {
return true;
}
}
@@ -47033,15 +47743,15 @@ var ts;
}
function canHaveConstantValue(node) {
switch (node.kind) {
- case 276:
- case 187:
- case 188:
+ case 278:
+ case 189:
+ case 190:
return true;
}
return false;
}
function getConstantValue(node) {
- if (node.kind === 276) {
+ if (node.kind === 278) {
return getEnumMemberValue(node);
}
var symbol = getNodeLinks(node).resolvedSymbol;
@@ -47054,7 +47764,7 @@ var ts;
return undefined;
}
function isFunctionType(type) {
- return !!(type.flags & 131072) && getSignaturesOfType(type, 0).length > 0;
+ return !!(type.flags & 524288) && getSignaturesOfType(type, 0).length > 0;
}
function getTypeReferenceSerializationKind(typeNameIn, location) {
var typeName = ts.getParseTreeNode(typeNameIn, ts.isEntityName);
@@ -47087,22 +47797,25 @@ var ts;
else if (type.flags & 3) {
return ts.TypeReferenceSerializationKind.ObjectType;
}
- else if (isTypeAssignableToKind(type, 4096 | 24576 | 32768)) {
+ else if (isTypeAssignableToKind(type, 16384 | 98304 | 131072)) {
return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType;
}
- else if (isTypeAssignableToKind(type, 272)) {
+ else if (isTypeAssignableToKind(type, 528)) {
return ts.TypeReferenceSerializationKind.BooleanType;
}
- else if (isTypeAssignableToKind(type, 168)) {
+ else if (isTypeAssignableToKind(type, 296)) {
return ts.TypeReferenceSerializationKind.NumberLikeType;
}
- else if (isTypeAssignableToKind(type, 68)) {
+ else if (isTypeAssignableToKind(type, 2112)) {
+ return ts.TypeReferenceSerializationKind.BigIntLikeType;
+ }
+ else if (isTypeAssignableToKind(type, 132)) {
return ts.TypeReferenceSerializationKind.StringLikeType;
}
else if (isTupleType(type)) {
return ts.TypeReferenceSerializationKind.ArrayLikeType;
}
- else if (isTypeAssignableToKind(type, 3072)) {
+ else if (isTypeAssignableToKind(type, 12288)) {
return ts.TypeReferenceSerializationKind.ESSymbolType;
}
else if (isFunctionType(type)) {
@@ -47118,13 +47831,13 @@ var ts;
function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker, addUndefined) {
var declaration = ts.getParseTreeNode(declarationIn, ts.isVariableLikeOrAccessor);
if (!declaration) {
- return ts.createToken(119);
+ return ts.createToken(120);
}
var symbol = getSymbolOfNode(declaration);
var type = symbol && !(symbol.flags & (2048 | 131072))
? getWidenedLiteralType(getTypeOfSymbol(symbol))
: errorType;
- if (type.flags & 2048 &&
+ if (type.flags & 8192 &&
type.symbol === symbol) {
flags |= 1048576;
}
@@ -47136,7 +47849,7 @@ var ts;
function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) {
var signatureDeclaration = ts.getParseTreeNode(signatureDeclarationIn, ts.isFunctionLike);
if (!signatureDeclaration) {
- return ts.createToken(119);
+ return ts.createToken(120);
}
var signature = getSignatureFromDeclaration(signatureDeclaration);
return nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024, tracker);
@@ -47144,7 +47857,7 @@ var ts;
function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) {
var expr = ts.getParseTreeNode(exprIn, ts.isExpression);
if (!expr) {
- return ts.createToken(119);
+ return ts.createToken(120);
}
var type = getWidenedType(getRegularTypeOfExpression(expr));
return nodeBuilder.typeToTypeNode(type, enclosingDeclaration, flags | 1024, tracker);
@@ -47180,19 +47893,18 @@ var ts;
}
function isLiteralConstDeclaration(node) {
if (ts.isDeclarationReadonly(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node)) {
- var type = getTypeOfSymbol(getSymbolOfNode(node));
- return !!(type.flags & 448 && type.flags & 33554432);
+ return isFreshLiteralType(getTypeOfSymbol(getSymbolOfNode(node)));
}
return false;
}
- function literalTypeToNode(type, enclosing) {
- var enumResult = type.flags & 512 ? nodeBuilder.symbolToExpression(type.symbol, 67220415, enclosing)
+ function literalTypeToNode(type, enclosing, tracker) {
+ var enumResult = type.flags & 1024 ? nodeBuilder.symbolToExpression(type.symbol, 67220415, enclosing, undefined, tracker)
: type === trueType ? ts.createTrue() : type === falseType && ts.createFalse();
return enumResult || ts.createLiteral(type.value);
}
- function createLiteralConstValue(node) {
+ function createLiteralConstValue(node, tracker) {
var type = getTypeOfSymbol(getSymbolOfNode(node));
- return literalTypeToNode(type, node);
+ return literalTypeToNode(type, node, tracker);
}
function createResolver() {
var resolvedTypeReferenceDirectives = host.getResolvedTypeReferenceDirectives();
@@ -47260,12 +47972,12 @@ var ts;
getJsxFactoryEntity: function (location) { return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity; },
getAllAccessorDeclarations: function (accessor) {
accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration);
- var otherKind = accessor.kind === 157 ? 156 : 157;
+ var otherKind = accessor.kind === 159 ? 158 : 159;
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind);
var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor;
var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor;
- var setAccessor = accessor.kind === 157 ? accessor : otherAccessor;
- var getAccessor = accessor.kind === 156 ? accessor : otherAccessor;
+ var setAccessor = accessor.kind === 159 ? accessor : otherAccessor;
+ var getAccessor = accessor.kind === 158 ? accessor : otherAccessor;
return {
firstAccessor: firstAccessor,
secondAccessor: secondAccessor,
@@ -47281,14 +47993,14 @@ var ts;
}
};
function isInHeritageClause(node) {
- return node.parent && node.parent.kind === 209 && node.parent.parent && node.parent.parent.kind === 271;
+ return node.parent && node.parent.kind === 211 && node.parent.parent && node.parent.parent.kind === 273;
}
function getTypeReferenceDirectivesForEntityName(node) {
if (!fileToDirective) {
return undefined;
}
var meaning = 67897832 | 1920;
- if ((node.kind === 71 && isInTypeQuery(node)) || (node.kind === 187 && !isInHeritageClause(node))) {
+ if ((node.kind === 72 && isInTypeQuery(node)) || (node.kind === 189 && !isInHeritageClause(node))) {
meaning = 67220415 | 1048576;
}
var symbol = resolveEntityName(node, meaning, true);
@@ -47331,7 +48043,7 @@ var ts;
break;
}
}
- if (current.valueDeclaration && current.valueDeclaration.kind === 277 && current.flags & 512) {
+ if (current.valueDeclaration && current.valueDeclaration.kind === 279 && current.flags & 512) {
return false;
}
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
@@ -47345,12 +48057,12 @@ var ts;
}
}
function getExternalModuleFileFromDeclaration(declaration) {
- var specifier = declaration.kind === 242 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
+ var specifier = declaration.kind === 244 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, undefined);
if (!moduleSymbol) {
return undefined;
}
- return ts.getDeclarationOfKind(moduleSymbol, 277);
+ return ts.getDeclarationOfKind(moduleSymbol, 279);
}
function initializeTypeChecker() {
for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) {
@@ -47509,14 +48221,14 @@ var ts;
return false;
}
if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
- if (node.kind === 154 && !ts.nodeIsPresent(node.body)) {
+ if (node.kind === 156 && !ts.nodeIsPresent(node.body)) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);
}
else {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);
}
}
- else if (node.kind === 156 || node.kind === 157) {
+ else if (node.kind === 158 || node.kind === 159) {
var accessors = ts.getAllAccessorDeclarations(node.parent.members, node);
if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
@@ -47533,23 +48245,23 @@ var ts;
var flags = 0;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
- if (modifier.kind !== 132) {
- if (node.kind === 151 || node.kind === 153) {
+ if (modifier.kind !== 133) {
+ if (node.kind === 153 || node.kind === 155) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind));
}
- if (node.kind === 160) {
+ if (node.kind === 162) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
- case 76:
- if (node.kind !== 241) {
- return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76));
+ case 77:
+ if (node.kind !== 243) {
+ return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(77));
}
break;
+ case 115:
case 114:
case 113:
- case 112:
var text = visibilityToString(ts.modifierToFlag(modifier.kind));
if (flags & 28) {
return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen);
@@ -47563,11 +48275,11 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async");
}
- else if (node.parent.kind === 243 || node.parent.kind === 277) {
+ else if (node.parent.kind === 245 || node.parent.kind === 279) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
}
else if (flags & 128) {
- if (modifier.kind === 112) {
+ if (modifier.kind === 113) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
}
else {
@@ -47576,7 +48288,7 @@ var ts;
}
flags |= ts.modifierToFlag(modifier.kind);
break;
- case 115:
+ case 116:
if (flags & 32) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
}
@@ -47586,10 +48298,10 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async");
}
- else if (node.parent.kind === 243 || node.parent.kind === 277) {
+ else if (node.parent.kind === 245 || node.parent.kind === 279) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
}
- else if (node.kind === 149) {
+ else if (node.kind === 151) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
}
else if (flags & 128) {
@@ -47598,17 +48310,17 @@ var ts;
flags |= 32;
lastStatic = modifier;
break;
- case 132:
+ case 133:
if (flags & 64) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly");
}
- else if (node.kind !== 152 && node.kind !== 151 && node.kind !== 160 && node.kind !== 149) {
+ else if (node.kind !== 154 && node.kind !== 153 && node.kind !== 162 && node.kind !== 151) {
return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64;
lastReadonly = modifier;
break;
- case 84:
+ case 85:
if (flags & 1) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export");
}
@@ -47621,52 +48333,52 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
}
- else if (node.parent.kind === 238) {
+ else if (node.parent.kind === 240) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export");
}
- else if (node.kind === 149) {
+ else if (node.kind === 151) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1;
break;
- case 79:
- var container = node.parent.kind === 277 ? node.parent : node.parent.parent;
- if (container.kind === 242 && !ts.isAmbientModule(container)) {
+ case 80:
+ var container = node.parent.kind === 279 ? node.parent : node.parent.parent;
+ if (container.kind === 244 && !ts.isAmbientModule(container)) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
}
flags |= 512;
break;
- case 124:
+ case 125:
if (flags & 2) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare");
}
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.parent.kind === 238) {
+ else if (node.parent.kind === 240) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare");
}
- else if (node.kind === 149) {
+ else if (node.kind === 151) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
}
- else if ((node.parent.flags & 4194304) && node.parent.kind === 243) {
+ else if ((node.parent.flags & 4194304) && node.parent.kind === 245) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
}
flags |= 2;
lastDeclare = modifier;
break;
- case 117:
+ case 118:
if (flags & 128) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 238) {
- if (node.kind !== 154 &&
- node.kind !== 152 &&
- node.kind !== 156 &&
- node.kind !== 157) {
+ if (node.kind !== 240) {
+ if (node.kind !== 156 &&
+ node.kind !== 154 &&
+ node.kind !== 158 &&
+ node.kind !== 159) {
return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 238 && ts.hasModifier(node.parent, 128))) {
+ if (!(node.parent.kind === 240 && ts.hasModifier(node.parent, 128))) {
return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32) {
@@ -47678,14 +48390,14 @@ var ts;
}
flags |= 128;
break;
- case 120:
+ case 121:
if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async");
}
else if (flags & 2 || node.parent.flags & 4194304) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.kind === 149) {
+ else if (node.kind === 151) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
flags |= 256;
@@ -47693,7 +48405,7 @@ var ts;
break;
}
}
- if (node.kind === 155) {
+ if (node.kind === 157) {
if (flags & 32) {
return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -47708,13 +48420,13 @@ var ts;
}
return false;
}
- else if ((node.kind === 247 || node.kind === 246) && flags & 2) {
+ else if ((node.kind === 249 || node.kind === 248) && flags & 2) {
return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
}
- else if (node.kind === 149 && (flags & 92) && ts.isBindingPattern(node.name)) {
+ else if (node.kind === 151 && (flags & 92) && ts.isBindingPattern(node.name)) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);
}
- else if (node.kind === 149 && (flags & 92) && node.dotDotDotToken) {
+ else if (node.kind === 151 && (flags & 92) && node.dotDotDotToken) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 256) {
@@ -47731,38 +48443,38 @@ var ts;
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 156:
+ case 158:
+ case 159:
case 157:
- case 155:
- case 152:
- case 151:
case 154:
case 153:
- case 160:
- case 242:
- case 247:
- case 246:
- case 253:
- case 252:
- case 194:
- case 195:
- case 149:
+ case 156:
+ case 155:
+ case 162:
+ case 244:
+ case 249:
+ case 248:
+ case 255:
+ case 254:
+ case 196:
+ case 197:
+ case 151:
return false;
default:
- if (node.parent.kind === 243 || node.parent.kind === 277) {
+ if (node.parent.kind === 245 || node.parent.kind === 279) {
return false;
}
switch (node.kind) {
- case 237:
- return nodeHasAnyModifiersExcept(node, 120);
- case 238:
- return nodeHasAnyModifiersExcept(node, 117);
case 239:
- case 217:
+ return nodeHasAnyModifiersExcept(node, 121);
case 240:
- return true;
+ return nodeHasAnyModifiersExcept(node, 118);
case 241:
- return nodeHasAnyModifiersExcept(node, 76);
+ case 219:
+ case 242:
+ return true;
+ case 243:
+ return nodeHasAnyModifiersExcept(node, 77);
default:
ts.Debug.fail();
return false;
@@ -47774,10 +48486,10 @@ var ts;
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 154:
- case 237:
- case 194:
- case 195:
+ case 156:
+ case 239:
+ case 196:
+ case 197:
return false;
}
return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async");
@@ -47894,12 +48606,12 @@ var ts;
if (!parameter.type) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);
}
- if (parameter.type.kind !== 137 && parameter.type.kind !== 134) {
+ if (parameter.type.kind !== 138 && parameter.type.kind !== 135) {
var type = getTypeFromTypeNode(parameter.type);
if (type.flags & 4 || type.flags & 8) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(getTypeFromTypeNode(node.type)));
}
- if (type.flags & 262144 && allTypesAssignableToKind(type, 64, true)) {
+ if (type.flags & 1048576 && allTypesAssignableToKind(type, 128, true)) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead);
}
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
@@ -47929,7 +48641,7 @@ var ts;
if (args) {
for (var _i = 0, args_5 = args; _i < args_5.length; _i++) {
var arg = args_5[_i];
- if (arg.kind === 208) {
+ if (arg.kind === 210) {
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
}
}
@@ -47959,7 +48671,7 @@ var ts;
if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) {
for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
var heritageClause = _a[_i];
- if (heritageClause.token === 85) {
+ if (heritageClause.token === 86) {
if (seenExtendsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
}
@@ -47972,7 +48684,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 108);
+ ts.Debug.assert(heritageClause.token === 109);
if (seenImplementsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
}
@@ -47987,14 +48699,14 @@ var ts;
if (node.heritageClauses) {
for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
var heritageClause = _a[_i];
- if (heritageClause.token === 85) {
+ if (heritageClause.token === 86) {
if (seenExtendsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
}
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 108);
+ ts.Debug.assert(heritageClause.token === 109);
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
}
checkGrammarHeritageClause(heritageClause);
@@ -48003,20 +48715,20 @@ var ts;
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 147) {
+ if (node.kind !== 149) {
return false;
}
var computedPropertyName = node;
- if (computedPropertyName.expression.kind === 202 && computedPropertyName.expression.operatorToken.kind === 26) {
+ if (computedPropertyName.expression.kind === 204 && computedPropertyName.expression.operatorToken.kind === 27) {
return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);
}
return false;
}
function checkGrammarForGenerator(node) {
if (node.asteriskToken) {
- ts.Debug.assert(node.kind === 237 ||
- node.kind === 194 ||
- node.kind === 154);
+ ts.Debug.assert(node.kind === 239 ||
+ node.kind === 196 ||
+ node.kind === 156);
if (node.flags & 4194304) {
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
}
@@ -48035,40 +48747,40 @@ var ts;
var seen = ts.createUnderscoreEscapedMap();
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- if (prop.kind === 275) {
+ if (prop.kind === 277) {
continue;
}
var name = prop.name;
- if (name.kind === 147) {
+ if (name.kind === 149) {
checkGrammarComputedPropertyName(name);
}
- if (prop.kind === 274 && !inDestructuring && prop.objectAssignmentInitializer) {
+ if (prop.kind === 276 && !inDestructuring && prop.objectAssignmentInitializer) {
return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment);
}
if (prop.modifiers) {
for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) {
var mod = _c[_b];
- if (mod.kind !== 120 || prop.kind !== 154) {
+ if (mod.kind !== 121 || prop.kind !== 156) {
grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod));
}
}
}
var currentKind = void 0;
switch (prop.kind) {
- case 274:
+ case 276:
checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
- case 273:
+ case 275:
checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
if (name.kind === 8) {
checkGrammarNumericLiteral(name);
}
- case 154:
+ case 156:
currentKind = 1;
break;
- case 156:
+ case 158:
currentKind = 2;
break;
- case 157:
+ case 159:
currentKind = 4;
break;
default:
@@ -48105,7 +48817,7 @@ var ts;
var seen = ts.createUnderscoreEscapedMap();
for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) {
var attr = _a[_i];
- if (attr.kind === 267) {
+ if (attr.kind === 269) {
continue;
}
var name = attr.name, initializer = attr.initializer;
@@ -48115,7 +48827,7 @@ var ts;
else {
return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
- if (initializer && initializer.kind === 268 && !initializer.expression) {
+ if (initializer && initializer.kind === 270 && !initializer.expression) {
return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
}
}
@@ -48124,12 +48836,12 @@ var ts;
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.kind === 225 && forInOrOfStatement.awaitModifier) {
+ if (forInOrOfStatement.kind === 227 && forInOrOfStatement.awaitModifier) {
if ((forInOrOfStatement.flags & 16384) === 0) {
return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator);
}
}
- if (forInOrOfStatement.initializer.kind === 236) {
+ if (forInOrOfStatement.initializer.kind === 238) {
var variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
var declarations = variableList.declarations;
@@ -48137,20 +48849,20 @@ var ts;
return false;
}
if (declarations.length > 1) {
- var diagnostic = forInOrOfStatement.kind === 224
+ var diagnostic = forInOrOfStatement.kind === 226
? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement
: ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);
}
var firstDeclaration = declarations[0];
if (firstDeclaration.initializer) {
- var diagnostic = forInOrOfStatement.kind === 224
+ var diagnostic = forInOrOfStatement.kind === 226
? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer
: ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
return grammarErrorOnNode(firstDeclaration.name, diagnostic);
}
if (firstDeclaration.type) {
- var diagnostic = forInOrOfStatement.kind === 224
+ var diagnostic = forInOrOfStatement.kind === 226
? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation
: ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
return grammarErrorOnNode(firstDeclaration, diagnostic);
@@ -48177,11 +48889,11 @@ var ts;
return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters);
}
else if (!doesAccessorHaveCorrectParameterCount(accessor)) {
- return grammarErrorOnNode(accessor.name, kind === 156 ?
+ return grammarErrorOnNode(accessor.name, kind === 158 ?
ts.Diagnostics.A_get_accessor_cannot_have_parameters :
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);
}
- else if (kind === 157) {
+ else if (kind === 159) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -48201,23 +48913,23 @@ var ts;
return false;
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 156 ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 158 ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 156 ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 158 ? 1 : 2)) {
return ts.getThisParameter(accessor);
}
}
function checkGrammarTypeOperatorNode(node) {
- if (node.operator === 141) {
- if (node.type.kind !== 138) {
- return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(138));
+ if (node.operator === 142) {
+ if (node.type.kind !== 139) {
+ return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(139));
}
var parent = ts.walkUpParenthesizedTypes(node.parent);
switch (parent.kind) {
- case 235:
+ case 237:
var decl = parent;
- if (decl.name.kind !== 71) {
+ if (decl.name.kind !== 72) {
return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
}
if (!ts.isVariableDeclarationInVariableStatement(decl)) {
@@ -48227,13 +48939,13 @@ var ts;
return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
}
break;
- case 152:
+ case 154:
if (!ts.hasModifier(parent, 32) ||
!ts.hasModifier(parent, 64)) {
return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);
}
break;
- case 151:
+ case 153:
if (!ts.hasModifier(parent, 64)) {
return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
}
@@ -48252,9 +48964,9 @@ var ts;
if (checkGrammarFunctionLikeDeclaration(node)) {
return true;
}
- if (node.kind === 154) {
- if (node.parent.kind === 186) {
- if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120)) {
+ if (node.kind === 156) {
+ if (node.parent.kind === 188) {
+ if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 121)) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here);
}
else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {
@@ -48275,14 +48987,14 @@ var ts;
if (node.flags & 4194304) {
return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
- else if (node.kind === 154 && !node.body) {
+ else if (node.kind === 156 && !node.body) {
return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
}
- else if (node.parent.kind === 239) {
+ else if (node.parent.kind === 241) {
return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
- else if (node.parent.kind === 166) {
+ else if (node.parent.kind === 168) {
return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
}
}
@@ -48293,9 +49005,9 @@ var ts;
return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 231:
+ case 233:
if (node.label && current.label.escapedText === node.label.escapedText) {
- var isMisplacedContinueLabel = node.kind === 226
+ var isMisplacedContinueLabel = node.kind === 228
&& !ts.isIterationStatement(current.statement, true);
if (isMisplacedContinueLabel) {
return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);
@@ -48303,8 +49015,8 @@ var ts;
return false;
}
break;
- case 230:
- if (node.kind === 227 && !node.label) {
+ case 232:
+ if (node.kind === 229 && !node.label) {
return false;
}
break;
@@ -48317,13 +49029,13 @@ var ts;
current = current.parent;
}
if (node.label) {
- var message = node.kind === 227
+ var message = node.kind === 229
? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement
: ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
}
else {
- var message = node.kind === 227
+ var message = node.kind === 229
? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement
: ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
return grammarErrorOnNode(node, message);
@@ -48345,34 +49057,43 @@ var ts;
}
}
function isStringOrNumberLiteralExpression(expr) {
- return expr.kind === 9 || expr.kind === 8 ||
- expr.kind === 200 && expr.operator === 38 &&
+ return expr.kind === 10 || expr.kind === 8 ||
+ expr.kind === 202 && expr.operator === 39 &&
expr.operand.kind === 8;
}
+ function isBigIntLiteralExpression(expr) {
+ return expr.kind === 9 ||
+ expr.kind === 202 && expr.operator === 39 &&
+ expr.operand.kind === 9;
+ }
function isSimpleLiteralEnumReference(expr) {
if ((ts.isPropertyAccessExpression(expr) || (ts.isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression))) &&
ts.isEntityNameExpression(expr.expression))
- return !!(checkExpressionCached(expr).flags & 512);
+ return !!(checkExpressionCached(expr).flags & 1024);
}
function checkAmbientInitializer(node) {
- if (node.initializer) {
- var isInvalidInitializer = !(isStringOrNumberLiteralExpression(node.initializer) || isSimpleLiteralEnumReference(node.initializer) || node.initializer.kind === 101 || node.initializer.kind === 86);
+ var initializer = node.initializer;
+ if (initializer) {
+ var isInvalidInitializer = !(isStringOrNumberLiteralExpression(initializer) ||
+ isSimpleLiteralEnumReference(initializer) ||
+ initializer.kind === 102 || initializer.kind === 87 ||
+ isBigIntLiteralExpression(initializer));
var isConstOrReadonly = ts.isDeclarationReadonly(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node);
if (isConstOrReadonly && !node.type) {
if (isInvalidInitializer) {
- return grammarErrorOnNode(node.initializer, ts.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference);
+ return grammarErrorOnNode(initializer, ts.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference);
}
}
else {
- return grammarErrorOnNode(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);
+ return grammarErrorOnNode(initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);
}
if (!isConstOrReadonly || isInvalidInitializer) {
- return grammarErrorOnNode(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);
+ return grammarErrorOnNode(initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);
}
}
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 224 && node.parent.parent.kind !== 225) {
+ if (node.parent.parent.kind !== 226 && node.parent.parent.kind !== 227) {
if (node.flags & 4194304) {
checkAmbientInitializer(node);
}
@@ -48385,7 +49106,7 @@ var ts;
}
}
}
- if (node.exclamationToken && (node.parent.parent.kind !== 217 || !node.type || node.initializer || node.flags & 4194304)) {
+ if (node.exclamationToken && (node.parent.parent.kind !== 219 || !node.type || node.initializer || node.flags & 4194304)) {
return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
}
if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit &&
@@ -48396,7 +49117,7 @@ var ts;
return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name);
}
function checkESModuleMarker(name) {
- if (name.kind === 71) {
+ if (name.kind === 72) {
if (ts.idText(name) === "__esModule") {
return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules);
}
@@ -48413,8 +49134,8 @@ var ts;
return false;
}
function checkGrammarNameInLetOrConstDeclarations(name) {
- if (name.kind === 71) {
- if (name.originalKeywordKind === 110) {
+ if (name.kind === 72) {
+ if (name.originalKeywordKind === 111) {
return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
}
}
@@ -48441,15 +49162,15 @@ var ts;
}
function allowLetAndConstDeclarations(parent) {
switch (parent.kind) {
- case 220:
- case 221:
case 222:
- case 229:
case 223:
case 224:
- case 225:
- return false;
case 231:
+ case 225:
+ case 226:
+ case 227:
+ return false;
+ case 233:
return allowLetAndConstDeclarations(parent.parent);
}
return true;
@@ -48467,12 +49188,12 @@ var ts;
function checkGrammarMetaProperty(node) {
var escapedText = node.name.escapedText;
switch (node.keywordToken) {
- case 94:
+ case 95:
if (escapedText !== "target") {
return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts.tokenToString(node.keywordToken), "target");
}
break;
- case 91:
+ case 92:
if (escapedText !== "meta") {
return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts.tokenToString(node.keywordToken), "meta");
}
@@ -48527,7 +49248,7 @@ var ts;
return true;
}
}
- else if (node.parent.kind === 239) {
+ else if (node.parent.kind === 241) {
if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
return true;
}
@@ -48535,7 +49256,7 @@ var ts;
return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer);
}
}
- else if (node.parent.kind === 166) {
+ else if (node.parent.kind === 168) {
if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
return true;
}
@@ -48552,13 +49273,13 @@ var ts;
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 239 ||
- node.kind === 240 ||
+ if (node.kind === 241 ||
+ node.kind === 242 ||
+ node.kind === 249 ||
+ node.kind === 248 ||
+ node.kind === 255 ||
+ node.kind === 254 ||
node.kind === 247 ||
- node.kind === 246 ||
- node.kind === 253 ||
- node.kind === 252 ||
- node.kind === 245 ||
ts.hasModifier(node, 2 | 1 | 512)) {
return false;
}
@@ -48567,7 +49288,7 @@ var ts;
function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {
for (var _i = 0, _a = file.statements; _i < _a.length; _i++) {
var decl = _a[_i];
- if (ts.isDeclaration(decl) || decl.kind === 217) {
+ if (ts.isDeclaration(decl) || decl.kind === 219) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
@@ -48587,7 +49308,7 @@ var ts;
if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 216 || node.parent.kind === 243 || node.parent.kind === 277) {
+ if (node.parent.kind === 218 || node.parent.kind === 245 || node.parent.kind === 279) {
var links_2 = getNodeLinks(node.parent);
if (!links_2.hasReportedStatementInAmbientContext) {
return links_2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -48604,20 +49325,32 @@ var ts;
if (languageVersion >= 1) {
diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0;
}
- else if (ts.isChildOfNodeWithKind(node, 180)) {
+ else if (ts.isChildOfNodeWithKind(node, 182)) {
diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
}
- else if (ts.isChildOfNodeWithKind(node, 276)) {
+ else if (ts.isChildOfNodeWithKind(node, 278)) {
diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
}
if (diagnosticMessage) {
- var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 38;
+ var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 39;
var literal = (withMinus ? "-" : "") + "0o" + node.text;
return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal);
}
}
return false;
}
+ function checkGrammarBigIntLiteral(node) {
+ var literalType = ts.isLiteralTypeNode(node.parent) ||
+ ts.isPrefixUnaryExpression(node.parent) && ts.isLiteralTypeNode(node.parent.parent);
+ if (!literalType) {
+ if (languageVersion < 6) {
+ if (grammarErrorOnNode(node, ts.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ESNext)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) {
var sourceFile = ts.getSourceFileOfNode(node);
if (!hasParseDiagnostics(sourceFile)) {
@@ -48658,8 +49391,8 @@ var ts;
ts.createTypeChecker = createTypeChecker;
function isDeclarationNameOrImportPropertyName(name) {
switch (name.parent.kind) {
- case 251:
- case 255:
+ case 253:
+ case 257:
return ts.isIdentifier(name);
default:
return ts.isDeclarationName(name);
@@ -48667,13 +49400,13 @@ var ts;
}
function isSomeImportDeclaration(decl) {
switch (decl.kind) {
+ case 250:
case 248:
- case 246:
- case 249:
case 251:
+ case 253:
return true;
- case 71:
- return decl.parent.kind === 251;
+ case 72:
+ return decl.parent.kind === 253;
default:
return false;
}
@@ -48691,7 +49424,7 @@ var ts;
JsxNames.LibraryManagedAttributes = "LibraryManagedAttributes";
})(JsxNames || (JsxNames = {}));
function typeIsLiteralType(type) {
- return !!(type.flags & 448);
+ return !!(type.flags & 2944);
}
})(ts || (ts = {}));
var ts;
@@ -48744,6 +49477,9 @@ var ts;
if (typeof value === "number") {
return createNumericLiteral(value + "");
}
+ if (typeof value === "object" && "base10Value" in value) {
+ return createBigIntLiteral(ts.pseudoBigIntToString(value) + "n");
+ }
if (typeof value === "boolean") {
return value ? createTrue() : createFalse();
}
@@ -48763,14 +49499,20 @@ var ts;
return node;
}
ts.createNumericLiteral = createNumericLiteral;
- function createStringLiteral(text) {
+ function createBigIntLiteral(value) {
var node = createSynthesizedNode(9);
+ node.text = value;
+ return node;
+ }
+ ts.createBigIntLiteral = createBigIntLiteral;
+ function createStringLiteral(text) {
+ var node = createSynthesizedNode(10);
node.text = text;
return node;
}
ts.createStringLiteral = createStringLiteral;
function createRegularExpressionLiteral(text) {
- var node = createSynthesizedNode(12);
+ var node = createSynthesizedNode(13);
node.text = text;
return node;
}
@@ -48781,7 +49523,7 @@ var ts;
return node;
}
function createIdentifier(text, typeArguments) {
- var node = createSynthesizedNode(71);
+ var node = createSynthesizedNode(72);
node.escapedText = ts.escapeLeadingUnderscores(text);
node.originalKeywordKind = text ? ts.stringToToken(text) : 0;
node.autoGenerateFlags = 0;
@@ -48857,23 +49599,23 @@ var ts;
}
ts.createToken = createToken;
function createSuper() {
- return createSynthesizedNode(97);
+ return createSynthesizedNode(98);
}
ts.createSuper = createSuper;
function createThis() {
- return createSynthesizedNode(99);
+ return createSynthesizedNode(100);
}
ts.createThis = createThis;
function createNull() {
- return createSynthesizedNode(95);
+ return createSynthesizedNode(96);
}
ts.createNull = createNull;
function createTrue() {
- return createSynthesizedNode(101);
+ return createSynthesizedNode(102);
}
ts.createTrue = createTrue;
function createFalse() {
- return createSynthesizedNode(86);
+ return createSynthesizedNode(87);
}
ts.createFalse = createFalse;
function createModifier(kind) {
@@ -48883,43 +49625,43 @@ var ts;
function createModifiersFromModifierFlags(flags) {
var result = [];
if (flags & 1) {
- result.push(createModifier(84));
+ result.push(createModifier(85));
}
if (flags & 2) {
- result.push(createModifier(124));
+ result.push(createModifier(125));
}
if (flags & 512) {
- result.push(createModifier(79));
+ result.push(createModifier(80));
}
if (flags & 2048) {
- result.push(createModifier(76));
+ result.push(createModifier(77));
}
if (flags & 4) {
- result.push(createModifier(114));
- }
- if (flags & 8) {
- result.push(createModifier(112));
- }
- if (flags & 16) {
- result.push(createModifier(113));
- }
- if (flags & 128) {
- result.push(createModifier(117));
- }
- if (flags & 32) {
result.push(createModifier(115));
}
+ if (flags & 8) {
+ result.push(createModifier(113));
+ }
+ if (flags & 16) {
+ result.push(createModifier(114));
+ }
+ if (flags & 128) {
+ result.push(createModifier(118));
+ }
+ if (flags & 32) {
+ result.push(createModifier(116));
+ }
if (flags & 64) {
- result.push(createModifier(132));
+ result.push(createModifier(133));
}
if (flags & 256) {
- result.push(createModifier(120));
+ result.push(createModifier(121));
}
return result;
}
ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags;
function createQualifiedName(left, right) {
- var node = createSynthesizedNode(146);
+ var node = createSynthesizedNode(148);
node.left = left;
node.right = asName(right);
return node;
@@ -48938,7 +49680,7 @@ var ts;
: expression;
}
function createComputedPropertyName(expression) {
- var node = createSynthesizedNode(147);
+ var node = createSynthesizedNode(149);
node.expression = parenthesizeForComputedName(expression);
return node;
}
@@ -48950,7 +49692,7 @@ var ts;
}
ts.updateComputedPropertyName = updateComputedPropertyName;
function createTypeParameterDeclaration(name, constraint, defaultType) {
- var node = createSynthesizedNode(148);
+ var node = createSynthesizedNode(150);
node.name = asName(name);
node.constraint = constraint;
node.default = defaultType;
@@ -48966,7 +49708,7 @@ var ts;
}
ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration;
function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
- var node = createSynthesizedNode(149);
+ var node = createSynthesizedNode(151);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.dotDotDotToken = dotDotDotToken;
@@ -48990,7 +49732,7 @@ var ts;
}
ts.updateParameter = updateParameter;
function createDecorator(expression) {
- var node = createSynthesizedNode(150);
+ var node = createSynthesizedNode(152);
node.expression = ts.parenthesizeForAccess(expression);
return node;
}
@@ -49002,7 +49744,7 @@ var ts;
}
ts.updateDecorator = updateDecorator;
function createPropertySignature(modifiers, name, questionToken, type, initializer) {
- var node = createSynthesizedNode(151);
+ var node = createSynthesizedNode(153);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
node.questionToken = questionToken;
@@ -49022,12 +49764,12 @@ var ts;
}
ts.updatePropertySignature = updatePropertySignature;
function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) {
- var node = createSynthesizedNode(152);
+ var node = createSynthesizedNode(154);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
- node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 ? questionOrExclamationToken : undefined;
- node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 ? questionOrExclamationToken : undefined;
+ node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 56 ? questionOrExclamationToken : undefined;
+ node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 52 ? questionOrExclamationToken : undefined;
node.type = type;
node.initializer = initializer;
return node;
@@ -49037,8 +49779,8 @@ var ts;
return node.decorators !== decorators
|| node.modifiers !== modifiers
|| node.name !== name
- || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 ? questionOrExclamationToken : undefined)
- || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 ? questionOrExclamationToken : undefined)
+ || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 56 ? questionOrExclamationToken : undefined)
+ || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 52 ? questionOrExclamationToken : undefined)
|| node.type !== type
|| node.initializer !== initializer
? updateNode(createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node)
@@ -49046,7 +49788,7 @@ var ts;
}
ts.updateProperty = updateProperty;
function createMethodSignature(typeParameters, parameters, type, name, questionToken) {
- var node = createSignatureDeclaration(153, typeParameters, parameters, type);
+ var node = createSignatureDeclaration(155, typeParameters, parameters, type);
node.name = asName(name);
node.questionToken = questionToken;
return node;
@@ -49063,7 +49805,7 @@ var ts;
}
ts.updateMethodSignature = updateMethodSignature;
function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(154);
+ var node = createSynthesizedNode(156);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
@@ -49091,7 +49833,7 @@ var ts;
}
ts.updateMethod = updateMethod;
function createConstructor(decorators, modifiers, parameters, body) {
- var node = createSynthesizedNode(155);
+ var node = createSynthesizedNode(157);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.typeParameters = undefined;
@@ -49111,7 +49853,7 @@ var ts;
}
ts.updateConstructor = updateConstructor;
function createGetAccessor(decorators, modifiers, name, parameters, type, body) {
- var node = createSynthesizedNode(156);
+ var node = createSynthesizedNode(158);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -49134,7 +49876,7 @@ var ts;
}
ts.updateGetAccessor = updateGetAccessor;
function createSetAccessor(decorators, modifiers, name, parameters, body) {
- var node = createSynthesizedNode(157);
+ var node = createSynthesizedNode(159);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -49155,7 +49897,7 @@ var ts;
}
ts.updateSetAccessor = updateSetAccessor;
function createCallSignature(typeParameters, parameters, type) {
- return createSignatureDeclaration(158, typeParameters, parameters, type);
+ return createSignatureDeclaration(160, typeParameters, parameters, type);
}
ts.createCallSignature = createCallSignature;
function updateCallSignature(node, typeParameters, parameters, type) {
@@ -49163,7 +49905,7 @@ var ts;
}
ts.updateCallSignature = updateCallSignature;
function createConstructSignature(typeParameters, parameters, type) {
- return createSignatureDeclaration(159, typeParameters, parameters, type);
+ return createSignatureDeclaration(161, typeParameters, parameters, type);
}
ts.createConstructSignature = createConstructSignature;
function updateConstructSignature(node, typeParameters, parameters, type) {
@@ -49171,7 +49913,7 @@ var ts;
}
ts.updateConstructSignature = updateConstructSignature;
function createIndexSignature(decorators, modifiers, parameters, type) {
- var node = createSynthesizedNode(160);
+ var node = createSynthesizedNode(162);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.parameters = createNodeArray(parameters);
@@ -49209,7 +49951,7 @@ var ts;
}
ts.createKeywordTypeNode = createKeywordTypeNode;
function createTypePredicateNode(parameterName, type) {
- var node = createSynthesizedNode(161);
+ var node = createSynthesizedNode(163);
node.parameterName = asName(parameterName);
node.type = type;
return node;
@@ -49223,7 +49965,7 @@ var ts;
}
ts.updateTypePredicateNode = updateTypePredicateNode;
function createTypeReferenceNode(typeName, typeArguments) {
- var node = createSynthesizedNode(162);
+ var node = createSynthesizedNode(164);
node.typeName = asName(typeName);
node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments);
return node;
@@ -49237,7 +49979,7 @@ var ts;
}
ts.updateTypeReferenceNode = updateTypeReferenceNode;
function createFunctionTypeNode(typeParameters, parameters, type) {
- return createSignatureDeclaration(163, typeParameters, parameters, type);
+ return createSignatureDeclaration(165, typeParameters, parameters, type);
}
ts.createFunctionTypeNode = createFunctionTypeNode;
function updateFunctionTypeNode(node, typeParameters, parameters, type) {
@@ -49245,7 +49987,7 @@ var ts;
}
ts.updateFunctionTypeNode = updateFunctionTypeNode;
function createConstructorTypeNode(typeParameters, parameters, type) {
- return createSignatureDeclaration(164, typeParameters, parameters, type);
+ return createSignatureDeclaration(166, typeParameters, parameters, type);
}
ts.createConstructorTypeNode = createConstructorTypeNode;
function updateConstructorTypeNode(node, typeParameters, parameters, type) {
@@ -49253,7 +49995,7 @@ var ts;
}
ts.updateConstructorTypeNode = updateConstructorTypeNode;
function createTypeQueryNode(exprName) {
- var node = createSynthesizedNode(165);
+ var node = createSynthesizedNode(167);
node.exprName = exprName;
return node;
}
@@ -49265,7 +50007,7 @@ var ts;
}
ts.updateTypeQueryNode = updateTypeQueryNode;
function createTypeLiteralNode(members) {
- var node = createSynthesizedNode(166);
+ var node = createSynthesizedNode(168);
node.members = createNodeArray(members);
return node;
}
@@ -49277,7 +50019,7 @@ var ts;
}
ts.updateTypeLiteralNode = updateTypeLiteralNode;
function createArrayTypeNode(elementType) {
- var node = createSynthesizedNode(167);
+ var node = createSynthesizedNode(169);
node.elementType = ts.parenthesizeArrayTypeMember(elementType);
return node;
}
@@ -49289,7 +50031,7 @@ var ts;
}
ts.updateArrayTypeNode = updateArrayTypeNode;
function createTupleTypeNode(elementTypes) {
- var node = createSynthesizedNode(168);
+ var node = createSynthesizedNode(170);
node.elementTypes = createNodeArray(elementTypes);
return node;
}
@@ -49301,7 +50043,7 @@ var ts;
}
ts.updateTupleTypeNode = updateTupleTypeNode;
function createOptionalTypeNode(type) {
- var node = createSynthesizedNode(169);
+ var node = createSynthesizedNode(171);
node.type = ts.parenthesizeArrayTypeMember(type);
return node;
}
@@ -49313,7 +50055,7 @@ var ts;
}
ts.updateOptionalTypeNode = updateOptionalTypeNode;
function createRestTypeNode(type) {
- var node = createSynthesizedNode(170);
+ var node = createSynthesizedNode(172);
node.type = type;
return node;
}
@@ -49325,7 +50067,7 @@ var ts;
}
ts.updateRestTypeNode = updateRestTypeNode;
function createUnionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(171, types);
+ return createUnionOrIntersectionTypeNode(173, types);
}
ts.createUnionTypeNode = createUnionTypeNode;
function updateUnionTypeNode(node, types) {
@@ -49333,7 +50075,7 @@ var ts;
}
ts.updateUnionTypeNode = updateUnionTypeNode;
function createIntersectionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(172, types);
+ return createUnionOrIntersectionTypeNode(174, types);
}
ts.createIntersectionTypeNode = createIntersectionTypeNode;
function updateIntersectionTypeNode(node, types) {
@@ -49352,7 +50094,7 @@ var ts;
: node;
}
function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
- var node = createSynthesizedNode(173);
+ var node = createSynthesizedNode(175);
node.checkType = ts.parenthesizeConditionalTypeMember(checkType);
node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType);
node.trueType = trueType;
@@ -49370,7 +50112,7 @@ var ts;
}
ts.updateConditionalTypeNode = updateConditionalTypeNode;
function createInferTypeNode(typeParameter) {
- var node = createSynthesizedNode(174);
+ var node = createSynthesizedNode(176);
node.typeParameter = typeParameter;
return node;
}
@@ -49382,7 +50124,7 @@ var ts;
}
ts.updateInferTypeNode = updateInferTypeNode;
function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) {
- var node = createSynthesizedNode(181);
+ var node = createSynthesizedNode(183);
node.argument = argument;
node.qualifier = qualifier;
node.typeArguments = asNodeArray(typeArguments);
@@ -49400,7 +50142,7 @@ var ts;
}
ts.updateImportTypeNode = updateImportTypeNode;
function createParenthesizedType(type) {
- var node = createSynthesizedNode(175);
+ var node = createSynthesizedNode(177);
node.type = type;
return node;
}
@@ -49412,12 +50154,12 @@ var ts;
}
ts.updateParenthesizedType = updateParenthesizedType;
function createThisTypeNode() {
- return createSynthesizedNode(176);
+ return createSynthesizedNode(178);
}
ts.createThisTypeNode = createThisTypeNode;
function createTypeOperatorNode(operatorOrType, type) {
- var node = createSynthesizedNode(177);
- node.operator = typeof operatorOrType === "number" ? operatorOrType : 128;
+ var node = createSynthesizedNode(179);
+ node.operator = typeof operatorOrType === "number" ? operatorOrType : 129;
node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType);
return node;
}
@@ -49427,7 +50169,7 @@ var ts;
}
ts.updateTypeOperatorNode = updateTypeOperatorNode;
function createIndexedAccessTypeNode(objectType, indexType) {
- var node = createSynthesizedNode(178);
+ var node = createSynthesizedNode(180);
node.objectType = ts.parenthesizeElementTypeMember(objectType);
node.indexType = indexType;
return node;
@@ -49441,7 +50183,7 @@ var ts;
}
ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode;
function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) {
- var node = createSynthesizedNode(179);
+ var node = createSynthesizedNode(181);
node.readonlyToken = readonlyToken;
node.typeParameter = typeParameter;
node.questionToken = questionToken;
@@ -49459,7 +50201,7 @@ var ts;
}
ts.updateMappedTypeNode = updateMappedTypeNode;
function createLiteralTypeNode(literal) {
- var node = createSynthesizedNode(180);
+ var node = createSynthesizedNode(182);
node.literal = literal;
return node;
}
@@ -49471,7 +50213,7 @@ var ts;
}
ts.updateLiteralTypeNode = updateLiteralTypeNode;
function createObjectBindingPattern(elements) {
- var node = createSynthesizedNode(182);
+ var node = createSynthesizedNode(184);
node.elements = createNodeArray(elements);
return node;
}
@@ -49483,7 +50225,7 @@ var ts;
}
ts.updateObjectBindingPattern = updateObjectBindingPattern;
function createArrayBindingPattern(elements) {
- var node = createSynthesizedNode(183);
+ var node = createSynthesizedNode(185);
node.elements = createNodeArray(elements);
return node;
}
@@ -49495,7 +50237,7 @@ var ts;
}
ts.updateArrayBindingPattern = updateArrayBindingPattern;
function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
- var node = createSynthesizedNode(184);
+ var node = createSynthesizedNode(186);
node.dotDotDotToken = dotDotDotToken;
node.propertyName = asName(propertyName);
node.name = asName(name);
@@ -49513,7 +50255,7 @@ var ts;
}
ts.updateBindingElement = updateBindingElement;
function createArrayLiteral(elements, multiLine) {
- var node = createSynthesizedNode(185);
+ var node = createSynthesizedNode(187);
node.elements = ts.parenthesizeListElements(createNodeArray(elements));
if (multiLine)
node.multiLine = true;
@@ -49527,7 +50269,7 @@ var ts;
}
ts.updateArrayLiteral = updateArrayLiteral;
function createObjectLiteral(properties, multiLine) {
- var node = createSynthesizedNode(186);
+ var node = createSynthesizedNode(188);
node.properties = createNodeArray(properties);
if (multiLine)
node.multiLine = true;
@@ -49541,7 +50283,7 @@ var ts;
}
ts.updateObjectLiteral = updateObjectLiteral;
function createPropertyAccess(expression, name) {
- var node = createSynthesizedNode(187);
+ var node = createSynthesizedNode(189);
node.expression = ts.parenthesizeForAccess(expression);
node.name = asName(name);
setEmitFlags(node, 131072);
@@ -49556,7 +50298,7 @@ var ts;
}
ts.updatePropertyAccess = updatePropertyAccess;
function createElementAccess(expression, index) {
- var node = createSynthesizedNode(188);
+ var node = createSynthesizedNode(190);
node.expression = ts.parenthesizeForAccess(expression);
node.argumentExpression = asExpression(index);
return node;
@@ -49570,7 +50312,7 @@ var ts;
}
ts.updateElementAccess = updateElementAccess;
function createCall(expression, typeArguments, argumentsArray) {
- var node = createSynthesizedNode(189);
+ var node = createSynthesizedNode(191);
node.expression = ts.parenthesizeForAccess(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray));
@@ -49586,7 +50328,7 @@ var ts;
}
ts.updateCall = updateCall;
function createNew(expression, typeArguments, argumentsArray) {
- var node = createSynthesizedNode(190);
+ var node = createSynthesizedNode(192);
node.expression = ts.parenthesizeForNew(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined;
@@ -49602,7 +50344,7 @@ var ts;
}
ts.updateNew = updateNew;
function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) {
- var node = createSynthesizedNode(191);
+ var node = createSynthesizedNode(193);
node.tag = ts.parenthesizeForAccess(tag);
if (template) {
node.typeArguments = asNodeArray(typeArgumentsOrTemplate);
@@ -49625,7 +50367,7 @@ var ts;
}
ts.updateTaggedTemplate = updateTaggedTemplate;
function createTypeAssertion(type, expression) {
- var node = createSynthesizedNode(192);
+ var node = createSynthesizedNode(194);
node.type = type;
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
@@ -49639,7 +50381,7 @@ var ts;
}
ts.updateTypeAssertion = updateTypeAssertion;
function createParen(expression) {
- var node = createSynthesizedNode(193);
+ var node = createSynthesizedNode(195);
node.expression = expression;
return node;
}
@@ -49651,7 +50393,7 @@ var ts;
}
ts.updateParen = updateParen;
function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(194);
+ var node = createSynthesizedNode(196);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
node.name = asName(name);
@@ -49675,12 +50417,12 @@ var ts;
}
ts.updateFunctionExpression = updateFunctionExpression;
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
- var node = createSynthesizedNode(195);
+ var node = createSynthesizedNode(197);
node.modifiers = asNodeArray(modifiers);
node.typeParameters = asNodeArray(typeParameters);
node.parameters = createNodeArray(parameters);
node.type = type;
- node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(36);
+ node.equalsGreaterThanToken = equalsGreaterThanToken || createToken(37);
node.body = ts.parenthesizeConciseBody(body);
return node;
}
@@ -49697,7 +50439,7 @@ var ts;
}
ts.updateArrowFunction = updateArrowFunction;
function createDelete(expression) {
- var node = createSynthesizedNode(196);
+ var node = createSynthesizedNode(198);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -49709,7 +50451,7 @@ var ts;
}
ts.updateDelete = updateDelete;
function createTypeOf(expression) {
- var node = createSynthesizedNode(197);
+ var node = createSynthesizedNode(199);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -49721,7 +50463,7 @@ var ts;
}
ts.updateTypeOf = updateTypeOf;
function createVoid(expression) {
- var node = createSynthesizedNode(198);
+ var node = createSynthesizedNode(200);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -49733,7 +50475,7 @@ var ts;
}
ts.updateVoid = updateVoid;
function createAwait(expression) {
- var node = createSynthesizedNode(199);
+ var node = createSynthesizedNode(201);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -49745,7 +50487,7 @@ var ts;
}
ts.updateAwait = updateAwait;
function createPrefix(operator, operand) {
- var node = createSynthesizedNode(200);
+ var node = createSynthesizedNode(202);
node.operator = operator;
node.operand = ts.parenthesizePrefixOperand(operand);
return node;
@@ -49758,7 +50500,7 @@ var ts;
}
ts.updatePrefix = updatePrefix;
function createPostfix(operand, operator) {
- var node = createSynthesizedNode(201);
+ var node = createSynthesizedNode(203);
node.operand = ts.parenthesizePostfixOperand(operand);
node.operator = operator;
return node;
@@ -49771,7 +50513,7 @@ var ts;
}
ts.updatePostfix = updatePostfix;
function createBinary(left, operator, right) {
- var node = createSynthesizedNode(202);
+ var node = createSynthesizedNode(204);
var operatorToken = asToken(operator);
var operatorKind = operatorToken.kind;
node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined);
@@ -49788,11 +50530,11 @@ var ts;
}
ts.updateBinary = updateBinary;
function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) {
- var node = createSynthesizedNode(203);
+ var node = createSynthesizedNode(205);
node.condition = ts.parenthesizeForConditionalHead(condition);
- node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55);
+ node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(56);
node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue);
- node.colonToken = whenFalse ? colonToken : createToken(56);
+ node.colonToken = whenFalse ? colonToken : createToken(57);
node.whenFalse = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenFalse : whenTrueOrWhenFalse);
return node;
}
@@ -49808,7 +50550,7 @@ var ts;
}
ts.updateConditional = updateConditional;
function createTemplateExpression(head, templateSpans) {
- var node = createSynthesizedNode(204);
+ var node = createSynthesizedNode(206);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
return node;
@@ -49822,33 +50564,33 @@ var ts;
}
ts.updateTemplateExpression = updateTemplateExpression;
function createTemplateHead(text) {
- var node = createSynthesizedNode(14);
+ var node = createSynthesizedNode(15);
node.text = text;
return node;
}
ts.createTemplateHead = createTemplateHead;
function createTemplateMiddle(text) {
- var node = createSynthesizedNode(15);
+ var node = createSynthesizedNode(16);
node.text = text;
return node;
}
ts.createTemplateMiddle = createTemplateMiddle;
function createTemplateTail(text) {
- var node = createSynthesizedNode(16);
+ var node = createSynthesizedNode(17);
node.text = text;
return node;
}
ts.createTemplateTail = createTemplateTail;
function createNoSubstitutionTemplateLiteral(text) {
- var node = createSynthesizedNode(13);
+ var node = createSynthesizedNode(14);
node.text = text;
return node;
}
ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral;
function createYield(asteriskTokenOrExpression, expression) {
- var node = createSynthesizedNode(205);
- node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 ? asteriskTokenOrExpression : undefined;
- node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 ? asteriskTokenOrExpression : expression;
+ var node = createSynthesizedNode(207);
+ node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 40 ? asteriskTokenOrExpression : undefined;
+ node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 40 ? asteriskTokenOrExpression : expression;
return node;
}
ts.createYield = createYield;
@@ -49860,7 +50602,7 @@ var ts;
}
ts.updateYield = updateYield;
function createSpread(expression) {
- var node = createSynthesizedNode(206);
+ var node = createSynthesizedNode(208);
node.expression = ts.parenthesizeExpressionForList(expression);
return node;
}
@@ -49872,7 +50614,7 @@ var ts;
}
ts.updateSpread = updateSpread;
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(207);
+ var node = createSynthesizedNode(209);
node.decorators = undefined;
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -49893,11 +50635,11 @@ var ts;
}
ts.updateClassExpression = updateClassExpression;
function createOmittedExpression() {
- return createSynthesizedNode(208);
+ return createSynthesizedNode(210);
}
ts.createOmittedExpression = createOmittedExpression;
function createExpressionWithTypeArguments(typeArguments, expression) {
- var node = createSynthesizedNode(209);
+ var node = createSynthesizedNode(211);
node.expression = ts.parenthesizeForAccess(expression);
node.typeArguments = asNodeArray(typeArguments);
return node;
@@ -49911,7 +50653,7 @@ var ts;
}
ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments;
function createAsExpression(expression, type) {
- var node = createSynthesizedNode(210);
+ var node = createSynthesizedNode(212);
node.expression = expression;
node.type = type;
return node;
@@ -49925,7 +50667,7 @@ var ts;
}
ts.updateAsExpression = updateAsExpression;
function createNonNullExpression(expression) {
- var node = createSynthesizedNode(211);
+ var node = createSynthesizedNode(213);
node.expression = ts.parenthesizeForAccess(expression);
return node;
}
@@ -49937,7 +50679,7 @@ var ts;
}
ts.updateNonNullExpression = updateNonNullExpression;
function createMetaProperty(keywordToken, name) {
- var node = createSynthesizedNode(212);
+ var node = createSynthesizedNode(214);
node.keywordToken = keywordToken;
node.name = name;
return node;
@@ -49950,7 +50692,7 @@ var ts;
}
ts.updateMetaProperty = updateMetaProperty;
function createTemplateSpan(expression, literal) {
- var node = createSynthesizedNode(214);
+ var node = createSynthesizedNode(216);
node.expression = expression;
node.literal = literal;
return node;
@@ -49964,11 +50706,11 @@ var ts;
}
ts.updateTemplateSpan = updateTemplateSpan;
function createSemicolonClassElement() {
- return createSynthesizedNode(215);
+ return createSynthesizedNode(217);
}
ts.createSemicolonClassElement = createSemicolonClassElement;
function createBlock(statements, multiLine) {
- var block = createSynthesizedNode(216);
+ var block = createSynthesizedNode(218);
block.statements = createNodeArray(statements);
if (multiLine)
block.multiLine = multiLine;
@@ -49982,7 +50724,7 @@ var ts;
}
ts.updateBlock = updateBlock;
function createVariableStatement(modifiers, declarationList) {
- var node = createSynthesizedNode(217);
+ var node = createSynthesizedNode(219);
node.decorators = undefined;
node.modifiers = asNodeArray(modifiers);
node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
@@ -49997,11 +50739,11 @@ var ts;
}
ts.updateVariableStatement = updateVariableStatement;
function createEmptyStatement() {
- return createSynthesizedNode(218);
+ return createSynthesizedNode(220);
}
ts.createEmptyStatement = createEmptyStatement;
function createExpressionStatement(expression) {
- var node = createSynthesizedNode(219);
+ var node = createSynthesizedNode(221);
node.expression = ts.parenthesizeExpressionForExpressionStatement(expression);
return node;
}
@@ -50015,7 +50757,7 @@ var ts;
ts.createStatement = createExpressionStatement;
ts.updateStatement = updateExpressionStatement;
function createIf(expression, thenStatement, elseStatement) {
- var node = createSynthesizedNode(220);
+ var node = createSynthesizedNode(222);
node.expression = expression;
node.thenStatement = thenStatement;
node.elseStatement = elseStatement;
@@ -50031,7 +50773,7 @@ var ts;
}
ts.updateIf = updateIf;
function createDo(statement, expression) {
- var node = createSynthesizedNode(221);
+ var node = createSynthesizedNode(223);
node.statement = statement;
node.expression = expression;
return node;
@@ -50045,7 +50787,7 @@ var ts;
}
ts.updateDo = updateDo;
function createWhile(expression, statement) {
- var node = createSynthesizedNode(222);
+ var node = createSynthesizedNode(224);
node.expression = expression;
node.statement = statement;
return node;
@@ -50059,7 +50801,7 @@ var ts;
}
ts.updateWhile = updateWhile;
function createFor(initializer, condition, incrementor, statement) {
- var node = createSynthesizedNode(223);
+ var node = createSynthesizedNode(225);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -50077,7 +50819,7 @@ var ts;
}
ts.updateFor = updateFor;
function createForIn(initializer, expression, statement) {
- var node = createSynthesizedNode(224);
+ var node = createSynthesizedNode(226);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -50093,7 +50835,7 @@ var ts;
}
ts.updateForIn = updateForIn;
function createForOf(awaitModifier, initializer, expression, statement) {
- var node = createSynthesizedNode(225);
+ var node = createSynthesizedNode(227);
node.awaitModifier = awaitModifier;
node.initializer = initializer;
node.expression = expression;
@@ -50111,7 +50853,7 @@ var ts;
}
ts.updateForOf = updateForOf;
function createContinue(label) {
- var node = createSynthesizedNode(226);
+ var node = createSynthesizedNode(228);
node.label = asName(label);
return node;
}
@@ -50123,7 +50865,7 @@ var ts;
}
ts.updateContinue = updateContinue;
function createBreak(label) {
- var node = createSynthesizedNode(227);
+ var node = createSynthesizedNode(229);
node.label = asName(label);
return node;
}
@@ -50135,7 +50877,7 @@ var ts;
}
ts.updateBreak = updateBreak;
function createReturn(expression) {
- var node = createSynthesizedNode(228);
+ var node = createSynthesizedNode(230);
node.expression = expression;
return node;
}
@@ -50147,7 +50889,7 @@ var ts;
}
ts.updateReturn = updateReturn;
function createWith(expression, statement) {
- var node = createSynthesizedNode(229);
+ var node = createSynthesizedNode(231);
node.expression = expression;
node.statement = statement;
return node;
@@ -50161,7 +50903,7 @@ var ts;
}
ts.updateWith = updateWith;
function createSwitch(expression, caseBlock) {
- var node = createSynthesizedNode(230);
+ var node = createSynthesizedNode(232);
node.expression = ts.parenthesizeExpressionForList(expression);
node.caseBlock = caseBlock;
return node;
@@ -50175,7 +50917,7 @@ var ts;
}
ts.updateSwitch = updateSwitch;
function createLabel(label, statement) {
- var node = createSynthesizedNode(231);
+ var node = createSynthesizedNode(233);
node.label = asName(label);
node.statement = statement;
return node;
@@ -50189,7 +50931,7 @@ var ts;
}
ts.updateLabel = updateLabel;
function createThrow(expression) {
- var node = createSynthesizedNode(232);
+ var node = createSynthesizedNode(234);
node.expression = expression;
return node;
}
@@ -50201,7 +50943,7 @@ var ts;
}
ts.updateThrow = updateThrow;
function createTry(tryBlock, catchClause, finallyBlock) {
- var node = createSynthesizedNode(233);
+ var node = createSynthesizedNode(235);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -50217,11 +50959,11 @@ var ts;
}
ts.updateTry = updateTry;
function createDebuggerStatement() {
- return createSynthesizedNode(234);
+ return createSynthesizedNode(236);
}
ts.createDebuggerStatement = createDebuggerStatement;
function createVariableDeclaration(name, type, initializer) {
- var node = createSynthesizedNode(235);
+ var node = createSynthesizedNode(237);
node.name = asName(name);
node.type = type;
node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined;
@@ -50238,7 +50980,7 @@ var ts;
ts.updateVariableDeclaration = updateVariableDeclaration;
function createVariableDeclarationList(declarations, flags) {
if (flags === void 0) { flags = 0; }
- var node = createSynthesizedNode(236);
+ var node = createSynthesizedNode(238);
node.flags |= flags & 3;
node.declarations = createNodeArray(declarations);
return node;
@@ -50251,7 +50993,7 @@ var ts;
}
ts.updateVariableDeclarationList = updateVariableDeclarationList;
function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(237);
+ var node = createSynthesizedNode(239);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
@@ -50277,7 +51019,7 @@ var ts;
}
ts.updateFunctionDeclaration = updateFunctionDeclaration;
function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(238);
+ var node = createSynthesizedNode(240);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -50299,7 +51041,7 @@ var ts;
}
ts.updateClassDeclaration = updateClassDeclaration;
function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(239);
+ var node = createSynthesizedNode(241);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -50321,7 +51063,7 @@ var ts;
}
ts.updateInterfaceDeclaration = updateInterfaceDeclaration;
function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) {
- var node = createSynthesizedNode(240);
+ var node = createSynthesizedNode(242);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -50341,7 +51083,7 @@ var ts;
}
ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration;
function createEnumDeclaration(decorators, modifiers, name, members) {
- var node = createSynthesizedNode(241);
+ var node = createSynthesizedNode(243);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -50360,7 +51102,7 @@ var ts;
ts.updateEnumDeclaration = updateEnumDeclaration;
function createModuleDeclaration(decorators, modifiers, name, body, flags) {
if (flags === void 0) { flags = 0; }
- var node = createSynthesizedNode(242);
+ var node = createSynthesizedNode(244);
node.flags |= flags & (16 | 4 | 512);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
@@ -50379,7 +51121,7 @@ var ts;
}
ts.updateModuleDeclaration = updateModuleDeclaration;
function createModuleBlock(statements) {
- var node = createSynthesizedNode(243);
+ var node = createSynthesizedNode(245);
node.statements = createNodeArray(statements);
return node;
}
@@ -50391,7 +51133,7 @@ var ts;
}
ts.updateModuleBlock = updateModuleBlock;
function createCaseBlock(clauses) {
- var node = createSynthesizedNode(244);
+ var node = createSynthesizedNode(246);
node.clauses = createNodeArray(clauses);
return node;
}
@@ -50403,7 +51145,7 @@ var ts;
}
ts.updateCaseBlock = updateCaseBlock;
function createNamespaceExportDeclaration(name) {
- var node = createSynthesizedNode(245);
+ var node = createSynthesizedNode(247);
node.name = asName(name);
return node;
}
@@ -50415,7 +51157,7 @@ var ts;
}
ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration;
function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) {
- var node = createSynthesizedNode(246);
+ var node = createSynthesizedNode(248);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -50433,7 +51175,7 @@ var ts;
}
ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration;
function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) {
- var node = createSynthesizedNode(247);
+ var node = createSynthesizedNode(249);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.importClause = importClause;
@@ -50451,7 +51193,7 @@ var ts;
}
ts.updateImportDeclaration = updateImportDeclaration;
function createImportClause(name, namedBindings) {
- var node = createSynthesizedNode(248);
+ var node = createSynthesizedNode(250);
node.name = name;
node.namedBindings = namedBindings;
return node;
@@ -50465,7 +51207,7 @@ var ts;
}
ts.updateImportClause = updateImportClause;
function createNamespaceImport(name) {
- var node = createSynthesizedNode(249);
+ var node = createSynthesizedNode(251);
node.name = name;
return node;
}
@@ -50477,7 +51219,7 @@ var ts;
}
ts.updateNamespaceImport = updateNamespaceImport;
function createNamedImports(elements) {
- var node = createSynthesizedNode(250);
+ var node = createSynthesizedNode(252);
node.elements = createNodeArray(elements);
return node;
}
@@ -50489,7 +51231,7 @@ var ts;
}
ts.updateNamedImports = updateNamedImports;
function createImportSpecifier(propertyName, name) {
- var node = createSynthesizedNode(251);
+ var node = createSynthesizedNode(253);
node.propertyName = propertyName;
node.name = name;
return node;
@@ -50503,11 +51245,11 @@ var ts;
}
ts.updateImportSpecifier = updateImportSpecifier;
function createExportAssignment(decorators, modifiers, isExportEquals, expression) {
- var node = createSynthesizedNode(252);
+ var node = createSynthesizedNode(254);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.isExportEquals = isExportEquals;
- node.expression = isExportEquals ? ts.parenthesizeBinaryOperand(58, expression, false, undefined) : ts.parenthesizeDefaultExpression(expression);
+ node.expression = isExportEquals ? ts.parenthesizeBinaryOperand(59, expression, false, undefined) : ts.parenthesizeDefaultExpression(expression);
return node;
}
ts.createExportAssignment = createExportAssignment;
@@ -50520,7 +51262,7 @@ var ts;
}
ts.updateExportAssignment = updateExportAssignment;
function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) {
- var node = createSynthesizedNode(253);
+ var node = createSynthesizedNode(255);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.exportClause = exportClause;
@@ -50538,7 +51280,7 @@ var ts;
}
ts.updateExportDeclaration = updateExportDeclaration;
function createNamedExports(elements) {
- var node = createSynthesizedNode(254);
+ var node = createSynthesizedNode(256);
node.elements = createNodeArray(elements);
return node;
}
@@ -50550,7 +51292,7 @@ var ts;
}
ts.updateNamedExports = updateNamedExports;
function createExportSpecifier(propertyName, name) {
- var node = createSynthesizedNode(255);
+ var node = createSynthesizedNode(257);
node.propertyName = asName(propertyName);
node.name = asName(name);
return node;
@@ -50564,7 +51306,7 @@ var ts;
}
ts.updateExportSpecifier = updateExportSpecifier;
function createExternalModuleReference(expression) {
- var node = createSynthesizedNode(257);
+ var node = createSynthesizedNode(259);
node.expression = expression;
return node;
}
@@ -50575,8 +51317,49 @@ var ts;
: node;
}
ts.updateExternalModuleReference = updateExternalModuleReference;
+ function createJSDocTypeExpression(type) {
+ var node = createSynthesizedNode(283);
+ node.type = type;
+ return node;
+ }
+ ts.createJSDocTypeExpression = createJSDocTypeExpression;
+ function createJSDocTypeTag(typeExpression, comment) {
+ var tag = createJSDocTag(302, "type");
+ tag.typeExpression = typeExpression;
+ tag.comment = comment;
+ return tag;
+ }
+ ts.createJSDocTypeTag = createJSDocTypeTag;
+ function createJSDocReturnTag(typeExpression, comment) {
+ var tag = createJSDocTag(300, "returns");
+ tag.typeExpression = typeExpression;
+ tag.comment = comment;
+ return tag;
+ }
+ ts.createJSDocReturnTag = createJSDocReturnTag;
+ function createJSDocParamTag(name, isBracketed, typeExpression, comment) {
+ var tag = createJSDocTag(299, "param");
+ tag.typeExpression = typeExpression;
+ tag.name = name;
+ tag.isBracketed = isBracketed;
+ tag.comment = comment;
+ return tag;
+ }
+ ts.createJSDocParamTag = createJSDocParamTag;
+ function createJSDocComment(comment, tags) {
+ var node = createSynthesizedNode(291);
+ node.comment = comment;
+ node.tags = tags;
+ return node;
+ }
+ ts.createJSDocComment = createJSDocComment;
+ function createJSDocTag(kind, tagName) {
+ var node = createSynthesizedNode(kind);
+ node.tagName = createIdentifier(tagName);
+ return node;
+ }
function createJsxElement(openingElement, children, closingElement) {
- var node = createSynthesizedNode(258);
+ var node = createSynthesizedNode(260);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -50592,7 +51375,7 @@ var ts;
}
ts.updateJsxElement = updateJsxElement;
function createJsxSelfClosingElement(tagName, typeArguments, attributes) {
- var node = createSynthesizedNode(259);
+ var node = createSynthesizedNode(261);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -50608,7 +51391,7 @@ var ts;
}
ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement;
function createJsxOpeningElement(tagName, typeArguments, attributes) {
- var node = createSynthesizedNode(260);
+ var node = createSynthesizedNode(262);
node.tagName = tagName;
node.typeArguments = asNodeArray(typeArguments);
node.attributes = attributes;
@@ -50624,7 +51407,7 @@ var ts;
}
ts.updateJsxOpeningElement = updateJsxOpeningElement;
function createJsxClosingElement(tagName) {
- var node = createSynthesizedNode(261);
+ var node = createSynthesizedNode(263);
node.tagName = tagName;
return node;
}
@@ -50636,7 +51419,7 @@ var ts;
}
ts.updateJsxClosingElement = updateJsxClosingElement;
function createJsxFragment(openingFragment, children, closingFragment) {
- var node = createSynthesizedNode(262);
+ var node = createSynthesizedNode(264);
node.openingFragment = openingFragment;
node.children = createNodeArray(children);
node.closingFragment = closingFragment;
@@ -50652,7 +51435,7 @@ var ts;
}
ts.updateJsxFragment = updateJsxFragment;
function createJsxAttribute(name, initializer) {
- var node = createSynthesizedNode(265);
+ var node = createSynthesizedNode(267);
node.name = name;
node.initializer = initializer;
return node;
@@ -50666,7 +51449,7 @@ var ts;
}
ts.updateJsxAttribute = updateJsxAttribute;
function createJsxAttributes(properties) {
- var node = createSynthesizedNode(266);
+ var node = createSynthesizedNode(268);
node.properties = createNodeArray(properties);
return node;
}
@@ -50678,7 +51461,7 @@ var ts;
}
ts.updateJsxAttributes = updateJsxAttributes;
function createJsxSpreadAttribute(expression) {
- var node = createSynthesizedNode(267);
+ var node = createSynthesizedNode(269);
node.expression = expression;
return node;
}
@@ -50690,7 +51473,7 @@ var ts;
}
ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute;
function createJsxExpression(dotDotDotToken, expression) {
- var node = createSynthesizedNode(268);
+ var node = createSynthesizedNode(270);
node.dotDotDotToken = dotDotDotToken;
node.expression = expression;
return node;
@@ -50703,7 +51486,7 @@ var ts;
}
ts.updateJsxExpression = updateJsxExpression;
function createCaseClause(expression, statements) {
- var node = createSynthesizedNode(269);
+ var node = createSynthesizedNode(271);
node.expression = ts.parenthesizeExpressionForList(expression);
node.statements = createNodeArray(statements);
return node;
@@ -50717,7 +51500,7 @@ var ts;
}
ts.updateCaseClause = updateCaseClause;
function createDefaultClause(statements) {
- var node = createSynthesizedNode(270);
+ var node = createSynthesizedNode(272);
node.statements = createNodeArray(statements);
return node;
}
@@ -50729,7 +51512,7 @@ var ts;
}
ts.updateDefaultClause = updateDefaultClause;
function createHeritageClause(token, types) {
- var node = createSynthesizedNode(271);
+ var node = createSynthesizedNode(273);
node.token = token;
node.types = createNodeArray(types);
return node;
@@ -50742,7 +51525,7 @@ var ts;
}
ts.updateHeritageClause = updateHeritageClause;
function createCatchClause(variableDeclaration, block) {
- var node = createSynthesizedNode(272);
+ var node = createSynthesizedNode(274);
node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration;
node.block = block;
return node;
@@ -50756,7 +51539,7 @@ var ts;
}
ts.updateCatchClause = updateCatchClause;
function createPropertyAssignment(name, initializer) {
- var node = createSynthesizedNode(273);
+ var node = createSynthesizedNode(275);
node.name = asName(name);
node.questionToken = undefined;
node.initializer = ts.parenthesizeExpressionForList(initializer);
@@ -50771,7 +51554,7 @@ var ts;
}
ts.updatePropertyAssignment = updatePropertyAssignment;
function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
- var node = createSynthesizedNode(274);
+ var node = createSynthesizedNode(276);
node.name = asName(name);
node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined;
return node;
@@ -50785,7 +51568,7 @@ var ts;
}
ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment;
function createSpreadAssignment(expression) {
- var node = createSynthesizedNode(275);
+ var node = createSynthesizedNode(277);
node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined;
return node;
}
@@ -50797,7 +51580,7 @@ var ts;
}
ts.updateSpreadAssignment = updateSpreadAssignment;
function createEnumMember(name, initializer) {
- var node = createSynthesizedNode(276);
+ var node = createSynthesizedNode(278);
node.name = asName(name);
node.initializer = initializer && ts.parenthesizeExpressionForList(initializer);
return node;
@@ -50817,7 +51600,7 @@ var ts;
(typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) ||
(libReferences !== undefined && node.libReferenceDirectives !== libReferences) ||
(hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) {
- var updated = createSynthesizedNode(277);
+ var updated = createSynthesizedNode(279);
updated.flags |= node.flags;
updated.statements = createNodeArray(statements);
updated.endOfFileToken = node.endOfFileToken;
@@ -50891,28 +51674,28 @@ var ts;
}
ts.getMutableClone = getMutableClone;
function createNotEmittedStatement(original) {
- var node = createSynthesizedNode(305);
+ var node = createSynthesizedNode(307);
node.original = original;
setTextRange(node, original);
return node;
}
ts.createNotEmittedStatement = createNotEmittedStatement;
function createEndOfDeclarationMarker(original) {
- var node = createSynthesizedNode(309);
+ var node = createSynthesizedNode(311);
node.emitNode = {};
node.original = original;
return node;
}
ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker;
function createMergeDeclarationMarker(original) {
- var node = createSynthesizedNode(308);
+ var node = createSynthesizedNode(310);
node.emitNode = {};
node.original = original;
return node;
}
ts.createMergeDeclarationMarker = createMergeDeclarationMarker;
function createPartiallyEmittedExpression(expression, original) {
- var node = createSynthesizedNode(306);
+ var node = createSynthesizedNode(308);
node.expression = expression;
node.original = original;
setTextRange(node, original);
@@ -50928,17 +51711,17 @@ var ts;
ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression;
function flattenCommaElements(node) {
if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) {
- if (node.kind === 307) {
+ if (node.kind === 309) {
return node.elements;
}
- if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26) {
+ if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27) {
return [node.left, node.right];
}
}
return node;
}
function createCommaList(elements) {
- var node = createSynthesizedNode(307);
+ var node = createSynthesizedNode(309);
node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements));
return node;
}
@@ -50951,14 +51734,14 @@ var ts;
ts.updateCommaList = updateCommaList;
function createBundle(sourceFiles, prepends) {
if (prepends === void 0) { prepends = ts.emptyArray; }
- var node = ts.createNode(278);
+ var node = ts.createNode(280);
node.prepends = prepends;
node.sourceFiles = sourceFiles;
return node;
}
ts.createBundle = createBundle;
function createUnparsedSourceFile(text, mapPath, map) {
- var node = ts.createNode(279);
+ var node = ts.createNode(281);
node.text = text;
node.sourceMapPath = mapPath;
node.sourceMapText = map;
@@ -50966,7 +51749,7 @@ var ts;
}
ts.createUnparsedSourceFile = createUnparsedSourceFile;
function createInputFiles(javascript, declaration, javascriptMapPath, javascriptMapText, declarationMapPath, declarationMapText) {
- var node = ts.createNode(280);
+ var node = ts.createNode(282);
node.javascriptText = javascript;
node.javascriptMapPath = javascriptMapPath;
node.javascriptMapText = javascriptMapText;
@@ -50993,47 +51776,47 @@ var ts;
}
ts.createImmediatelyInvokedArrowFunction = createImmediatelyInvokedArrowFunction;
function createComma(left, right) {
- return createBinary(left, 26, right);
+ return createBinary(left, 27, right);
}
ts.createComma = createComma;
function createLessThan(left, right) {
- return createBinary(left, 27, right);
+ return createBinary(left, 28, right);
}
ts.createLessThan = createLessThan;
function createAssignment(left, right) {
- return createBinary(left, 58, right);
+ return createBinary(left, 59, right);
}
ts.createAssignment = createAssignment;
function createStrictEquality(left, right) {
- return createBinary(left, 34, right);
+ return createBinary(left, 35, right);
}
ts.createStrictEquality = createStrictEquality;
function createStrictInequality(left, right) {
- return createBinary(left, 35, right);
+ return createBinary(left, 36, right);
}
ts.createStrictInequality = createStrictInequality;
function createAdd(left, right) {
- return createBinary(left, 37, right);
+ return createBinary(left, 38, right);
}
ts.createAdd = createAdd;
function createSubtract(left, right) {
- return createBinary(left, 38, right);
+ return createBinary(left, 39, right);
}
ts.createSubtract = createSubtract;
function createPostfixIncrement(operand) {
- return createPostfix(operand, 43);
+ return createPostfix(operand, 44);
}
ts.createPostfixIncrement = createPostfixIncrement;
function createLogicalAnd(left, right) {
- return createBinary(left, 53, right);
+ return createBinary(left, 54, right);
}
ts.createLogicalAnd = createLogicalAnd;
function createLogicalOr(left, right) {
- return createBinary(left, 54, right);
+ return createBinary(left, 55, right);
}
ts.createLogicalOr = createLogicalOr;
function createLogicalNot(operand) {
- return createPrefix(51, operand);
+ return createPrefix(52, operand);
}
ts.createLogicalNot = createLogicalNot;
function createVoidZero() {
@@ -51075,7 +51858,7 @@ var ts;
function getOrCreateEmitNode(node) {
if (!node.emitNode) {
if (ts.isParseTreeNode(node)) {
- if (node.kind === 277) {
+ if (node.kind === 279) {
return node.emitNode = { annotatedNodes: [node] };
}
var sourceFile = ts.getSourceFileOfNode(node);
@@ -51506,7 +52289,7 @@ var ts;
if (!outermostLabeledStatement) {
return node;
}
- var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 231
+ var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 233
? restoreEnclosingLabel(node, outermostLabeledStatement.statement)
: node);
if (afterRestoreLabelCallback) {
@@ -51518,19 +52301,20 @@ var ts;
function shouldBeCapturedInTempVariable(node, cacheIdentifiers) {
var target = ts.skipParentheses(node);
switch (target.kind) {
- case 71:
+ case 72:
return cacheIdentifiers;
- case 99:
+ case 100:
case 8:
case 9:
+ case 10:
return false;
- case 185:
+ case 187:
var elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 186:
+ case 188:
return target.properties.length > 0;
default:
return true;
@@ -51545,7 +52329,7 @@ var ts;
thisArg = ts.createThis();
target = callee;
}
- else if (callee.kind === 97) {
+ else if (callee.kind === 98) {
thisArg = ts.createThis();
target = languageVersion < 2
? ts.setTextRange(ts.createIdentifier("_super"), callee)
@@ -51557,7 +52341,7 @@ var ts;
}
else {
switch (callee.kind) {
- case 187: {
+ case 189: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = ts.createTempVariable(recordTempVariable);
target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name);
@@ -51569,7 +52353,7 @@ var ts;
}
break;
}
- case 188: {
+ case 190: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = ts.createTempVariable(recordTempVariable);
target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression);
@@ -51622,14 +52406,14 @@ var ts;
ts.createExpressionForPropertyName = createExpressionForPropertyName;
function createExpressionForObjectLiteralElementLike(node, property, receiver) {
switch (property.kind) {
- case 156:
- case 157:
+ case 158:
+ case 159:
return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine);
- case 273:
+ case 275:
return createExpressionForPropertyAssignment(property, receiver);
- case 274:
+ case 276:
return createExpressionForShorthandPropertyAssignment(property, receiver);
- case 154:
+ case 156:
return createExpressionForMethodDeclaration(property, receiver);
}
}
@@ -51637,27 +52421,27 @@ var ts;
function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) {
var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor;
if (property === firstAccessor) {
- var properties_9 = [];
+ var properties_8 = [];
if (getAccessor) {
var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body);
ts.setTextRange(getterFunction, getAccessor);
ts.setOriginalNode(getterFunction, getAccessor);
var getter = ts.createPropertyAssignment("get", getterFunction);
- properties_9.push(getter);
+ properties_8.push(getter);
}
if (setAccessor) {
var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, undefined, undefined, undefined, setAccessor.parameters, undefined, setAccessor.body);
ts.setTextRange(setterFunction, setAccessor);
ts.setOriginalNode(setterFunction, setAccessor);
var setter = ts.createPropertyAssignment("set", setterFunction);
- properties_9.push(setter);
+ properties_8.push(setter);
}
- properties_9.push(ts.createPropertyAssignment("enumerable", ts.createTrue()));
- properties_9.push(ts.createPropertyAssignment("configurable", ts.createTrue()));
+ properties_8.push(ts.createPropertyAssignment("enumerable", ts.createTrue()));
+ properties_8.push(ts.createPropertyAssignment("configurable", ts.createTrue()));
var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), undefined, [
receiver,
createExpressionForPropertyName(property.name),
- ts.createObjectLiteral(properties_9, multiLine)
+ ts.createObjectLiteral(properties_8, multiLine)
]), firstAccessor);
return ts.aggregateTransformFlags(expression);
}
@@ -51834,7 +52618,7 @@ var ts;
ts.ensureUseStrict = ensureUseStrict;
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
var skipped = ts.skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 193) {
+ if (skipped.kind === 195) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)
@@ -51843,10 +52627,10 @@ var ts;
}
ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand;
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- var binaryOperatorPrecedence = ts.getOperatorPrecedence(202, binaryOperator);
- var binaryOperatorAssociativity = ts.getOperatorAssociativity(202, binaryOperator);
+ var binaryOperatorPrecedence = ts.getOperatorPrecedence(204, binaryOperator);
+ var binaryOperatorAssociativity = ts.getOperatorAssociativity(204, binaryOperator);
var emittedOperand = ts.skipPartiallyEmittedExpressions(operand);
- if (!isLeftSideOfBinary && operand.kind === 195 && binaryOperatorPrecedence > 4) {
+ if (!isLeftSideOfBinary && operand.kind === 197 && binaryOperatorPrecedence > 4) {
return true;
}
var operandPrecedence = ts.getExpressionPrecedence(emittedOperand);
@@ -51854,7 +52638,7 @@ var ts;
case -1:
if (!isLeftSideOfBinary
&& binaryOperatorAssociativity === 1
- && operand.kind === 205) {
+ && operand.kind === 207) {
return false;
}
return true;
@@ -51870,7 +52654,7 @@ var ts;
if (operatorHasAssociativeProperty(binaryOperator)) {
return false;
}
- if (binaryOperator === 37) {
+ if (binaryOperator === 38) {
var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0;
if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) {
return false;
@@ -51883,17 +52667,17 @@ var ts;
}
}
function operatorHasAssociativeProperty(binaryOperator) {
- return binaryOperator === 39
+ return binaryOperator === 40
+ || binaryOperator === 50
|| binaryOperator === 49
- || binaryOperator === 48
- || binaryOperator === 50;
+ || binaryOperator === 51;
}
function getLiteralKindOfBinaryPlusOperand(node) {
node = ts.skipPartiallyEmittedExpressions(node);
if (ts.isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 202 && node.operatorToken.kind === 37) {
+ if (node.kind === 204 && node.operatorToken.kind === 38) {
if (node.cachedLiteralKind !== undefined) {
return node.cachedLiteralKind;
}
@@ -51908,7 +52692,7 @@ var ts;
return 0;
}
function parenthesizeForConditionalHead(condition) {
- var conditionalPrecedence = ts.getOperatorPrecedence(203, 55);
+ var conditionalPrecedence = ts.getOperatorPrecedence(205, 56);
var emittedCondition = ts.skipPartiallyEmittedExpressions(condition);
var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition);
if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) {
@@ -51929,8 +52713,8 @@ var ts;
var needsParens = isCommaSequence(check);
if (!needsParens) {
switch (getLeftmostExpression(check, false).kind) {
- case 207:
- case 194:
+ case 209:
+ case 196:
needsParens = true;
}
}
@@ -51940,9 +52724,9 @@ var ts;
function parenthesizeForNew(expression) {
var leftmostExpr = getLeftmostExpression(expression, true);
switch (leftmostExpr.kind) {
- case 189:
+ case 191:
return ts.createParen(expression);
- case 190:
+ case 192:
return !leftmostExpr.arguments
? ts.createParen(expression)
: expression;
@@ -51953,7 +52737,7 @@ var ts;
function parenthesizeForAccess(expression) {
var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
if (ts.isLeftHandSideExpression(emittedExpression)
- && (emittedExpression.kind !== 190 || emittedExpression.arguments)) {
+ && (emittedExpression.kind !== 192 || emittedExpression.arguments)) {
return expression;
}
return ts.setTextRange(ts.createParen(expression), expression);
@@ -51991,7 +52775,7 @@ var ts;
function parenthesizeExpressionForList(expression) {
var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);
- var commaPrecedence = ts.getOperatorPrecedence(202, 26);
+ var commaPrecedence = ts.getOperatorPrecedence(204, 27);
return expressionPrecedence > commaPrecedence
? expression
: ts.setTextRange(ts.createParen(expression), expression);
@@ -52002,29 +52786,29 @@ var ts;
if (ts.isCallExpression(emittedExpression)) {
var callee = emittedExpression.expression;
var kind = ts.skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 194 || kind === 195) {
+ if (kind === 196 || kind === 197) {
var mutableCall = ts.getMutableClone(emittedExpression);
mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee);
return recreateOuterExpressions(expression, mutableCall, 4);
}
}
var leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind;
- if (leftmostExpressionKind === 186 || leftmostExpressionKind === 194) {
+ if (leftmostExpressionKind === 188 || leftmostExpressionKind === 196) {
return ts.setTextRange(ts.createParen(expression), expression);
}
return expression;
}
ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement;
function parenthesizeConditionalTypeMember(member) {
- return member.kind === 173 ? ts.createParenthesizedType(member) : member;
+ return member.kind === 175 ? ts.createParenthesizedType(member) : member;
}
ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember;
function parenthesizeElementTypeMember(member) {
switch (member.kind) {
- case 171:
- case 172:
- case 163:
- case 164:
+ case 173:
+ case 174:
+ case 165:
+ case 166:
return ts.createParenthesizedType(member);
}
return parenthesizeConditionalTypeMember(member);
@@ -52032,9 +52816,9 @@ var ts;
ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember;
function parenthesizeArrayTypeMember(member) {
switch (member.kind) {
- case 165:
- case 177:
- case 174:
+ case 167:
+ case 179:
+ case 176:
return ts.createParenthesizedType(member);
}
return parenthesizeElementTypeMember(member);
@@ -52060,27 +52844,27 @@ var ts;
function getLeftmostExpression(node, stopAtCallExpressions) {
while (true) {
switch (node.kind) {
- case 201:
+ case 203:
node = node.operand;
continue;
- case 202:
+ case 204:
node = node.left;
continue;
- case 203:
+ case 205:
node = node.condition;
continue;
- case 191:
+ case 193:
node = node.tag;
continue;
- case 189:
+ case 191:
if (stopAtCallExpressions) {
return node;
}
- case 210:
- case 188:
- case 187:
- case 211:
- case 306:
+ case 212:
+ case 190:
+ case 189:
+ case 213:
+ case 308:
node = node.expression;
continue;
}
@@ -52088,27 +52872,27 @@ var ts;
}
}
function parenthesizeConciseBody(body) {
- if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 186)) {
+ if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 188)) {
return ts.setTextRange(ts.createParen(body), body);
}
return body;
}
ts.parenthesizeConciseBody = parenthesizeConciseBody;
function isCommaSequence(node) {
- return node.kind === 202 && node.operatorToken.kind === 26 ||
- node.kind === 307;
+ return node.kind === 204 && node.operatorToken.kind === 27 ||
+ node.kind === 309;
}
ts.isCommaSequence = isCommaSequence;
function isOuterExpression(node, kinds) {
if (kinds === void 0) { kinds = 7; }
switch (node.kind) {
- case 193:
+ case 195:
return (kinds & 1) !== 0;
- case 192:
- case 210:
- case 211:
+ case 194:
+ case 212:
+ case 213:
return (kinds & 2) !== 0;
- case 306:
+ case 308:
return (kinds & 4) !== 0;
}
return false;
@@ -52133,7 +52917,7 @@ var ts;
}
ts.skipOuterExpressions = skipOuterExpressions;
function skipAssertions(node) {
- while (ts.isAssertionExpression(node) || node.kind === 211) {
+ while (ts.isAssertionExpression(node) || node.kind === 213) {
node = node.expression;
}
return node;
@@ -52141,15 +52925,15 @@ var ts;
ts.skipAssertions = skipAssertions;
function updateOuterExpression(outerExpression, expression) {
switch (outerExpression.kind) {
- case 193: return ts.updateParen(outerExpression, expression);
- case 192: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression);
- case 210: return ts.updateAsExpression(outerExpression, expression, outerExpression.type);
- case 211: return ts.updateNonNullExpression(outerExpression, expression);
- case 306: return ts.updatePartiallyEmittedExpression(outerExpression, expression);
+ case 195: return ts.updateParen(outerExpression, expression);
+ case 194: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression);
+ case 212: return ts.updateAsExpression(outerExpression, expression, outerExpression.type);
+ case 213: return ts.updateNonNullExpression(outerExpression, expression);
+ case 308: return ts.updatePartiallyEmittedExpression(outerExpression, expression);
}
}
function isIgnorableParen(node) {
- return node.kind === 193
+ return node.kind === 195
&& ts.nodeIsSynthesized(node)
&& ts.nodeIsSynthesized(ts.getSourceMapRange(node))
&& ts.nodeIsSynthesized(ts.getCommentRange(node))
@@ -52211,10 +52995,10 @@ var ts;
var name = namespaceDeclaration.name;
return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name));
}
- if (node.kind === 247 && node.importClause) {
+ if (node.kind === 249 && node.importClause) {
return ts.getGeneratedNameForNode(node);
}
- if (node.kind === 253 && node.moduleSpecifier) {
+ if (node.kind === 255 && node.moduleSpecifier) {
return ts.getGeneratedNameForNode(node);
}
return undefined;
@@ -52222,7 +53006,7 @@ var ts;
ts.getLocalNameForExternalImport = getLocalNameForExternalImport;
function getExternalModuleNameLiteral(importNode, sourceFile, host, resolver, compilerOptions) {
var moduleName = ts.getExternalModuleName(importNode);
- if (moduleName.kind === 9) {
+ if (moduleName.kind === 10) {
return tryGetModuleNameFromDeclaration(importNode, host, resolver, compilerOptions)
|| tryRenameExternalModule(moduleName, sourceFile)
|| ts.getSynthesizedClone(moduleName);
@@ -52277,11 +53061,11 @@ var ts;
}
if (ts.isObjectLiteralElementLike(bindingElement)) {
switch (bindingElement.kind) {
- case 273:
- return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
- case 274:
- return bindingElement.name;
case 275:
+ return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
+ case 276:
+ return bindingElement.name;
+ case 277:
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
}
return undefined;
@@ -52297,11 +53081,11 @@ var ts;
ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement;
function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 149:
- case 184:
+ case 151:
+ case 186:
return bindingElement.dotDotDotToken;
- case 206:
- case 275:
+ case 208:
+ case 277:
return bindingElement;
}
return undefined;
@@ -52309,7 +53093,7 @@ var ts;
ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement;
function getPropertyNameOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 184:
+ case 186:
if (bindingElement.propertyName) {
var propertyName = bindingElement.propertyName;
return ts.isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression)
@@ -52317,7 +53101,7 @@ var ts;
: propertyName;
}
break;
- case 273:
+ case 275:
if (bindingElement.name) {
var propertyName = bindingElement.name;
return ts.isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression)
@@ -52325,7 +53109,7 @@ var ts;
: propertyName;
}
break;
- case 275:
+ case 277:
return bindingElement.name;
}
var target = getTargetOfBindingOrAssignmentElement(bindingElement);
@@ -52339,16 +53123,16 @@ var ts;
ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement;
function isStringOrNumericLiteral(node) {
var kind = node.kind;
- return kind === 9
+ return kind === 10
|| kind === 8;
}
function getElementsOfBindingOrAssignmentPattern(name) {
switch (name.kind) {
- case 182:
- case 183:
+ case 184:
case 185:
+ case 187:
return name.elements;
- case 186:
+ case 188:
return name.properties;
}
}
@@ -52387,11 +53171,11 @@ var ts;
ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement;
function convertToAssignmentPattern(node) {
switch (node.kind) {
- case 183:
case 185:
+ case 187:
return convertToArrayAssignmentPattern(node);
- case 182:
- case 186:
+ case 184:
+ case 188:
return convertToObjectAssignmentPattern(node);
}
}
@@ -52528,261 +53312,261 @@ var ts;
return undefined;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 145) || kind === 176) {
+ if ((kind > 0 && kind <= 147) || kind === 178) {
return node;
}
switch (kind) {
- case 71:
+ case 72:
return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration));
- case 146:
- return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier));
- case 147:
- return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression));
case 148:
- return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode));
+ return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier));
case 149:
- return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
+ return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression));
case 150:
- return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode));
case 151:
- return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
+ return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 152:
- return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
+ return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression));
case 153:
- return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken));
+ return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 154:
- return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context));
+ return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 155:
- return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context));
+ return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken));
case 156:
- return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context));
+ return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context));
case 157:
- return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context));
+ return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context));
case 158:
- return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context));
case 159:
- return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context));
case 160:
- return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
case 161:
- return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
case 162:
- return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
+ return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
case 163:
- return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode));
case 164:
- return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
case 165:
- return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName));
+ return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
case 166:
- return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
+ return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
case 167:
- return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode));
+ return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName));
case 168:
- return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode));
+ return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
case 169:
- return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode));
case 170:
- return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode));
case 171:
- return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
+ return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode));
case 172:
- return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
+ return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode));
case 173:
- return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode));
+ return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
case 174:
- return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
- case 181:
- return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf);
+ return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
case 175:
- return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode));
- case 177:
- return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode));
- case 178:
- return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode));
- case 179:
- return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode));
- case 180:
- return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression));
- case 182:
- return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement));
+ return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode));
+ case 176:
+ return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
case 183:
- return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement));
+ return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf);
+ case 177:
+ return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode));
+ case 179:
+ return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode));
+ case 180:
+ return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode));
+ case 181:
+ return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode));
+ case 182:
+ return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression));
case 184:
- return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression));
+ return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement));
case 185:
- return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression));
+ return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement));
case 186:
- return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike));
+ return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression));
case 187:
- return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression));
case 188:
- return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
+ return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike));
case 189:
- return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
+ return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
case 190:
- return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
+ return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
case 191:
- return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral));
+ return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
case 192:
- return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
case 193:
- return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral));
case 194:
- return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context));
+ return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
case 195:
- return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context));
+ return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression));
case 196:
- return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context));
case 197:
- return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context));
case 198:
- return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
case 199:
- return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
case 200:
- return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
+ return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
case 201:
- return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
+ return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
case 202:
- return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken));
+ return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
case 203:
- return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression));
+ return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
case 204:
- return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan));
+ return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken));
case 205:
- return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression));
case 206:
- return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan));
case 207:
- return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement));
+ return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression));
+ case 208:
+ return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
case 209:
- return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
- case 210:
- return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement));
case 211:
- return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
case 212:
- return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode));
+ case 213:
+ return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression));
case 214:
- return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
+ return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier));
case 216:
+ return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
+ case 218:
return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
- case 217:
- return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
case 219:
- return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression));
- case 220:
- return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock));
+ return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
case 221:
- return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression));
case 222:
- return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
+ return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock));
case 223:
- return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
+ return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression));
case 224:
- return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
+ return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
case 225:
- return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
+ return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
case 226:
- return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier));
+ return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
case 227:
- return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier));
+ return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
case 228:
- return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier));
case 229:
- return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
+ return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier));
case 230:
- return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock));
+ return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression));
case 231:
- return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
+ return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
case 232:
- return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock));
case 233:
- return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock));
+ return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock));
+ case 234:
+ return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
case 235:
- return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
- case 236:
- return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration));
+ return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock));
case 237:
- return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context));
+ return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 238:
- return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement));
+ return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration));
case 239:
- return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement));
+ return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context));
case 240:
- return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
+ return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement));
case 241:
- return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember));
+ return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement));
case 242:
- return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody));
+ return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode));
case 243:
- return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
+ return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember));
case 244:
- return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause));
+ return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody));
case 245:
- return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
case 246:
- return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference));
+ return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause));
case 247:
- return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
+ return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier));
case 248:
- return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings));
+ return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference));
case 249:
- return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 250:
- return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));
+ return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings));
case 251:
- return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
case 252:
- return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));
case 253:
- return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
+ return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier));
case 254:
- return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
+ return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
case 255:
- return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
+ case 256:
+ return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
case 257:
- return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression));
- case 258:
- return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement));
+ return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier));
case 259:
- return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes));
+ return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression));
case 260:
- return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes));
+ return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement));
case 261:
- return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression));
+ return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes));
case 262:
+ return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes));
+ case 263:
+ return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression));
+ case 264:
return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment));
- case 265:
- return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression));
- case 266:
- return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike));
case 267:
- return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression));
case 268:
- return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike));
case 269:
- return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement));
+ return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression));
case 270:
- return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement));
+ return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression));
case 271:
- return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments));
+ return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement));
case 272:
- return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock));
+ return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement));
case 273:
- return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression));
+ return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments));
case 274:
- return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression));
+ return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock));
case 275:
- return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression));
case 276:
- return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression));
+ return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression));
case 277:
+ return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 278:
+ return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression));
+ case 279:
return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context));
- case 306:
+ case 308:
return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression));
- case 307:
+ case 309:
return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression));
default:
return node;
@@ -52808,48 +53592,41 @@ var ts;
var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft;
var cbNodes = cbNodeArray || cbNode;
var kind = node.kind;
- if ((kind > 0 && kind <= 145)) {
+ if ((kind > 0 && kind <= 147)) {
return initial;
}
- if ((kind >= 161 && kind <= 180)) {
+ if ((kind >= 163 && kind <= 182)) {
return initial;
}
var result = initial;
switch (node.kind) {
- case 215:
- case 218:
- case 208:
- case 234:
- case 305:
+ case 217:
+ case 220:
+ case 210:
+ case 236:
+ case 307:
break;
- case 146:
+ case 148:
result = reduceNode(node.left, cbNode, result);
result = reduceNode(node.right, cbNode, result);
break;
- case 147:
- result = reduceNode(node.expression, cbNode, result);
- break;
case 149:
- result = reduceNodes(node.decorators, cbNodes, result);
- result = reduceNodes(node.modifiers, cbNodes, result);
- result = reduceNode(node.name, cbNode, result);
- result = reduceNode(node.type, cbNode, result);
- result = reduceNode(node.initializer, cbNode, result);
- break;
- case 150:
result = reduceNode(node.expression, cbNode, result);
break;
case 151:
+ result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
- result = reduceNode(node.questionToken, cbNode, result);
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
case 152:
- result = reduceNodes(node.decorators, cbNodes, result);
+ result = reduceNode(node.expression, cbNode, result);
+ break;
+ case 153:
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
+ result = reduceNode(node.questionToken, cbNode, result);
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
@@ -52857,73 +53634,81 @@ var ts;
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
- result = reduceNodes(node.typeParameters, cbNodes, result);
- result = reduceNodes(node.parameters, cbNodes, result);
result = reduceNode(node.type, cbNode, result);
- result = reduceNode(node.body, cbNode, result);
- break;
- case 155:
- result = reduceNodes(node.modifiers, cbNodes, result);
- result = reduceNodes(node.parameters, cbNodes, result);
- result = reduceNode(node.body, cbNode, result);
+ result = reduceNode(node.initializer, cbNode, result);
break;
case 156:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
+ result = reduceNodes(node.typeParameters, cbNodes, result);
result = reduceNodes(node.parameters, cbNodes, result);
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
case 157:
+ result = reduceNodes(node.modifiers, cbNodes, result);
+ result = reduceNodes(node.parameters, cbNodes, result);
+ result = reduceNode(node.body, cbNode, result);
+ break;
+ case 158:
+ result = reduceNodes(node.decorators, cbNodes, result);
+ result = reduceNodes(node.modifiers, cbNodes, result);
+ result = reduceNode(node.name, cbNode, result);
+ result = reduceNodes(node.parameters, cbNodes, result);
+ result = reduceNode(node.type, cbNode, result);
+ result = reduceNode(node.body, cbNode, result);
+ break;
+ case 159:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNodes(node.parameters, cbNodes, result);
result = reduceNode(node.body, cbNode, result);
break;
- case 182:
- case 183:
- result = reduceNodes(node.elements, cbNodes, result);
- break;
case 184:
- result = reduceNode(node.propertyName, cbNode, result);
- result = reduceNode(node.name, cbNode, result);
- result = reduceNode(node.initializer, cbNode, result);
- break;
case 185:
result = reduceNodes(node.elements, cbNodes, result);
break;
case 186:
- result = reduceNodes(node.properties, cbNodes, result);
+ result = reduceNode(node.propertyName, cbNode, result);
+ result = reduceNode(node.name, cbNode, result);
+ result = reduceNode(node.initializer, cbNode, result);
break;
case 187:
- result = reduceNode(node.expression, cbNode, result);
- result = reduceNode(node.name, cbNode, result);
+ result = reduceNodes(node.elements, cbNodes, result);
break;
case 188:
- result = reduceNode(node.expression, cbNode, result);
- result = reduceNode(node.argumentExpression, cbNode, result);
+ result = reduceNodes(node.properties, cbNodes, result);
break;
case 189:
result = reduceNode(node.expression, cbNode, result);
- result = reduceNodes(node.typeArguments, cbNodes, result);
- result = reduceNodes(node.arguments, cbNodes, result);
+ result = reduceNode(node.name, cbNode, result);
break;
case 190:
+ result = reduceNode(node.expression, cbNode, result);
+ result = reduceNode(node.argumentExpression, cbNode, result);
+ break;
+ case 191:
result = reduceNode(node.expression, cbNode, result);
result = reduceNodes(node.typeArguments, cbNodes, result);
result = reduceNodes(node.arguments, cbNodes, result);
break;
- case 191:
+ case 192:
+ result = reduceNode(node.expression, cbNode, result);
+ result = reduceNodes(node.typeArguments, cbNodes, result);
+ result = reduceNodes(node.arguments, cbNodes, result);
+ break;
+ case 193:
result = reduceNode(node.tag, cbNode, result);
+ result = reduceNodes(node.typeArguments, cbNodes, result);
result = reduceNode(node.template, cbNode, result);
break;
- case 192:
+ case 194:
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
break;
- case 194:
+ case 196:
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNodes(node.typeParameters, cbNodes, result);
@@ -52931,121 +53716,121 @@ var ts;
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
+ case 197:
+ result = reduceNodes(node.modifiers, cbNodes, result);
+ result = reduceNodes(node.typeParameters, cbNodes, result);
+ result = reduceNodes(node.parameters, cbNodes, result);
+ result = reduceNode(node.type, cbNode, result);
+ result = reduceNode(node.body, cbNode, result);
+ break;
case 195:
- result = reduceNodes(node.modifiers, cbNodes, result);
- result = reduceNodes(node.typeParameters, cbNodes, result);
- result = reduceNodes(node.parameters, cbNodes, result);
- result = reduceNode(node.type, cbNode, result);
- result = reduceNode(node.body, cbNode, result);
- break;
- case 193:
- case 196:
- case 197:
case 198:
case 199:
- case 205:
- case 206:
- case 211:
- result = reduceNode(node.expression, cbNode, result);
- break;
case 200:
case 201:
- result = reduceNode(node.operand, cbNode, result);
+ case 207:
+ case 208:
+ case 213:
+ result = reduceNode(node.expression, cbNode, result);
break;
case 202:
+ case 203:
+ result = reduceNode(node.operand, cbNode, result);
+ break;
+ case 204:
result = reduceNode(node.left, cbNode, result);
result = reduceNode(node.right, cbNode, result);
break;
- case 203:
+ case 205:
result = reduceNode(node.condition, cbNode, result);
result = reduceNode(node.whenTrue, cbNode, result);
result = reduceNode(node.whenFalse, cbNode, result);
break;
- case 204:
+ case 206:
result = reduceNode(node.head, cbNode, result);
result = reduceNodes(node.templateSpans, cbNodes, result);
break;
- case 207:
+ case 209:
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNodes(node.typeParameters, cbNodes, result);
result = reduceNodes(node.heritageClauses, cbNodes, result);
result = reduceNodes(node.members, cbNodes, result);
break;
- case 209:
+ case 211:
result = reduceNode(node.expression, cbNode, result);
result = reduceNodes(node.typeArguments, cbNodes, result);
break;
- case 210:
+ case 212:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.type, cbNode, result);
break;
- case 214:
+ case 216:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.literal, cbNode, result);
break;
- case 216:
+ case 218:
result = reduceNodes(node.statements, cbNodes, result);
break;
- case 217:
+ case 219:
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.declarationList, cbNode, result);
break;
- case 219:
+ case 221:
result = reduceNode(node.expression, cbNode, result);
break;
- case 220:
+ case 222:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.thenStatement, cbNode, result);
result = reduceNode(node.elseStatement, cbNode, result);
break;
- case 221:
- result = reduceNode(node.statement, cbNode, result);
- result = reduceNode(node.expression, cbNode, result);
- break;
- case 222:
- case 229:
- result = reduceNode(node.expression, cbNode, result);
- result = reduceNode(node.statement, cbNode, result);
- break;
case 223:
+ result = reduceNode(node.statement, cbNode, result);
+ result = reduceNode(node.expression, cbNode, result);
+ break;
+ case 224:
+ case 231:
+ result = reduceNode(node.expression, cbNode, result);
+ result = reduceNode(node.statement, cbNode, result);
+ break;
+ case 225:
result = reduceNode(node.initializer, cbNode, result);
result = reduceNode(node.condition, cbNode, result);
result = reduceNode(node.incrementor, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
break;
- case 224:
- case 225:
+ case 226:
+ case 227:
result = reduceNode(node.initializer, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
break;
- case 228:
- case 232:
+ case 230:
+ case 234:
result = reduceNode(node.expression, cbNode, result);
break;
- case 230:
+ case 232:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.caseBlock, cbNode, result);
break;
- case 231:
+ case 233:
result = reduceNode(node.label, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
break;
- case 233:
+ case 235:
result = reduceNode(node.tryBlock, cbNode, result);
result = reduceNode(node.catchClause, cbNode, result);
result = reduceNode(node.finallyBlock, cbNode, result);
break;
- case 235:
+ case 237:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 236:
+ case 238:
result = reduceNodes(node.declarations, cbNodes, result);
break;
- case 237:
+ case 239:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
@@ -53054,7 +53839,7 @@ var ts;
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
- case 238:
+ case 240:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
@@ -53062,131 +53847,132 @@ var ts;
result = reduceNodes(node.heritageClauses, cbNodes, result);
result = reduceNodes(node.members, cbNodes, result);
break;
- case 241:
+ case 243:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNodes(node.members, cbNodes, result);
break;
- case 242:
+ case 244:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
- case 243:
+ case 245:
result = reduceNodes(node.statements, cbNodes, result);
break;
- case 244:
+ case 246:
result = reduceNodes(node.clauses, cbNodes, result);
break;
- case 246:
+ case 248:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.moduleReference, cbNode, result);
break;
- case 247:
+ case 249:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.importClause, cbNode, result);
result = reduceNode(node.moduleSpecifier, cbNode, result);
break;
- case 248:
+ case 250:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.namedBindings, cbNode, result);
break;
- case 249:
- result = reduceNode(node.name, cbNode, result);
- break;
- case 250:
- case 254:
- result = reduceNodes(node.elements, cbNodes, result);
- break;
case 251:
- case 255:
- result = reduceNode(node.propertyName, cbNode, result);
result = reduceNode(node.name, cbNode, result);
break;
case 252:
+ case 256:
+ result = reduceNodes(node.elements, cbNodes, result);
+ break;
+ case 253:
+ case 257:
+ result = reduceNode(node.propertyName, cbNode, result);
+ result = reduceNode(node.name, cbNode, result);
+ break;
+ case 254:
result = ts.reduceLeft(node.decorators, cbNode, result);
result = ts.reduceLeft(node.modifiers, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
break;
- case 253:
+ case 255:
result = ts.reduceLeft(node.decorators, cbNode, result);
result = ts.reduceLeft(node.modifiers, cbNode, result);
result = reduceNode(node.exportClause, cbNode, result);
result = reduceNode(node.moduleSpecifier, cbNode, result);
break;
- case 257:
+ case 259:
result = reduceNode(node.expression, cbNode, result);
break;
- case 258:
+ case 260:
result = reduceNode(node.openingElement, cbNode, result);
result = ts.reduceLeft(node.children, cbNode, result);
result = reduceNode(node.closingElement, cbNode, result);
break;
- case 262:
+ case 264:
result = reduceNode(node.openingFragment, cbNode, result);
result = ts.reduceLeft(node.children, cbNode, result);
result = reduceNode(node.closingFragment, cbNode, result);
break;
- case 259:
- case 260:
+ case 261:
+ case 262:
result = reduceNode(node.tagName, cbNode, result);
+ result = reduceNodes(node.typeArguments, cbNode, result);
result = reduceNode(node.attributes, cbNode, result);
break;
- case 266:
+ case 268:
result = reduceNodes(node.properties, cbNodes, result);
break;
- case 261:
+ case 263:
result = reduceNode(node.tagName, cbNode, result);
break;
- case 265:
+ case 267:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 267:
- result = reduceNode(node.expression, cbNode, result);
- break;
- case 268:
- result = reduceNode(node.expression, cbNode, result);
- break;
case 269:
result = reduceNode(node.expression, cbNode, result);
+ break;
case 270:
- result = reduceNodes(node.statements, cbNodes, result);
+ result = reduceNode(node.expression, cbNode, result);
break;
case 271:
+ result = reduceNode(node.expression, cbNode, result);
+ case 272:
+ result = reduceNodes(node.statements, cbNodes, result);
+ break;
+ case 273:
result = reduceNodes(node.types, cbNodes, result);
break;
- case 272:
+ case 274:
result = reduceNode(node.variableDeclaration, cbNode, result);
result = reduceNode(node.block, cbNode, result);
break;
- case 273:
+ case 275:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 274:
- result = reduceNode(node.name, cbNode, result);
- result = reduceNode(node.objectAssignmentInitializer, cbNode, result);
- break;
- case 275:
- result = reduceNode(node.expression, cbNode, result);
- break;
case 276:
result = reduceNode(node.name, cbNode, result);
- result = reduceNode(node.initializer, cbNode, result);
+ result = reduceNode(node.objectAssignmentInitializer, cbNode, result);
break;
case 277:
- result = reduceNodes(node.statements, cbNodes, result);
- break;
- case 306:
result = reduceNode(node.expression, cbNode, result);
break;
- case 307:
+ case 278:
+ result = reduceNode(node.name, cbNode, result);
+ result = reduceNode(node.initializer, cbNode, result);
+ break;
+ case 279:
+ result = reduceNodes(node.statements, cbNodes, result);
+ break;
+ case 308:
+ result = reduceNode(node.expression, cbNode, result);
+ break;
+ case 309:
result = reduceNodes(node.elements, cbNodes, result);
break;
default:
@@ -53239,7 +54025,7 @@ var ts;
return subtreeFlags;
}
function aggregateTransformFlagsForSubtree(node) {
- if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 209)) {
+ if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 211)) {
return 0;
}
return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes);
@@ -53280,7 +54066,7 @@ var ts;
});
Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, {
__debugFlags: { get: function () { return ts.formatTypeFlags(this.flags); } },
- __debugObjectFlags: { get: function () { return this.flags & 131072 ? ts.formatObjectFlags(this.objectFlags) : ""; } },
+ __debugObjectFlags: { get: function () { return this.flags & 524288 ? ts.formatObjectFlags(this.objectFlags) : ""; } },
__debugTypeToString: { value: function () { return this.checker.typeToString(this); } },
});
var nodeConstructors = [
@@ -53316,251 +54102,580 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function createSourceFileLikeCache(host) {
- var cached = ts.createMap();
+ function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) {
+ var _a = generatorOptions.extendedDiagnostics
+ ? ts.performance.createTimer("Source Map", "beforeSourcemap", "afterSourcemap")
+ : ts.performance.nullTimer, enter = _a.enter, exit = _a.exit;
+ var rawSources = [];
+ var sources = [];
+ var sourceToSourceIndexMap = ts.createMap();
+ var sourcesContent;
+ var names = [];
+ var nameToNameIndexMap;
+ 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 {
- get: function (path) {
- if (cached.has(path)) {
- return cached.get(path);
+ getSources: function () { return rawSources; },
+ addSource: addSource,
+ setSourceContent: setSourceContent,
+ addName: addName,
+ addMapping: addMapping,
+ appendSourceMap: appendSourceMap,
+ toJSON: toJSON,
+ toString: function () { return JSON.stringify(toJSON()); }
+ };
+ function addSource(fileName) {
+ enter();
+ var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true);
+ var sourceIndex = sourceToSourceIndexMap.get(source);
+ if (sourceIndex === undefined) {
+ sourceIndex = sources.length;
+ sources.push(source);
+ rawSources.push(fileName);
+ sourceToSourceIndexMap.set(source, sourceIndex);
+ }
+ exit();
+ return sourceIndex;
+ }
+ function setSourceContent(sourceIndex, content) {
+ enter();
+ if (content !== null) {
+ if (!sourcesContent)
+ sourcesContent = [];
+ while (sourcesContent.length < sourceIndex) {
+ sourcesContent.push(null);
}
- if (!host.fileExists || !host.readFile || !host.fileExists(path))
- return;
- var text = host.readFile(path);
- var file = {
- text: text,
- lineMap: undefined,
- getLineAndCharacterOfPosition: function (pos) {
- return ts.computeLineAndCharacterOfPosition(ts.getLineStarts(this), pos);
+ sourcesContent[sourceIndex] = content;
+ }
+ exit();
+ }
+ function addName(name) {
+ enter();
+ if (!nameToNameIndexMap)
+ nameToNameIndexMap = ts.createMap();
+ var nameIndex = nameToNameIndexMap.get(name);
+ if (nameIndex === undefined) {
+ nameIndex = names.length;
+ names.push(name);
+ nameToNameIndexMap.set(name, nameIndex);
+ }
+ exit();
+ return nameIndex;
+ }
+ function isNewGeneratedPosition(generatedLine, generatedCharacter) {
+ return !hasPending
+ || pendingGeneratedLine !== generatedLine
+ || pendingGeneratedCharacter !== generatedCharacter;
+ }
+ function isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter) {
+ return sourceIndex !== undefined
+ && sourceLine !== undefined
+ && sourceCharacter !== undefined
+ && pendingSourceIndex === sourceIndex
+ && (pendingSourceLine > sourceLine
+ || pendingSourceLine === sourceLine && pendingSourceCharacter > sourceCharacter);
+ }
+ function addMapping(generatedLine, generatedCharacter, sourceIndex, sourceLine, sourceCharacter, nameIndex) {
+ ts.Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack");
+ ts.Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative");
+ ts.Debug.assert(sourceIndex === undefined || sourceIndex >= 0, "sourceIndex cannot be negative");
+ ts.Debug.assert(sourceLine === undefined || sourceLine >= 0, "sourceLine cannot be negative");
+ ts.Debug.assert(sourceCharacter === undefined || sourceCharacter >= 0, "sourceCharacter cannot be negative");
+ enter();
+ if (isNewGeneratedPosition(generatedLine, generatedCharacter) ||
+ isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter)) {
+ commitPendingMapping();
+ pendingGeneratedLine = generatedLine;
+ pendingGeneratedCharacter = generatedCharacter;
+ hasPendingSource = false;
+ hasPendingName = false;
+ hasPending = true;
+ }
+ if (sourceIndex !== undefined && sourceLine !== undefined && sourceCharacter !== undefined) {
+ pendingSourceIndex = sourceIndex;
+ pendingSourceLine = sourceLine;
+ pendingSourceCharacter = sourceCharacter;
+ hasPendingSource = true;
+ if (nameIndex !== undefined) {
+ pendingNameIndex = nameIndex;
+ hasPendingName = true;
+ }
+ }
+ exit();
+ }
+ function appendSourceMap(generatedLine, generatedCharacter, map, sourceMapPath) {
+ var _a;
+ ts.Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack");
+ ts.Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative");
+ enter();
+ var sourceIndexToNewSourceIndexMap = [];
+ var nameIndexToNewNameIndexMap;
+ var mappingIterator = decodeMappings(map.mappings);
+ for (var _b = mappingIterator.next(), raw = _b.value, done = _b.done; !done; _a = mappingIterator.next(), raw = _a.value, done = _a.done, _a) {
+ var newSourceIndex = void 0;
+ var newSourceLine = void 0;
+ var newSourceCharacter = void 0;
+ var newNameIndex = void 0;
+ if (raw.sourceIndex !== undefined) {
+ newSourceIndex = sourceIndexToNewSourceIndexMap[raw.sourceIndex];
+ if (newSourceIndex === undefined) {
+ var rawPath = map.sources[raw.sourceIndex];
+ var relativePath = map.sourceRoot ? ts.combinePaths(map.sourceRoot, rawPath) : rawPath;
+ var combinedPath = ts.combinePaths(ts.getDirectoryPath(sourceMapPath), relativePath);
+ sourceIndexToNewSourceIndexMap[raw.sourceIndex] = newSourceIndex = addSource(combinedPath);
+ if (map.sourcesContent && typeof map.sourcesContent[raw.sourceIndex] === "string") {
+ setSourceContent(newSourceIndex, map.sourcesContent[raw.sourceIndex]);
+ }
}
- };
- cached.set(path, file);
- return file;
+ newSourceLine = raw.sourceLine;
+ newSourceCharacter = raw.sourceCharacter;
+ if (map.names && raw.nameIndex !== undefined) {
+ if (!nameIndexToNewNameIndexMap)
+ nameIndexToNewNameIndexMap = [];
+ newNameIndex = nameIndexToNewNameIndexMap[raw.nameIndex];
+ if (newNameIndex === undefined) {
+ nameIndexToNewNameIndexMap[raw.nameIndex] = newNameIndex = addName(map.names[raw.nameIndex]);
+ }
+ }
+ }
+ var newGeneratedLine = raw.generatedLine + generatedLine;
+ var newGeneratedCharacter = raw.generatedLine === 0 ? raw.generatedCharacter + generatedCharacter : raw.generatedCharacter;
+ addMapping(newGeneratedLine, newGeneratedCharacter, newSourceIndex, newSourceLine, newSourceCharacter, newNameIndex);
+ }
+ exit();
+ }
+ function shouldCommitMapping() {
+ return !hasLast
+ || lastGeneratedLine !== pendingGeneratedLine
+ || lastGeneratedCharacter !== pendingGeneratedCharacter
+ || lastSourceIndex !== pendingSourceIndex
+ || lastSourceLine !== pendingSourceLine
+ || lastSourceCharacter !== pendingSourceCharacter
+ || lastNameIndex !== pendingNameIndex;
+ }
+ function commitPendingMapping() {
+ if (!hasPending || !shouldCommitMapping()) {
+ return;
+ }
+ enter();
+ if (lastGeneratedLine < pendingGeneratedLine) {
+ do {
+ mappings += ";";
+ lastGeneratedLine++;
+ lastGeneratedCharacter = 0;
+ } while (lastGeneratedLine < pendingGeneratedLine);
+ }
+ else {
+ ts.Debug.assertEqual(lastGeneratedLine, pendingGeneratedLine, "generatedLine cannot backtrack");
+ if (hasLast) {
+ mappings += ",";
+ }
+ }
+ mappings += base64VLQFormatEncode(pendingGeneratedCharacter - lastGeneratedCharacter);
+ lastGeneratedCharacter = pendingGeneratedCharacter;
+ if (hasPendingSource) {
+ mappings += base64VLQFormatEncode(pendingSourceIndex - lastSourceIndex);
+ lastSourceIndex = pendingSourceIndex;
+ mappings += base64VLQFormatEncode(pendingSourceLine - lastSourceLine);
+ lastSourceLine = pendingSourceLine;
+ mappings += base64VLQFormatEncode(pendingSourceCharacter - lastSourceCharacter);
+ lastSourceCharacter = pendingSourceCharacter;
+ if (hasPendingName) {
+ mappings += base64VLQFormatEncode(pendingNameIndex - lastNameIndex);
+ lastNameIndex = pendingNameIndex;
+ }
+ }
+ hasLast = true;
+ exit();
+ }
+ function toJSON() {
+ commitPendingMapping();
+ return {
+ version: 3,
+ file: file,
+ sourceRoot: sourceRoot,
+ sources: sources,
+ names: names,
+ mappings: mappings,
+ sourcesContent: sourcesContent,
+ };
+ }
+ }
+ ts.createSourceMapGenerator = createSourceMapGenerator;
+ var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\s*$/;
+ var whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/;
+ function tryGetSourceMappingURL(text, lineStarts) {
+ if (lineStarts === void 0) { lineStarts = ts.computeLineStarts(text); }
+ for (var index = lineStarts.length - 1; index >= 0; index--) {
+ var line = text.substring(lineStarts[index], lineStarts[index + 1]);
+ var comment = sourceMapCommentRegExp.exec(line);
+ if (comment) {
+ return comment[1];
+ }
+ else if (!line.match(whitespaceOrMapCommentRegExp)) {
+ break;
+ }
+ }
+ }
+ ts.tryGetSourceMappingURL = tryGetSourceMappingURL;
+ 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"
+ && ts.isArray(x.sources) && ts.every(x.sources, ts.isString)
+ && (x.sourceRoot === undefined || x.sourceRoot === null || typeof x.sourceRoot === "string")
+ && (x.sourcesContent === undefined || x.sourcesContent === null || ts.isArray(x.sourcesContent) && ts.every(x.sourcesContent, isStringOrNull))
+ && (x.names === undefined || x.names === null || ts.isArray(x.names) && ts.every(x.names, ts.isString));
+ }
+ ts.isRawSourceMap = isRawSourceMap;
+ function tryParseRawSourceMap(text) {
+ try {
+ var parsed = JSON.parse(text);
+ if (isRawSourceMap(parsed)) {
+ return parsed;
+ }
+ }
+ catch (_a) {
+ }
+ return undefined;
+ }
+ ts.tryParseRawSourceMap = tryParseRawSourceMap;
+ function decodeMappings(mappings) {
+ var done = false;
+ var pos = 0;
+ var generatedLine = 0;
+ var generatedCharacter = 0;
+ var sourceIndex = 0;
+ var sourceLine = 0;
+ var sourceCharacter = 0;
+ var nameIndex = 0;
+ var error;
+ return {
+ get pos() { return pos; },
+ get error() { return error; },
+ get state() { return captureMapping(true, true); },
+ next: function () {
+ while (!done && pos < mappings.length) {
+ var ch = mappings.charCodeAt(pos);
+ if (ch === 59) {
+ generatedLine++;
+ generatedCharacter = 0;
+ pos++;
+ continue;
+ }
+ if (ch === 44) {
+ pos++;
+ continue;
+ }
+ var hasSource = false;
+ var hasName = false;
+ generatedCharacter += base64VLQFormatDecode();
+ if (hasReportedError())
+ return stopIterating();
+ if (generatedCharacter < 0)
+ return setErrorAndStopIterating("Invalid generatedCharacter found");
+ if (!isSourceMappingSegmentEnd()) {
+ hasSource = true;
+ sourceIndex += base64VLQFormatDecode();
+ if (hasReportedError())
+ return stopIterating();
+ if (sourceIndex < 0)
+ return setErrorAndStopIterating("Invalid sourceIndex found");
+ if (isSourceMappingSegmentEnd())
+ return setErrorAndStopIterating("Unsupported Format: No entries after sourceIndex");
+ sourceLine += base64VLQFormatDecode();
+ if (hasReportedError())
+ return stopIterating();
+ if (sourceLine < 0)
+ return setErrorAndStopIterating("Invalid sourceLine found");
+ if (isSourceMappingSegmentEnd())
+ return setErrorAndStopIterating("Unsupported Format: No entries after sourceLine");
+ sourceCharacter += base64VLQFormatDecode();
+ if (hasReportedError())
+ return stopIterating();
+ if (sourceCharacter < 0)
+ return setErrorAndStopIterating("Invalid sourceCharacter found");
+ if (!isSourceMappingSegmentEnd()) {
+ hasName = true;
+ nameIndex += base64VLQFormatDecode();
+ if (hasReportedError())
+ return stopIterating();
+ if (nameIndex < 0)
+ return setErrorAndStopIterating("Invalid nameIndex found");
+ if (!isSourceMappingSegmentEnd())
+ return setErrorAndStopIterating("Unsupported Error Format: Entries after nameIndex");
+ }
+ }
+ return { value: captureMapping(hasSource, hasName), done: done };
+ }
+ return stopIterating();
}
};
+ function captureMapping(hasSource, hasName) {
+ return {
+ generatedLine: generatedLine,
+ generatedCharacter: generatedCharacter,
+ sourceIndex: hasSource ? sourceIndex : undefined,
+ sourceLine: hasSource ? sourceLine : undefined,
+ sourceCharacter: hasSource ? sourceCharacter : undefined,
+ nameIndex: hasName ? nameIndex : undefined
+ };
+ }
+ function stopIterating() {
+ done = true;
+ return { value: undefined, done: true };
+ }
+ function setError(message) {
+ if (error === undefined) {
+ error = message;
+ }
+ }
+ function setErrorAndStopIterating(message) {
+ setError(message);
+ return stopIterating();
+ }
+ function hasReportedError() {
+ return error !== undefined;
+ }
+ function isSourceMappingSegmentEnd() {
+ return (pos === mappings.length ||
+ mappings.charCodeAt(pos) === 44 ||
+ mappings.charCodeAt(pos) === 59);
+ }
+ function base64VLQFormatDecode() {
+ var moreDigits = true;
+ var shiftCount = 0;
+ var value = 0;
+ for (; moreDigits; pos++) {
+ if (pos >= mappings.length)
+ return setError("Error in decoding base64VLQFormatDecode, past the mapping string"), -1;
+ var currentByte = base64FormatDecode(mappings.charCodeAt(pos));
+ if (currentByte === -1)
+ return setError("Invalid character in VLQ"), -1;
+ moreDigits = (currentByte & 32) !== 0;
+ value = value | ((currentByte & 31) << shiftCount);
+ shiftCount += 5;
+ }
+ if ((value & 1) === 0) {
+ value = value >> 1;
+ }
+ else {
+ value = value >> 1;
+ value = -value;
+ }
+ return value;
+ }
}
- ts.createSourceFileLikeCache = createSourceFileLikeCache;
-})(ts || (ts = {}));
-(function (ts) {
- var sourcemaps;
- (function (sourcemaps) {
- sourcemaps.identitySourceMapper = { getOriginalPosition: ts.identity, getGeneratedPosition: ts.identity };
- function decode(host, mapPath, map, program, fallbackCache) {
- if (fallbackCache === void 0) { fallbackCache = ts.createSourceFileLikeCache(host); }
- var currentDirectory = ts.getDirectoryPath(mapPath);
- var sourceRoot = map.sourceRoot ? ts.getNormalizedAbsolutePath(map.sourceRoot, currentDirectory) : currentDirectory;
- var decodedMappings;
- var generatedOrderedMappings;
- var sourceOrderedMappings;
- return {
- getOriginalPosition: getOriginalPosition,
- getGeneratedPosition: getGeneratedPosition
- };
- function getGeneratedPosition(loc) {
- var maps = getSourceOrderedMappings();
- if (!ts.length(maps))
- return loc;
- var targetIndex = ts.binarySearch(maps, { sourcePath: loc.fileName, sourcePosition: loc.position }, ts.identity, compareProcessedPositionSourcePositions);
- if (targetIndex < 0 && maps.length > 0) {
- targetIndex = ~targetIndex;
- }
- if (!maps[targetIndex] || ts.comparePaths(loc.fileName, maps[targetIndex].sourcePath, sourceRoot) !== 0) {
- return loc;
- }
- return { fileName: ts.toPath(map.file, sourceRoot, host.getCanonicalFileName), position: maps[targetIndex].emittedPosition };
- }
- function getOriginalPosition(loc) {
- var maps = getGeneratedOrderedMappings();
- if (!ts.length(maps))
- return loc;
- var targetIndex = ts.binarySearch(maps, { emittedPosition: loc.position }, ts.identity, compareProcessedPositionEmittedPositions);
- if (targetIndex < 0 && maps.length > 0) {
- targetIndex = ~targetIndex;
- }
- return { fileName: ts.toPath(maps[targetIndex].sourcePath, sourceRoot, host.getCanonicalFileName), position: maps[targetIndex].sourcePosition };
- }
- function getSourceFileLike(fileName, location) {
- var path = ts.toPath(fileName, location, host.getCanonicalFileName);
- var file = program && program.getSourceFile(path);
- if (!file || file.resolvedPath !== path) {
- return fallbackCache.get(path);
- }
- return file;
- }
- function getPositionOfLineAndCharacterUsingName(fileName, directory, line, character) {
- var file = getSourceFileLike(fileName, directory);
- if (!file) {
- return -1;
- }
- return ts.getPositionOfLineAndCharacter(file, line, character);
- }
- function getDecodedMappings() {
- return decodedMappings || (decodedMappings = calculateDecodedMappings(map, processPosition, host));
- }
- function getSourceOrderedMappings() {
- return sourceOrderedMappings || (sourceOrderedMappings = getDecodedMappings().slice().sort(compareProcessedPositionSourcePositions));
- }
- function getGeneratedOrderedMappings() {
- return generatedOrderedMappings || (generatedOrderedMappings = getDecodedMappings().slice().sort(compareProcessedPositionEmittedPositions));
- }
- function compareProcessedPositionSourcePositions(a, b) {
- return ts.comparePaths(a.sourcePath, b.sourcePath, sourceRoot) ||
- ts.compareValues(a.sourcePosition, b.sourcePosition);
- }
- function compareProcessedPositionEmittedPositions(a, b) {
- return ts.compareValues(a.emittedPosition, b.emittedPosition);
- }
- function processPosition(position) {
- var sourcePath = map.sources[position.sourceIndex];
- return {
- emittedPosition: getPositionOfLineAndCharacterUsingName(map.file, currentDirectory, position.emittedLine, position.emittedColumn),
- sourcePosition: getPositionOfLineAndCharacterUsingName(sourcePath, sourceRoot, position.sourceLine, position.sourceColumn),
- sourcePath: sourcePath,
- };
- }
+ ts.decodeMappings = decodeMappings;
+ function sameMapping(left, right) {
+ return left === right
+ || left.generatedLine === right.generatedLine
+ && left.generatedCharacter === right.generatedCharacter
+ && left.sourceIndex === right.sourceIndex
+ && left.sourceLine === right.sourceLine
+ && left.sourceCharacter === right.sourceCharacter
+ && left.nameIndex === right.nameIndex;
+ }
+ ts.sameMapping = sameMapping;
+ function isSourceMapping(mapping) {
+ return mapping.sourceIndex !== undefined
+ && mapping.sourceLine !== undefined
+ && mapping.sourceCharacter !== undefined;
+ }
+ ts.isSourceMapping = isSourceMapping;
+ function base64FormatEncode(value) {
+ return value >= 0 && value < 26 ? 65 + value :
+ value >= 26 && value < 52 ? 97 + value - 26 :
+ value >= 52 && value < 62 ? 48 + value - 52 :
+ value === 62 ? 43 :
+ value === 63 ? 47 :
+ ts.Debug.fail(value + ": not a base64 value");
+ }
+ function base64FormatDecode(ch) {
+ return ch >= 65 && ch <= 90 ? ch - 65 :
+ ch >= 97 && ch <= 122 ? ch - 97 + 26 :
+ ch >= 48 && ch <= 57 ? ch - 48 + 52 :
+ ch === 43 ? 62 :
+ ch === 47 ? 63 :
+ -1;
+ }
+ function base64VLQFormatEncode(inValue) {
+ if (inValue < 0) {
+ inValue = ((-inValue) << 1) + 1;
}
- sourcemaps.decode = decode;
- function decodeMappings(map) {
- var state = {
- encodedText: map.mappings,
- currentNameIndex: undefined,
- sourceMapNamesLength: map.names ? map.names.length : undefined,
- currentEmittedColumn: 0,
- currentEmittedLine: 0,
- currentSourceColumn: 0,
- currentSourceLine: 0,
- currentSourceIndex: 0,
- decodingIndex: 0
- };
- function captureSpan() {
- return {
- emittedColumn: state.currentEmittedColumn,
- emittedLine: state.currentEmittedLine,
- sourceColumn: state.currentSourceColumn,
- sourceIndex: state.currentSourceIndex,
- sourceLine: state.currentSourceLine,
- nameIndex: state.currentNameIndex
- };
+ else {
+ inValue = inValue << 1;
+ }
+ var encodedStr = "";
+ do {
+ var currentDigit = inValue & 31;
+ inValue = inValue >> 5;
+ if (inValue > 0) {
+ currentDigit = currentDigit | 32;
+ }
+ encodedStr = encodedStr + String.fromCharCode(base64FormatEncode(currentDigit));
+ } while (inValue > 0);
+ return encodedStr;
+ }
+ function isSourceMappedPosition(value) {
+ return value.sourceIndex !== undefined
+ && value.sourcePosition !== undefined;
+ }
+ function sameMappedPosition(left, right) {
+ return left.generatedPosition === right.generatedPosition
+ && left.sourceIndex === right.sourceIndex
+ && left.sourcePosition === right.sourcePosition;
+ }
+ function compareSourcePositions(left, right) {
+ return ts.compareValues(left.sourceIndex, right.sourceIndex);
+ }
+ function compareGeneratedPositions(left, right) {
+ return ts.compareValues(left.generatedPosition, right.generatedPosition);
+ }
+ function getSourcePositionOfMapping(value) {
+ return value.sourcePosition;
+ }
+ function getGeneratedPositionOfMapping(value) {
+ return value.generatedPosition;
+ }
+ function createDocumentPositionMapper(host, map, mapPath) {
+ var mapDirectory = ts.getDirectoryPath(mapPath);
+ var sourceRoot = map.sourceRoot ? ts.getNormalizedAbsolutePath(map.sourceRoot, mapDirectory) : mapDirectory;
+ var generatedAbsoluteFilePath = ts.getNormalizedAbsolutePath(map.file, mapDirectory);
+ var generatedCanonicalFilePath = host.getCanonicalFileName(generatedAbsoluteFilePath);
+ var generatedFile = host.getSourceFileLike(generatedCanonicalFilePath);
+ var sourceFileAbsolutePaths = map.sources.map(function (source) { return ts.getNormalizedAbsolutePath(source, sourceRoot); });
+ var sourceFileCanonicalPaths = sourceFileAbsolutePaths.map(function (source) { return host.getCanonicalFileName(source); });
+ var sourceToSourceIndexMap = ts.createMapFromEntries(sourceFileCanonicalPaths.map(function (source, i) { return [source, i]; }));
+ var decodedMappings;
+ var generatedMappings;
+ var sourceMappings;
+ return {
+ getSourcePosition: getSourcePosition,
+ getGeneratedPosition: getGeneratedPosition
+ };
+ function processMapping(mapping) {
+ var generatedPosition = generatedFile !== undefined
+ ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter)
+ : -1;
+ var source;
+ var sourcePosition;
+ if (isSourceMapping(mapping)) {
+ var sourceFilePath = sourceFileCanonicalPaths[mapping.sourceIndex];
+ var sourceFile = host.getSourceFileLike(sourceFilePath);
+ source = map.sources[mapping.sourceIndex];
+ sourcePosition = sourceFile !== undefined
+ ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter)
+ : -1;
}
return {
- get decodingIndex() { return state.decodingIndex; },
- get error() { return state.error; },
- get lastSpan() { return captureSpan(); },
- next: function () {
- if (hasCompletedDecoding(state) || state.error)
- return { done: true, value: undefined };
- if (!decodeSinglePosition(state))
- return { done: true, value: undefined };
- return { done: false, value: captureSpan() };
- }
+ generatedPosition: generatedPosition,
+ source: source,
+ sourceIndex: mapping.sourceIndex,
+ sourcePosition: sourcePosition,
+ nameIndex: mapping.nameIndex
};
}
- sourcemaps.decodeMappings = decodeMappings;
- function calculateDecodedMappings(map, processPosition, host) {
- var decoder = decodeMappings(map);
- var positions = ts.arrayFrom(decoder, processPosition);
- if (decoder.error) {
- if (host && host.log) {
- host.log("Encountered error while decoding sourcemap: " + decoder.error);
- }
- return [];
- }
- return positions;
- }
- function hasCompletedDecoding(state) {
- return state.decodingIndex === state.encodedText.length;
- }
- function decodeSinglePosition(state) {
- while (state.decodingIndex < state.encodedText.length) {
- var char = state.encodedText.charCodeAt(state.decodingIndex);
- if (char === 59) {
- state.currentEmittedLine++;
- state.currentEmittedColumn = 0;
- state.decodingIndex++;
- continue;
- }
- if (char === 44) {
- state.decodingIndex++;
- continue;
- }
- state.currentEmittedColumn += base64VLQFormatDecode();
- if (createErrorIfCondition(state.currentEmittedColumn < 0, "Invalid emittedColumn found")) {
- return false;
- }
- if (createErrorIfCondition(isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex), "Unsupported Error Format: No entries after emitted column")) {
- return false;
- }
- state.currentSourceIndex += base64VLQFormatDecode();
- if (createErrorIfCondition(state.currentSourceIndex < 0, "Invalid sourceIndex found")) {
- return false;
- }
- if (createErrorIfCondition(isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex), "Unsupported Error Format: No entries after sourceIndex")) {
- return false;
- }
- state.currentSourceLine += base64VLQFormatDecode();
- if (createErrorIfCondition(state.currentSourceLine < 0, "Invalid sourceLine found")) {
- return false;
- }
- if (createErrorIfCondition(isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex), "Unsupported Error Format: No entries after emitted Line")) {
- return false;
- }
- state.currentSourceColumn += base64VLQFormatDecode();
- if (createErrorIfCondition(state.currentSourceColumn < 0, "Invalid sourceLine found")) {
- return false;
- }
- if (!isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex)) {
- if (state.currentNameIndex === undefined) {
- state.currentNameIndex = 0;
+ function getDecodedMappings() {
+ if (decodedMappings === undefined) {
+ var decoder = decodeMappings(map.mappings);
+ var mappings = ts.arrayFrom(decoder, processMapping);
+ if (decoder.error !== undefined) {
+ if (host.log) {
+ host.log("Encountered error while decoding sourcemap: " + decoder.error);
}
- state.currentNameIndex += base64VLQFormatDecode();
- }
- if (createErrorIfCondition(!isSourceMappingSegmentEnd(state.encodedText, state.decodingIndex), "Unsupported Error Format: There are more entries after " + (state.currentNameIndex === undefined ? "sourceColumn" : "nameIndex"))) {
- return false;
- }
- return true;
- }
- createErrorIfCondition(true, "No encoded entry found");
- return false;
- function createErrorIfCondition(condition, errormsg) {
- if (state.error) {
- return true;
- }
- if (condition) {
- state.error = errormsg;
- }
- return condition;
- }
- function base64VLQFormatDecode() {
- var moreDigits = true;
- var shiftCount = 0;
- var value = 0;
- for (; moreDigits; state.decodingIndex++) {
- if (createErrorIfCondition(state.decodingIndex >= state.encodedText.length, "Error in decoding base64VLQFormatDecode, past the mapping string")) {
- return undefined;
- }
- var currentByte = base64FormatDecode(state.encodedText.charAt(state.decodingIndex));
- moreDigits = (currentByte & 32) !== 0;
- value = value | ((currentByte & 31) << shiftCount);
- shiftCount += 5;
- }
- if ((value & 1) === 0) {
- value = value >> 1;
+ decodedMappings = ts.emptyArray;
}
else {
- value = value >> 1;
- value = -value;
+ decodedMappings = mappings;
}
- return value;
}
+ return decodedMappings;
}
- function base64FormatDecode(char) {
- return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(char);
+ function getSourceMappings(sourceIndex) {
+ if (sourceMappings === undefined) {
+ var lists = [];
+ for (var _i = 0, _a = getDecodedMappings(); _i < _a.length; _i++) {
+ var mapping = _a[_i];
+ if (!isSourceMappedPosition(mapping))
+ continue;
+ var list = lists[mapping.sourceIndex];
+ if (!list)
+ lists[mapping.sourceIndex] = list = [];
+ list.push(mapping);
+ }
+ sourceMappings = lists.map(function (list) { return ts.sortAndDeduplicate(list, compareSourcePositions, sameMappedPosition); });
+ }
+ return sourceMappings[sourceIndex];
}
- function isSourceMappingSegmentEnd(encodedText, pos) {
- return (pos === encodedText.length ||
- encodedText.charCodeAt(pos) === 44 ||
- encodedText.charCodeAt(pos) === 59);
+ function getGeneratedMappings() {
+ if (generatedMappings === undefined) {
+ var list = [];
+ for (var _i = 0, _a = getDecodedMappings(); _i < _a.length; _i++) {
+ var mapping = _a[_i];
+ list.push(mapping);
+ }
+ generatedMappings = ts.sortAndDeduplicate(list, compareGeneratedPositions, sameMappedPosition);
+ }
+ return generatedMappings;
}
- })(sourcemaps = ts.sourcemaps || (ts.sourcemaps = {}));
+ function getGeneratedPosition(loc) {
+ var sourceIndex = sourceToSourceIndexMap.get(host.getCanonicalFileName(loc.fileName));
+ if (sourceIndex === undefined)
+ return loc;
+ var sourceMappings = getSourceMappings(sourceIndex);
+ if (!ts.some(sourceMappings))
+ return loc;
+ var targetIndex = ts.binarySearchKey(sourceMappings, loc.pos, getSourcePositionOfMapping, ts.compareValues);
+ if (targetIndex < 0) {
+ targetIndex = ~targetIndex;
+ }
+ var mapping = sourceMappings[targetIndex];
+ if (mapping === undefined || mapping.sourceIndex !== sourceIndex) {
+ return loc;
+ }
+ return { fileName: generatedAbsoluteFilePath, pos: mapping.generatedPosition };
+ }
+ function getSourcePosition(loc) {
+ var generatedMappings = getGeneratedMappings();
+ if (!ts.some(generatedMappings))
+ return loc;
+ var targetIndex = ts.binarySearchKey(generatedMappings, loc.pos, getGeneratedPositionOfMapping, ts.compareValues);
+ if (targetIndex < 0) {
+ targetIndex = ~targetIndex;
+ }
+ var mapping = generatedMappings[targetIndex];
+ if (mapping === undefined || !isSourceMappedPosition(mapping)) {
+ return loc;
+ }
+ return { fileName: sourceFileAbsolutePaths[mapping.sourceIndex], pos: mapping.sourcePosition };
+ }
+ }
+ ts.createDocumentPositionMapper = createDocumentPositionMapper;
+ ts.identitySourceMapConsumer = {
+ getSourcePosition: ts.identity,
+ getGeneratedPosition: ts.identity
+ };
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -53582,7 +54697,7 @@ var ts;
function chainBundle(transformSourceFile) {
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- return node.kind === 277 ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 279 ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -53626,16 +54741,16 @@ var ts;
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var node = _a[_i];
switch (node.kind) {
- case 247:
+ case 249:
externalImports.push(node);
hasImportStarOrImportDefault = hasImportStarOrImportDefault || getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node);
break;
- case 246:
- if (node.moduleReference.kind === 257) {
+ case 248:
+ if (node.moduleReference.kind === 259) {
externalImports.push(node);
}
break;
- case 253:
+ case 255:
if (node.moduleSpecifier) {
if (!node.exportClause) {
externalImports.push(node);
@@ -53662,12 +54777,12 @@ var ts;
}
}
break;
- case 252:
+ case 254:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
break;
- case 217:
+ case 219:
if (ts.hasModifier(node, 1)) {
for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) {
var decl = _e[_d];
@@ -53675,7 +54790,7 @@ var ts;
}
}
break;
- case 237:
+ case 239:
if (ts.hasModifier(node, 1)) {
if (ts.hasModifier(node, 512)) {
if (!hasExportDefault) {
@@ -53693,7 +54808,7 @@ var ts;
}
}
break;
- case 238:
+ case 240:
if (ts.hasModifier(node, 1)) {
if (ts.hasModifier(node, 512)) {
if (!hasExportDefault) {
@@ -54138,8 +55253,8 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(187);
- context.enableSubstitution(188);
+ context.enableSubstitution(189);
+ context.enableSubstitution(190);
var currentSourceFile;
var currentNamespace;
var currentNamespaceContainerName;
@@ -54152,14 +55267,14 @@ var ts;
var pendingExpressions;
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- if (node.kind === 278) {
+ if (node.kind === 280) {
return transformBundle(node);
}
return transformSourceFile(node);
}
function transformBundle(node) {
return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) {
- if (prepend.kind === 280) {
+ if (prepend.kind === 282) {
return ts.createUnparsedSourceFile(prepend.javascriptText, prepend.javascriptMapPath, prepend.javascriptMapText);
}
return prepend;
@@ -54190,16 +55305,16 @@ var ts;
}
function onBeforeVisitNode(node) {
switch (node.kind) {
- case 277:
- case 244:
- case 243:
- case 216:
+ case 279:
+ case 246:
+ case 245:
+ case 218:
currentLexicalScope = node;
currentNameScope = undefined;
currentScopeFirstDeclarationsOfName = undefined;
break;
- case 238:
- case 237:
+ case 240:
+ case 239:
if (ts.hasModifier(node, 2)) {
break;
}
@@ -54207,7 +55322,7 @@ var ts;
recordEmittedDeclarationInScope(node);
}
else {
- ts.Debug.assert(node.kind === 238 || ts.hasModifier(node, 512));
+ ts.Debug.assert(node.kind === 240 || ts.hasModifier(node, 512));
}
if (ts.isClassDeclaration(node)) {
currentNameScope = node;
@@ -54232,10 +55347,10 @@ var ts;
}
function sourceElementVisitorWorker(node) {
switch (node.kind) {
- case 247:
- case 246:
- case 252:
- case 253:
+ case 249:
+ case 248:
+ case 254:
+ case 255:
return visitEllidableStatement(node);
default:
return visitorWorker(node);
@@ -54250,13 +55365,13 @@ var ts;
return node;
}
switch (node.kind) {
- case 247:
+ case 249:
return visitImportDeclaration(node);
- case 246:
+ case 248:
return visitImportEqualsDeclaration(node);
- case 252:
+ case 254:
return visitExportAssignment(node);
- case 253:
+ case 255:
return visitExportDeclaration(node);
default:
ts.Debug.fail("Unhandled ellided statement");
@@ -54266,11 +55381,11 @@ var ts;
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 253 ||
- node.kind === 247 ||
- node.kind === 248 ||
- (node.kind === 246 &&
- node.moduleReference.kind === 257)) {
+ if (node.kind === 255 ||
+ node.kind === 249 ||
+ node.kind === 250 ||
+ (node.kind === 248 &&
+ node.moduleReference.kind === 259)) {
return undefined;
}
else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) {
@@ -54286,15 +55401,15 @@ var ts;
}
function classElementVisitorWorker(node) {
switch (node.kind) {
- case 155:
- return undefined;
- case 152:
- case 160:
- case 156:
case 157:
+ return undefined;
case 154:
+ case 162:
+ case 158:
+ case 159:
+ case 156:
return visitorWorker(node);
- case 215:
+ case 217:
return node;
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -54304,7 +55419,7 @@ var ts;
if (ts.modifierToFlag(node.kind) & 2270) {
return undefined;
}
- else if (currentNamespace && node.kind === 84) {
+ else if (currentNamespace && node.kind === 85) {
return undefined;
}
return node;
@@ -54314,100 +55429,100 @@ var ts;
return ts.createNotEmittedStatement(node);
}
switch (node.kind) {
- case 84:
- case 79:
+ case 85:
+ case 80:
return currentNamespace ? undefined : node;
- case 114:
- case 112:
+ case 115:
case 113:
- case 117:
- case 76:
- case 124:
- case 132:
- case 167:
- case 168:
+ case 114:
+ case 118:
+ case 77:
+ case 125:
+ case 133:
case 169:
case 170:
- case 166:
- case 161:
- case 148:
- case 119:
- case 142:
- case 122:
- case 137:
- case 134:
- case 131:
- case 105:
- case 138:
- case 164:
- case 163:
- case 165:
- case 162:
case 171:
case 172:
+ case 168:
+ case 163:
+ case 150:
+ case 120:
+ case 143:
+ case 123:
+ case 138:
+ case 135:
+ case 132:
+ case 106:
+ case 139:
+ case 166:
+ case 165:
+ case 167:
+ case 164:
case 173:
+ case 174:
case 175:
- case 176:
case 177:
case 178:
case 179:
case 180:
- case 160:
- case 150:
- case 240:
- return undefined;
+ case 181:
+ case 182:
+ case 162:
case 152:
- return visitPropertyDeclaration(node);
- case 245:
- return undefined;
- case 155:
- return visitConstructor(node);
- case 239:
- return ts.createNotEmittedStatement(node);
- case 238:
- return visitClassDeclaration(node);
- case 207:
- return visitClassExpression(node);
- case 271:
- return visitHeritageClause(node);
- case 209:
- return visitExpressionWithTypeArguments(node);
- case 154:
- return visitMethodDeclaration(node);
- case 156:
- return visitGetAccessor(node);
- case 157:
- return visitSetAccessor(node);
- case 237:
- return visitFunctionDeclaration(node);
- case 194:
- return visitFunctionExpression(node);
- case 195:
- return visitArrowFunction(node);
- case 149:
- return visitParameter(node);
- case 193:
- return visitParenthesizedExpression(node);
- case 192:
- case 210:
- return visitAssertionExpression(node);
- case 189:
- return visitCallExpression(node);
- case 190:
- return visitNewExpression(node);
- case 191:
- return visitTaggedTemplateExpression(node);
- case 211:
- return visitNonNullExpression(node);
- case 241:
- return visitEnumDeclaration(node);
- case 217:
- return visitVariableStatement(node);
- case 235:
- return visitVariableDeclaration(node);
case 242:
+ return undefined;
+ case 154:
+ return visitPropertyDeclaration(node);
+ case 247:
+ return undefined;
+ case 157:
+ return visitConstructor(node);
+ case 241:
+ return ts.createNotEmittedStatement(node);
+ case 240:
+ return visitClassDeclaration(node);
+ case 209:
+ return visitClassExpression(node);
+ case 273:
+ return visitHeritageClause(node);
+ case 211:
+ return visitExpressionWithTypeArguments(node);
+ case 156:
+ return visitMethodDeclaration(node);
+ case 158:
+ return visitGetAccessor(node);
+ case 159:
+ return visitSetAccessor(node);
+ case 239:
+ return visitFunctionDeclaration(node);
+ case 196:
+ return visitFunctionExpression(node);
+ case 197:
+ return visitArrowFunction(node);
+ case 151:
+ return visitParameter(node);
+ case 195:
+ return visitParenthesizedExpression(node);
+ case 194:
+ case 212:
+ return visitAssertionExpression(node);
+ case 191:
+ return visitCallExpression(node);
+ case 192:
+ return visitNewExpression(node);
+ case 193:
+ return visitTaggedTemplateExpression(node);
+ case 213:
+ return visitNonNullExpression(node);
+ case 243:
+ return visitEnumDeclaration(node);
+ case 219:
+ return visitVariableStatement(node);
+ case 237:
+ return visitVariableDeclaration(node);
+ case 244:
return visitModuleDeclaration(node);
- case 246:
+ case 248:
return visitImportEqualsDeclaration(node);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -54437,7 +55552,7 @@ var ts;
if (ts.some(staticProperties))
facts |= 1;
var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);
- if (extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 95)
+ if (extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 96)
facts |= 64;
if (shouldEmitDecorateCallForClass(node))
facts |= 2;
@@ -54477,7 +55592,7 @@ var ts;
addClassElementDecorationStatements(statements, node, true);
addConstructorDecorationStatement(statements, node);
if (facts & 128) {
- var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentSourceFile.text, node.members.end), 18);
+ var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentSourceFile.text, node.members.end), 19);
var localName = ts.getInternalName(node);
var outer = ts.createPartiallyEmittedExpression(localName);
outer.end = closingBraceLocation.end;
@@ -54551,7 +55666,7 @@ var ts;
pendingExpressions = undefined;
var staticProperties = getInitializedProperties(node, true);
var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause);
- var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 85; }));
+ var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 86; }));
var classExpression = ts.createClassExpression(undefined, node.name, undefined, heritageClauses, members);
ts.setOriginalNode(classExpression, node);
ts.setTextRange(classExpression, node);
@@ -54630,7 +55745,7 @@ var ts;
return index;
}
var statement = statements[index];
- if (statement.kind === 219 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 221 && ts.isSuperCall(statement.expression)) {
result.push(ts.visitNode(statement, visitor, ts.isStatement));
return index + 1;
}
@@ -54664,13 +55779,13 @@ var ts;
return isInitializedProperty(member, false);
}
function isInitializedProperty(member, isStatic) {
- return member.kind === 152
+ return member.kind === 154
&& isStatic === ts.hasModifier(member, 32)
&& member.initializer !== undefined;
}
function addInitializedPropertyStatements(statements, properties, receiver) {
- for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) {
- var property = properties_10[_i];
+ for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) {
+ var property = properties_9[_i];
var statement = ts.createExpressionStatement(transformInitializedProperty(property, receiver));
ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
ts.setCommentRange(statement, property);
@@ -54680,8 +55795,8 @@ var ts;
}
function generateInitializedPropertyExpressions(properties, receiver) {
var expressions = [];
- for (var _i = 0, properties_11 = properties; _i < properties_11.length; _i++) {
- var property = properties_11[_i];
+ for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) {
+ var property = properties_10[_i];
var expression = transformInitializedProperty(property, receiver);
ts.startOnNewLine(expression);
ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property));
@@ -54741,12 +55856,12 @@ var ts;
}
function getAllDecoratorsOfClassElement(node, member) {
switch (member.kind) {
- case 156:
- case 157:
+ case 158:
+ case 159:
return getAllDecoratorsOfAccessors(node, member);
- case 154:
+ case 156:
return getAllDecoratorsOfMethod(member);
- case 152:
+ case 154:
return getAllDecoratorsOfProperty(member);
default:
return undefined;
@@ -54825,7 +55940,7 @@ var ts;
var prefix = getClassMemberPrefix(node, member);
var memberName = getExpressionForPropertyName(member, true);
var descriptor = languageVersion > 0
- ? member.kind === 152
+ ? member.kind === 154
? ts.createVoidZero()
: ts.createNull()
: undefined;
@@ -54894,13 +56009,13 @@ var ts;
if (compilerOptions.emitDecoratorMetadata) {
var properties = void 0;
if (shouldAddTypeMetadata(node)) {
- (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(36), serializeTypeOfNode(node))));
+ (properties || (properties = [])).push(ts.createPropertyAssignment("type", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(37), serializeTypeOfNode(node))));
}
if (shouldAddParamTypesMetadata(node)) {
- (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(36), serializeParameterTypesOfNode(node, container))));
+ (properties || (properties = [])).push(ts.createPropertyAssignment("paramTypes", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(37), serializeParameterTypesOfNode(node, container))));
}
if (shouldAddReturnTypeMetadata(node)) {
- (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(36), serializeReturnTypeOfNode(node))));
+ (properties || (properties = [])).push(ts.createPropertyAssignment("returnType", ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(37), serializeReturnTypeOfNode(node))));
}
if (properties) {
decoratorExpressions.push(createMetadataHelper(context, "design:typeinfo", ts.createObjectLiteral(properties, true)));
@@ -54909,22 +56024,22 @@ var ts;
}
function shouldAddTypeMetadata(node) {
var kind = node.kind;
- return kind === 154
- || kind === 156
- || kind === 157
- || kind === 152;
+ return kind === 156
+ || kind === 158
+ || kind === 159
+ || kind === 154;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 154;
+ return node.kind === 156;
}
function shouldAddParamTypesMetadata(node) {
switch (node.kind) {
- case 238:
- case 207:
+ case 240:
+ case 209:
return ts.getFirstConstructorWithBody(node) !== undefined;
- case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
return true;
}
return false;
@@ -54936,15 +56051,15 @@ var ts;
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 152:
- case 149:
- return serializeTypeNode(node.type);
- case 157:
- case 156:
- return serializeTypeNode(getAccessorTypeNode(node));
- case 238:
- case 207:
case 154:
+ case 151:
+ return serializeTypeNode(node.type);
+ case 159:
+ case 158:
+ return serializeTypeNode(getAccessorTypeNode(node));
+ case 240:
+ case 209:
+ case 156:
return ts.createIdentifier("Function");
default:
return ts.createVoidZero();
@@ -54976,7 +56091,7 @@ var ts;
return ts.createArrayLiteral(expressions);
}
function getParametersOfDecoratedDeclaration(node, container) {
- if (container && node.kind === 156) {
+ if (container && node.kind === 158) {
var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor;
if (setAccessor) {
return setAccessor.parameters;
@@ -54998,75 +56113,81 @@ var ts;
return ts.createIdentifier("Object");
}
switch (node.kind) {
- case 105:
- case 140:
- case 95:
- case 131:
+ case 106:
+ case 141:
+ case 96:
+ case 132:
return ts.createVoidZero();
- case 175:
+ case 177:
return serializeTypeNode(node.type);
- case 163:
- case 164:
+ case 165:
+ case 166:
return ts.createIdentifier("Function");
- case 167:
- case 168:
+ case 169:
+ case 170:
return ts.createIdentifier("Array");
- case 161:
- case 122:
+ case 163:
+ case 123:
return ts.createIdentifier("Boolean");
- case 137:
+ case 138:
return ts.createIdentifier("String");
- case 135:
+ case 136:
return ts.createIdentifier("Object");
- case 180:
+ case 182:
switch (node.literal.kind) {
- case 9:
+ case 10:
return ts.createIdentifier("String");
case 8:
return ts.createIdentifier("Number");
- case 101:
- case 86:
+ case 9:
+ return getGlobalBigIntNameWithFallback();
+ case 102:
+ case 87:
return ts.createIdentifier("Boolean");
default:
return ts.Debug.failBadSyntaxKind(node.literal);
}
- case 134:
+ case 135:
return ts.createIdentifier("Number");
- case 138:
+ case 146:
+ return getGlobalBigIntNameWithFallback();
+ case 139:
return languageVersion < 2
? getGlobalSymbolNameWithFallback()
: ts.createIdentifier("Symbol");
- case 162:
+ case 164:
return serializeTypeReferenceNode(node);
- case 172:
- case 171:
- return serializeUnionOrIntersectionType(node);
- case 165:
- case 177:
- case 178:
+ case 174:
+ case 173:
+ return serializeTypeList(node.types);
+ case 175:
+ return serializeTypeList([node.trueType, node.falseType]);
+ case 167:
case 179:
- case 166:
- case 119:
- case 142:
- case 176:
+ case 180:
case 181:
+ case 168:
+ case 120:
+ case 143:
+ case 178:
+ case 183:
break;
default:
return ts.Debug.failBadSyntaxKind(node);
}
return ts.createIdentifier("Object");
}
- function serializeUnionOrIntersectionType(node) {
+ function serializeTypeList(types) {
var serializedUnion;
- for (var _i = 0, _a = node.types; _i < _a.length; _i++) {
- var typeNode = _a[_i];
- while (typeNode.kind === 175) {
+ for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
+ var typeNode = types_17[_i];
+ while (typeNode.kind === 177) {
typeNode = typeNode.type;
}
- if (typeNode.kind === 131) {
+ if (typeNode.kind === 132) {
continue;
}
- if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 140)) {
+ if (!strictNullChecks && (typeNode.kind === 96 || typeNode.kind === 141)) {
continue;
}
var serializedIndividual = serializeTypeNode(typeNode);
@@ -55090,6 +56211,9 @@ var ts;
var kind = resolver.getTypeReferenceSerializationKind(node.typeName, currentNameScope || currentLexicalScope);
switch (kind) {
case ts.TypeReferenceSerializationKind.Unknown:
+ if (ts.findAncestor(node, function (n) { return n.parent && ts.isConditionalTypeNode(n.parent) && (n.parent.trueType === n || n.parent.falseType === n); })) {
+ return ts.createIdentifier("Object");
+ }
var serialized = serializeEntityNameAsExpressionFallback(node.typeName);
var temp = ts.createTempVariable(hoistVariableDeclaration);
return ts.createConditional(ts.createTypeCheck(ts.createAssignment(temp, serialized), "function"), temp, ts.createIdentifier("Object"));
@@ -55097,6 +56221,8 @@ var ts;
return serializeEntityNameAsExpression(node.typeName);
case ts.TypeReferenceSerializationKind.VoidNullableOrNeverType:
return ts.createVoidZero();
+ case ts.TypeReferenceSerializationKind.BigIntLikeType:
+ return getGlobalBigIntNameWithFallback();
case ts.TypeReferenceSerializationKind.BooleanType:
return ts.createIdentifier("Boolean");
case ts.TypeReferenceSerializationKind.NumberLikeType:
@@ -55123,11 +56249,11 @@ var ts;
return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(left), ts.createLiteral("undefined")), right);
}
function serializeEntityNameAsExpressionFallback(node) {
- if (node.kind === 71) {
+ if (node.kind === 72) {
var copied = serializeEntityNameAsExpression(node);
return createCheckedValue(copied, copied);
}
- if (node.left.kind === 71) {
+ if (node.left.kind === 72) {
return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node));
}
var left = serializeEntityNameAsExpressionFallback(node.left);
@@ -55136,13 +56262,13 @@ var ts;
}
function serializeEntityNameAsExpression(node) {
switch (node.kind) {
- case 71:
+ case 72:
var name = ts.getMutableClone(node);
name.flags &= ~8;
name.original = undefined;
name.parent = ts.getParseTreeNode(currentLexicalScope);
return name;
- case 146:
+ case 148:
return serializeQualifiedNameAsExpression(node);
}
}
@@ -55152,6 +56278,11 @@ var ts;
function getGlobalSymbolNameWithFallback() {
return ts.createConditional(ts.createTypeCheck(ts.createIdentifier("Symbol"), "function"), ts.createIdentifier("Symbol"), ts.createIdentifier("Object"));
}
+ function getGlobalBigIntNameWithFallback() {
+ return languageVersion < 6
+ ? ts.createConditional(ts.createTypeCheck(ts.createIdentifier("BigInt"), "function"), ts.createIdentifier("BigInt"), ts.createIdentifier("Object"))
+ : ts.createIdentifier("BigInt");
+ }
function isSimpleInlineableExpression(expression) {
return !ts.isIdentifier(expression) && ts.isSimpleCopiableExpression(expression) ||
ts.isWellKnownSymbolSyntactically(expression);
@@ -55198,9 +56329,9 @@ var ts;
}
}
function visitHeritageClause(node) {
- if (node.token === 85) {
+ if (node.token === 86) {
var types = ts.visitNodes(node.types, visitor, ts.isExpressionWithTypeArguments, 0, 1);
- return ts.setTextRange(ts.createHeritageClause(85, types), node);
+ return ts.setTextRange(ts.createHeritageClause(86, types), node);
}
return undefined;
}
@@ -55400,7 +56531,7 @@ var ts;
var name = getExpressionForPropertyName(member, false);
var valueExpression = transformEnumMemberDeclarationValue(member);
var innerAssignment = ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, name), valueExpression);
- var outerAssignment = valueExpression.kind === 9 ?
+ var outerAssignment = valueExpression.kind === 10 ?
innerAssignment :
ts.createAssignment(ts.createElementAccess(currentNamespaceContainerName, innerAssignment), name);
return ts.setTextRange(ts.createExpressionStatement(ts.setTextRange(outerAssignment, member)), member);
@@ -55453,11 +56584,11 @@ var ts;
function addVarForEnumOrModuleDeclaration(statements, node) {
var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([
ts.createVariableDeclaration(ts.getLocalName(node, false, true))
- ], currentLexicalScope.kind === 277 ? 0 : 1));
+ ], currentLexicalScope.kind === 279 ? 0 : 1));
ts.setOriginalNode(statement, node);
recordEmittedDeclarationInScope(node);
if (isFirstEmittedDeclarationInScope(node)) {
- if (node.kind === 241) {
+ if (node.kind === 243) {
ts.setSourceMapRange(statement.declarationList, node);
}
else {
@@ -55523,7 +56654,7 @@ var ts;
var statementsLocation;
var blockLocation;
var body = node.body;
- if (body.kind === 243) {
+ if (body.kind === 245) {
saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); });
statementsLocation = body.statements;
blockLocation = body;
@@ -55547,13 +56678,13 @@ var ts;
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true);
ts.setTextRange(block, blockLocation);
- if (body.kind !== 243) {
+ if (body.kind !== 245) {
ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 242) {
+ if (moduleDeclaration.body.kind === 244) {
var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
@@ -55573,7 +56704,7 @@ var ts;
return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined;
}
function visitNamedImportBindings(node) {
- if (node.kind === 249) {
+ if (node.kind === 251) {
return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
}
else {
@@ -55694,29 +56825,29 @@ var ts;
function enableSubstitutionForNonQualifiedEnumMembers() {
if ((enabledSubstitutions & 8) === 0) {
enabledSubstitutions |= 8;
- context.enableSubstitution(71);
+ context.enableSubstitution(72);
}
}
function enableSubstitutionForClassAliases() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(71);
+ context.enableSubstitution(72);
classAliases = [];
}
}
function enableSubstitutionForNamespaceExports() {
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
- context.enableSubstitution(71);
- context.enableSubstitution(274);
- context.enableEmitNotification(242);
+ context.enableSubstitution(72);
+ context.enableSubstitution(276);
+ context.enableEmitNotification(244);
}
}
function isTransformedModuleDeclaration(node) {
- return ts.getOriginalNode(node).kind === 242;
+ return ts.getOriginalNode(node).kind === 244;
}
function isTransformedEnumDeclaration(node) {
- return ts.getOriginalNode(node).kind === 241;
+ return ts.getOriginalNode(node).kind === 243;
}
function onEmitNode(hint, node, emitCallback) {
var savedApplicableSubstitutions = applicableSubstitutions;
@@ -55760,11 +56891,11 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 71:
+ case 72:
return substituteExpressionIdentifier(node);
- case 187:
+ case 189:
return substitutePropertyAccessExpression(node);
- case 188:
+ case 190:
return substituteElementAccessExpression(node);
}
return node;
@@ -55794,9 +56925,9 @@ var ts;
function trySubstituteNamespaceExportedName(node) {
if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) {
var container = resolver.getReferencedExportContainer(node, false);
- if (container && container.kind !== 277) {
- var substitute = (applicableSubstitutions & 2 && container.kind === 242) ||
- (applicableSubstitutions & 8 && container.kind === 241);
+ if (container && container.kind !== 279) {
+ var substitute = (applicableSubstitutions & 2 && container.kind === 244) ||
+ (applicableSubstitutions & 8 && container.kind === 243);
if (substitute) {
return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node);
}
@@ -55910,25 +57041,25 @@ var ts;
return node;
}
switch (node.kind) {
- case 120:
+ case 121:
return undefined;
- case 199:
+ case 201:
return visitAwaitExpression(node);
- case 154:
+ case 156:
return visitMethodDeclaration(node);
- case 237:
+ case 239:
return visitFunctionDeclaration(node);
- case 194:
+ case 196:
return visitFunctionExpression(node);
- case 195:
+ case 197:
return visitArrowFunction(node);
- case 187:
- if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 97) {
+ case 189:
+ if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 98) {
capturedSuperProperties.set(node.name.escapedText, true);
}
return ts.visitEachChild(node, visitor, context);
- case 188:
- if (capturedSuperProperties && node.expression.kind === 97) {
+ case 190:
+ if (capturedSuperProperties && node.expression.kind === 98) {
hasSuperElementAccess = true;
}
return ts.visitEachChild(node, visitor, context);
@@ -55939,27 +57070,27 @@ var ts;
function asyncBodyVisitor(node) {
if (ts.isNodeWithPossibleHoistedDeclaration(node)) {
switch (node.kind) {
- case 217:
+ case 219:
return visitVariableStatementInAsyncBody(node);
- case 223:
- return visitForStatementInAsyncBody(node);
- case 224:
- return visitForInStatementInAsyncBody(node);
case 225:
+ return visitForStatementInAsyncBody(node);
+ case 226:
+ return visitForInStatementInAsyncBody(node);
+ case 227:
return visitForOfStatementInAsyncBody(node);
- case 272:
+ case 274:
return visitCatchClauseInAsyncBody(node);
- case 216:
- case 230:
- case 244:
- case 269:
- case 270:
- case 233:
- case 221:
+ case 218:
+ case 232:
+ case 246:
+ case 271:
+ case 272:
+ case 235:
+ case 223:
+ case 224:
case 222:
- case 220:
- case 229:
case 231:
+ case 233:
return ts.visitEachChild(node, asyncBodyVisitor, context);
default:
return ts.Debug.assertNever(node, "Unhandled node.");
@@ -56108,7 +57239,7 @@ var ts;
var original = ts.getOriginalNode(node, ts.isFunctionLike);
var nodeType = original.type;
var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined;
- var isArrowFunction = node.kind === 195;
+ var isArrowFunction = node.kind === 197;
var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap();
@@ -56183,15 +57314,15 @@ var ts;
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
+ context.enableSubstitution(191);
context.enableSubstitution(189);
- context.enableSubstitution(187);
- context.enableSubstitution(188);
- context.enableEmitNotification(238);
- context.enableEmitNotification(154);
+ context.enableSubstitution(190);
+ context.enableEmitNotification(240);
context.enableEmitNotification(156);
+ context.enableEmitNotification(158);
+ context.enableEmitNotification(159);
context.enableEmitNotification(157);
- context.enableEmitNotification(155);
- context.enableEmitNotification(217);
+ context.enableEmitNotification(219);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -56223,23 +57354,23 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 187:
- return substitutePropertyAccessExpression(node);
- case 188:
- return substituteElementAccessExpression(node);
case 189:
+ return substitutePropertyAccessExpression(node);
+ case 190:
+ return substituteElementAccessExpression(node);
+ case 191:
return substituteCallExpression(node);
}
return node;
}
function substitutePropertyAccessExpression(node) {
- if (node.expression.kind === 97) {
+ if (node.expression.kind === 98) {
return ts.setTextRange(ts.createPropertyAccess(ts.createFileLevelUniqueName("_super"), node.name), node);
}
return node;
}
function substituteElementAccessExpression(node) {
- if (node.expression.kind === 97) {
+ if (node.expression.kind === 98) {
return createSuperElementAccessInAsyncMethod(node.argumentExpression, node);
}
return node;
@@ -56258,11 +57389,11 @@ var ts;
}
function isSuperContainer(node) {
var kind = node.kind;
- return kind === 238
- || kind === 155
- || kind === 154
+ return kind === 240
+ || kind === 157
|| kind === 156
- || kind === 157;
+ || kind === 158
+ || kind === 159;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096) {
@@ -56304,7 +57435,7 @@ var ts;
};
function createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, body) {
context.requestEmitHelper(awaiterHelper);
- var generatorFunc = ts.createFunctionExpression(undefined, ts.createToken(39), undefined, undefined, [], undefined, body);
+ var generatorFunc = ts.createFunctionExpression(undefined, ts.createToken(40), undefined, undefined, [], undefined, body);
(generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 262144 | 524288;
return ts.createCall(ts.getHelperName("__awaiter"), undefined, [
ts.createThis(),
@@ -56357,7 +57488,7 @@ var ts;
return visitorWorker(node, true);
}
function visitorNoAsyncModifier(node) {
- if (node.kind === 120) {
+ if (node.kind === 121) {
return undefined;
}
return node;
@@ -56367,55 +57498,55 @@ var ts;
return node;
}
switch (node.kind) {
- case 199:
+ case 201:
return visitAwaitExpression(node);
- case 205:
+ case 207:
return visitYieldExpression(node);
- case 228:
+ case 230:
return visitReturnStatement(node);
- case 231:
+ case 233:
return visitLabeledStatement(node);
- case 186:
+ case 188:
return visitObjectLiteralExpression(node);
- case 202:
+ case 204:
return visitBinaryExpression(node, noDestructuringValue);
- case 235:
- return visitVariableDeclaration(node);
- case 225:
- return visitForOfStatement(node, undefined);
- case 223:
- return visitForStatement(node);
- case 198:
- return visitVoidExpression(node);
- case 155:
- return visitConstructorDeclaration(node);
- case 154:
- return visitMethodDeclaration(node);
- case 156:
- return visitGetAccessorDeclaration(node);
- case 157:
- return visitSetAccessorDeclaration(node);
case 237:
+ return visitVariableDeclaration(node);
+ case 227:
+ return visitForOfStatement(node, undefined);
+ case 225:
+ return visitForStatement(node);
+ case 200:
+ return visitVoidExpression(node);
+ case 157:
+ return visitConstructorDeclaration(node);
+ case 156:
+ return visitMethodDeclaration(node);
+ case 158:
+ return visitGetAccessorDeclaration(node);
+ case 159:
+ return visitSetAccessorDeclaration(node);
+ case 239:
return visitFunctionDeclaration(node);
- case 194:
+ case 196:
return visitFunctionExpression(node);
- case 195:
+ case 197:
return visitArrowFunction(node);
- case 149:
+ case 151:
return visitParameter(node);
- case 219:
+ case 221:
return visitExpressionStatement(node);
- case 193:
+ case 195:
return visitParenthesizedExpression(node, noDestructuringValue);
- case 272:
+ case 274:
return visitCatchClause(node);
- case 187:
- if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 97) {
+ case 189:
+ if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 98) {
capturedSuperProperties.set(node.name.escapedText, true);
}
return ts.visitEachChild(node, visitor, context);
- case 188:
- if (capturedSuperProperties && node.expression.kind === 97) {
+ case 190:
+ if (capturedSuperProperties && node.expression.kind === 98) {
hasSuperElementAccess = true;
}
return ts.visitEachChild(node, visitor, context);
@@ -56450,7 +57581,7 @@ var ts;
function visitLabeledStatement(node) {
if (enclosingFunctionFlags & 2) {
var statement = ts.unwrapInnermostStatementOfLabel(node);
- if (statement.kind === 225 && statement.awaitModifier) {
+ if (statement.kind === 227 && statement.awaitModifier) {
return visitForOfStatement(statement, node);
}
return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node);
@@ -56462,7 +57593,7 @@ var ts;
var objects = [];
for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) {
var e = elements_4[_i];
- if (e.kind === 275) {
+ if (e.kind === 277) {
if (chunkObject) {
objects.push(ts.createObjectLiteral(chunkObject));
chunkObject = undefined;
@@ -56471,7 +57602,7 @@ var ts;
objects.push(ts.visitNode(target, visitor, ts.isExpression));
}
else {
- chunkObject = ts.append(chunkObject, e.kind === 273
+ chunkObject = ts.append(chunkObject, e.kind === 275
? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression))
: ts.visitNode(e, visitor, ts.isObjectLiteralElementLike));
}
@@ -56484,7 +57615,7 @@ var ts;
function visitObjectLiteralExpression(node) {
if (node.transformFlags & 262144) {
var objects = chunkObjectLiteralElements(node.properties);
- if (objects.length && objects[0].kind !== 186) {
+ if (objects.length && objects[0].kind !== 188) {
objects.unshift(ts.createObjectLiteral());
}
return createAssignHelper(context, objects);
@@ -56507,7 +57638,7 @@ var ts;
if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 262144) {
return ts.flattenDestructuringAssignment(node, visitor, context, 1, !noDestructuringValue);
}
- else if (node.operatorToken.kind === 26) {
+ else if (node.operatorToken.kind === 27) {
return ts.updateBinary(node, ts.visitNode(node.left, visitorNoDestructuringValue, ts.isExpression), ts.visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, ts.isExpression));
}
return ts.visitEachChild(node, visitor, context);
@@ -56693,7 +57824,7 @@ var ts;
var savedHasSuperElementAccess = hasSuperElementAccess;
capturedSuperProperties = ts.createUnderscoreEscapedMap();
hasSuperElementAccess = false;
- var returnStatement = ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression(undefined, ts.createToken(39), node.name && ts.getGeneratedNameForNode(node.name), undefined, [], undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)))));
+ var returnStatement = ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression(undefined, ts.createToken(40), node.name && ts.getGeneratedNameForNode(node.name), undefined, [], undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)))));
var emitSuperHelpers = languageVersion >= 2 && resolver.getNodeCheckFlags(node) & (4096 | 2048);
if (emitSuperHelpers) {
enableSubstitutionForAsyncMethodsWithSuper();
@@ -56752,15 +57883,15 @@ var ts;
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
+ context.enableSubstitution(191);
context.enableSubstitution(189);
- context.enableSubstitution(187);
- context.enableSubstitution(188);
- context.enableEmitNotification(238);
- context.enableEmitNotification(154);
+ context.enableSubstitution(190);
+ context.enableEmitNotification(240);
context.enableEmitNotification(156);
+ context.enableEmitNotification(158);
+ context.enableEmitNotification(159);
context.enableEmitNotification(157);
- context.enableEmitNotification(155);
- context.enableEmitNotification(217);
+ context.enableEmitNotification(219);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -56792,23 +57923,23 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 187:
- return substitutePropertyAccessExpression(node);
- case 188:
- return substituteElementAccessExpression(node);
case 189:
+ return substitutePropertyAccessExpression(node);
+ case 190:
+ return substituteElementAccessExpression(node);
+ case 191:
return substituteCallExpression(node);
}
return node;
}
function substitutePropertyAccessExpression(node) {
- if (node.expression.kind === 97) {
+ if (node.expression.kind === 98) {
return ts.setTextRange(ts.createPropertyAccess(ts.createFileLevelUniqueName("_super"), node.name), node);
}
return node;
}
function substituteElementAccessExpression(node) {
- if (node.expression.kind === 97) {
+ if (node.expression.kind === 98) {
return createSuperElementAccessInAsyncMethod(node.argumentExpression, node);
}
return node;
@@ -56827,11 +57958,11 @@ var ts;
}
function isSuperContainer(node) {
var kind = node.kind;
- return kind === 238
- || kind === 155
- || kind === 154
+ return kind === 240
+ || kind === 157
|| kind === 156
- || kind === 157;
+ || kind === 158
+ || kind === 159;
}
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096) {
@@ -56926,13 +58057,13 @@ var ts;
}
function visitorWorker(node) {
switch (node.kind) {
- case 258:
+ case 260:
return visitJsxElement(node, false);
- case 259:
+ case 261:
return visitJsxSelfClosingElement(node, false);
- case 262:
+ case 264:
return visitJsxFragment(node, false);
- case 268:
+ case 270:
return visitJsxExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -56940,15 +58071,15 @@ var ts;
}
function transformJsxChildToExpression(node) {
switch (node.kind) {
- case 10:
+ case 11:
return visitJsxText(node);
- case 268:
+ case 270:
return visitJsxExpression(node);
- case 258:
+ case 260:
return visitJsxElement(node, true);
- case 259:
+ case 261:
return visitJsxSelfClosingElement(node, true);
- case 262:
+ case 264:
return visitJsxFragment(node, true);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -57007,12 +58138,12 @@ var ts;
if (node === undefined) {
return ts.createTrue();
}
- else if (node.kind === 9) {
+ else if (node.kind === 10) {
var literal = ts.createLiteral(tryDecodeEntities(node.text) || node.text);
literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile);
return ts.setTextRange(literal, node);
}
- else if (node.kind === 268) {
+ else if (node.kind === 270) {
if (node.expression === undefined) {
return ts.createTrue();
}
@@ -57072,7 +58203,7 @@ var ts;
return decoded === text ? undefined : decoded;
}
function getTagName(node) {
- if (node.kind === 258) {
+ if (node.kind === 260) {
return getTagName(node.openingElement);
}
else {
@@ -57372,7 +58503,7 @@ var ts;
return node;
}
switch (node.kind) {
- case 202:
+ case 204:
return visitBinaryExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -57380,9 +58511,9 @@ var ts;
}
function visitBinaryExpression(node) {
switch (node.operatorToken.kind) {
- case 62:
+ case 63:
return visitExponentiationAssignmentExpression(node);
- case 40:
+ case 41:
return visitExponentiationExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -57462,13 +58593,13 @@ var ts;
}
function isReturnVoidStatementInConstructorWithCapturedSuper(node) {
return (hierarchyFacts & 4096) !== 0
- && node.kind === 228
+ && node.kind === 230
&& !node.expression;
}
function shouldVisitNode(node) {
return (node.transformFlags & 128) !== 0
|| convertedLoopState !== undefined
- || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 216)))
+ || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 218)))
|| (ts.isIterationStatement(node, false) && shouldConvertIterationStatement(node))
|| (ts.getEmitFlags(node) & 33554432) !== 0;
}
@@ -57487,104 +58618,104 @@ var ts;
return node;
}
function callExpressionVisitor(node) {
- if (node.kind === 97) {
+ if (node.kind === 98) {
return visitSuperKeyword(true);
}
return visitor(node);
}
function visitJavaScript(node) {
switch (node.kind) {
- case 115:
+ case 116:
return undefined;
- case 238:
+ case 240:
return visitClassDeclaration(node);
- case 207:
+ case 209:
return visitClassExpression(node);
- case 149:
+ case 151:
return visitParameter(node);
- case 237:
+ case 239:
return visitFunctionDeclaration(node);
- case 195:
+ case 197:
return visitArrowFunction(node);
- case 194:
+ case 196:
return visitFunctionExpression(node);
- case 235:
+ case 237:
return visitVariableDeclaration(node);
- case 71:
+ case 72:
return visitIdentifier(node);
- case 236:
+ case 238:
return visitVariableDeclarationList(node);
- case 230:
+ case 232:
return visitSwitchStatement(node);
- case 244:
+ case 246:
return visitCaseBlock(node);
- case 216:
+ case 218:
return visitBlock(node, false);
- case 227:
- case 226:
+ case 229:
+ case 228:
return visitBreakOrContinueStatement(node);
- case 231:
+ case 233:
return visitLabeledStatement(node);
- case 221:
- case 222:
- return visitDoOrWhileStatement(node, undefined);
case 223:
- return visitForStatement(node, undefined);
case 224:
- return visitForInStatement(node, undefined);
+ return visitDoOrWhileStatement(node, undefined);
case 225:
+ return visitForStatement(node, undefined);
+ case 226:
+ return visitForInStatement(node, undefined);
+ case 227:
return visitForOfStatement(node, undefined);
- case 219:
+ case 221:
return visitExpressionStatement(node);
- case 186:
+ case 188:
return visitObjectLiteralExpression(node);
- case 272:
- return visitCatchClause(node);
case 274:
+ return visitCatchClause(node);
+ case 276:
return visitShorthandPropertyAssignment(node);
- case 147:
+ case 149:
return visitComputedPropertyName(node);
- case 185:
+ case 187:
return visitArrayLiteralExpression(node);
- case 189:
+ case 191:
return visitCallExpression(node);
- case 190:
+ case 192:
return visitNewExpression(node);
- case 193:
+ case 195:
return visitParenthesizedExpression(node, true);
- case 202:
+ case 204:
return visitBinaryExpression(node, true);
- case 13:
case 14:
case 15:
case 16:
+ case 17:
return visitTemplateLiteral(node);
- case 9:
+ case 10:
return visitStringLiteral(node);
case 8:
return visitNumericLiteral(node);
- case 191:
+ case 193:
return visitTaggedTemplateExpression(node);
- case 204:
- return visitTemplateExpression(node);
- case 205:
- return visitYieldExpression(node);
case 206:
+ return visitTemplateExpression(node);
+ case 207:
+ return visitYieldExpression(node);
+ case 208:
return visitSpreadElement(node);
- case 97:
+ case 98:
return visitSuperKeyword(false);
- case 99:
+ case 100:
return visitThisKeyword(node);
- case 212:
+ case 214:
return visitMetaProperty(node);
- case 154:
- return visitMethodDeclaration(node);
case 156:
- case 157:
+ return visitMethodDeclaration(node);
+ case 158:
+ case 159:
return visitAccessorDeclaration(node);
- case 217:
+ case 219:
return visitVariableStatement(node);
- case 228:
+ case 230:
return visitReturnStatement(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -57665,14 +58796,14 @@ var ts;
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- var jump = node.kind === 227 ? 2 : 4;
+ var jump = node.kind === 229 ? 2 : 4;
var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) ||
(!node.label && (convertedLoopState.allowedNonLabeledJumps & jump));
if (!canUseBreakOrContinue) {
var labelMarker = void 0;
var label = node.label;
if (!label) {
- if (node.kind === 227) {
+ if (node.kind === 229) {
convertedLoopState.nonLocalJumps |= 2;
labelMarker = "break";
}
@@ -57682,7 +58813,7 @@ var ts;
}
}
else {
- if (node.kind === 227) {
+ if (node.kind === 229) {
labelMarker = "break-" + label.escapedText;
setLabeledJump(convertedLoopState, true, ts.idText(label), labelMarker);
}
@@ -57701,10 +58832,10 @@ var ts;
expr = copyExpr;
}
else {
- expr = ts.createBinary(expr, 26, copyExpr);
+ expr = ts.createBinary(expr, 27, copyExpr);
}
}
- returnExpression = ts.createBinary(expr, 26, returnExpression);
+ returnExpression = ts.createBinary(expr, 27, returnExpression);
}
return ts.createReturn(returnExpression);
}
@@ -57762,7 +58893,7 @@ var ts;
addExtendsHelperIfNeeded(statements, node, extendsClauseElement);
addConstructor(statements, node, extendsClauseElement);
addClassMembers(statements, node);
- var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 18);
+ var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 19);
var localName = ts.getInternalName(node);
var outer = ts.createPartiallyEmittedExpression(localName);
outer.end = closingBraceLocation.end;
@@ -57818,7 +58949,7 @@ var ts;
}
ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!");
}
- var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 95;
+ var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 96;
var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset);
if (superCaptureStatus === 1 || superCaptureStatus === 2) {
statementOffset++;
@@ -57846,17 +58977,17 @@ var ts;
return block;
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 228) {
+ if (statement.kind === 230) {
return true;
}
- else if (statement.kind === 220) {
+ else if (statement.kind === 222) {
var ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&
isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
}
- else if (statement.kind === 216) {
+ else if (statement.kind === 218) {
var lastStatement = ts.lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -57885,7 +59016,7 @@ var ts;
var ctorStatements = ctor.body.statements;
if (statementOffset < ctorStatements.length) {
firstStatement = ctorStatements[statementOffset];
- if (firstStatement.kind === 219 && ts.isSuperCall(firstStatement.expression)) {
+ if (firstStatement.kind === 221 && ts.isSuperCall(firstStatement.expression)) {
superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression);
}
}
@@ -57893,8 +59024,8 @@ var ts;
&& statementOffset === ctorStatements.length - 1
&& !(ctor.transformFlags & (8192 | 16384))) {
var returnStatement = ts.createReturn(superCallExpression);
- if (superCallExpression.kind !== 202
- || superCallExpression.left.kind !== 189) {
+ if (superCallExpression.kind !== 204
+ || superCallExpression.left.kind !== 191) {
ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'.");
}
ts.setCommentRange(returnStatement, ts.getCommentRange(ts.setEmitFlags(superCallExpression.left, 1536)));
@@ -57968,7 +59099,7 @@ var ts;
statements.push(statement);
}
function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) {
- return node && node.dotDotDotToken && node.name.kind === 71 && !inConstructorWithSynthesizedSuper;
+ return node && node.dotDotDotToken && node.name.kind === 72 && !inConstructorWithSynthesizedSuper;
}
function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) {
var parameter = ts.lastOrUndefined(node.parameters);
@@ -57995,7 +59126,7 @@ var ts;
statements.push(forStatement);
}
function addCaptureThisForNodeIfNeeded(statements, node) {
- if (node.transformFlags & 16384 && node.kind !== 195) {
+ if (node.transformFlags & 16384 && node.kind !== 197) {
captureThisForNode(statements, node, ts.createThis());
}
}
@@ -58012,19 +59143,19 @@ var ts;
if (hierarchyFacts & 16384) {
var newTarget = void 0;
switch (node.kind) {
- case 195:
+ case 197:
return statements;
- case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
newTarget = ts.createVoidZero();
break;
- case 155:
+ case 157:
newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor");
break;
- case 237:
- case 194:
- newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 93, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero());
+ case 239:
+ case 196:
+ newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 94, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero());
break;
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -58043,20 +59174,20 @@ var ts;
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
switch (member.kind) {
- case 215:
+ case 217:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 154:
+ case 156:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));
break;
- case 156:
- case 157:
+ case 158:
+ case 159:
var accessors = ts.getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));
}
break;
- case 155:
+ case 157:
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -58181,7 +59312,7 @@ var ts;
: enterSubtree(16286, 65);
var parameters = ts.visitParameterList(node.parameters, visitor, context);
var body = transformFunctionBody(node);
- if (hierarchyFacts & 16384 && !name && (node.kind === 237 || node.kind === 194)) {
+ if (hierarchyFacts & 16384 && !name && (node.kind === 239 || node.kind === 196)) {
name = ts.getGeneratedNameForNode(node);
}
exitSubtree(ancestorFacts, 49152, 0);
@@ -58213,7 +59344,7 @@ var ts;
}
}
else {
- ts.Debug.assert(node.kind === 195);
+ ts.Debug.assert(node.kind === 197);
statementsLocation = ts.moveRangeEnd(body, -1);
var equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) {
@@ -58244,7 +59375,7 @@ var ts;
ts.setEmitFlags(block, 1);
}
if (closeBraceLocation) {
- ts.setTokenSourceMapRange(block, 18, closeBraceLocation);
+ ts.setTokenSourceMapRange(block, 19, closeBraceLocation);
}
ts.setOriginalNode(block, node.body);
return block;
@@ -58266,9 +59397,9 @@ var ts;
}
function visitExpressionStatement(node) {
switch (node.expression.kind) {
- case 193:
+ case 195:
return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, false));
- case 202:
+ case 204:
return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, false));
}
return ts.visitEachChild(node, visitor, context);
@@ -58276,9 +59407,9 @@ var ts;
function visitParenthesizedExpression(node, needsDestructuringValue) {
if (!needsDestructuringValue) {
switch (node.expression.kind) {
- case 193:
+ case 195:
return ts.updateParen(node, visitParenthesizedExpression(node.expression, false));
- case 202:
+ case 204:
return ts.updateParen(node, visitBinaryExpression(node.expression, false));
}
}
@@ -58304,7 +59435,7 @@ var ts;
assignment = ts.flattenDestructuringAssignment(decl, visitor, context, 0);
}
else {
- assignment = ts.createBinary(decl.name, 58, ts.visitNode(decl.initializer, visitor, ts.isExpression));
+ assignment = ts.createBinary(decl.name, 59, ts.visitNode(decl.initializer, visitor, ts.isExpression));
ts.setTextRange(assignment, decl);
}
assignments = ts.append(assignments, assignment);
@@ -58409,14 +59540,14 @@ var ts;
}
function visitIterationStatement(node, outermostLabeledStatement) {
switch (node.kind) {
- case 221:
- case 222:
- return visitDoOrWhileStatement(node, outermostLabeledStatement);
case 223:
- return visitForStatement(node, outermostLabeledStatement);
case 224:
- return visitForInStatement(node, outermostLabeledStatement);
+ return visitDoOrWhileStatement(node, outermostLabeledStatement);
case 225:
+ return visitForStatement(node, outermostLabeledStatement);
+ case 226:
+ return visitForInStatement(node, outermostLabeledStatement);
+ case 227:
return visitForOfStatement(node, outermostLabeledStatement);
}
}
@@ -58540,7 +59671,7 @@ var ts;
&& i < numInitialPropertiesWithoutYield) {
numInitialPropertiesWithoutYield = i;
}
- if (property.name.kind === 147) {
+ if (property.name.kind === 149) {
numInitialProperties = i;
break;
}
@@ -58587,7 +59718,7 @@ var ts;
}
visit(node.name);
function visit(node) {
- if (node.kind === 71) {
+ if (node.kind === 72) {
state.hoistedLocalVariables.push(node);
}
else {
@@ -58651,11 +59782,11 @@ var ts;
}
function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) {
switch (node.kind) {
- case 223: return convertForStatement(node, initializerFunction, convertedLoopBody);
- case 224: return convertForInStatement(node, convertedLoopBody);
- case 225: return convertForOfStatement(node, convertedLoopBody);
- case 221: return convertDoStatement(node, convertedLoopBody);
- case 222: return convertWhileStatement(node, convertedLoopBody);
+ case 225: return convertForStatement(node, initializerFunction, convertedLoopBody);
+ case 226: return convertForInStatement(node, convertedLoopBody);
+ case 227: return convertForOfStatement(node, convertedLoopBody);
+ case 223: return convertDoStatement(node, convertedLoopBody);
+ case 224: return convertWhileStatement(node, convertedLoopBody);
default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected");
}
}
@@ -58679,11 +59810,11 @@ var ts;
function createConvertedLoopState(node) {
var loopInitializer;
switch (node.kind) {
- case 223:
- case 224:
case 225:
+ case 226:
+ case 227:
var initializer = node.initializer;
- if (initializer && initializer.kind === 236) {
+ if (initializer && initializer.kind === 238) {
loopInitializer = initializer;
}
break;
@@ -58777,7 +59908,7 @@ var ts;
statements.push(ts.createVariableStatement(undefined, node.initializer));
copyOutParameters(currentState.loopOutParameters, 2, 1, statements);
var functionDeclaration = ts.createVariableStatement(undefined, ts.setEmitFlags(ts.createVariableDeclarationList([
- ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(undefined, containsYield ? ts.createToken(39) : undefined, undefined, undefined, undefined, undefined, ts.visitNode(ts.createBlock(statements, true), visitor, ts.isBlock)), emitFlags))
+ ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(undefined, containsYield ? ts.createToken(40) : undefined, undefined, undefined, undefined, undefined, ts.visitNode(ts.createBlock(statements, true), visitor, ts.isBlock)), emitFlags))
]), 2097152));
var part = ts.createVariableDeclarationList(ts.map(currentState.loopOutParameters, createOutVariable));
return { functionName: functionName, containsYield: containsYield, functionDeclaration: functionDeclaration, part: part };
@@ -58792,7 +59923,7 @@ var ts;
currentState.conditionVariable = ts.createUniqueName("inc");
statements.push(ts.createIf(currentState.conditionVariable, ts.createStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), ts.createStatement(ts.createAssignment(currentState.conditionVariable, ts.createTrue()))));
if (shouldConvertConditionOfForStatement(node)) {
- statements.push(ts.createIf(ts.createPrefix(51, ts.visitNode(node.condition, visitor, ts.isExpression)), ts.visitNode(ts.createBreak(), visitor, ts.isStatement)));
+ statements.push(ts.createIf(ts.createPrefix(52, ts.visitNode(node.condition, visitor, ts.isExpression)), ts.visitNode(ts.createBreak(), visitor, ts.isStatement)));
}
}
if (ts.isBlock(statement)) {
@@ -58813,7 +59944,7 @@ var ts;
if (containsYield && (hierarchyFacts & 4) !== 0)
emitFlags |= 262144;
var functionDeclaration = ts.createVariableStatement(undefined, ts.setEmitFlags(ts.createVariableDeclarationList([
- ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(undefined, containsYield ? ts.createToken(39) : undefined, undefined, undefined, currentState.loopParameters, undefined, loopBody), emitFlags))
+ ts.createVariableDeclaration(functionName, undefined, ts.setEmitFlags(ts.createFunctionExpression(undefined, containsYield ? ts.createToken(40) : undefined, undefined, undefined, currentState.loopParameters, undefined, loopBody), emitFlags))
]), 2097152));
var part = generateCallToConvertedLoop(functionName, currentState, outerState, containsYield);
return { functionName: functionName, containsYield: containsYield, functionDeclaration: functionDeclaration, part: part };
@@ -58821,7 +59952,7 @@ var ts;
function copyOutParameter(outParam, copyDirection) {
var source = copyDirection === 0 ? outParam.outParamName : outParam.originalName;
var target = copyDirection === 0 ? outParam.originalName : outParam.outParamName;
- return ts.createBinary(target, 58, source);
+ return ts.createBinary(target, 59, source);
}
function copyOutParameters(outParams, partFlags, copyDirection, statements) {
for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) {
@@ -58834,7 +59965,7 @@ var ts;
function generateCallToConvertedLoopInitializer(initFunctionExpressionName, containsYield) {
var call = ts.createCall(initFunctionExpressionName, undefined, []);
var callResult = containsYield
- ? ts.createYield(ts.createToken(39), ts.setEmitFlags(call, 8388608))
+ ? ts.createYield(ts.createToken(40), ts.setEmitFlags(call, 8388608))
: call;
return ts.createStatement(callResult);
}
@@ -58845,7 +59976,7 @@ var ts;
!state.labeledNonLocalContinues;
var call = ts.createCall(loopFunctionExpressionName, undefined, ts.map(state.loopParameters, function (p) { return p.name; }));
var callResult = containsYield
- ? ts.createYield(ts.createToken(39), ts.setEmitFlags(call, 8388608))
+ ? ts.createYield(ts.createToken(40), ts.setEmitFlags(call, 8388608))
: call;
if (isSimpleLoop) {
statements.push(ts.createExpressionStatement(callResult));
@@ -58865,10 +59996,10 @@ var ts;
else {
returnStatement = ts.createReturn(ts.createPropertyAccess(loopResultName, "value"));
}
- statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 34, ts.createLiteral("object")), returnStatement));
+ statements.push(ts.createIf(ts.createBinary(ts.createTypeOf(loopResultName), 35, ts.createLiteral("object")), returnStatement));
}
if (state.nonLocalJumps & 2) {
- statements.push(ts.createIf(ts.createBinary(loopResultName, 34, ts.createLiteral("break")), ts.createBreak()));
+ statements.push(ts.createIf(ts.createBinary(loopResultName, 35, ts.createLiteral("break")), ts.createBreak()));
}
if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) {
var caseClauses = [];
@@ -58942,20 +60073,20 @@ var ts;
for (var i = start; i < numProperties; i++) {
var property = properties[i];
switch (property.kind) {
- case 156:
- case 157:
+ case 158:
+ case 159:
var accessors = ts.getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
}
break;
- case 154:
+ case 156:
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
break;
- case 273:
+ case 275:
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 274:
+ case 276:
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
default:
@@ -59030,7 +60161,7 @@ var ts;
var body = node.transformFlags & (16384 | 128)
? transformFunctionBody(node)
: visitFunctionBodyDownLevel(node);
- if (node.kind === 156) {
+ if (node.kind === 158) {
updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body);
}
else {
@@ -59109,10 +60240,10 @@ var ts;
}
function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {
if (node.transformFlags & 131072 ||
- node.expression.kind === 97 ||
+ node.expression.kind === 98 ||
ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) {
var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;
- if (node.expression.kind === 97) {
+ if (node.expression.kind === 98) {
ts.setEmitFlags(thisArg, 4);
}
var resultingCall = void 0;
@@ -59122,7 +60253,7 @@ var ts;
else {
resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node);
}
- if (node.expression.kind === 97) {
+ if (node.expression.kind === 98) {
var actualThis = ts.createThis();
ts.setEmitFlags(actualThis, 4);
var initializer = ts.createLogicalOr(resultingCall, actualThis);
@@ -59161,7 +60292,7 @@ var ts;
else {
if (segments.length === 1) {
var firstElement = elements[0];
- return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 185
+ return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 187
? ts.createArraySlice(segments[0])
: segments[0];
}
@@ -59233,7 +60364,7 @@ var ts;
}
function getRawLiteral(node) {
var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node);
- var isLast = node.kind === 13 || node.kind === 16;
+ var isLast = node.kind === 14 || node.kind === 17;
text = text.substring(1, text.length - (isLast ? 1 : 2));
text = text.replace(/\r\n?/g, "\n");
return ts.setTextRange(ts.createLiteral(text), node);
@@ -59275,7 +60406,7 @@ var ts;
: ts.createFileLevelUniqueName("_super");
}
function visitMetaProperty(node) {
- if (node.keywordToken === 94 && node.name.escapedText === "target") {
+ if (node.keywordToken === 95 && node.name.escapedText === "target") {
if (hierarchyFacts & 8192) {
hierarchyFacts |= 32768;
}
@@ -59300,20 +60431,20 @@ var ts;
function enableSubstitutionsForBlockScopedBindings() {
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
- context.enableSubstitution(71);
+ context.enableSubstitution(72);
}
}
function enableSubstitutionsForCapturedThis() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(99);
- context.enableEmitNotification(155);
- context.enableEmitNotification(154);
- context.enableEmitNotification(156);
+ context.enableSubstitution(100);
context.enableEmitNotification(157);
- context.enableEmitNotification(195);
- context.enableEmitNotification(194);
- context.enableEmitNotification(237);
+ context.enableEmitNotification(156);
+ context.enableEmitNotification(158);
+ context.enableEmitNotification(159);
+ context.enableEmitNotification(197);
+ context.enableEmitNotification(196);
+ context.enableEmitNotification(239);
}
}
function onSubstituteNode(hint, node) {
@@ -59337,10 +60468,10 @@ var ts;
}
function isNameOfDeclarationWithCollidingName(node) {
switch (node.parent.kind) {
- case 184:
- case 238:
- case 241:
- case 235:
+ case 186:
+ case 240:
+ case 243:
+ case 237:
return node.parent.name === node
&& resolver.isDeclarationWithCollidingName(node.parent);
}
@@ -59348,9 +60479,9 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 71:
+ case 72:
return substituteExpressionIdentifier(node);
- case 99:
+ case 100:
return substituteThisKeyword(node);
}
return node;
@@ -59401,19 +60532,19 @@ var ts;
return false;
}
var statement = ts.firstOrUndefined(constructor.body.statements);
- if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 219) {
+ if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 221) {
return false;
}
var statementExpression = statement.expression;
- if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 189) {
+ if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 191) {
return false;
}
var callTarget = statementExpression.expression;
- if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 97) {
+ if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 98) {
return false;
}
var callArgument = ts.singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 206) {
+ if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 208) {
return false;
}
var expression = callArgument.expression;
@@ -59457,24 +60588,24 @@ var ts;
if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) {
previousOnEmitNode = context.onEmitNode;
context.onEmitNode = onEmitNode;
- context.enableEmitNotification(260);
+ context.enableEmitNotification(262);
+ context.enableEmitNotification(263);
context.enableEmitNotification(261);
- context.enableEmitNotification(259);
noSubstitution = [];
}
var previousOnSubstituteNode = context.onSubstituteNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(187);
- context.enableSubstitution(273);
+ context.enableSubstitution(189);
+ context.enableSubstitution(275);
return ts.chainBundle(transformSourceFile);
function transformSourceFile(node) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
switch (node.kind) {
- case 260:
+ case 262:
+ case 263:
case 261:
- case 259:
var tagName = node.tagName;
noSubstitution[ts.getOriginalNodeId(tagName)] = true;
break;
@@ -59510,7 +60641,7 @@ var ts;
}
function trySubstituteReservedName(name) {
var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(ts.idText(name)) : undefined);
- if (token !== undefined && token >= 72 && token <= 107) {
+ if (token !== undefined && token >= 73 && token <= 108) {
return ts.setTextRange(ts.createLiteral(name), name);
}
return undefined;
@@ -59591,13 +60722,13 @@ var ts;
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 221:
+ case 223:
return visitDoStatement(node);
- case 222:
+ case 224:
return visitWhileStatement(node);
- case 230:
+ case 232:
return visitSwitchStatement(node);
- case 231:
+ case 233:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -59605,24 +60736,24 @@ var ts;
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 237:
+ case 239:
return visitFunctionDeclaration(node);
- case 194:
+ case 196:
return visitFunctionExpression(node);
- case 156:
- case 157:
+ case 158:
+ case 159:
return visitAccessorDeclaration(node);
- case 217:
+ case 219:
return visitVariableStatement(node);
- case 223:
+ case 225:
return visitForStatement(node);
- case 224:
- return visitForInStatement(node);
- case 227:
- return visitBreakStatement(node);
case 226:
- return visitContinueStatement(node);
+ return visitForInStatement(node);
+ case 229:
+ return visitBreakStatement(node);
case 228:
+ return visitContinueStatement(node);
+ case 230:
return visitReturnStatement(node);
default:
if (node.transformFlags & 4194304) {
@@ -59638,21 +60769,21 @@ var ts;
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 202:
+ case 204:
return visitBinaryExpression(node);
- case 203:
- return visitConditionalExpression(node);
case 205:
+ return visitConditionalExpression(node);
+ case 207:
return visitYieldExpression(node);
- case 185:
+ case 187:
return visitArrayLiteralExpression(node);
- case 186:
- return visitObjectLiteralExpression(node);
case 188:
- return visitElementAccessExpression(node);
- case 189:
- return visitCallExpression(node);
+ return visitObjectLiteralExpression(node);
case 190:
+ return visitElementAccessExpression(node);
+ case 191:
+ return visitCallExpression(node);
+ case 192:
return visitNewExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -59660,9 +60791,9 @@ var ts;
}
function visitGenerator(node) {
switch (node.kind) {
- case 237:
+ case 239:
return visitFunctionDeclaration(node);
- case 194:
+ case 196:
return visitFunctionExpression(node);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -59795,23 +60926,23 @@ var ts;
}
}
function isCompoundAssignment(kind) {
- return kind >= 59
- && kind <= 70;
+ return kind >= 60
+ && kind <= 71;
}
function getOperatorForCompoundAssignment(kind) {
switch (kind) {
- case 59: return 37;
case 60: return 38;
case 61: return 39;
case 62: return 40;
case 63: return 41;
case 64: return 42;
- case 65: return 45;
+ case 65: return 43;
case 66: return 46;
case 67: return 47;
case 68: return 48;
case 69: return 49;
case 70: return 50;
+ case 71: return 51;
}
}
function visitRightAssociativeBinaryExpression(node) {
@@ -59819,10 +60950,10 @@ var ts;
if (containsYield(right)) {
var target = void 0;
switch (left.kind) {
- case 187:
+ case 189:
target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
break;
- case 188:
+ case 190:
target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
break;
default:
@@ -59844,7 +60975,7 @@ var ts;
if (ts.isLogicalOperator(node.operatorToken.kind)) {
return visitLogicalBinaryExpression(node);
}
- else if (node.operatorToken.kind === 26) {
+ else if (node.operatorToken.kind === 27) {
return visitCommaExpression(node);
}
var clone_5 = ts.getMutableClone(node);
@@ -59858,7 +60989,7 @@ var ts;
var resultLabel = defineLabel();
var resultLocal = declareLocal();
emitAssignment(resultLocal, ts.visitNode(node.left, visitor, ts.isExpression), node.left);
- if (node.operatorToken.kind === 53) {
+ if (node.operatorToken.kind === 54) {
emitBreakWhenFalse(resultLabel, resultLocal, node.left);
}
else {
@@ -59874,7 +61005,7 @@ var ts;
visit(node.right);
return ts.inlineExpressions(pendingExpressions);
function visit(node) {
- if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26) {
+ if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27) {
visit(node.left);
visit(node.right);
}
@@ -60023,35 +61154,35 @@ var ts;
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 216:
+ case 218:
return transformAndEmitBlock(node);
- case 219:
- return transformAndEmitExpressionStatement(node);
- case 220:
- return transformAndEmitIfStatement(node);
case 221:
- return transformAndEmitDoStatement(node);
+ return transformAndEmitExpressionStatement(node);
case 222:
- return transformAndEmitWhileStatement(node);
+ return transformAndEmitIfStatement(node);
case 223:
- return transformAndEmitForStatement(node);
+ return transformAndEmitDoStatement(node);
case 224:
- return transformAndEmitForInStatement(node);
+ return transformAndEmitWhileStatement(node);
+ case 225:
+ return transformAndEmitForStatement(node);
case 226:
- return transformAndEmitContinueStatement(node);
- case 227:
- return transformAndEmitBreakStatement(node);
+ return transformAndEmitForInStatement(node);
case 228:
- return transformAndEmitReturnStatement(node);
+ return transformAndEmitContinueStatement(node);
case 229:
- return transformAndEmitWithStatement(node);
+ return transformAndEmitBreakStatement(node);
case 230:
- return transformAndEmitSwitchStatement(node);
+ return transformAndEmitReturnStatement(node);
case 231:
- return transformAndEmitLabeledStatement(node);
+ return transformAndEmitWithStatement(node);
case 232:
- return transformAndEmitThrowStatement(node);
+ return transformAndEmitSwitchStatement(node);
case 233:
+ return transformAndEmitLabeledStatement(node);
+ case 234:
+ return transformAndEmitThrowStatement(node);
+ case 235:
return transformAndEmitTryStatement(node);
default:
return emitStatement(ts.visitNode(node, visitor, ts.isStatement));
@@ -60345,7 +61476,7 @@ var ts;
for (var i = 0; i < numClauses; i++) {
var clause = caseBlock.clauses[i];
clauseLabels.push(defineLabel());
- if (clause.kind === 270 && defaultClauseIndex === -1) {
+ if (clause.kind === 272 && defaultClauseIndex === -1) {
defaultClauseIndex = i;
}
}
@@ -60355,7 +61486,7 @@ var ts;
var defaultClausesSkipped = 0;
for (var i = clausesWritten; i < numClauses; i++) {
var clause = caseBlock.clauses[i];
- if (clause.kind === 269) {
+ if (clause.kind === 271) {
if (containsYield(clause.expression) && pendingClauses.length > 0) {
break;
}
@@ -60590,7 +61721,7 @@ var ts;
if (!renamedCatchVariables) {
renamedCatchVariables = ts.createMap();
renamedCatchVariableDeclarations = [];
- context.enableSubstitution(71);
+ context.enableSubstitution(72);
}
renamedCatchVariables.set(text, true);
renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name;
@@ -61170,12 +62301,12 @@ var ts;
var previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(71);
+ context.enableSubstitution(72);
+ context.enableSubstitution(204);
context.enableSubstitution(202);
- context.enableSubstitution(200);
- context.enableSubstitution(201);
- context.enableSubstitution(274);
- context.enableEmitNotification(277);
+ context.enableSubstitution(203);
+ context.enableSubstitution(276);
+ context.enableEmitNotification(279);
var moduleInfoMap = [];
var deferredExports = [];
var currentSourceFile;
@@ -61366,23 +62497,23 @@ var ts;
}
function sourceElementVisitor(node) {
switch (node.kind) {
- case 247:
+ case 249:
return visitImportDeclaration(node);
- case 246:
+ case 248:
return visitImportEqualsDeclaration(node);
- case 253:
+ case 255:
return visitExportDeclaration(node);
- case 252:
+ case 254:
return visitExportAssignment(node);
- case 217:
+ case 219:
return visitVariableStatement(node);
- case 237:
+ case 239:
return visitFunctionDeclaration(node);
- case 238:
+ case 240:
return visitClassDeclaration(node);
- case 308:
+ case 310:
return visitMergeDeclarationMarker(node);
- case 309:
+ case 311:
return visitEndOfDeclarationMarker(node);
default:
return ts.visitEachChild(node, moduleExpressionElementVisitor, context);
@@ -61407,24 +62538,24 @@ var ts;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var elem = _a[_i];
switch (elem.kind) {
- case 273:
+ case 275:
if (destructuringNeedsFlattening(elem.initializer)) {
return true;
}
break;
- case 274:
+ case 276:
if (destructuringNeedsFlattening(elem.name)) {
return true;
}
break;
- case 275:
+ case 277:
if (destructuringNeedsFlattening(elem.expression)) {
return true;
}
break;
- case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
return false;
default: ts.Debug.assertNever(elem, "Unhandled object member kind");
}
@@ -61739,7 +62870,7 @@ var ts;
}
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 217) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 219) {
var id = ts.getOriginalNodeId(node);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);
}
@@ -61771,10 +62902,10 @@ var ts;
var namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 249:
+ case 251:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 250:
+ case 252:
for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {
var importBinding = _a[_i];
statements = appendExportsOfDeclaration(statements, importBinding);
@@ -61875,14 +63006,14 @@ var ts;
}
function modifierVisitor(node) {
switch (node.kind) {
- case 84:
- case 79:
+ case 85:
+ case 80:
return undefined;
}
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 277) {
+ if (node.kind === 279) {
currentSourceFile = node;
currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)];
noSubstitution = [];
@@ -61922,12 +63053,12 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 71:
+ case 72:
return substituteExpressionIdentifier(node);
- case 202:
+ case 204:
return substituteBinaryExpression(node);
- case 201:
- case 200:
+ case 203:
+ case 202:
return substituteUnaryExpression(node);
}
return node;
@@ -61942,7 +63073,7 @@ var ts;
}
if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) {
var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node));
- if (exportContainer && exportContainer.kind === 277) {
+ if (exportContainer && exportContainer.kind === 279) {
return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node);
}
var importDeclaration = resolver.getReferencedImportDeclaration(node);
@@ -61978,15 +63109,15 @@ var ts;
return node;
}
function substituteUnaryExpression(node) {
- if ((node.operator === 43 || node.operator === 44)
+ if ((node.operator === 44 || node.operator === 45)
&& ts.isIdentifier(node.operand)
&& !ts.isGeneratedIdentifier(node.operand)
&& !ts.isLocalName(node.operand)
&& !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
var exportedNames = getExports(node.operand);
if (exportedNames) {
- var expression = node.kind === 201
- ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 ? 59 : 60), ts.createLiteral(1)), node)
+ var expression = node.kind === 203
+ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 44 ? 60 : 61), ts.createLiteral(1)), node)
: node;
for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) {
var exportName = exportedNames_3[_i];
@@ -62048,12 +63179,12 @@ var ts;
var previousOnEmitNode = context.onEmitNode;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
- context.enableSubstitution(71);
- context.enableSubstitution(274);
+ context.enableSubstitution(72);
+ context.enableSubstitution(276);
+ context.enableSubstitution(204);
context.enableSubstitution(202);
- context.enableSubstitution(200);
- context.enableSubstitution(201);
- context.enableEmitNotification(277);
+ context.enableSubstitution(203);
+ context.enableEmitNotification(279);
var moduleInfoMap = [];
var deferredExports = [];
var exportFunctionsMap = [];
@@ -62157,7 +63288,7 @@ var ts;
var hasExportDeclarationWithExportClause = false;
for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) {
var externalImport = _a[_i];
- if (externalImport.kind === 253 && externalImport.exportClause) {
+ if (externalImport.kind === 255 && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -62180,7 +63311,7 @@ var ts;
}
for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) {
var externalImport = _e[_d];
- if (externalImport.kind !== 253) {
+ if (externalImport.kind !== 255) {
continue;
}
if (!externalImport.exportClause) {
@@ -62231,15 +63362,15 @@ var ts;
var entry = _b[_a];
var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile);
switch (entry.kind) {
- case 247:
+ case 249:
if (!entry.importClause) {
break;
}
- case 246:
+ case 248:
ts.Debug.assert(importVariableName !== undefined);
statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName)));
break;
- case 253:
+ case 255:
ts.Debug.assert(importVariableName !== undefined);
if (entry.exportClause) {
var properties = [];
@@ -62261,13 +63392,13 @@ var ts;
}
function sourceElementVisitor(node) {
switch (node.kind) {
- case 247:
+ case 249:
return visitImportDeclaration(node);
- case 246:
+ case 248:
return visitImportEqualsDeclaration(node);
- case 253:
+ case 255:
return undefined;
- case 252:
+ case 254:
return visitExportAssignment(node);
default:
return nestedElementVisitor(node);
@@ -62388,7 +63519,7 @@ var ts;
}
function shouldHoistVariableDeclarationList(node) {
return (ts.getEmitFlags(node) & 2097152) === 0
- && (enclosingBlockScopedContainer.kind === 277
+ && (enclosingBlockScopedContainer.kind === 279
|| (ts.getOriginalNode(node).flags & 3) === 0);
}
function transformInitializedVariable(node, isExportedDeclaration) {
@@ -62410,7 +63541,7 @@ var ts;
: preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location));
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 217) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 219) {
var id = ts.getOriginalNodeId(node);
var isExportedDeclaration = ts.hasModifier(node.original, 1);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);
@@ -62449,10 +63580,10 @@ var ts;
var namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 249:
+ case 251:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 250:
+ case 252:
for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {
var importBinding = _a[_i];
statements = appendExportsOfDeclaration(statements, importBinding);
@@ -62552,43 +63683,43 @@ var ts;
}
function nestedElementVisitor(node) {
switch (node.kind) {
- case 217:
+ case 219:
return visitVariableStatement(node);
- case 237:
+ case 239:
return visitFunctionDeclaration(node);
- case 238:
+ case 240:
return visitClassDeclaration(node);
- case 223:
- return visitForStatement(node);
- case 224:
- return visitForInStatement(node);
case 225:
+ return visitForStatement(node);
+ case 226:
+ return visitForInStatement(node);
+ case 227:
return visitForOfStatement(node);
- case 221:
+ case 223:
return visitDoStatement(node);
- case 222:
+ case 224:
return visitWhileStatement(node);
- case 231:
- return visitLabeledStatement(node);
- case 229:
- return visitWithStatement(node);
- case 230:
- return visitSwitchStatement(node);
- case 244:
- return visitCaseBlock(node);
- case 269:
- return visitCaseClause(node);
- case 270:
- return visitDefaultClause(node);
case 233:
- return visitTryStatement(node);
+ return visitLabeledStatement(node);
+ case 231:
+ return visitWithStatement(node);
+ case 232:
+ return visitSwitchStatement(node);
+ case 246:
+ return visitCaseBlock(node);
+ case 271:
+ return visitCaseClause(node);
case 272:
+ return visitDefaultClause(node);
+ case 235:
+ return visitTryStatement(node);
+ case 274:
return visitCatchClause(node);
- case 216:
+ case 218:
return visitBlock(node);
- case 308:
+ case 310:
return visitMergeDeclarationMarker(node);
- case 309:
+ case 311:
return visitEndOfDeclarationMarker(node);
default:
return destructuringAndImportCallVisitor(node);
@@ -62682,7 +63813,7 @@ var ts;
}
function destructuringAndImportCallVisitor(node) {
if (node.transformFlags & 1024
- && node.kind === 202) {
+ && node.kind === 204) {
return visitDestructuringAssignment(node);
}
else if (ts.isImportCall(node)) {
@@ -62725,7 +63856,7 @@ var ts;
}
else if (ts.isIdentifier(node)) {
var container = resolver.getReferencedExportContainer(node);
- return container !== undefined && container.kind === 277;
+ return container !== undefined && container.kind === 279;
}
else {
return false;
@@ -62733,14 +63864,14 @@ var ts;
}
function modifierVisitor(node) {
switch (node.kind) {
- case 84:
- case 79:
+ case 85:
+ case 80:
return undefined;
}
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 277) {
+ if (node.kind === 279) {
var id = ts.getOriginalNodeId(node);
currentSourceFile = node;
moduleInfo = moduleInfoMap[id];
@@ -62774,7 +63905,7 @@ var ts;
}
function substituteUnspecified(node) {
switch (node.kind) {
- case 274:
+ case 276:
return substituteShorthandPropertyAssignment(node);
}
return node;
@@ -62796,12 +63927,12 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 71:
+ case 72:
return substituteExpressionIdentifier(node);
- case 202:
+ case 204:
return substituteBinaryExpression(node);
- case 200:
- case 201:
+ case 202:
+ case 203:
return substituteUnaryExpression(node);
}
return node;
@@ -62846,22 +63977,22 @@ var ts;
return node;
}
function substituteUnaryExpression(node) {
- if ((node.operator === 43 || node.operator === 44)
+ if ((node.operator === 44 || node.operator === 45)
&& ts.isIdentifier(node.operand)
&& !ts.isGeneratedIdentifier(node.operand)
&& !ts.isLocalName(node.operand)
&& !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
var exportedNames = getExports(node.operand);
if (exportedNames) {
- var expression = node.kind === 201
+ var expression = node.kind === 203
? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node)
: node;
for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) {
var exportName = exportedNames_5[_i];
expression = createExportExpression(exportName, preventSubstitution(expression));
}
- if (node.kind === 201) {
- expression = node.operator === 43
+ if (node.kind === 203) {
+ expression = node.operator === 44
? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1))
: ts.createAdd(preventSubstitution(expression), ts.createLiteral(1));
}
@@ -62877,7 +64008,7 @@ var ts;
|| resolver.getReferencedValueDeclaration(name);
if (valueDeclaration) {
var exportContainer = resolver.getReferencedExportContainer(name, false);
- if (exportContainer && exportContainer.kind === 277) {
+ if (exportContainer && exportContainer.kind === 279) {
exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration));
}
exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]);
@@ -62905,8 +64036,8 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableEmitNotification(277);
- context.enableSubstitution(71);
+ context.enableEmitNotification(279);
+ context.enableSubstitution(72);
var currentSourceFile;
return ts.chainBundle(transformSourceFile);
function transformSourceFile(node) {
@@ -62932,9 +64063,9 @@ var ts;
}
function visitor(node) {
switch (node.kind) {
- case 246:
+ case 248:
return undefined;
- case 252:
+ case 254:
return visitExportAssignment(node);
}
return node;
@@ -63020,7 +64151,7 @@ var ts;
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.kind === 238) {
+ else if (node.parent.kind === 240) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -63049,7 +64180,7 @@ var ts;
ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.kind === 238) {
+ else if (node.parent.kind === 240) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -63096,15 +64227,15 @@ var ts;
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
- if (node.kind === 235 || node.kind === 184) {
+ if (node.kind === 237 || node.kind === 186) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
}
- else if (node.kind === 152 || node.kind === 151 ||
- (node.kind === 149 && ts.hasModifier(node.parent, 8))) {
+ else if (node.kind === 154 || node.kind === 153 ||
+ (node.kind === 151 && ts.hasModifier(node.parent, 8))) {
if (ts.hasModifier(node, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -63112,7 +64243,7 @@ var ts;
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.kind === 238 || node.kind === 149) {
+ else if (node.parent.kind === 240 || node.kind === 151) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -63136,7 +64267,7 @@ var ts;
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
- if (node.kind === 157) {
+ if (node.kind === 159) {
if (ts.hasModifier(node, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
@@ -63173,23 +64304,23 @@ var ts;
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
switch (node.kind) {
- case 159:
+ case 161:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 158:
+ case 160:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 160:
+ case 162:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
break;
- case 154:
- case 153:
+ case 156:
+ case 155:
if (ts.hasModifier(node, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -63197,7 +64328,7 @@ var ts;
ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 :
ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;
}
- else if (node.parent.kind === 238) {
+ else if (node.parent.kind === 240) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -63210,7 +64341,7 @@ var ts;
ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 237:
+ case 239:
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :
@@ -63235,27 +64366,27 @@ var ts;
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 155:
+ case 157:
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 159:
- case 164:
+ case 161:
+ case 166:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 158:
+ case 160:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 160:
+ case 162:
return symbolAccessibilityResult.errorModuleName ?
ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 154:
- case 153:
+ case 156:
+ case 155:
if (ts.hasModifier(node.parent, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -63263,7 +64394,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.parent.kind === 238) {
+ else if (node.parent.parent.kind === 240) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -63275,8 +64406,8 @@ var ts;
ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
- case 237:
- case 163:
+ case 239:
+ case 165:
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :
@@ -63289,34 +64420,34 @@ var ts;
function getTypeParameterConstraintVisibilityError() {
var diagnosticMessage;
switch (node.parent.kind) {
- case 238:
+ case 240:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 239:
+ case 241:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 159:
+ case 161:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 158:
+ case 160:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 154:
- case 153:
+ case 156:
+ case 155:
if (ts.hasModifier(node.parent, 32)) {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;
}
- else if (node.parent.parent.kind === 238) {
+ else if (node.parent.parent.kind === 240) {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;
}
else {
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
}
break;
- case 237:
+ case 239:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
- case 240:
+ case 242:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
break;
default:
@@ -63330,8 +64461,8 @@ var ts;
}
function getHeritageClauseVisibilityError() {
var diagnosticMessage;
- if (node.parent.parent.kind === 238) {
- diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 108 ?
+ if (node.parent.parent.kind === 240) {
+ diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 109 ?
ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 :
ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1;
}
@@ -63483,10 +64614,10 @@ var ts;
}
}
function transformRoot(node) {
- if (node.kind === 277 && (node.isDeclarationFile || ts.isSourceFileJS(node))) {
+ if (node.kind === 279 && (node.isDeclarationFile || ts.isSourceFileJS(node))) {
return node;
}
- if (node.kind === 278) {
+ if (node.kind === 280) {
isBundledEmit = true;
refs = ts.createMap();
libs = ts.createMap();
@@ -63509,14 +64640,14 @@ var ts;
resultHasExternalModuleIndicator = false;
needsDeclare = false;
var statements_4 = ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
- var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(124)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements_4)), sourceFile.statements)))], true, [], [], false, []);
+ var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(125)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements_4)), sourceFile.statements)))], true, [], [], false, []);
return newFile;
}
needsDeclare = true;
var updated = ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), true, [], [], false, []);
}), ts.mapDefined(node.prepends, function (prepend) {
- if (prepend.kind === 280) {
+ if (prepend.kind === 282) {
return ts.createUnparsedSourceFile(prepend.declarationText, prepend.declarationMapPath, prepend.declarationMapText);
}
}));
@@ -63625,11 +64756,11 @@ var ts;
return ret;
}
function filterBindingPatternInitializers(name) {
- if (name.kind === 71) {
+ if (name.kind === 72) {
return name;
}
else {
- if (name.kind === 183) {
+ if (name.kind === 185) {
return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
}
else {
@@ -63637,7 +64768,7 @@ var ts;
}
}
function visitBindingElement(elem) {
- if (elem.kind === 208) {
+ if (elem.kind === 210) {
return elem;
}
return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined);
@@ -63649,7 +64780,7 @@ var ts;
oldDiag = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(p);
}
- var newParam = ts.updateParameter(p, undefined, maskModifiers(p, modifierMask), p.dotDotDotToken, filterBindingPatternInitializers(p.name), resolver.isOptionalParameter(p) ? (p.questionToken || ts.createToken(55)) : undefined, ensureType(p, p.type, true), ensureNoInitializer(p));
+ var newParam = ts.updateParameter(p, undefined, maskModifiers(p, modifierMask), p.dotDotDotToken, filterBindingPatternInitializers(p.name), resolver.isOptionalParameter(p) ? (p.questionToken || ts.createToken(56)) : undefined, ensureType(p, p.type, true), ensureNoInitializer(p));
if (!suppressNewDiagnosticContexts) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
@@ -63660,7 +64791,7 @@ var ts;
}
function ensureNoInitializer(node) {
if (shouldPrintWithInitializer(node)) {
- return resolver.createLiteralConstValue(ts.getParseTreeNode(node));
+ return resolver.createLiteralConstValue(ts.getParseTreeNode(node), symbolTracker);
}
return undefined;
}
@@ -63671,17 +64802,17 @@ var ts;
if (shouldPrintWithInitializer(node)) {
return;
}
- var shouldUseResolverType = node.kind === 149 &&
+ var shouldUseResolverType = node.kind === 151 &&
(resolver.isRequiredInitializedParameter(node) ||
resolver.isOptionalUninitializedParameterProperty(node));
if (type && !shouldUseResolverType) {
return ts.visitNode(type, visitDeclarationSubtree);
}
if (!ts.getParseTreeNode(node)) {
- return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(119);
+ return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(120);
}
- if (node.kind === 157) {
- return ts.createKeywordTypeNode(119);
+ if (node.kind === 159) {
+ return ts.createKeywordTypeNode(120);
}
errorNameNode = node.name;
var oldDiag;
@@ -63689,12 +64820,12 @@ var ts;
oldDiag = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node);
}
- if (node.kind === 235 || node.kind === 184) {
+ if (node.kind === 237 || node.kind === 186) {
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
}
- if (node.kind === 149
- || node.kind === 152
- || node.kind === 151) {
+ if (node.kind === 151
+ || node.kind === 154
+ || node.kind === 153) {
if (!node.initializer)
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType));
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
@@ -63705,25 +64836,25 @@ var ts;
if (!suppressNewDiagnosticContexts) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
- return returnValue || ts.createKeywordTypeNode(119);
+ return returnValue || ts.createKeywordTypeNode(120);
}
}
function isDeclarationAndNotVisible(node) {
node = ts.getParseTreeNode(node);
switch (node.kind) {
- case 237:
- case 242:
case 239:
- case 238:
- case 240:
+ case 244:
case 241:
+ case 240:
+ case 242:
+ case 243:
return !resolver.isDeclarationVisible(node);
- case 235:
+ case 237:
return !getBindingNameVisible(node);
- case 246:
- case 247:
- case 253:
- case 252:
+ case 248:
+ case 249:
+ case 255:
+ case 254:
return false;
}
return false;
@@ -63776,7 +64907,7 @@ var ts;
function rewriteModuleSpecifier(parent, input) {
if (!input)
return undefined;
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 242 && parent.kind !== 181);
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 244 && parent.kind !== 183);
if (ts.isStringLiteralLike(input)) {
if (isBundledEmit) {
var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent);
@@ -63796,7 +64927,7 @@ var ts;
function transformImportEqualsDeclaration(decl) {
if (!resolver.isDeclarationVisible(decl))
return;
- if (decl.moduleReference.kind === 257) {
+ if (decl.moduleReference.kind === 259) {
var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl);
return ts.updateImportEqualsDeclaration(decl, undefined, decl.modifiers, decl.name, ts.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier)));
}
@@ -63816,7 +64947,7 @@ var ts;
if (!decl.importClause.namedBindings) {
return visibleDefaultBinding && ts.updateImportDeclaration(decl, undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier));
}
- if (decl.importClause.namedBindings.kind === 249) {
+ if (decl.importClause.namedBindings.kind === 251) {
var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : undefined;
return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined;
}
@@ -63896,61 +65027,61 @@ var ts;
checkEntityNameVisibility(input.exprName, enclosingDeclaration);
}
var oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
- var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 166 || input.kind === 179) && input.parent.kind !== 240);
+ var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 168 || input.kind === 181) && input.parent.kind !== 242);
if (shouldEnterSuppressNewDiagnosticsContextContext) {
suppressNewDiagnosticContexts = true;
}
if (isProcessedComponent(input)) {
switch (input.kind) {
- case 209: {
+ case 211: {
if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) {
checkEntityNameVisibility(input.expression, enclosingDeclaration);
}
var node = ts.visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression));
}
- case 162: {
+ case 164: {
checkEntityNameVisibility(input.typeName, enclosingDeclaration);
var node = ts.visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments)));
}
- case 159:
+ case 161:
return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
- case 155: {
+ case 157: {
var isPrivate = ts.hasModifier(input, 8);
- var ctor = ts.createSignatureDeclaration(155, isPrivate ? undefined : ensureTypeParams(input, input.typeParameters), isPrivate ? undefined : updateParamsList(input, input.parameters, 0), undefined);
+ var ctor = ts.createSignatureDeclaration(157, isPrivate ? undefined : ensureTypeParams(input, input.typeParameters), isPrivate ? undefined : updateParamsList(input, input.parameters, 0), undefined);
ctor.modifiers = ts.createNodeArray(ensureModifiers(input));
return cleanup(ctor);
}
- case 154: {
- var sig = ts.createSignatureDeclaration(153, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type));
+ case 156: {
+ var sig = ts.createSignatureDeclaration(155, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type));
sig.name = input.name;
sig.modifiers = ts.createNodeArray(ensureModifiers(input));
sig.questionToken = input.questionToken;
return cleanup(sig);
}
- case 156: {
+ case 158: {
var newNode = ensureAccessor(input);
return cleanup(newNode);
}
- case 157: {
+ case 159: {
var newNode = ensureAccessor(input);
return cleanup(newNode);
}
- case 152:
+ case 154:
return cleanup(ts.updateProperty(input, undefined, ensureModifiers(input), input.name, input.questionToken, !ts.hasModifier(input, 8) ? ensureType(input, input.type) : undefined, ensureNoInitializer(input)));
- case 151:
+ case 153:
return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, !ts.hasModifier(input, 8) ? ensureType(input, input.type) : undefined, ensureNoInitializer(input)));
- case 153: {
+ case 155: {
return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken));
}
- case 158: {
+ case 160: {
return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
}
- case 160: {
- return cleanup(ts.updateIndexSignature(input, undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(119)));
+ case 162: {
+ return cleanup(ts.updateIndexSignature(input, undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(120)));
}
- case 235: {
+ case 237: {
if (ts.isBindingPattern(input.name)) {
return recreateBindingPattern(input.name);
}
@@ -63958,13 +65089,13 @@ var ts;
suppressNewDiagnosticContexts = true;
return cleanup(ts.updateVariableDeclaration(input, input.name, ensureType(input, input.type), ensureNoInitializer(input)));
}
- case 148: {
+ case 150: {
if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {
return cleanup(ts.updateTypeParameterDeclaration(input, input.name, undefined, undefined));
}
return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context));
}
- case 173: {
+ case 175: {
var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree);
var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree);
var oldEnclosingDecl = enclosingDeclaration;
@@ -63974,13 +65105,13 @@ var ts;
var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree);
return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
- case 163: {
+ case 165: {
return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));
}
- case 164: {
+ case 166: {
return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));
}
- case 181: {
+ case 183: {
if (!ts.isLiteralImportTypeNode(input))
return cleanup(input);
return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));
@@ -64009,7 +65140,7 @@ var ts;
}
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 154 && ts.hasModifier(node.parent, 8);
+ return node.parent.kind === 156 && ts.hasModifier(node.parent, 8);
}
function visitDeclarationStatements(input) {
if (!isPreservedDeclarationStatement(input)) {
@@ -64018,19 +65149,19 @@ var ts;
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 253: {
+ case 255: {
if (ts.isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
resultHasScopeMarker = true;
}
return ts.updateExportDeclaration(input, undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier));
}
- case 252: {
+ case 254: {
if (ts.isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
resultHasScopeMarker = true;
}
- if (input.expression.kind === 71) {
+ if (input.expression.kind === 72) {
return input;
}
else {
@@ -64040,7 +65171,7 @@ var ts;
errorNode: input
}); };
var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), undefined);
- var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(124)] : [], ts.createVariableDeclarationList([varDecl], 2));
+ var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(125)] : [], ts.createVariableDeclarationList([varDecl], 2));
return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)];
}
}
@@ -64053,10 +65184,10 @@ var ts;
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 246: {
+ case 248: {
return transformImportEqualsDeclaration(input);
}
- case 247: {
+ case 249: {
return transformImportDeclaration(input);
}
}
@@ -64076,12 +65207,12 @@ var ts;
}
var previousNeedsDeclare = needsDeclare;
switch (input.kind) {
- case 240:
+ case 242:
return cleanup(ts.updateTypeAliasDeclaration(input, undefined, ensureModifiers(input, isPrivate), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode)));
- case 239: {
+ case 241: {
return cleanup(ts.updateInterfaceDeclaration(input, undefined, ensureModifiers(input, isPrivate), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
}
- case 237: {
+ case 239: {
var clean = cleanup(ts.updateFunctionDeclaration(input, undefined, ensureModifiers(input, isPrivate), undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), undefined));
if (clean && resolver.isExpandoFunctionDeclaration(input)) {
var declarations = ts.mapDefined(resolver.getPropertiesOfContainerFunction(input), function (p) {
@@ -64099,10 +65230,10 @@ var ts;
return clean;
}
}
- case 242: {
+ case 244: {
needsDeclare = false;
var inner = input.body;
- if (inner && inner.kind === 243) {
+ if (inner && inner.kind === 245) {
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);
var body = ts.updateModuleBlock(inner, transformAndReplaceLatePaintedStatements(statements));
needsDeclare = previousNeedsDeclare;
@@ -64120,7 +65251,7 @@ var ts;
return cleanup(ts.updateModuleDeclaration(input, undefined, mods, input.name, body));
}
}
- case 238: {
+ case 240: {
var modifiers = ts.createNodeArray(ensureModifiers(input, isPrivate));
var typeParameters = ensureTypeParams(input, input.typeParameters);
var ctor = ts.getFirstConstructorWithBody(input);
@@ -64131,7 +65262,7 @@ var ts;
if (!ts.hasModifier(param, 92))
return;
getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(param);
- if (param.name.kind === 71) {
+ if (param.name.kind === 72) {
return preserveJsDoc(ts.createProperty(undefined, ensureModifiers(param), param.name, param.questionToken, ensureType(param, param.type), ensureNoInitializer(param)), param);
}
else {
@@ -64156,7 +65287,7 @@ var ts;
}
var members = ts.createNodeArray(ts.concatenate(parameterProperties, ts.visitNodes(input.members, visitDeclarationSubtree)));
var extendsClause_1 = ts.getEffectiveBaseTypeNode(input);
- if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 95) {
+ if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 96) {
var newId_1 = ts.createOptimisticUniqueName(ts.unescapeLeadingUnderscores(input.name.escapedText) + "_base");
getSymbolAccessibilityDiagnostic = function () { return ({
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
@@ -64164,16 +65295,16 @@ var ts;
typeName: input.name
}); };
var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), undefined);
- var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(124)] : [], ts.createVariableDeclarationList([varDecl], 2));
+ var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(125)] : [], ts.createVariableDeclarationList([varDecl], 2));
var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) {
- if (clause.token === 85) {
+ if (clause.token === 86) {
var oldDiag_2 = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]);
var newClause = ts.updateHeritageClause(clause, ts.map(clause.types, function (t) { return ts.updateExpressionWithTypeArguments(t, ts.visitNodes(t.typeArguments, visitDeclarationSubtree), newId_1); }));
getSymbolAccessibilityDiagnostic = oldDiag_2;
return newClause;
}
- return ts.updateHeritageClause(clause, ts.visitNodes(ts.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 95; })), visitDeclarationSubtree));
+ return ts.updateHeritageClause(clause, ts.visitNodes(ts.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 96; })), visitDeclarationSubtree));
}));
return [statement, cleanup(ts.updateClassDeclaration(input, undefined, modifiers, input.name, typeParameters, heritageClauses, members))];
}
@@ -64182,10 +65313,10 @@ var ts;
return cleanup(ts.updateClassDeclaration(input, undefined, modifiers, input.name, typeParameters, heritageClauses, members));
}
}
- case 217: {
+ case 219: {
return cleanup(transformVariableStatement(input, isPrivate));
}
- case 241: {
+ case 243: {
return cleanup(ts.updateEnumDeclaration(input, undefined, ts.createNodeArray(ensureModifiers(input, isPrivate)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) {
if (shouldStripInternal(m))
return;
@@ -64202,7 +65333,7 @@ var ts;
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
- if (input.kind === 242) {
+ if (input.kind === 244) {
needsDeclare = previousNeedsDeclare;
}
if (node === input) {
@@ -64223,7 +65354,7 @@ var ts;
return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); }));
}
function recreateBindingElement(e) {
- if (e.kind === 208) {
+ if (e.kind === 210) {
return;
}
if (e.name) {
@@ -64286,7 +65417,7 @@ var ts;
function ensureModifierFlags(node, privateDeclaration) {
var mask = 3071 ^ (4 | 256);
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 : 0;
- var parentIsFile = node.parent.kind === 277;
+ var parentIsFile = node.parent.kind === 279;
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) || hasScopeMarker(node.parent) ? 0 : 1) | 2);
additions = 0;
@@ -64327,13 +65458,13 @@ var ts;
}
function transformHeritageClauses(nodes) {
return ts.createNodeArray(ts.filter(ts.map(nodes, function (clause) { return ts.updateHeritageClause(clause, ts.visitNodes(ts.createNodeArray(ts.filter(clause.types, function (t) {
- return ts.isEntityNameExpression(t.expression) || (clause.token === 85 && t.expression.kind === 95);
+ return ts.isEntityNameExpression(t.expression) || (clause.token === 86 && t.expression.kind === 96);
})), visitDeclarationSubtree)); }), function (clause) { return clause.types && !!clause.types.length; }));
}
}
ts.transformDeclarations = transformDeclarations;
function isAlwaysType(node) {
- if (node.kind === 239) {
+ if (node.kind === 241) {
return true;
}
return false;
@@ -64355,7 +65486,7 @@ var ts;
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 156
+ return accessor.kind === 158
? accessor.type
: accessor.parameters.length > 0
? accessor.parameters[0].type
@@ -64364,52 +65495,52 @@ var ts;
}
function canHaveLiteralInitializer(node) {
switch (node.kind) {
- case 152:
- case 151:
+ case 154:
+ case 153:
return !ts.hasModifier(node, 8);
- case 149:
- case 235:
+ case 151:
+ case 237:
return true;
}
return false;
}
function isPreservedDeclarationStatement(node) {
switch (node.kind) {
- case 237:
- case 242:
- case 246:
case 239:
- case 238:
- case 240:
+ case 244:
+ case 248:
case 241:
- case 217:
- case 247:
- case 253:
- case 252:
+ case 240:
+ case 242:
+ case 243:
+ case 219:
+ case 249:
+ case 255:
+ case 254:
return true;
}
return false;
}
function isProcessedComponent(node) {
switch (node.kind) {
- case 159:
- case 155:
- case 154:
- case 156:
+ case 161:
case 157:
- case 152:
- case 151:
- case 153:
+ case 156:
case 158:
+ case 159:
+ case 154:
+ case 153:
+ case 155:
case 160:
- case 235:
- case 148:
- case 209:
case 162:
- case 173:
- case 163:
+ case 237:
+ case 150:
+ case 211:
case 164:
- case 181:
+ case 175:
+ case 165:
+ case 166:
+ case 183:
return true;
}
return false;
@@ -64459,8 +65590,16 @@ var ts;
return transformers;
}
ts.getTransformers = getTransformers;
+ function noEmitSubstitution(_hint, node) {
+ return node;
+ }
+ ts.noEmitSubstitution = noEmitSubstitution;
+ function noEmitNotification(hint, node, callback) {
+ callback(hint, node);
+ }
+ ts.noEmitNotification = noEmitNotification;
function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) {
- var enabledSyntaxKindFeatures = new Array(310);
+ var enabledSyntaxKindFeatures = new Array(312);
var lexicalEnvironmentVariableDeclarations;
var lexicalEnvironmentFunctionDeclarations;
var lexicalEnvironmentVariableDeclarationsStack = [];
@@ -64468,8 +65607,8 @@ var ts;
var lexicalEnvironmentStackOffset = 0;
var lexicalEnvironmentSuspended = false;
var emitHelpers;
- var onSubstituteNode = function (_, node) { return node; };
- var onEmitNode = function (hint, node, callback) { return callback(hint, node); };
+ var onSubstituteNode = noEmitSubstitution;
+ var onEmitNode = noEmitNotification;
var state = 0;
var diagnostics = [];
var context = {
@@ -64660,694 +65799,10 @@ var ts;
ts.transformNodes = transformNodes;
})(ts || (ts = {}));
var ts;
-(function (ts) {
- var defaultLastEncodedSourceMapSpan = {
- emittedLine: 0,
- emittedColumn: 0,
- sourceLine: 0,
- sourceColumn: 0,
- sourceIndex: 0
- };
- function createSourceMapWriter(host, writer, compilerOptions) {
- if (compilerOptions === void 0) { compilerOptions = host.getCompilerOptions(); }
- var extendedDiagnostics = compilerOptions.extendedDiagnostics;
- var currentSource;
- var currentSourceText;
- var sourceMapDir;
- var sourceMapSourceIndex;
- var lastRecordedSourceMapSpan;
- var lastEncodedSourceMapSpan;
- var lastEncodedNameIndex;
- var sourceMapData;
- var sourceMapDataList;
- var disabled = !(compilerOptions.sourceMap || compilerOptions.inlineSourceMap);
- return {
- initialize: initialize,
- reset: reset,
- setSourceFile: setSourceFile,
- emitPos: emitPos,
- emitNodeWithSourceMap: emitNodeWithSourceMap,
- emitTokenWithSourceMap: emitTokenWithSourceMap,
- getText: getText,
- getSourceMappingURL: getSourceMappingURL,
- };
- function skipSourceTrivia(pos) {
- return currentSource.skipTrivia ? currentSource.skipTrivia(pos) : ts.skipTrivia(currentSourceText, pos);
- }
- function initialize(filePath, sourceMapFilePath, sourceFileOrBundle, outputSourceMapDataList) {
- if (disabled || ts.fileExtensionIs(filePath, ".json")) {
- return;
- }
- if (sourceMapData) {
- reset();
- }
- sourceMapDataList = outputSourceMapDataList;
- currentSource = undefined;
- currentSourceText = undefined;
- sourceMapSourceIndex = -1;
- lastRecordedSourceMapSpan = undefined;
- lastEncodedSourceMapSpan = defaultLastEncodedSourceMapSpan;
- lastEncodedNameIndex = 0;
- sourceMapData = {
- sourceMapFilePath: sourceMapFilePath,
- jsSourceMappingURL: !compilerOptions.inlineSourceMap ? ts.getBaseFileName(ts.normalizeSlashes(sourceMapFilePath)) : undefined,
- sourceMapFile: ts.getBaseFileName(ts.normalizeSlashes(filePath)),
- sourceMapSourceRoot: compilerOptions.sourceRoot || "",
- sourceMapSources: [],
- inputSourceFileNames: [],
- sourceMapNames: [],
- sourceMapMappings: "",
- sourceMapSourcesContent: compilerOptions.inlineSources ? [] : undefined,
- };
- sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot);
- if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47) {
- sourceMapData.sourceMapSourceRoot += ts.directorySeparator;
- }
- if (compilerOptions.mapRoot) {
- sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot);
- if (sourceFileOrBundle.kind === 277) {
- sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle.fileName, host, sourceMapDir));
- }
- if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) {
- sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir);
- sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, true);
- }
- else {
- sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL);
- }
- }
- else {
- sourceMapDir = ts.getDirectoryPath(ts.normalizePath(filePath));
- }
- }
- function reset() {
- if (disabled) {
- return;
- }
- if (sourceMapDataList) {
- sourceMapDataList.push(sourceMapData);
- }
- currentSource = undefined;
- sourceMapDir = undefined;
- sourceMapSourceIndex = undefined;
- lastRecordedSourceMapSpan = undefined;
- lastEncodedSourceMapSpan = undefined;
- lastEncodedNameIndex = undefined;
- sourceMapData = undefined;
- sourceMapDataList = undefined;
- }
- function captureSection() {
- return {
- version: 3,
- file: sourceMapData.sourceMapFile,
- sourceRoot: sourceMapData.sourceMapSourceRoot,
- sources: sourceMapData.sourceMapSources,
- names: sourceMapData.sourceMapNames,
- mappings: sourceMapData.sourceMapMappings,
- sourcesContent: sourceMapData.sourceMapSourcesContent,
- };
- }
- function encodeLastRecordedSourceMapSpan() {
- if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) {
- return;
- }
- ts.Debug.assert(lastRecordedSourceMapSpan.emittedColumn >= 0, "lastEncodedSourceMapSpan.emittedColumn was negative");
- ts.Debug.assert(lastRecordedSourceMapSpan.sourceIndex >= 0, "lastEncodedSourceMapSpan.sourceIndex was negative");
- ts.Debug.assert(lastRecordedSourceMapSpan.sourceLine >= 0, "lastEncodedSourceMapSpan.sourceLine was negative");
- ts.Debug.assert(lastRecordedSourceMapSpan.sourceColumn >= 0, "lastEncodedSourceMapSpan.sourceColumn was negative");
- var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn;
- if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) {
- if (sourceMapData.sourceMapMappings) {
- sourceMapData.sourceMapMappings += ",";
- }
- }
- else {
- for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) {
- sourceMapData.sourceMapMappings += ";";
- }
- prevEncodedEmittedColumn = 0;
- }
- sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn);
- sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex);
- sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine);
- sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn);
- if (lastRecordedSourceMapSpan.nameIndex >= 0) {
- ts.Debug.assert(false, "We do not support name index right now, Make sure to update updateLastEncodedAndRecordedSpans when we start using this");
- sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex);
- lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex;
- }
- lastEncodedSourceMapSpan = lastRecordedSourceMapSpan;
- }
- function emitPos(pos) {
- if (disabled || ts.positionIsSynthesized(pos) || isJsonSourceMapSource(currentSource)) {
- return;
- }
- if (extendedDiagnostics) {
- ts.performance.mark("beforeSourcemap");
- }
- var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSource, pos);
- var emittedLine = writer.getLine();
- var emittedColumn = writer.getColumn();
- if (!lastRecordedSourceMapSpan ||
- lastRecordedSourceMapSpan.emittedLine !== emittedLine ||
- lastRecordedSourceMapSpan.emittedColumn !== emittedColumn ||
- (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex &&
- (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line ||
- (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) {
- encodeLastRecordedSourceMapSpan();
- lastRecordedSourceMapSpan = {
- emittedLine: emittedLine,
- emittedColumn: emittedColumn,
- sourceLine: sourceLinePos.line,
- sourceColumn: sourceLinePos.character,
- sourceIndex: sourceMapSourceIndex
- };
- }
- else {
- lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line;
- lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character;
- lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex;
- }
- if (extendedDiagnostics) {
- ts.performance.mark("afterSourcemap");
- ts.performance.measure("Source Map", "beforeSourcemap", "afterSourcemap");
- }
- }
- function isPossiblySourceMap(x) {
- return typeof x === "object" && !!x.mappings && typeof x.mappings === "string" && !!x.sources;
- }
- function emitNodeWithSourceMap(hint, node, emitCallback) {
- var _a;
- if (disabled || ts.isInJsonFile(node)) {
- return emitCallback(hint, node);
- }
- if (node) {
- if (ts.isUnparsedSource(node) && node.sourceMapText !== undefined) {
- var text = node.sourceMapText;
- var parsed = void 0;
- try {
- parsed = JSON.parse(text);
- }
- catch (_b) {
- }
- if (!parsed || !isPossiblySourceMap(parsed)) {
- return emitCallback(hint, node);
- }
- var offsetLine = writer.getLine();
- var firstLineColumnOffset = writer.getColumn();
- var originalMap = parsed;
- var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
- var resolvedPathCache = ts.createMap();
- var absolutePathCache = ts.createMap();
- var sourcemapIterator = ts.sourcemaps.decodeMappings(originalMap);
- for (var _c = sourcemapIterator.next(), raw = _c.value, done = _c.done; !done; _a = sourcemapIterator.next(), raw = _a.value, done = _a.done, _a) {
- var pathCacheKey = "" + raw.sourceIndex;
- if (!resolvedPathCache.has(pathCacheKey)) {
- var rawPath = originalMap.sources[raw.sourceIndex];
- var relativePath = originalMap.sourceRoot ? ts.combinePaths(originalMap.sourceRoot, rawPath) : rawPath;
- var combinedPath = ts.combinePaths(ts.getDirectoryPath(node.sourceMapPath), relativePath);
- var resolvedPath_1 = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, combinedPath, host.getCurrentDirectory(), host.getCanonicalFileName, true);
- resolvedPathCache.set(pathCacheKey, resolvedPath_1);
- absolutePathCache.set(pathCacheKey, ts.getNormalizedAbsolutePath(resolvedPath_1, sourcesDirectoryPath));
- }
- var resolvedPath = resolvedPathCache.get(pathCacheKey);
- var absolutePath = absolutePathCache.get(pathCacheKey);
- setupSourceEntry(absolutePath, originalMap.sourcesContent ? originalMap.sourcesContent[raw.sourceIndex] : null, resolvedPath);
- var newIndex = sourceMapData.sourceMapSources.indexOf(resolvedPath);
- encodeLastRecordedSourceMapSpan();
- lastRecordedSourceMapSpan = __assign({}, raw, { emittedLine: raw.emittedLine + offsetLine, emittedColumn: raw.emittedLine === 0 ? (raw.emittedColumn + firstLineColumnOffset) : raw.emittedColumn, sourceIndex: newIndex });
- }
- return emitCallback(hint, node);
- }
- var emitNode = node.emitNode;
- var emitFlags = emitNode && emitNode.flags || 0;
- var range = emitNode && emitNode.sourceMapRange;
- var _d = range || node, pos = _d.pos, end = _d.end;
- var source = range && range.source;
- var oldSource = currentSource;
- if (source === oldSource)
- source = undefined;
- if (source)
- setSourceFile(source);
- if (node.kind !== 305
- && (emitFlags & 16) === 0
- && pos >= 0) {
- emitPos(skipSourceTrivia(pos));
- }
- if (source)
- setSourceFile(oldSource);
- if (emitFlags & 64) {
- disabled = true;
- emitCallback(hint, node);
- disabled = false;
- }
- else {
- emitCallback(hint, node);
- }
- if (source)
- setSourceFile(source);
- if (node.kind !== 305
- && (emitFlags & 32) === 0
- && end >= 0) {
- emitPos(end);
- }
- if (source)
- setSourceFile(oldSource);
- }
- }
- function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) {
- if (disabled || ts.isInJsonFile(node)) {
- return emitCallback(token, writer, tokenPos);
- }
- var emitNode = node && node.emitNode;
- var emitFlags = emitNode && emitNode.flags || 0;
- var range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token];
- tokenPos = skipSourceTrivia(range ? range.pos : tokenPos);
- if ((emitFlags & 128) === 0 && tokenPos >= 0) {
- emitPos(tokenPos);
- }
- tokenPos = emitCallback(token, writer, tokenPos);
- if (range)
- tokenPos = range.end;
- if ((emitFlags & 256) === 0 && tokenPos >= 0) {
- emitPos(tokenPos);
- }
- return tokenPos;
- }
- function isJsonSourceMapSource(sourceFile) {
- return ts.fileExtensionIs(sourceFile.fileName, ".json");
- }
- function setSourceFile(sourceFile) {
- if (disabled) {
- return;
- }
- currentSource = sourceFile;
- currentSourceText = currentSource.text;
- if (isJsonSourceMapSource(sourceFile)) {
- return;
- }
- setupSourceEntry(sourceFile.fileName, sourceFile.text);
- }
- function setupSourceEntry(fileName, content, source) {
- if (!source) {
- var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
- source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true);
- }
- sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source);
- if (sourceMapSourceIndex === -1) {
- sourceMapSourceIndex = sourceMapData.sourceMapSources.length;
- sourceMapData.sourceMapSources.push(source);
- sourceMapData.inputSourceFileNames.push(fileName);
- if (compilerOptions.inlineSources) {
- sourceMapData.sourceMapSourcesContent.push(content);
- }
- }
- }
- function getText() {
- if (disabled || isJsonSourceMapSource(currentSource)) {
- return undefined;
- }
- encodeLastRecordedSourceMapSpan();
- return JSON.stringify(captureSection());
- }
- function getSourceMappingURL() {
- if (disabled || isJsonSourceMapSource(currentSource)) {
- return undefined;
- }
- if (compilerOptions.inlineSourceMap) {
- var base64SourceMapText = ts.base64encode(ts.sys, getText());
- return sourceMapData.jsSourceMappingURL = "data:application/json;base64," + base64SourceMapText;
- }
- else {
- return sourceMapData.jsSourceMappingURL;
- }
- }
- }
- ts.createSourceMapWriter = createSourceMapWriter;
- var base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- function base64FormatEncode(inValue) {
- if (inValue < 64) {
- return base64Chars.charAt(inValue);
- }
- throw TypeError(inValue + ": not a 64 based value");
- }
- function base64VLQFormatEncode(inValue) {
- if (inValue < 0) {
- inValue = ((-inValue) << 1) + 1;
- }
- else {
- inValue = inValue << 1;
- }
- var encodedStr = "";
- do {
- var currentDigit = inValue & 31;
- inValue = inValue >> 5;
- if (inValue > 0) {
- currentDigit = currentDigit | 32;
- }
- encodedStr = encodedStr + base64FormatEncode(currentDigit);
- } while (inValue > 0);
- return encodedStr;
- }
-})(ts || (ts = {}));
-var ts;
-(function (ts) {
- function createCommentWriter(printerOptions, emitPos) {
- var extendedDiagnostics = printerOptions.extendedDiagnostics;
- var newLine = ts.getNewLineCharacter(printerOptions);
- var writer;
- var containerPos = -1;
- var containerEnd = -1;
- var declarationListContainerEnd = -1;
- var currentSourceFile;
- var currentText;
- var currentLineMap;
- var detachedCommentsInfo;
- var hasWrittenComment = false;
- var disabled = !!printerOptions.removeComments;
- return {
- reset: reset,
- setWriter: setWriter,
- setSourceFile: setSourceFile,
- emitNodeWithComments: emitNodeWithComments,
- emitBodyWithDetachedComments: emitBodyWithDetachedComments,
- emitTrailingCommentsOfPosition: emitTrailingCommentsOfPosition,
- emitLeadingCommentsOfPosition: emitLeadingCommentsOfPosition,
- };
- function emitNodeWithComments(hint, node, emitCallback) {
- if (disabled) {
- emitCallback(hint, node);
- return;
- }
- if (node) {
- hasWrittenComment = false;
- var emitNode = node.emitNode;
- var emitFlags = emitNode && emitNode.flags || 0;
- var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end;
- if ((pos < 0 && end < 0) || (pos === end)) {
- emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback);
- }
- else {
- if (extendedDiagnostics) {
- ts.performance.mark("preEmitNodeWithComment");
- }
- var isEmittedNode = node.kind !== 305;
- var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 10;
- var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 10;
- if (!skipLeadingComments) {
- emitLeadingComments(pos, isEmittedNode);
- }
- var savedContainerPos = containerPos;
- var savedContainerEnd = containerEnd;
- var savedDeclarationListContainerEnd = declarationListContainerEnd;
- if (!skipLeadingComments || (pos >= 0 && (emitFlags & 512) !== 0)) {
- containerPos = pos;
- }
- if (!skipTrailingComments || (end >= 0 && (emitFlags & 1024) !== 0)) {
- containerEnd = end;
- if (node.kind === 236) {
- declarationListContainerEnd = end;
- }
- }
- if (extendedDiagnostics) {
- ts.performance.measure("commentTime", "preEmitNodeWithComment");
- }
- emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback);
- if (extendedDiagnostics) {
- ts.performance.mark("postEmitNodeWithComment");
- }
- containerPos = savedContainerPos;
- containerEnd = savedContainerEnd;
- declarationListContainerEnd = savedDeclarationListContainerEnd;
- if (!skipTrailingComments && isEmittedNode) {
- emitTrailingComments(end);
- }
- if (extendedDiagnostics) {
- ts.performance.measure("commentTime", "postEmitNodeWithComment");
- }
- }
- }
- }
- function emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback) {
- var leadingComments = emitNode && emitNode.leadingComments;
- if (ts.some(leadingComments)) {
- if (extendedDiagnostics) {
- ts.performance.mark("preEmitNodeWithSynthesizedComments");
- }
- ts.forEach(leadingComments, emitLeadingSynthesizedComment);
- if (extendedDiagnostics) {
- ts.performance.measure("commentTime", "preEmitNodeWithSynthesizedComments");
- }
- }
- emitNodeWithNestedComments(hint, node, emitFlags, emitCallback);
- var trailingComments = emitNode && emitNode.trailingComments;
- if (ts.some(trailingComments)) {
- if (extendedDiagnostics) {
- ts.performance.mark("postEmitNodeWithSynthesizedComments");
- }
- ts.forEach(trailingComments, emitTrailingSynthesizedComment);
- if (extendedDiagnostics) {
- ts.performance.measure("commentTime", "postEmitNodeWithSynthesizedComments");
- }
- }
- }
- function emitLeadingSynthesizedComment(comment) {
- if (comment.kind === 2) {
- writer.writeLine();
- }
- writeSynthesizedComment(comment);
- if (comment.hasTrailingNewLine || comment.kind === 2) {
- writer.writeLine();
- }
- else {
- writer.write(" ");
- }
- }
- function emitTrailingSynthesizedComment(comment) {
- if (!writer.isAtStartOfLine()) {
- writer.write(" ");
- }
- writeSynthesizedComment(comment);
- if (comment.hasTrailingNewLine) {
- writer.writeLine();
- }
- }
- function writeSynthesizedComment(comment) {
- var text = formatSynthesizedComment(comment);
- var lineMap = comment.kind === 3 ? ts.computeLineStarts(text) : undefined;
- ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine);
- }
- function formatSynthesizedComment(comment) {
- return comment.kind === 3
- ? "/*" + comment.text + "*/"
- : "//" + comment.text;
- }
- function emitNodeWithNestedComments(hint, node, emitFlags, emitCallback) {
- if (emitFlags & 2048) {
- disabled = true;
- emitCallback(hint, node);
- disabled = false;
- }
- else {
- emitCallback(hint, node);
- }
- }
- function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
- if (extendedDiagnostics) {
- ts.performance.mark("preEmitBodyWithDetachedComments");
- }
- var pos = detachedRange.pos, end = detachedRange.end;
- var emitFlags = ts.getEmitFlags(node);
- var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0;
- var skipTrailingComments = disabled || end < 0 || (emitFlags & 1024) !== 0;
- if (!skipLeadingComments) {
- emitDetachedCommentsAndUpdateCommentsInfo(detachedRange);
- }
- if (extendedDiagnostics) {
- ts.performance.measure("commentTime", "preEmitBodyWithDetachedComments");
- }
- if (emitFlags & 2048 && !disabled) {
- disabled = true;
- emitCallback(node);
- disabled = false;
- }
- else {
- emitCallback(node);
- }
- if (extendedDiagnostics) {
- ts.performance.mark("beginEmitBodyWithDetachedComments");
- }
- if (!skipTrailingComments) {
- emitLeadingComments(detachedRange.end, true);
- if (hasWrittenComment && !writer.isAtStartOfLine()) {
- writer.writeLine();
- }
- }
- if (extendedDiagnostics) {
- ts.performance.measure("commentTime", "beginEmitBodyWithDetachedComments");
- }
- }
- function emitLeadingComments(pos, isEmittedNode) {
- hasWrittenComment = false;
- if (isEmittedNode) {
- 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 shouldWriteComment(text, pos) {
- if (printerOptions.onlyPrintJsDocStyle) {
- return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos));
- }
- return true;
- }
- function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) {
- if (!shouldWriteComment(currentText, commentPos))
- return;
- if (!hasWrittenComment) {
- ts.emitNewLineBeforeLeadingCommentOfPosition(currentLineMap, writer, rangePos, commentPos);
- hasWrittenComment = true;
- }
- if (emitPos)
- emitPos(commentPos);
- ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine);
- if (emitPos)
- emitPos(commentEnd);
- if (hasTrailingNewLine) {
- writer.writeLine();
- }
- else if (kind === 3) {
- writer.write(" ");
- }
- }
- function emitLeadingCommentsOfPosition(pos) {
- if (disabled || pos === -1) {
- return;
- }
- emitLeadingComments(pos, true);
- }
- function emitTrailingComments(pos) {
- forEachTrailingCommentToEmit(pos, emitTrailingComment);
- }
- function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) {
- if (!shouldWriteComment(currentText, commentPos))
- return;
- if (!writer.isAtStartOfLine()) {
- writer.write(" ");
- }
- if (emitPos)
- emitPos(commentPos);
- ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine);
- if (emitPos)
- emitPos(commentEnd);
- if (hasTrailingNewLine) {
- writer.writeLine();
- }
- }
- function emitTrailingCommentsOfPosition(pos, prefixSpace) {
- if (disabled) {
- return;
- }
- if (extendedDiagnostics) {
- ts.performance.mark("beforeEmitTrailingCommentsOfPosition");
- }
- forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : emitTrailingCommentOfPosition);
- if (extendedDiagnostics) {
- ts.performance.measure("commentTime", "beforeEmitTrailingCommentsOfPosition");
- }
- }
- function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) {
- if (emitPos)
- emitPos(commentPos);
- ts.writeCommentRange(currentText, currentLineMap, writer, commentPos, commentEnd, newLine);
- if (emitPos)
- emitPos(commentEnd);
- if (hasTrailingNewLine) {
- writer.writeLine();
- }
- else {
- writer.write(" ");
- }
- }
- function forEachLeadingCommentToEmit(pos, cb) {
- if (containerPos === -1 || pos !== containerPos) {
- if (hasDetachedComments(pos)) {
- forEachLeadingCommentWithoutDetachedComments(cb);
- }
- else {
- ts.forEachLeadingCommentRange(currentText, pos, cb, pos);
- }
- }
- }
- function forEachTrailingCommentToEmit(end, cb) {
- if (containerEnd === -1 || (end !== containerEnd && end !== declarationListContainerEnd)) {
- ts.forEachTrailingCommentRange(currentText, end, cb);
- }
- }
- function reset() {
- currentSourceFile = undefined;
- currentText = undefined;
- currentLineMap = undefined;
- detachedCommentsInfo = undefined;
- }
- function setWriter(output) {
- writer = output;
- }
- function setSourceFile(sourceFile) {
- currentSourceFile = sourceFile;
- currentText = currentSourceFile.text;
- currentLineMap = ts.getLineStarts(currentSourceFile);
- detachedCommentsInfo = undefined;
- }
- function hasDetachedComments(pos) {
- return detachedCommentsInfo !== undefined && ts.last(detachedCommentsInfo).nodePos === pos;
- }
- function forEachLeadingCommentWithoutDetachedComments(cb) {
- var pos = ts.last(detachedCommentsInfo).detachedCommentEndPos;
- if (detachedCommentsInfo.length - 1) {
- detachedCommentsInfo.pop();
- }
- else {
- detachedCommentsInfo = undefined;
- }
- ts.forEachLeadingCommentRange(currentText, pos, cb, pos);
- }
- function emitDetachedCommentsAndUpdateCommentsInfo(range) {
- var currentDetachedCommentInfo = ts.emitDetachedComments(currentText, currentLineMap, writer, writeComment, range, newLine, disabled);
- if (currentDetachedCommentInfo) {
- if (detachedCommentsInfo) {
- detachedCommentsInfo.push(currentDetachedCommentInfo);
- }
- else {
- detachedCommentsInfo = [currentDetachedCommentInfo];
- }
- }
- }
- function writeComment(text, lineMap, writer, commentPos, commentEnd, newLine) {
- if (!shouldWriteComment(currentText, commentPos))
- return;
- if (emitPos)
- emitPos(commentPos);
- ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine);
- if (emitPos)
- emitPos(commentEnd);
- }
- function isTripleSlashComment(commentPos, commentEnd) {
- return ts.isRecognizedTripleSlashComment(currentText, commentPos, commentEnd);
- }
- }
- ts.createCommentWriter = createCommentWriter;
-})(ts || (ts = {}));
-var ts;
(function (ts) {
var infoExtension = ".tsbundleinfo";
var brackets = createBracketsMap();
+ var syntheticParent = { pos: -1, end: -1 };
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) {
if (emitOnlyDtsFiles === void 0) { emitOnlyDtsFiles = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
@@ -65374,7 +65829,7 @@ var ts;
ts.forEachEmittedFile = forEachEmittedFile;
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
var options = host.getCompilerOptions();
- if (sourceFile.kind === 278) {
+ if (sourceFile.kind === 280) {
var outPath = options.outFile || options.out;
var jsFilePath = options.emitDeclarationOnly ? undefined : outPath;
var sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options);
@@ -65427,21 +65882,15 @@ var ts;
var sourceMapDataList = (compilerOptions.sourceMap || compilerOptions.inlineSourceMap || ts.getAreDeclarationMapsEnabled(compilerOptions)) ? [] : undefined;
var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined;
var emitterDiagnostics = ts.createDiagnosticCollection();
- var newLine = host.getNewLine();
+ var newLine = ts.getNewLineCharacter(compilerOptions, function () { return host.getNewLine(); });
var writer = ts.createTextWriter(newLine);
- var sourceMap = ts.createSourceMapWriter(host, writer);
- var declarationSourceMap = ts.createSourceMapWriter(host, writer, {
- sourceMap: compilerOptions.declarationMap,
- sourceRoot: compilerOptions.sourceRoot,
- mapRoot: compilerOptions.mapRoot,
- extendedDiagnostics: compilerOptions.extendedDiagnostics,
- });
+ var _a = ts.performance.createTimer("printTime", "beforePrint", "afterPrint"), enter = _a.enter, exit = _a.exit;
var bundleInfo = createDefaultBundleInfo();
var emitSkipped = false;
var exportedModulesFromDeclarationEmit;
- ts.performance.mark("beforePrint");
+ enter();
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), emitOnlyDtsFiles);
- ts.performance.measure("printTime", "beforePrint");
+ exit();
return {
emitSkipped: emitSkipped,
diagnostics: emitterDiagnostics.getDiagnostics(),
@@ -65482,17 +65931,24 @@ var ts;
return;
}
var transform = ts.transformNodes(resolver, host, compilerOptions, [sourceFileOrBundle], transformers, false);
- var printer = createPrinter(__assign({}, compilerOptions, { noEmitHelpers: compilerOptions.noEmitHelpers }), {
+ var printerOptions = {
+ removeComments: compilerOptions.removeComments,
+ newLine: compilerOptions.newLine,
+ noEmitHelpers: compilerOptions.noEmitHelpers,
+ module: compilerOptions.module,
+ target: compilerOptions.target,
+ sourceMap: compilerOptions.sourceMap,
+ inlineSourceMap: compilerOptions.inlineSourceMap,
+ inlineSources: compilerOptions.inlineSources,
+ extendedDiagnostics: compilerOptions.extendedDiagnostics,
+ };
+ var printer = createPrinter(printerOptions, {
hasGlobalName: resolver.hasGlobalName,
onEmitNode: transform.emitNodeWithNotification,
substituteNode: transform.substituteNode,
- onEmitSourceMapOfNode: sourceMap.emitNodeWithSourceMap,
- onEmitSourceMapOfToken: sourceMap.emitTokenWithSourceMap,
- onEmitSourceMapOfPosition: sourceMap.emitPos,
- onSetSourceFile: setSourceFile,
});
ts.Debug.assert(transform.transformed.length === 1, "Should only see one output from the transform");
- printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform.transformed[0], bundleInfoPath, printer, sourceMap);
+ printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform.transformed[0], bundleInfoPath, printer, compilerOptions);
transform.dispose();
}
function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath) {
@@ -65512,12 +65968,19 @@ var ts;
emitterDiagnostics.add(diagnostic);
}
}
- var declarationPrinter = createPrinter(__assign({}, compilerOptions, { onlyPrintJsDocStyle: true, noEmitHelpers: true }), {
+ var printerOptions = {
+ removeComments: compilerOptions.removeComments,
+ newLine: compilerOptions.newLine,
+ noEmitHelpers: true,
+ module: compilerOptions.module,
+ target: compilerOptions.target,
+ sourceMap: compilerOptions.sourceMap,
+ inlineSourceMap: compilerOptions.inlineSourceMap,
+ extendedDiagnostics: compilerOptions.extendedDiagnostics,
+ onlyPrintJsDocStyle: true,
+ };
+ var declarationPrinter = createPrinter(printerOptions, {
hasGlobalName: resolver.hasGlobalName,
- onEmitSourceMapOfNode: declarationSourceMap.emitNodeWithSourceMap,
- onEmitSourceMapOfToken: declarationSourceMap.emitTokenWithSourceMap,
- onEmitSourceMapOfPosition: declarationSourceMap.emitPos,
- onSetSourceFile: setSourceFileForDeclarationSourceMaps,
onEmitNode: declarationTransform.emitNodeWithNotification,
substituteNode: declarationTransform.substituteNode,
});
@@ -65525,8 +65988,13 @@ var ts;
emitSkipped = emitSkipped || declBlocked;
if (!declBlocked || emitOnlyDtsFiles) {
ts.Debug.assert(declarationTransform.transformed.length === 1, "Should only see one output from the decl transform");
- printSourceFileOrBundle(declarationFilePath, declarationMapPath, declarationTransform.transformed[0], undefined, declarationPrinter, declarationSourceMap);
- if (emitOnlyDtsFiles && declarationTransform.transformed[0].kind === 277) {
+ printSourceFileOrBundle(declarationFilePath, declarationMapPath, declarationTransform.transformed[0], undefined, declarationPrinter, {
+ sourceMap: compilerOptions.declarationMap,
+ sourceRoot: compilerOptions.sourceRoot,
+ mapRoot: compilerOptions.mapRoot,
+ extendedDiagnostics: compilerOptions.extendedDiagnostics,
+ });
+ if (emitOnlyDtsFiles && declarationTransform.transformed[0].kind === 279) {
var sourceFile = declarationTransform.transformed[0];
exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;
}
@@ -65535,7 +66003,7 @@ var ts;
}
function collectLinkedAliases(node) {
if (ts.isExportAssignment(node)) {
- if (node.expression.kind === 71) {
+ if (node.expression.kind === 72) {
resolver.collectLinkedAliases(node.expression, true);
}
return;
@@ -65546,49 +66014,104 @@ var ts;
}
ts.forEachChild(node, collectLinkedAliases);
}
- function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, bundleInfoPath, printer, mapRecorder) {
- var bundle = sourceFileOrBundle.kind === 278 ? sourceFileOrBundle : undefined;
- var sourceFile = sourceFileOrBundle.kind === 277 ? sourceFileOrBundle : undefined;
+ function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, bundleInfoPath, printer, mapOptions) {
+ var bundle = sourceFileOrBundle.kind === 280 ? sourceFileOrBundle : undefined;
+ var sourceFile = sourceFileOrBundle.kind === 279 ? sourceFileOrBundle : undefined;
var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
- mapRecorder.initialize(jsFilePath, sourceMapFilePath || "", sourceFileOrBundle, sourceMapDataList);
+ var sourceMapGenerator;
+ if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {
+ sourceMapGenerator = ts.createSourceMapGenerator(host, ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)), getSourceRoot(mapOptions), getSourceMapDirectory(mapOptions, jsFilePath, sourceFile), mapOptions);
+ }
if (bundle) {
- printer.writeBundle(bundle, writer, bundleInfo);
+ printer.writeBundle(bundle, bundleInfo, writer, sourceMapGenerator);
}
else {
- printer.writeFile(sourceFile, writer);
+ printer.writeFile(sourceFile, writer, sourceMapGenerator);
}
- writer.writeLine();
- var sourceMappingURL = mapRecorder.getSourceMappingURL();
- if (sourceMappingURL) {
- writer.write("//# " + "sourceMappingURL" + "=" + sourceMappingURL);
+ if (sourceMapGenerator) {
+ if (sourceMapDataList) {
+ sourceMapDataList.push({
+ inputSourceFileNames: sourceMapGenerator.getSources(),
+ sourceMap: sourceMapGenerator.toJSON()
+ });
+ }
+ var sourceMappingURL = getSourceMappingURL(mapOptions, sourceMapGenerator, jsFilePath, sourceMapFilePath, sourceFile);
+ if (sourceMappingURL) {
+ if (!writer.isAtStartOfLine())
+ writer.rawWrite(newLine);
+ writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL);
+ }
+ if (sourceMapFilePath) {
+ var sourceMap = sourceMapGenerator.toString();
+ ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, false, sourceFiles);
+ }
}
- if (sourceMapFilePath) {
- ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, mapRecorder.getText(), false, sourceFiles);
+ else {
+ writer.writeLine();
}
ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles);
if (bundleInfoPath) {
bundleInfo.totalLength = writer.getTextPos();
ts.writeFile(host, emitterDiagnostics, bundleInfoPath, JSON.stringify(bundleInfo, undefined, 2), false);
}
- mapRecorder.reset();
writer.clear();
bundleInfo = createDefaultBundleInfo();
}
- function setSourceFile(node) {
- sourceMap.setSourceFile(node);
+ function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
+ return (mapOptions.sourceMap || mapOptions.inlineSourceMap)
+ && (sourceFileOrBundle.kind !== 279 || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json"));
}
- function setSourceFileForDeclarationSourceMaps(node) {
- declarationSourceMap.setSourceFile(node);
+ function getSourceRoot(mapOptions) {
+ var sourceRoot = ts.normalizeSlashes(mapOptions.sourceRoot || "");
+ return sourceRoot ? ts.ensureTrailingDirectorySeparator(sourceRoot) : sourceRoot;
+ }
+ function getSourceMapDirectory(mapOptions, filePath, sourceFile) {
+ if (mapOptions.sourceRoot)
+ return host.getCommonSourceDirectory();
+ if (mapOptions.mapRoot) {
+ var sourceMapDir = ts.normalizeSlashes(mapOptions.mapRoot);
+ if (sourceFile) {
+ sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir));
+ }
+ if (ts.getRootLength(sourceMapDir) === 0) {
+ sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir);
+ }
+ return sourceMapDir;
+ }
+ return ts.getDirectoryPath(ts.normalizePath(filePath));
+ }
+ function getSourceMappingURL(mapOptions, sourceMapGenerator, filePath, sourceMapFilePath, sourceFile) {
+ if (mapOptions.inlineSourceMap) {
+ var sourceMapText = sourceMapGenerator.toString();
+ var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
+ return "data:application/json;base64," + base64SourceMapText;
+ }
+ var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.assertDefined(sourceMapFilePath)));
+ if (mapOptions.mapRoot) {
+ var sourceMapDir = ts.normalizeSlashes(mapOptions.mapRoot);
+ if (sourceFile) {
+ sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir));
+ }
+ if (ts.getRootLength(sourceMapDir) === 0) {
+ sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir);
+ return ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), ts.combinePaths(sourceMapDir, sourceMapFile), host.getCurrentDirectory(), host.getCanonicalFileName, true);
+ }
+ else {
+ return ts.combinePaths(sourceMapDir, sourceMapFile);
+ }
+ }
+ return sourceMapFile;
}
}
ts.emitFiles = emitFiles;
function createPrinter(printerOptions, handlers) {
if (printerOptions === void 0) { printerOptions = {}; }
if (handlers === void 0) { handlers = {}; }
- var hasGlobalName = handlers.hasGlobalName, onEmitSourceMapOfNode = handlers.onEmitSourceMapOfNode, onEmitSourceMapOfToken = handlers.onEmitSourceMapOfToken, onEmitSourceMapOfPosition = handlers.onEmitSourceMapOfPosition, onEmitNode = handlers.onEmitNode, onSetSourceFile = handlers.onSetSourceFile, substituteNode = handlers.substituteNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray, onBeforeEmitToken = handlers.onBeforeEmitToken, onAfterEmitToken = handlers.onAfterEmitToken;
+ var hasGlobalName = handlers.hasGlobalName, _a = handlers.onEmitNode, onEmitNode = _a === void 0 ? ts.noEmitNotification : _a, _b = handlers.substituteNode, substituteNode = _b === void 0 ? ts.noEmitSubstitution : _b, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray, onBeforeEmitToken = handlers.onBeforeEmitToken, onAfterEmitToken = handlers.onAfterEmitToken;
+ var extendedDiagnostics = !!printerOptions.extendedDiagnostics;
var newLine = ts.getNewLineCharacter(printerOptions);
- var comments = ts.createCommentWriter(printerOptions, onEmitSourceMapOfPosition);
- var emitNodeWithComments = comments.emitNodeWithComments, emitBodyWithDetachedComments = comments.emitBodyWithDetachedComments, emitTrailingCommentsOfPosition = comments.emitTrailingCommentsOfPosition, emitLeadingCommentsOfPosition = comments.emitLeadingCommentsOfPosition;
+ var moduleKind = ts.getEmitModuleKind(printerOptions);
+ var bundledHelpers = ts.createMap();
var currentSourceFile;
var nodeIdToGeneratedName;
var autoGeneratedIdToGeneratedName;
@@ -65600,17 +66123,19 @@ var ts;
var writer;
var ownWriter;
var write = writeBase;
- var commitPendingSemicolon = ts.noop;
- var writeSemicolon = writeSemicolonInternal;
- var pendingSemicolon = false;
- if (printerOptions.omitTrailingSemicolon) {
- commitPendingSemicolon = commitPendingSemicolonInternal;
- writeSemicolon = deferWriteSemicolon;
- }
- var syntheticParent = { pos: -1, end: -1 };
- var moduleKind = ts.getEmitModuleKind(printerOptions);
- var bundledHelpers = ts.createMap();
var isOwnFileEmit;
+ var sourceMapsDisabled = true;
+ var sourceMapGenerator;
+ var sourceMapSource;
+ var sourceMapSourceIndex = -1;
+ var containerPos = -1;
+ var containerEnd = -1;
+ var declarationListContainerEnd = -1;
+ var currentLineMap;
+ var detachedCommentsInfo;
+ var hasWrittenComment = false;
+ var commentsDisabled = !!printerOptions.removeComments;
+ var _c = ts.performance.createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"), enterComment = _c.enter, exitComment = _c.exit;
reset();
return {
printNode: printNode,
@@ -65635,9 +66160,9 @@ var ts;
break;
}
switch (node.kind) {
- case 277: return printFile(node);
- case 278: return printBundle(node);
- case 279: return printUnparsedSource(node);
+ case 279: return printFile(node);
+ case 280: return printBundle(node);
+ case 281: return printUnparsedSource(node);
}
writeNode(hint, node, sourceFile, beginPrint());
return endPrint();
@@ -65647,11 +66172,11 @@ var ts;
return endPrint();
}
function printBundle(bundle) {
- writeBundle(bundle, beginPrint());
+ writeBundle(bundle, undefined, beginPrint(), undefined);
return endPrint();
}
function printFile(sourceFile) {
- writeFile(sourceFile, beginPrint());
+ writeFile(sourceFile, beginPrint(), undefined);
return endPrint();
}
function printUnparsedSource(unparsed) {
@@ -65660,14 +66185,14 @@ var ts;
}
function writeNode(hint, node, sourceFile, output) {
var previousWriter = writer;
- setWriter(output);
+ setWriter(output, undefined);
print(hint, node, sourceFile);
reset();
writer = previousWriter;
}
function writeList(format, nodes, sourceFile, output) {
var previousWriter = writer;
- setWriter(output);
+ setWriter(output, undefined);
if (sourceFile) {
setSourceFile(sourceFile);
}
@@ -65675,18 +66200,18 @@ var ts;
reset();
writer = previousWriter;
}
- function writeBundle(bundle, output, bundleInfo) {
+ function writeBundle(bundle, bundleInfo, output, sourceMapGenerator) {
isOwnFileEmit = false;
var previousWriter = writer;
- setWriter(output);
+ setWriter(output, sourceMapGenerator);
emitShebangIfNeeded(bundle);
emitPrologueDirectivesIfNeeded(bundle);
emitHelpers(bundle);
emitSyntheticTripleSlashReferencesIfNeeded(bundle);
for (var _a = 0, _b = bundle.prepends; _a < _b.length; _a++) {
var prepend = _b[_a];
- print(4, prepend, undefined);
writeLine();
+ print(4, prepend, undefined);
}
if (bundleInfo) {
bundleInfo.originalOffset = writer.getTextPos();
@@ -65700,15 +66225,15 @@ var ts;
}
function writeUnparsedSource(unparsed, output) {
var previousWriter = writer;
- setWriter(output);
+ setWriter(output, undefined);
print(4, unparsed, undefined);
reset();
writer = previousWriter;
}
- function writeFile(sourceFile, output) {
+ function writeFile(sourceFile, output, sourceMapGenerator) {
isOwnFileEmit = true;
var previousWriter = writer;
- setWriter(output);
+ setWriter(output, sourceMapGenerator);
emitShebangIfNeeded(sourceFile);
emitPrologueDirectivesIfNeeded(sourceFile);
print(0, sourceFile, sourceFile);
@@ -65727,19 +66252,24 @@ var ts;
if (sourceFile) {
setSourceFile(sourceFile);
}
- var pipelinePhase = getPipelinePhase(0, hint);
+ var pipelinePhase = getPipelinePhase(0, node);
pipelinePhase(hint, node);
}
function setSourceFile(sourceFile) {
currentSourceFile = sourceFile;
- comments.setSourceFile(sourceFile);
- if (onSetSourceFile) {
- onSetSourceFile(sourceFile);
+ currentLineMap = undefined;
+ detachedCommentsInfo = undefined;
+ if (sourceFile) {
+ setSourceMapSource(sourceFile);
}
}
- function setWriter(output) {
- writer = output;
- comments.setWriter(output);
+ function setWriter(_writer, _sourceMapGenerator) {
+ if (_writer && printerOptions.omitTrailingSemicolon) {
+ _writer = ts.getTrailingSemicolonOmittingWriter(_writer);
+ }
+ writer = _writer;
+ sourceMapGenerator = _sourceMapGenerator;
+ sourceMapsDisabled = !writer || !sourceMapGenerator;
}
function reset() {
nodeIdToGeneratedName = [];
@@ -65748,66 +66278,62 @@ var ts;
tempFlagsStack = [];
tempFlags = 0;
reservedNamesStack = [];
- comments.reset();
- setWriter(undefined);
+ currentSourceFile = undefined;
+ currentLineMap = undefined;
+ detachedCommentsInfo = undefined;
+ setWriter(undefined, undefined);
+ }
+ function getCurrentLineMap() {
+ return currentLineMap || (currentLineMap = ts.getLineStarts(currentSourceFile));
}
function emit(node) {
- if (!node)
+ if (node === undefined)
return;
- var pipelinePhase = getPipelinePhase(0, 4);
+ var pipelinePhase = getPipelinePhase(0, node);
pipelinePhase(4, node);
}
function emitIdentifierName(node) {
- if (!node)
+ if (node === undefined)
return;
- var pipelinePhase = getPipelinePhase(0, 2);
+ var pipelinePhase = getPipelinePhase(0, node);
pipelinePhase(2, node);
}
function emitExpression(node) {
- if (!node)
+ if (node === undefined)
return;
- var pipelinePhase = getPipelinePhase(0, 1);
+ var pipelinePhase = getPipelinePhase(0, node);
pipelinePhase(1, node);
}
- function getPipelinePhase(phase, hint) {
+ function getPipelinePhase(phase, node) {
switch (phase) {
case 0:
- if (onEmitNode) {
+ if (onEmitNode !== ts.noEmitNotification) {
return pipelineEmitWithNotification;
}
case 1:
- if (emitNodeWithComments && hint !== 0) {
+ if (substituteNode !== ts.noEmitSubstitution) {
+ return pipelineEmitWithSubstitution;
+ }
+ case 2:
+ if (!commentsDisabled && node.kind !== 279) {
return pipelineEmitWithComments;
}
- return pipelineEmitWithoutComments;
- case 2:
- if (onEmitSourceMapOfNode && hint !== 0) {
+ case 3:
+ if (!sourceMapsDisabled && node.kind !== 279 && !ts.isInJsonFile(node)) {
return pipelineEmitWithSourceMap;
}
- case 3:
+ case 4:
return pipelineEmitWithHint;
default:
- return ts.Debug.assertNever(phase, "Unexpected value for PipelinePhase: " + phase);
+ return ts.Debug.assertNever(phase);
}
}
- function getNextPipelinePhase(currentPhase, hint) {
- return getPipelinePhase(currentPhase + 1, hint);
+ function getNextPipelinePhase(currentPhase, node) {
+ return getPipelinePhase(currentPhase + 1, node);
}
function pipelineEmitWithNotification(hint, node) {
- ts.Debug.assertDefined(onEmitNode)(hint, node, getNextPipelinePhase(0, hint));
- }
- function pipelineEmitWithComments(hint, node) {
- ts.Debug.assertDefined(emitNodeWithComments);
- ts.Debug.assert(hint !== 0);
- emitNodeWithComments(hint, trySubstituteNode(hint, node), getNextPipelinePhase(1, hint));
- }
- function pipelineEmitWithoutComments(hint, node) {
- var pipelinePhase = getNextPipelinePhase(1, hint);
- pipelinePhase(hint, trySubstituteNode(hint, node));
- }
- function pipelineEmitWithSourceMap(hint, node) {
- ts.Debug.assert(hint !== 0);
- ts.Debug.assertDefined(onEmitSourceMapOfNode)(hint, node, pipelineEmitWithHint);
+ var pipelinePhase = getNextPipelinePhase(0, node);
+ onEmitNode(hint, node, pipelinePhase);
}
function pipelineEmitWithHint(hint, node) {
if (hint === 0)
@@ -65816,236 +66342,267 @@ var ts;
return emitIdentifier(ts.cast(node, ts.isIdentifier));
if (hint === 3)
return emitMappedTypeParameter(ts.cast(node, ts.isTypeParameterDeclaration));
+ if (hint === 5) {
+ ts.Debug.assertNode(node, ts.isEmptyStatement);
+ return emitEmptyStatement(true);
+ }
if (hint === 4) {
if (ts.isKeyword(node.kind))
return writeTokenNode(node, writeKeyword);
switch (node.kind) {
- case 14:
case 15:
case 16:
+ case 17:
return emitLiteral(node);
- case 279:
+ case 281:
return emitUnparsedSource(node);
- case 71:
+ case 72:
return emitIdentifier(node);
- case 146:
- return emitQualifiedName(node);
- case 147:
- return emitComputedPropertyName(node);
case 148:
- return emitTypeParameter(node);
+ return emitQualifiedName(node);
case 149:
- return emitParameter(node);
+ return emitComputedPropertyName(node);
case 150:
- return emitDecorator(node);
+ return emitTypeParameter(node);
case 151:
- return emitPropertySignature(node);
+ return emitParameter(node);
case 152:
- return emitPropertyDeclaration(node);
+ return emitDecorator(node);
case 153:
- return emitMethodSignature(node);
+ return emitPropertySignature(node);
case 154:
- return emitMethodDeclaration(node);
+ return emitPropertyDeclaration(node);
case 155:
- return emitConstructor(node);
+ return emitMethodSignature(node);
case 156:
+ return emitMethodDeclaration(node);
case 157:
- return emitAccessorDeclaration(node);
+ return emitConstructor(node);
case 158:
- return emitCallSignature(node);
case 159:
- return emitConstructSignature(node);
+ return emitAccessorDeclaration(node);
case 160:
- return emitIndexSignature(node);
+ return emitCallSignature(node);
case 161:
- return emitTypePredicate(node);
+ return emitConstructSignature(node);
case 162:
- return emitTypeReference(node);
+ return emitIndexSignature(node);
case 163:
- return emitFunctionType(node);
- case 287:
- return emitJSDocFunctionType(node);
+ return emitTypePredicate(node);
case 164:
- return emitConstructorType(node);
+ return emitTypeReference(node);
case 165:
- return emitTypeQuery(node);
+ return emitFunctionType(node);
+ case 289:
+ return emitJSDocFunctionType(node);
case 166:
- return emitTypeLiteral(node);
+ return emitConstructorType(node);
case 167:
- return emitArrayType(node);
+ return emitTypeQuery(node);
case 168:
- return emitTupleType(node);
+ return emitTypeLiteral(node);
case 169:
- return emitOptionalType(node);
- case 171:
- return emitUnionType(node);
- case 172:
- return emitIntersectionType(node);
- case 173:
- return emitConditionalType(node);
- case 174:
- return emitInferType(node);
- case 175:
- return emitParenthesizedType(node);
- case 209:
- return emitExpressionWithTypeArguments(node);
- case 176:
- return emitThisType();
- case 177:
- return emitTypeOperator(node);
- case 178:
- return emitIndexedAccessType(node);
- case 179:
- return emitMappedType(node);
- case 180:
- return emitLiteralType(node);
- case 181:
- return emitImportTypeNode(node);
- case 282:
- write("*");
- return;
- case 283:
- write("?");
- return;
- case 284:
- return emitJSDocNullableType(node);
- case 285:
- return emitJSDocNonNullableType(node);
- case 286:
- return emitJSDocOptionalType(node);
+ return emitArrayType(node);
case 170:
- case 288:
- return emitRestOrJSDocVariadicType(node);
+ return emitTupleType(node);
+ case 171:
+ return emitOptionalType(node);
+ case 173:
+ return emitUnionType(node);
+ case 174:
+ return emitIntersectionType(node);
+ case 175:
+ return emitConditionalType(node);
+ case 176:
+ return emitInferType(node);
+ case 177:
+ return emitParenthesizedType(node);
+ case 211:
+ return emitExpressionWithTypeArguments(node);
+ case 178:
+ return emitThisType();
+ case 179:
+ return emitTypeOperator(node);
+ case 180:
+ return emitIndexedAccessType(node);
+ case 181:
+ return emitMappedType(node);
case 182:
- return emitObjectBindingPattern(node);
+ return emitLiteralType(node);
case 183:
- return emitArrayBindingPattern(node);
- case 184:
- return emitBindingElement(node);
- case 214:
- return emitTemplateSpan(node);
- case 215:
- return emitSemicolonClassElement();
- case 216:
- return emitBlock(node);
- case 217:
- return emitVariableStatement(node);
- case 218:
- return emitEmptyStatement();
- case 219:
- return emitExpressionStatement(node);
- case 220:
- return emitIfStatement(node);
- case 221:
- return emitDoStatement(node);
- case 222:
- return emitWhileStatement(node);
- case 223:
- return emitForStatement(node);
- case 224:
- return emitForInStatement(node);
- case 225:
- return emitForOfStatement(node);
- case 226:
- return emitContinueStatement(node);
- case 227:
- return emitBreakStatement(node);
- case 228:
- return emitReturnStatement(node);
- case 229:
- return emitWithStatement(node);
- case 230:
- return emitSwitchStatement(node);
- case 231:
- return emitLabeledStatement(node);
- case 232:
- return emitThrowStatement(node);
- case 233:
- return emitTryStatement(node);
- case 234:
- return emitDebuggerStatement(node);
- case 235:
- return emitVariableDeclaration(node);
- case 236:
- return emitVariableDeclarationList(node);
- case 237:
- return emitFunctionDeclaration(node);
- case 238:
- return emitClassDeclaration(node);
- case 239:
- return emitInterfaceDeclaration(node);
- case 240:
- return emitTypeAliasDeclaration(node);
- case 241:
- return emitEnumDeclaration(node);
- case 242:
- return emitModuleDeclaration(node);
- case 243:
- return emitModuleBlock(node);
- case 244:
- return emitCaseBlock(node);
- case 245:
- return emitNamespaceExportDeclaration(node);
- case 246:
- return emitImportEqualsDeclaration(node);
- case 247:
- return emitImportDeclaration(node);
- case 248:
- return emitImportClause(node);
- case 249:
- return emitNamespaceImport(node);
- case 250:
- return emitNamedImports(node);
- case 251:
- return emitImportSpecifier(node);
- case 252:
- return emitExportAssignment(node);
- case 253:
- return emitExportDeclaration(node);
- case 254:
- return emitNamedExports(node);
- case 255:
- return emitExportSpecifier(node);
- case 256:
+ return emitImportTypeNode(node);
+ case 284:
+ writePunctuation("*");
return;
+ case 285:
+ writePunctuation("?");
+ return;
+ case 286:
+ return emitJSDocNullableType(node);
+ case 287:
+ return emitJSDocNonNullableType(node);
+ case 288:
+ return emitJSDocOptionalType(node);
+ case 172:
+ case 290:
+ return emitRestOrJSDocVariadicType(node);
+ case 184:
+ return emitObjectBindingPattern(node);
+ case 185:
+ return emitArrayBindingPattern(node);
+ case 186:
+ return emitBindingElement(node);
+ case 216:
+ return emitTemplateSpan(node);
+ case 217:
+ return emitSemicolonClassElement();
+ case 218:
+ return emitBlock(node);
+ case 219:
+ return emitVariableStatement(node);
+ case 220:
+ return emitEmptyStatement(false);
+ case 221:
+ return emitExpressionStatement(node);
+ case 222:
+ return emitIfStatement(node);
+ case 223:
+ return emitDoStatement(node);
+ case 224:
+ return emitWhileStatement(node);
+ case 225:
+ return emitForStatement(node);
+ case 226:
+ return emitForInStatement(node);
+ case 227:
+ return emitForOfStatement(node);
+ case 228:
+ return emitContinueStatement(node);
+ case 229:
+ return emitBreakStatement(node);
+ case 230:
+ return emitReturnStatement(node);
+ case 231:
+ return emitWithStatement(node);
+ case 232:
+ return emitSwitchStatement(node);
+ case 233:
+ return emitLabeledStatement(node);
+ case 234:
+ return emitThrowStatement(node);
+ case 235:
+ return emitTryStatement(node);
+ case 236:
+ return emitDebuggerStatement(node);
+ case 237:
+ return emitVariableDeclaration(node);
+ case 238:
+ return emitVariableDeclarationList(node);
+ case 239:
+ return emitFunctionDeclaration(node);
+ case 240:
+ return emitClassDeclaration(node);
+ case 241:
+ return emitInterfaceDeclaration(node);
+ case 242:
+ return emitTypeAliasDeclaration(node);
+ case 243:
+ return emitEnumDeclaration(node);
+ case 244:
+ return emitModuleDeclaration(node);
+ case 245:
+ return emitModuleBlock(node);
+ case 246:
+ return emitCaseBlock(node);
+ case 247:
+ return emitNamespaceExportDeclaration(node);
+ case 248:
+ return emitImportEqualsDeclaration(node);
+ case 249:
+ return emitImportDeclaration(node);
+ case 250:
+ return emitImportClause(node);
+ case 251:
+ return emitNamespaceImport(node);
+ case 252:
+ return emitNamedImports(node);
+ case 253:
+ return emitImportSpecifier(node);
+ case 254:
+ return emitExportAssignment(node);
+ case 255:
+ return emitExportDeclaration(node);
+ case 256:
+ return emitNamedExports(node);
case 257:
+ return emitExportSpecifier(node);
+ case 258:
+ return;
+ case 259:
return emitExternalModuleReference(node);
- case 10:
+ case 11:
return emitJsxText(node);
- case 260:
- case 263:
- return emitJsxOpeningElementOrFragment(node);
- case 261:
- case 264:
- return emitJsxClosingElementOrFragment(node);
+ case 262:
case 265:
- return emitJsxAttribute(node);
+ return emitJsxOpeningElementOrFragment(node);
+ case 263:
case 266:
- return emitJsxAttributes(node);
+ return emitJsxClosingElementOrFragment(node);
case 267:
- return emitJsxSpreadAttribute(node);
+ return emitJsxAttribute(node);
case 268:
- return emitJsxExpression(node);
+ return emitJsxAttributes(node);
case 269:
- return emitCaseClause(node);
+ return emitJsxSpreadAttribute(node);
case 270:
- return emitDefaultClause(node);
+ return emitJsxExpression(node);
case 271:
- return emitHeritageClause(node);
+ return emitCaseClause(node);
case 272:
- return emitCatchClause(node);
+ return emitDefaultClause(node);
case 273:
- return emitPropertyAssignment(node);
+ return emitHeritageClause(node);
case 274:
- return emitShorthandPropertyAssignment(node);
+ return emitCatchClause(node);
case 275:
- return emitSpreadAssignment(node);
+ return emitPropertyAssignment(node);
case 276:
+ return emitShorthandPropertyAssignment(node);
+ case 277:
+ return emitSpreadAssignment(node);
+ case 278:
return emitEnumMember(node);
+ case 299:
+ case 305:
+ return emitJSDocPropertyLikeTag(node);
+ case 300:
+ case 302:
+ case 301:
+ case 298:
+ return emitJSDocSimpleTypedTag(node);
+ case 295:
+ return emitJSDocAugmentsTag(node);
+ case 303:
+ return emitJSDocTemplateTag(node);
+ case 304:
+ return emitJSDocTypedefTag(node);
+ case 297:
+ return emitJSDocCallbackTag(node);
+ case 293:
+ return emitJSDocSignature(node);
+ case 292:
+ return emitJSDocTypeLiteral(node);
+ case 296:
+ case 294:
+ return emitJSDocSimpleTag(node);
+ case 291:
+ return emitJSDoc(node);
}
if (ts.isExpression(node)) {
hint = 1;
- node = trySubstituteNode(1, node);
+ if (substituteNode !== ts.noEmitSubstitution) {
+ node = substituteNode(hint, node);
+ }
}
else if (ts.isToken(node)) {
return writeTokenNode(node, writePunctuation);
@@ -66054,84 +66611,85 @@ var ts;
if (hint === 1) {
switch (node.kind) {
case 8:
- return emitNumericLiteral(node);
case 9:
- case 12:
+ return emitNumericOrBigIntLiteral(node);
+ case 10:
case 13:
+ case 14:
return emitLiteral(node);
- case 71:
+ case 72:
return emitIdentifier(node);
- case 86:
- case 95:
- case 97:
- case 101:
- case 99:
- case 91:
+ case 87:
+ case 96:
+ case 98:
+ case 102:
+ case 100:
+ case 92:
writeTokenNode(node, writeKeyword);
return;
- case 185:
- return emitArrayLiteralExpression(node);
- case 186:
- return emitObjectLiteralExpression(node);
case 187:
- return emitPropertyAccessExpression(node);
+ return emitArrayLiteralExpression(node);
case 188:
- return emitElementAccessExpression(node);
+ return emitObjectLiteralExpression(node);
case 189:
- return emitCallExpression(node);
+ return emitPropertyAccessExpression(node);
case 190:
- return emitNewExpression(node);
+ return emitElementAccessExpression(node);
case 191:
- return emitTaggedTemplateExpression(node);
+ return emitCallExpression(node);
case 192:
- return emitTypeAssertionExpression(node);
+ return emitNewExpression(node);
case 193:
- return emitParenthesizedExpression(node);
+ return emitTaggedTemplateExpression(node);
case 194:
- return emitFunctionExpression(node);
+ return emitTypeAssertionExpression(node);
case 195:
- return emitArrowFunction(node);
+ return emitParenthesizedExpression(node);
case 196:
- return emitDeleteExpression(node);
+ return emitFunctionExpression(node);
case 197:
- return emitTypeOfExpression(node);
+ return emitArrowFunction(node);
case 198:
- return emitVoidExpression(node);
+ return emitDeleteExpression(node);
case 199:
- return emitAwaitExpression(node);
+ return emitTypeOfExpression(node);
case 200:
- return emitPrefixUnaryExpression(node);
+ return emitVoidExpression(node);
case 201:
- return emitPostfixUnaryExpression(node);
+ return emitAwaitExpression(node);
case 202:
- return emitBinaryExpression(node);
+ return emitPrefixUnaryExpression(node);
case 203:
- return emitConditionalExpression(node);
+ return emitPostfixUnaryExpression(node);
case 204:
- return emitTemplateExpression(node);
+ return emitBinaryExpression(node);
case 205:
- return emitYieldExpression(node);
+ return emitConditionalExpression(node);
case 206:
- return emitSpreadExpression(node);
+ return emitTemplateExpression(node);
case 207:
- return emitClassExpression(node);
+ return emitYieldExpression(node);
case 208:
- return;
+ return emitSpreadExpression(node);
+ case 209:
+ return emitClassExpression(node);
case 210:
- return emitAsExpression(node);
- case 211:
- return emitNonNullExpression(node);
+ return;
case 212:
+ return emitAsExpression(node);
+ case 213:
+ return emitNonNullExpression(node);
+ case 214:
return emitMetaProperty(node);
- case 258:
+ case 260:
return emitJsxElement(node);
- case 259:
+ case 261:
return emitJsxSelfClosingElement(node);
- case 262:
+ case 264:
return emitJsxFragment(node);
- case 306:
+ case 308:
return emitPartiallyEmittedExpression(node);
- case 307:
+ case 309:
return emitCommaList(node);
}
}
@@ -66143,12 +66701,13 @@ var ts;
writeSpace();
emit(node.constraint);
}
- function trySubstituteNode(hint, node) {
- return node && substituteNode && substituteNode(hint, node) || node;
+ function pipelineEmitWithSubstitution(hint, node) {
+ var pipelinePhase = getNextPipelinePhase(1, node);
+ pipelinePhase(hint, substituteNode(hint, node));
}
function emitHelpers(node) {
var helpersEmitted = false;
- var bundle = node.kind === 278 ? node : undefined;
+ var bundle = node.kind === 280 ? node : undefined;
if (bundle && moduleKind === ts.ModuleKind.None) {
return;
}
@@ -66187,13 +66746,13 @@ var ts;
}
return helpersEmitted;
}
- function emitNumericLiteral(node) {
+ function emitNumericOrBigIntLiteral(node) {
emitLiteral(node);
}
function emitLiteral(node) {
var text = getLiteralTextOfNode(node, printerOptions.neverAsciiEscape);
if ((printerOptions.sourceMap || printerOptions.inlineSourceMap)
- && (node.kind === 9 || ts.isTemplateLiteralKind(node.kind))) {
+ && (node.kind === 10 || ts.isTemplateLiteralKind(node.kind))) {
writeLiteral(text);
}
else {
@@ -66206,7 +66765,7 @@ var ts;
function emitIdentifier(node) {
var writeText = node.symbol ? writeSymbol : write;
writeText(getTextOfNode(node, false), node.symbol);
- emitList(node, node.typeArguments, 26896);
+ emitList(node, node.typeArguments, 53776);
}
function emitQualifiedName(node) {
emitEntityName(node.left);
@@ -66214,7 +66773,7 @@ var ts;
emit(node.right);
}
function emitEntityName(node) {
- if (node.kind === 71) {
+ if (node.kind === 72) {
emitExpression(node);
}
else {
@@ -66247,7 +66806,7 @@ var ts;
emit(node.dotDotDotToken);
emitNodeWithWriter(node.name, writeParameter);
emit(node.questionToken);
- if (node.parent && node.parent.kind === 287 && !node.name) {
+ if (node.parent && node.parent.kind === 289 && !node.name) {
emit(node.type);
}
else {
@@ -66265,7 +66824,7 @@ var ts;
emitNodeWithWriter(node.name, writeProperty);
emit(node.questionToken);
emitTypeAnnotation(node.type);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitPropertyDeclaration(node) {
emitDecorators(node, node.decorators);
@@ -66275,7 +66834,7 @@ var ts;
emit(node.exclamationToken);
emitTypeAnnotation(node.type);
emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitMethodSignature(node) {
pushNameGenerationScope(node);
@@ -66286,7 +66845,7 @@ var ts;
emitTypeParameters(node, node.typeParameters);
emitParameters(node, node.parameters);
emitTypeAnnotation(node.type);
- writeSemicolon();
+ writeTrailingSemicolon();
popNameGenerationScope(node);
}
function emitMethodDeclaration(node) {
@@ -66305,7 +66864,7 @@ var ts;
function emitAccessorDeclaration(node) {
emitDecorators(node, node.decorators);
emitModifiers(node, node.modifiers);
- writeKeyword(node.kind === 156 ? "get" : "set");
+ writeKeyword(node.kind === 158 ? "get" : "set");
writeSpace();
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
@@ -66317,7 +66876,7 @@ var ts;
emitTypeParameters(node, node.typeParameters);
emitParameters(node, node.parameters);
emitTypeAnnotation(node.type);
- writeSemicolon();
+ writeTrailingSemicolon();
popNameGenerationScope(node);
}
function emitConstructSignature(node) {
@@ -66329,7 +66888,7 @@ var ts;
emitTypeParameters(node, node.typeParameters);
emitParameters(node, node.parameters);
emitTypeAnnotation(node.type);
- writeSemicolon();
+ writeTrailingSemicolon();
popNameGenerationScope(node);
}
function emitIndexSignature(node) {
@@ -66337,10 +66896,10 @@ var ts;
emitModifiers(node, node.modifiers);
emitParametersForIndexSignature(node, node.parameters);
emitTypeAnnotation(node.type);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitSemicolonClassElement() {
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitTypePredicate(node) {
emit(node.parameterName);
@@ -66364,22 +66923,22 @@ var ts;
popNameGenerationScope(node);
}
function emitJSDocFunctionType(node) {
- write("function");
+ writeKeyword("function");
emitParameters(node, node.parameters);
- write(":");
+ writePunctuation(":");
emit(node.type);
}
function emitJSDocNullableType(node) {
- write("?");
+ writePunctuation("?");
emit(node.type);
}
function emitJSDocNonNullableType(node) {
- write("!");
+ writePunctuation("!");
emit(node.type);
}
function emitJSDocOptionalType(node) {
emit(node.type);
- write("=");
+ writePunctuation("=");
}
function emitConstructorType(node) {
pushNameGenerationScope(node);
@@ -66400,8 +66959,8 @@ var ts;
}
function emitTypeLiteral(node) {
writePunctuation("{");
- var flags = ts.getEmitFlags(node) & 1 ? 384 : 16449;
- emitList(node, node.members, flags | 262144);
+ var flags = ts.getEmitFlags(node) & 1 ? 768 : 32897;
+ emitList(node, node.members, flags | 524288);
writePunctuation("}");
}
function emitArrayType(node) {
@@ -66410,23 +66969,23 @@ var ts;
writePunctuation("]");
}
function emitRestOrJSDocVariadicType(node) {
- write("...");
+ writePunctuation("...");
emit(node.type);
}
function emitTupleType(node) {
writePunctuation("[");
- emitList(node, node.elementTypes, 272);
+ emitList(node, node.elementTypes, 528);
writePunctuation("]");
}
function emitOptionalType(node) {
emit(node.type);
- write("?");
+ writePunctuation("?");
}
function emitUnionType(node) {
- emitList(node, node.types, 260);
+ emitList(node, node.types, 516);
}
function emitIntersectionType(node) {
- emitList(node, node.types, 264);
+ emitList(node, node.types, 520);
}
function emitConditionalType(node) {
emit(node.checkType);
@@ -66479,25 +67038,25 @@ var ts;
}
if (node.readonlyToken) {
emit(node.readonlyToken);
- if (node.readonlyToken.kind !== 132) {
+ if (node.readonlyToken.kind !== 133) {
writeKeyword("readonly");
}
writeSpace();
}
writePunctuation("[");
- var pipelinePhase = getPipelinePhase(0, 3);
+ var pipelinePhase = getPipelinePhase(0, node.typeParameter);
pipelinePhase(3, node.typeParameter);
writePunctuation("]");
if (node.questionToken) {
emit(node.questionToken);
- if (node.questionToken.kind !== 55) {
+ if (node.questionToken.kind !== 56) {
writePunctuation("?");
}
}
writePunctuation(":");
writeSpace();
emit(node.type);
- writeSemicolon();
+ writeTrailingSemicolon();
if (emitFlags & 1) {
writeSpace();
}
@@ -66527,12 +67086,12 @@ var ts;
}
function emitObjectBindingPattern(node) {
writePunctuation("{");
- emitList(node, node.elements, 262576);
+ emitList(node, node.elements, 525136);
writePunctuation("}");
}
function emitArrayBindingPattern(node) {
writePunctuation("[");
- emitList(node, node.elements, 262448);
+ emitList(node, node.elements, 524880);
writePunctuation("]");
}
function emitBindingElement(node) {
@@ -66547,8 +67106,8 @@ var ts;
}
function emitArrayLiteralExpression(node) {
var elements = node.elements;
- var preferNewLine = node.multiLine ? 32768 : 0;
- emitExpressionList(node, elements, 4466 | preferNewLine);
+ var preferNewLine = node.multiLine ? 65536 : 0;
+ emitExpressionList(node, elements, 8914 | preferNewLine);
}
function emitObjectLiteralExpression(node) {
ts.forEach(node.properties, generateMemberNames);
@@ -66556,9 +67115,9 @@ var ts;
if (indentedFlag) {
increaseIndent();
}
- var preferNewLine = node.multiLine ? 32768 : 0;
- var allowTrailingComma = currentSourceFile.languageVersion >= 1 && !ts.isJsonSourceFile(currentSourceFile) ? 32 : 0;
- emitList(node, node.properties, 263122 | allowTrailingComma | preferNewLine);
+ var preferNewLine = node.multiLine ? 65536 : 0;
+ var allowTrailingComma = currentSourceFile.languageVersion >= 1 && !ts.isJsonSourceFile(currentSourceFile) ? 64 : 0;
+ emitList(node, node.properties, 526226 | allowTrailingComma | preferNewLine);
if (indentedFlag) {
decreaseIndent();
}
@@ -66569,20 +67128,20 @@ var ts;
if (!(ts.getEmitFlags(node) & 131072)) {
var dotRangeStart = node.expression.end;
var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1;
- var dotToken = ts.createToken(23);
+ var dotToken = ts.createToken(24);
dotToken.pos = dotRangeStart;
dotToken.end = dotRangeEnd;
indentBeforeDot = needsIndentation(node, node.expression, dotToken);
indentAfterDot = needsIndentation(node, dotToken, node.name);
}
emitExpression(node.expression);
- increaseIndentIf(indentBeforeDot);
+ increaseIndentIf(indentBeforeDot, false);
var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression);
if (shouldEmitDotDot) {
writePunctuation(".");
}
- emitTokenWithComment(23, node.expression.end, writePunctuation, node);
- increaseIndentIf(indentAfterDot);
+ emitTokenWithComment(24, node.expression.end, writePunctuation, node);
+ increaseIndentIf(indentAfterDot, false);
emit(node.name);
decreaseIndentIf(indentBeforeDot, indentAfterDot);
}
@@ -66591,7 +67150,7 @@ var ts;
if (ts.isNumericLiteral(expression)) {
var text = getLiteralTextOfNode(expression, true);
return !expression.numericLiteralFlags
- && !ts.stringContains(text, ts.tokenToString(23));
+ && !ts.stringContains(text, ts.tokenToString(24));
}
else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) {
var constantValue = ts.getConstantValue(expression);
@@ -66602,21 +67161,21 @@ var ts;
}
function emitElementAccessExpression(node) {
emitExpression(node.expression);
- emitTokenWithComment(21, node.expression.end, writePunctuation, node);
+ emitTokenWithComment(22, node.expression.end, writePunctuation, node);
emitExpression(node.argumentExpression);
- emitTokenWithComment(22, node.argumentExpression.end, writePunctuation, node);
+ emitTokenWithComment(23, node.argumentExpression.end, writePunctuation, node);
}
function emitCallExpression(node) {
emitExpression(node.expression);
emitTypeArguments(node, node.typeArguments);
- emitExpressionList(node, node.arguments, 1296);
+ emitExpressionList(node, node.arguments, 2576);
}
function emitNewExpression(node) {
- emitTokenWithComment(94, node.pos, writeKeyword, node);
+ emitTokenWithComment(95, node.pos, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitTypeArguments(node, node.typeArguments);
- emitExpressionList(node, node.arguments, 9488);
+ emitExpressionList(node, node.arguments, 18960);
}
function emitTaggedTemplateExpression(node) {
emitExpression(node.tag);
@@ -66631,9 +67190,9 @@ var ts;
emitExpression(node.expression);
}
function emitParenthesizedExpression(node) {
- var openParenPos = emitTokenWithComment(19, node.pos, writePunctuation, node);
+ var openParenPos = emitTokenWithComment(20, node.pos, writePunctuation, node);
emitExpression(node.expression);
- emitTokenWithComment(20, node.expression ? node.expression.end : openParenPos, writePunctuation, node);
+ emitTokenWithComment(21, node.expression ? node.expression.end : openParenPos, writePunctuation, node);
}
function emitFunctionExpression(node) {
generateNameIfNeeded(node.name);
@@ -66652,22 +67211,22 @@ var ts;
emit(node.equalsGreaterThanToken);
}
function emitDeleteExpression(node) {
- emitTokenWithComment(80, node.pos, writeKeyword, node);
+ emitTokenWithComment(81, node.pos, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
}
function emitTypeOfExpression(node) {
- emitTokenWithComment(103, node.pos, writeKeyword, node);
+ emitTokenWithComment(104, node.pos, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
}
function emitVoidExpression(node) {
- emitTokenWithComment(105, node.pos, writeKeyword, node);
+ emitTokenWithComment(106, node.pos, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
}
function emitAwaitExpression(node) {
- emitTokenWithComment(121, node.pos, writeKeyword, node);
+ emitTokenWithComment(122, node.pos, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
}
@@ -66680,24 +67239,24 @@ var ts;
}
function shouldEmitWhitespaceBeforeOperand(node) {
var operand = node.operand;
- return operand.kind === 200
- && ((node.operator === 37 && (operand.operator === 37 || operand.operator === 43))
- || (node.operator === 38 && (operand.operator === 38 || operand.operator === 44)));
+ return operand.kind === 202
+ && ((node.operator === 38 && (operand.operator === 38 || operand.operator === 44))
+ || (node.operator === 39 && (operand.operator === 39 || operand.operator === 45)));
}
function emitPostfixUnaryExpression(node) {
emitExpression(node.operand);
writeTokenText(node.operator, writeOperator);
}
function emitBinaryExpression(node) {
- var isCommaOperator = node.operatorToken.kind !== 26;
+ var isCommaOperator = node.operatorToken.kind !== 27;
var indentBeforeOperator = needsIndentation(node, node.left, node.operatorToken);
var indentAfterOperator = needsIndentation(node, node.operatorToken, node.right);
emitExpression(node.left);
- increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined);
+ increaseIndentIf(indentBeforeOperator, isCommaOperator);
emitLeadingCommentsOfPosition(node.operatorToken.pos);
- writeTokenNode(node.operatorToken, writeOperator);
+ writeTokenNode(node.operatorToken, node.operatorToken.kind === 93 ? writeKeyword : writeOperator);
emitTrailingCommentsOfPosition(node.operatorToken.end, true);
- increaseIndentIf(indentAfterOperator, " ");
+ increaseIndentIf(indentAfterOperator, true);
emitExpression(node.right);
decreaseIndentIf(indentBeforeOperator, indentAfterOperator);
}
@@ -66707,23 +67266,23 @@ var ts;
var indentBeforeColon = needsIndentation(node, node.whenTrue, node.colonToken);
var indentAfterColon = needsIndentation(node, node.colonToken, node.whenFalse);
emitExpression(node.condition);
- increaseIndentIf(indentBeforeQuestion, " ");
+ increaseIndentIf(indentBeforeQuestion, true);
emit(node.questionToken);
- increaseIndentIf(indentAfterQuestion, " ");
+ increaseIndentIf(indentAfterQuestion, true);
emitExpression(node.whenTrue);
decreaseIndentIf(indentBeforeQuestion, indentAfterQuestion);
- increaseIndentIf(indentBeforeColon, " ");
+ increaseIndentIf(indentBeforeColon, true);
emit(node.colonToken);
- increaseIndentIf(indentAfterColon, " ");
+ increaseIndentIf(indentAfterColon, true);
emitExpression(node.whenFalse);
decreaseIndentIf(indentBeforeColon, indentAfterColon);
}
function emitTemplateExpression(node) {
emit(node.head);
- emitList(node, node.templateSpans, 131072);
+ emitList(node, node.templateSpans, 262144);
}
function emitYieldExpression(node) {
- emitTokenWithComment(116, node.pos, writeKeyword, node);
+ emitTokenWithComment(117, node.pos, writeKeyword, node);
emit(node.asteriskToken);
emitExpressionWithLeadingSpace(node.expression);
}
@@ -66765,36 +67324,41 @@ var ts;
emitBlockStatements(node, !node.multiLine && isEmptyBlock(node));
}
function emitBlockStatements(node, forceSingleLine) {
- emitTokenWithComment(17, node.pos, writePunctuation, node);
- var format = forceSingleLine || ts.getEmitFlags(node) & 1 ? 384 : 65;
+ emitTokenWithComment(18, node.pos, writePunctuation, node);
+ var format = forceSingleLine || ts.getEmitFlags(node) & 1 ? 768 : 129;
emitList(node, node.statements, format);
- emitTokenWithComment(18, node.statements.end, writePunctuation, node, !!(format & 1));
+ emitTokenWithComment(19, node.statements.end, writePunctuation, node, !!(format & 1));
}
function emitVariableStatement(node) {
emitModifiers(node, node.modifiers);
emit(node.declarationList);
- writeSemicolon();
+ writeTrailingSemicolon();
}
- function emitEmptyStatement() {
- writeSemicolon();
+ function emitEmptyStatement(isEmbeddedStatement) {
+ if (isEmbeddedStatement) {
+ writePunctuation(";");
+ }
+ else {
+ writeTrailingSemicolon();
+ }
}
function emitExpressionStatement(node) {
emitExpression(node.expression);
if (!ts.isJsonSourceFile(currentSourceFile) || ts.nodeIsSynthesized(node.expression)) {
- writeSemicolon();
+ writeTrailingSemicolon();
}
}
function emitIfStatement(node) {
- var openParenPos = emitTokenWithComment(90, node.pos, writeKeyword, node);
+ var openParenPos = emitTokenWithComment(91, node.pos, writeKeyword, node);
writeSpace();
- emitTokenWithComment(19, openParenPos, writePunctuation, node);
+ emitTokenWithComment(20, openParenPos, writePunctuation, node);
emitExpression(node.expression);
- emitTokenWithComment(20, node.expression.end, writePunctuation, node);
+ emitTokenWithComment(21, node.expression.end, writePunctuation, node);
emitEmbeddedStatement(node, node.thenStatement);
if (node.elseStatement) {
writeLineOrSpace(node);
- emitTokenWithComment(82, node.thenStatement.end, writeKeyword, node);
- if (node.elseStatement.kind === 220) {
+ emitTokenWithComment(83, node.thenStatement.end, writeKeyword, node);
+ if (node.elseStatement.kind === 222) {
writeSpace();
emit(node.elseStatement);
}
@@ -66804,14 +67368,14 @@ var ts;
}
}
function emitWhileClause(node, startPos) {
- var openParenPos = emitTokenWithComment(106, startPos, writeKeyword, node);
+ var openParenPos = emitTokenWithComment(107, startPos, writeKeyword, node);
writeSpace();
- emitTokenWithComment(19, openParenPos, writePunctuation, node);
+ emitTokenWithComment(20, openParenPos, writePunctuation, node);
emitExpression(node.expression);
- emitTokenWithComment(20, node.expression.end, writePunctuation, node);
+ emitTokenWithComment(21, node.expression.end, writePunctuation, node);
}
function emitDoStatement(node) {
- emitTokenWithComment(81, node.pos, writeKeyword, node);
+ emitTokenWithComment(82, node.pos, writeKeyword, node);
emitEmbeddedStatement(node, node.statement);
if (ts.isBlock(node.statement)) {
writeSpace();
@@ -66827,45 +67391,45 @@ var ts;
emitEmbeddedStatement(node, node.statement);
}
function emitForStatement(node) {
- var openParenPos = emitTokenWithComment(88, node.pos, writeKeyword, node);
+ var openParenPos = emitTokenWithComment(89, node.pos, writeKeyword, node);
writeSpace();
- var pos = emitTokenWithComment(19, openParenPos, writePunctuation, node);
+ var pos = emitTokenWithComment(20, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
- pos = emitTokenWithComment(25, node.initializer ? node.initializer.end : pos, writeSemicolon, node);
+ pos = emitTokenWithComment(26, node.initializer ? node.initializer.end : pos, writePunctuation, node);
emitExpressionWithLeadingSpace(node.condition);
- pos = emitTokenWithComment(25, node.condition ? node.condition.end : pos, writeSemicolon, node);
+ pos = emitTokenWithComment(26, node.condition ? node.condition.end : pos, writePunctuation, node);
emitExpressionWithLeadingSpace(node.incrementor);
- emitTokenWithComment(20, node.incrementor ? node.incrementor.end : pos, writePunctuation, node);
+ emitTokenWithComment(21, node.incrementor ? node.incrementor.end : pos, writePunctuation, node);
emitEmbeddedStatement(node, node.statement);
}
function emitForInStatement(node) {
- var openParenPos = emitTokenWithComment(88, node.pos, writeKeyword, node);
+ var openParenPos = emitTokenWithComment(89, node.pos, writeKeyword, node);
writeSpace();
- emitTokenWithComment(19, openParenPos, writePunctuation, node);
+ emitTokenWithComment(20, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(92, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(93, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
- emitTokenWithComment(20, node.expression.end, writePunctuation, node);
+ emitTokenWithComment(21, node.expression.end, writePunctuation, node);
emitEmbeddedStatement(node, node.statement);
}
function emitForOfStatement(node) {
- var openParenPos = emitTokenWithComment(88, node.pos, writeKeyword, node);
+ var openParenPos = emitTokenWithComment(89, node.pos, writeKeyword, node);
writeSpace();
emitWithTrailingSpace(node.awaitModifier);
- emitTokenWithComment(19, openParenPos, writePunctuation, node);
+ emitTokenWithComment(20, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(145, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(147, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
- emitTokenWithComment(20, node.expression.end, writePunctuation, node);
+ emitTokenWithComment(21, node.expression.end, writePunctuation, node);
emitEmbeddedStatement(node, node.statement);
}
function emitForBinding(node) {
if (node !== undefined) {
- if (node.kind === 236) {
+ if (node.kind === 238) {
emit(node);
}
else {
@@ -66874,14 +67438,14 @@ var ts;
}
}
function emitContinueStatement(node) {
- emitTokenWithComment(77, node.pos, writeKeyword, node);
+ emitTokenWithComment(78, node.pos, writeKeyword, node);
emitWithLeadingSpace(node.label);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitBreakStatement(node) {
- emitTokenWithComment(72, node.pos, writeKeyword, node);
+ emitTokenWithComment(73, node.pos, writeKeyword, node);
emitWithLeadingSpace(node.label);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitTokenWithComment(token, pos, writer, contextNode, indentLeading) {
var node = ts.getParseTreeNode(contextNode);
@@ -66907,40 +67471,40 @@ var ts;
return pos;
}
function emitReturnStatement(node) {
- emitTokenWithComment(96, node.pos, writeKeyword, node);
+ emitTokenWithComment(97, node.pos, writeKeyword, node);
emitExpressionWithLeadingSpace(node.expression);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitWithStatement(node) {
- var openParenPos = emitTokenWithComment(107, node.pos, writeKeyword, node);
+ var openParenPos = emitTokenWithComment(108, node.pos, writeKeyword, node);
writeSpace();
- emitTokenWithComment(19, openParenPos, writePunctuation, node);
+ emitTokenWithComment(20, openParenPos, writePunctuation, node);
emitExpression(node.expression);
- emitTokenWithComment(20, node.expression.end, writePunctuation, node);
+ emitTokenWithComment(21, node.expression.end, writePunctuation, node);
emitEmbeddedStatement(node, node.statement);
}
function emitSwitchStatement(node) {
- var openParenPos = emitTokenWithComment(98, node.pos, writeKeyword, node);
+ var openParenPos = emitTokenWithComment(99, node.pos, writeKeyword, node);
writeSpace();
- emitTokenWithComment(19, openParenPos, writePunctuation, node);
+ emitTokenWithComment(20, openParenPos, writePunctuation, node);
emitExpression(node.expression);
- emitTokenWithComment(20, node.expression.end, writePunctuation, node);
+ emitTokenWithComment(21, node.expression.end, writePunctuation, node);
writeSpace();
emit(node.caseBlock);
}
function emitLabeledStatement(node) {
emit(node.label);
- emitTokenWithComment(56, node.label.end, writePunctuation, node);
+ emitTokenWithComment(57, node.label.end, writePunctuation, node);
writeSpace();
emit(node.statement);
}
function emitThrowStatement(node) {
- emitTokenWithComment(100, node.pos, writeKeyword, node);
+ emitTokenWithComment(101, node.pos, writeKeyword, node);
emitExpressionWithLeadingSpace(node.expression);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitTryStatement(node) {
- emitTokenWithComment(102, node.pos, writeKeyword, node);
+ emitTokenWithComment(103, node.pos, writeKeyword, node);
writeSpace();
emit(node.tryBlock);
if (node.catchClause) {
@@ -66949,14 +67513,14 @@ var ts;
}
if (node.finallyBlock) {
writeLineOrSpace(node);
- emitTokenWithComment(87, (node.catchClause || node.tryBlock).end, writeKeyword, node);
+ emitTokenWithComment(88, (node.catchClause || node.tryBlock).end, writeKeyword, node);
writeSpace();
emit(node.finallyBlock);
}
}
function emitDebuggerStatement(node) {
- writeToken(78, node.pos, writeKeyword);
- writeSemicolon();
+ writeToken(79, node.pos, writeKeyword);
+ writeTrailingSemicolon();
}
function emitVariableDeclaration(node) {
emit(node.name);
@@ -66966,7 +67530,7 @@ var ts;
function emitVariableDeclarationList(node) {
writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
writeSpace();
- emitList(node, node.declarations, 272);
+ emitList(node, node.declarations, 528);
}
function emitFunctionDeclaration(node) {
emitFunctionDeclarationOrExpression(node);
@@ -67014,7 +67578,7 @@ var ts;
}
else {
emitSignatureHead(node);
- writeSemicolon();
+ writeTrailingSemicolon();
}
}
function emitSignatureHead(node) {
@@ -67060,7 +67624,7 @@ var ts;
emitBlockFunctionBody(body);
}
decreaseIndent();
- writeToken(18, body.statements.end, writePunctuation, body);
+ writeToken(19, body.statements.end, writePunctuation, body);
}
function emitBlockFunctionBodyOnSingleLine(body) {
emitBlockFunctionBodyWorker(body, true);
@@ -67071,7 +67635,7 @@ var ts;
emitHelpers(body);
if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine) {
decreaseIndent();
- emitList(body, body.statements, 384);
+ emitList(body, body.statements, 768);
increaseIndent();
}
else {
@@ -67098,7 +67662,7 @@ var ts;
emitList(node, node.heritageClauses, 0);
writeSpace();
writePunctuation("{");
- emitList(node, node.members, 65);
+ emitList(node, node.members, 129);
writePunctuation("}");
if (indentedFlag) {
decreaseIndent();
@@ -67111,10 +67675,10 @@ var ts;
writeSpace();
emit(node.name);
emitTypeParameters(node, node.typeParameters);
- emitList(node, node.heritageClauses, 256);
+ emitList(node, node.heritageClauses, 512);
writeSpace();
writePunctuation("{");
- emitList(node, node.members, 65);
+ emitList(node, node.members, 129);
writePunctuation("}");
}
function emitTypeAliasDeclaration(node) {
@@ -67128,7 +67692,7 @@ var ts;
writePunctuation("=");
writeSpace();
emit(node.type);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitEnumDeclaration(node) {
emitModifiers(node, node.modifiers);
@@ -67137,7 +67701,7 @@ var ts;
emit(node.name);
writeSpace();
writePunctuation("{");
- emitList(node, node.members, 81);
+ emitList(node, node.members, 145);
writePunctuation("}");
}
function emitModuleDeclaration(node) {
@@ -67149,8 +67713,8 @@ var ts;
emit(node.name);
var body = node.body;
if (!body)
- return writeSemicolon();
- while (body.kind === 242) {
+ return writeTrailingSemicolon();
+ while (body.kind === 244) {
writePunctuation(".");
emit(body.name);
body = body.body;
@@ -67165,23 +67729,23 @@ var ts;
popNameGenerationScope(node);
}
function emitCaseBlock(node) {
- emitTokenWithComment(17, node.pos, writePunctuation, node);
- emitList(node, node.clauses, 65);
- emitTokenWithComment(18, node.clauses.end, writePunctuation, node, true);
+ emitTokenWithComment(18, node.pos, writePunctuation, node);
+ emitList(node, node.clauses, 129);
+ emitTokenWithComment(19, node.clauses.end, writePunctuation, node, true);
}
function emitImportEqualsDeclaration(node) {
emitModifiers(node, node.modifiers);
- emitTokenWithComment(91, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);
+ emitTokenWithComment(92, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);
writeSpace();
emit(node.name);
writeSpace();
- emitTokenWithComment(58, node.name.end, writePunctuation, node);
+ emitTokenWithComment(59, node.name.end, writePunctuation, node);
writeSpace();
emitModuleReference(node.moduleReference);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitModuleReference(node) {
- if (node.kind === 71) {
+ if (node.kind === 72) {
emitExpression(node);
}
else {
@@ -67190,29 +67754,29 @@ var ts;
}
function emitImportDeclaration(node) {
emitModifiers(node, node.modifiers);
- emitTokenWithComment(91, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);
+ emitTokenWithComment(92, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);
writeSpace();
if (node.importClause) {
emit(node.importClause);
writeSpace();
- emitTokenWithComment(143, node.importClause.end, writeKeyword, node);
+ emitTokenWithComment(144, node.importClause.end, writeKeyword, node);
writeSpace();
}
emitExpression(node.moduleSpecifier);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitImportClause(node) {
emit(node.name);
if (node.name && node.namedBindings) {
- emitTokenWithComment(26, node.name.end, writePunctuation, node);
+ emitTokenWithComment(27, node.name.end, writePunctuation, node);
writeSpace();
}
emit(node.namedBindings);
}
function emitNamespaceImport(node) {
- var asPos = emitTokenWithComment(39, node.pos, writePunctuation, node);
+ var asPos = emitTokenWithComment(40, node.pos, writePunctuation, node);
writeSpace();
- emitTokenWithComment(118, asPos, writeKeyword, node);
+ emitTokenWithComment(119, asPos, writeKeyword, node);
writeSpace();
emit(node.name);
}
@@ -67223,45 +67787,45 @@ var ts;
emitImportOrExportSpecifier(node);
}
function emitExportAssignment(node) {
- var nextPos = emitTokenWithComment(84, node.pos, writeKeyword, node);
+ var nextPos = emitTokenWithComment(85, node.pos, writeKeyword, node);
writeSpace();
if (node.isExportEquals) {
- emitTokenWithComment(58, nextPos, writeOperator, node);
+ emitTokenWithComment(59, nextPos, writeOperator, node);
}
else {
- emitTokenWithComment(79, nextPos, writeKeyword, node);
+ emitTokenWithComment(80, nextPos, writeKeyword, node);
}
writeSpace();
emitExpression(node.expression);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitExportDeclaration(node) {
- var nextPos = emitTokenWithComment(84, node.pos, writeKeyword, node);
+ var nextPos = emitTokenWithComment(85, node.pos, writeKeyword, node);
writeSpace();
if (node.exportClause) {
emit(node.exportClause);
}
else {
- nextPos = emitTokenWithComment(39, nextPos, writePunctuation, node);
+ nextPos = emitTokenWithComment(40, nextPos, writePunctuation, node);
}
if (node.moduleSpecifier) {
writeSpace();
var fromPos = node.exportClause ? node.exportClause.end : nextPos;
- emitTokenWithComment(143, fromPos, writeKeyword, node);
+ emitTokenWithComment(144, fromPos, writeKeyword, node);
writeSpace();
emitExpression(node.moduleSpecifier);
}
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitNamespaceExportDeclaration(node) {
- var nextPos = emitTokenWithComment(84, node.pos, writeKeyword, node);
+ var nextPos = emitTokenWithComment(85, node.pos, writeKeyword, node);
writeSpace();
- nextPos = emitTokenWithComment(118, nextPos, writeKeyword, node);
+ nextPos = emitTokenWithComment(119, nextPos, writeKeyword, node);
writeSpace();
- nextPos = emitTokenWithComment(130, nextPos, writeKeyword, node);
+ nextPos = emitTokenWithComment(131, nextPos, writeKeyword, node);
writeSpace();
emit(node.name);
- writeSemicolon();
+ writeTrailingSemicolon();
}
function emitNamedExports(node) {
emitNamedImportsOrExports(node);
@@ -67271,14 +67835,14 @@ var ts;
}
function emitNamedImportsOrExports(node) {
writePunctuation("{");
- emitList(node, node.elements, 262576);
+ emitList(node, node.elements, 525136);
writePunctuation("}");
}
function emitImportOrExportSpecifier(node) {
if (node.propertyName) {
emit(node.propertyName);
writeSpace();
- emitTokenWithComment(118, node.propertyName.end, writeKeyword, node);
+ emitTokenWithComment(119, node.propertyName.end, writeKeyword, node);
writeSpace();
}
emit(node.name);
@@ -67291,7 +67855,7 @@ var ts;
}
function emitJsxElement(node) {
emit(node.openingElement);
- emitList(node, node.children, 131072);
+ emitList(node, node.children, 262144);
emit(node.closingElement);
}
function emitJsxSelfClosingElement(node) {
@@ -67303,7 +67867,7 @@ var ts;
}
function emitJsxFragment(node) {
emit(node.openingFragment);
- emitList(node, node.children, 131072);
+ emitList(node, node.children, 262144);
emit(node.closingFragment);
}
function emitJsxOpeningElementOrFragment(node) {
@@ -67318,7 +67882,6 @@ var ts;
writePunctuation(">");
}
function emitJsxText(node) {
- commitPendingSemicolon();
writer.writeLiteral(getTextOfNode(node, true));
}
function emitJsxClosingElementOrFragment(node) {
@@ -67329,7 +67892,7 @@ var ts;
writePunctuation(">");
}
function emitJsxAttributes(node) {
- emitList(node, node.properties, 131328);
+ emitList(node, node.properties, 262656);
}
function emitJsxAttribute(node) {
emit(node.name);
@@ -67349,7 +67912,7 @@ var ts;
}
}
function emitJsxTagName(node) {
- if (node.kind === 71) {
+ if (node.kind === 72) {
emitExpression(node);
}
else {
@@ -67357,13 +67920,13 @@ var ts;
}
}
function emitCaseClause(node) {
- emitTokenWithComment(73, node.pos, writeKeyword, node);
+ emitTokenWithComment(74, node.pos, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end);
}
function emitDefaultClause(node) {
- var pos = emitTokenWithComment(79, node.pos, writeKeyword, node);
+ var pos = emitTokenWithComment(80, node.pos, writeKeyword, node);
emitCaseOrDefaultClauseRest(node, node.statements, pos);
}
function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) {
@@ -67371,14 +67934,14 @@ var ts;
(ts.nodeIsSynthesized(parentNode) ||
ts.nodeIsSynthesized(statements[0]) ||
ts.rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile));
- var format = 81985;
+ var format = 163969;
if (emitAsSingleStatement) {
- writeToken(56, colonPos, writePunctuation, parentNode);
+ writeToken(57, colonPos, writePunctuation, parentNode);
writeSpace();
- format &= ~(1 | 64);
+ format &= ~(1 | 128);
}
else {
- emitTokenWithComment(56, colonPos, writePunctuation, parentNode);
+ emitTokenWithComment(57, colonPos, writePunctuation, parentNode);
}
emitList(parentNode, statements, format);
}
@@ -67386,15 +67949,15 @@ var ts;
writeSpace();
writeTokenText(node.token, writeKeyword);
writeSpace();
- emitList(node, node.types, 272);
+ emitList(node, node.types, 528);
}
function emitCatchClause(node) {
- var openParenPos = emitTokenWithComment(74, node.pos, writeKeyword, node);
+ var openParenPos = emitTokenWithComment(75, node.pos, writeKeyword, node);
writeSpace();
if (node.variableDeclaration) {
- emitTokenWithComment(19, openParenPos, writePunctuation, node);
+ emitTokenWithComment(20, openParenPos, writePunctuation, node);
emit(node.variableDeclaration);
- emitTokenWithComment(20, node.variableDeclaration.end, writePunctuation, node);
+ emitTokenWithComment(21, node.variableDeclaration.end, writePunctuation, node);
writeSpace();
}
emit(node.block);
@@ -67429,6 +67992,139 @@ var ts;
emit(node.name);
emitInitializer(node.initializer, node.name.end, node);
}
+ function emitJSDoc(node) {
+ write("/**");
+ if (node.comment) {
+ var lines = node.comment.split(/\r\n?|\n/g);
+ for (var _a = 0, lines_2 = lines; _a < lines_2.length; _a++) {
+ var line = lines_2[_a];
+ writeLine();
+ writeSpace();
+ writePunctuation("*");
+ writeSpace();
+ write(line);
+ }
+ }
+ if (node.tags) {
+ if (node.tags.length === 1 && node.tags[0].kind === 302 && !node.comment) {
+ writeSpace();
+ emit(node.tags[0]);
+ }
+ else {
+ emitList(node, node.tags, 33);
+ }
+ }
+ writeSpace();
+ write("*/");
+ }
+ function emitJSDocSimpleTypedTag(tag) {
+ emitJSDocTagName(tag.tagName);
+ emitJSDocTypeExpression(tag.typeExpression);
+ emitJSDocComment(tag.comment);
+ }
+ function emitJSDocAugmentsTag(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);
+ emitJSDocComment(tag.comment);
+ }
+ function emitJSDocTypedefTag(tag) {
+ emitJSDocTagName(tag.tagName);
+ if (tag.typeExpression) {
+ if (tag.typeExpression.kind === 283) {
+ 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 === 292) {
+ emitJSDocTypeLiteral(tag.typeExpression);
+ }
+ }
+ function emitJSDocCallbackTag(tag) {
+ emitJSDocTagName(tag.tagName);
+ if (tag.name) {
+ writeSpace();
+ emit(tag.name);
+ }
+ emitJSDocComment(tag.comment);
+ emitJSDocSignature(tag.typeExpression);
+ }
+ function emitJSDocSimpleTag(tag) {
+ emitJSDocTagName(tag.tagName);
+ emitJSDocComment(tag.comment);
+ }
+ function emitJSDocTypeLiteral(lit) {
+ emitList(lit, ts.createNodeArray(lit.jsDocPropertyTags), 33);
+ }
+ function emitJSDocSignature(sig) {
+ if (sig.typeParameters) {
+ emitList(sig, ts.createNodeArray(sig.typeParameters), 33);
+ }
+ if (sig.parameters) {
+ emitList(sig, ts.createNodeArray(sig.parameters), 33);
+ }
+ 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) {
+ if (comment) {
+ writeSpace();
+ write(comment);
+ }
+ }
+ function emitJSDocTypeExpression(typeExpression) {
+ if (typeExpression) {
+ writeSpace();
+ writePunctuation("{");
+ emit(typeExpression.type);
+ writePunctuation("}");
+ }
+ }
function emitSourceFile(node) {
writeLine();
var statements = node.statements;
@@ -67452,38 +68148,38 @@ var ts;
}
function emitTripleSlashDirectives(hasNoDefaultLib, files, types, libs) {
if (hasNoDefaultLib) {
- write("/// ");
+ writeComment("/// ");
writeLine();
}
if (currentSourceFile && currentSourceFile.moduleName) {
- write("/// ");
+ writeComment("/// ");
writeLine();
}
if (currentSourceFile && currentSourceFile.amdDependencies) {
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
var dep = _b[_a];
if (dep.name) {
- write("/// ");
+ writeComment("/// ");
}
else {
- write("/// ");
+ writeComment("/// ");
}
writeLine();
}
}
for (var _c = 0, files_1 = files; _c < files_1.length; _c++) {
var directive = files_1[_c];
- write("/// ");
+ writeComment("/// ");
writeLine();
}
- for (var _d = 0, types_16 = types; _d < types_16.length; _d++) {
- var directive = types_16[_d];
- write("/// ");
+ for (var _d = 0, types_18 = types; _d < types_18.length; _d++) {
+ var directive = types_18[_d];
+ writeComment("/// ");
writeLine();
}
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
var directive = libs_1[_e];
- write("/// ");
+ writeComment("/// ");
writeLine();
}
}
@@ -67501,7 +68197,7 @@ var ts;
emitExpression(node.expression);
}
function emitCommaList(node) {
- emitExpressionList(node, node.elements, 272);
+ emitExpressionList(node, node.elements, 528);
}
function emitPrologueDirectives(statements, startWithNewLine, seenPrologueDirectives) {
for (var i = 0; i < statements.length; i++) {
@@ -67536,13 +68232,14 @@ var ts;
setSourceFile(sourceFile);
emitPrologueDirectives(sourceFile.statements, true, seenPrologueDirectives);
}
+ setSourceFile(undefined);
}
}
function emitShebangIfNeeded(sourceFileOrBundle) {
if (ts.isSourceFile(sourceFileOrBundle)) {
var shebang = ts.getShebang(sourceFileOrBundle.text);
if (shebang) {
- write(shebang);
+ writeComment(shebang);
writeLine();
return true;
}
@@ -67566,7 +68263,7 @@ var ts;
}
function emitModifiers(node, modifiers) {
if (modifiers && modifiers.length) {
- emitList(node, modifiers, 131328);
+ emitList(node, modifiers, 262656);
writeSpace();
}
}
@@ -67580,7 +68277,7 @@ var ts;
function emitInitializer(node, equalCommentStartPos, container) {
if (node) {
writeSpace();
- emitTokenWithComment(58, equalCommentStartPos, writeOperator, container);
+ emitTokenWithComment(59, equalCommentStartPos, writeOperator, container);
writeSpace();
emitExpression(node);
}
@@ -67617,24 +68314,30 @@ var ts;
else {
writeLine();
increaseIndent();
- emit(node);
+ if (ts.isEmptyStatement(node)) {
+ var pipelinePhase = getPipelinePhase(0, node);
+ pipelinePhase(5, node);
+ }
+ else {
+ emit(node);
+ }
decreaseIndent();
}
}
function emitDecorators(parentNode, decorators) {
- emitList(parentNode, decorators, 24577);
+ emitList(parentNode, decorators, 49153);
}
function emitTypeArguments(parentNode, typeArguments) {
- emitList(parentNode, typeArguments, 26896);
+ emitList(parentNode, typeArguments, 53776);
}
function emitTypeParameters(parentNode, typeParameters) {
if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) {
return emitTypeArguments(parentNode, parentNode.typeArguments);
}
- emitList(parentNode, typeParameters, 26896);
+ emitList(parentNode, typeParameters, 53776);
}
function emitParameters(parentNode, parameters) {
- emitList(parentNode, parameters, 1296);
+ emitList(parentNode, parameters, 2576);
}
function canEmitSimpleArrowHead(parentNode, parameters) {
var parameter = ts.singleOrUndefined(parameters);
@@ -67655,14 +68358,14 @@ var ts;
}
function emitParametersForArrow(parentNode, parameters) {
if (canEmitSimpleArrowHead(parentNode, parameters)) {
- emitList(parentNode, parameters, 1296 & ~1024);
+ emitList(parentNode, parameters, 2576 & ~2048);
}
else {
emitParameters(parentNode, parameters);
}
}
function emitParametersForIndexSignature(parentNode, parameters) {
- emitList(parentNode, parameters, 4432);
+ emitList(parentNode, parameters, 8848);
}
function emitList(parentNode, children, format, start, count) {
emitNodeList(emit, parentNode, children, format, start, count);
@@ -67671,7 +68374,7 @@ var ts;
emitNodeList(emitExpression, parentNode, children, format, start, count);
}
function writeDelimiter(format) {
- switch (format & 28) {
+ switch (format & 60) {
case 0:
break;
case 16:
@@ -67681,6 +68384,11 @@ var ts;
writeSpace();
writePunctuation("|");
break;
+ case 32:
+ writeSpace();
+ writePunctuation("*");
+ writeSpace();
+ break;
case 8:
writeSpace();
writePunctuation("&");
@@ -67691,11 +68399,11 @@ var ts;
if (start === void 0) { start = 0; }
if (count === void 0) { count = children ? children.length - start : 0; }
var isUndefined = children === undefined;
- if (isUndefined && format & 8192) {
+ if (isUndefined && format & 16384) {
return;
}
var isEmpty = children === undefined || start >= children.length || count === 0;
- if (isEmpty && format & 16384) {
+ if (isEmpty && format & 32768) {
if (onBeforeEmitNodeArray) {
onBeforeEmitNodeArray(children);
}
@@ -67704,7 +68412,7 @@ var ts;
}
return;
}
- if (format & 7680) {
+ if (format & 15360) {
writePunctuation(getOpeningBracket(format));
if (isEmpty && !isUndefined) {
emitTrailingCommentsOfPosition(children.pos, true);
@@ -67717,41 +68425,45 @@ var ts;
if (format & 1) {
writeLine();
}
- else if (format & 128 && !(format & 262144)) {
+ else if (format & 256 && !(format & 524288)) {
writeSpace();
}
}
else {
- var mayEmitInterveningComments = (format & 131072) === 0;
+ var mayEmitInterveningComments = (format & 262144) === 0;
var shouldEmitInterveningComments = mayEmitInterveningComments;
if (shouldWriteLeadingLineTerminator(parentNode, children, format)) {
writeLine();
shouldEmitInterveningComments = false;
}
- else if (format & 128) {
+ else if (format & 256) {
writeSpace();
}
- if (format & 64) {
+ if (format & 128) {
increaseIndent();
}
var previousSibling = void 0;
var shouldDecreaseIndentAfterEmit = false;
for (var i = 0; i < count; i++) {
var child = children[start + i];
- if (previousSibling) {
- if (format & 28 && previousSibling.end !== parentNode.end) {
+ if (format & 32) {
+ writeLine();
+ writeDelimiter(format);
+ }
+ else if (previousSibling) {
+ if (format & 60 && previousSibling.end !== parentNode.end) {
emitLeadingCommentsOfPosition(previousSibling.end);
}
writeDelimiter(format);
if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) {
- if ((format & (3 | 64)) === 0) {
+ if ((format & (3 | 128)) === 0) {
increaseIndent();
shouldDecreaseIndentAfterEmit = true;
}
writeLine();
shouldEmitInterveningComments = false;
}
- else if (previousSibling && format & 256) {
+ else if (previousSibling && format & 512) {
writeSpace();
}
}
@@ -67771,100 +68483,81 @@ var ts;
}
previousSibling = child;
}
- var hasTrailingComma = (format & 32) && children.hasTrailingComma;
+ var hasTrailingComma = (format & 64) && children.hasTrailingComma;
if (format & 16 && hasTrailingComma) {
writePunctuation(",");
}
- if (previousSibling && format & 28 && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024)) {
+ if (previousSibling && format & 60 && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024)) {
emitLeadingCommentsOfPosition(previousSibling.end);
}
- if (format & 64) {
+ if (format & 128) {
decreaseIndent();
}
if (shouldWriteClosingLineTerminator(parentNode, children, format)) {
writeLine();
}
- else if (format & 128) {
+ else if (format & 256) {
writeSpace();
}
}
if (onAfterEmitNodeArray) {
onAfterEmitNodeArray(children);
}
- if (format & 7680) {
+ if (format & 15360) {
if (isEmpty && !isUndefined) {
emitLeadingCommentsOfPosition(children.end);
}
writePunctuation(getClosingBracket(format));
}
}
- function commitPendingSemicolonInternal() {
- if (pendingSemicolon) {
- writeSemicolonInternal();
- pendingSemicolon = false;
- }
- }
function writeLiteral(s) {
- commitPendingSemicolon();
writer.writeLiteral(s);
}
function writeStringLiteral(s) {
- commitPendingSemicolon();
writer.writeStringLiteral(s);
}
function writeBase(s) {
- commitPendingSemicolon();
writer.write(s);
}
function writeSymbol(s, sym) {
- commitPendingSemicolon();
writer.writeSymbol(s, sym);
}
function writePunctuation(s) {
- commitPendingSemicolon();
writer.writePunctuation(s);
}
- function deferWriteSemicolon() {
- pendingSemicolon = true;
- }
- function writeSemicolonInternal() {
- writer.writePunctuation(";");
+ function writeTrailingSemicolon() {
+ writer.writeTrailingSemicolon(";");
}
function writeKeyword(s) {
- commitPendingSemicolon();
writer.writeKeyword(s);
}
function writeOperator(s) {
- commitPendingSemicolon();
writer.writeOperator(s);
}
function writeParameter(s) {
- commitPendingSemicolon();
writer.writeParameter(s);
}
+ function writeComment(s) {
+ writer.writeComment(s);
+ }
function writeSpace() {
- commitPendingSemicolon();
writer.writeSpace(" ");
}
function writeProperty(s) {
- commitPendingSemicolon();
writer.writeProperty(s);
}
function writeLine() {
- commitPendingSemicolon();
writer.writeLine();
}
function increaseIndent() {
- commitPendingSemicolon();
writer.increaseIndent();
}
function decreaseIndent() {
- commitPendingSemicolon();
writer.decreaseIndent();
}
function writeToken(token, pos, writer, contextNode) {
- return onEmitSourceMapOfToken
- ? onEmitSourceMapOfToken(contextNode, token, writer, pos, writeTokenText)
+ return !sourceMapsDisabled
+ ? emitTokenWithSourceMap(contextNode, token, writer, pos, writeTokenText)
: writeTokenText(token, writer, pos);
}
function writeTokenNode(node, writer) {
@@ -67892,23 +68585,23 @@ var ts;
function writeLines(text) {
var lines = text.split(/\r\n?|\n/g);
var indentation = ts.guessIndentation(lines);
- for (var _a = 0, lines_2 = lines; _a < lines_2.length; _a++) {
- var lineText = lines_2[_a];
+ for (var _a = 0, lines_3 = lines; _a < lines_3.length; _a++) {
+ var lineText = lines_3[_a];
var line = indentation ? lineText.slice(indentation) : lineText;
if (line.length) {
writeLine();
write(line);
- writeLine();
+ writer.rawWrite(newLine);
}
}
}
- function increaseIndentIf(value, valueToWriteWhenNotIndenting) {
+ function increaseIndentIf(value, writeSpaceIfNotIndenting) {
if (value) {
increaseIndent();
writeLine();
}
- else if (valueToWriteWhenNotIndenting) {
- write(valueToWriteWhenNotIndenting);
+ else if (writeSpaceIfNotIndenting) {
+ writeSpace();
}
}
function decreaseIndentIf(value1, value2) {
@@ -67924,7 +68617,7 @@ var ts;
return true;
}
if (format & 2) {
- if (format & 32768) {
+ if (format & 65536) {
return true;
}
var firstChild = children[0];
@@ -67963,10 +68656,10 @@ var ts;
}
function shouldWriteClosingLineTerminator(parentNode, children, format) {
if (format & 1) {
- return (format & 65536) === 0;
+ return (format & 131072) === 0;
}
else if (format & 2) {
- if (format & 32768) {
+ if (format & 65536) {
return true;
}
var lastChild = ts.lastOrUndefined(children);
@@ -67988,11 +68681,11 @@ var ts;
if (ts.nodeIsSynthesized(node)) {
var startsOnNewLine = ts.getStartsOnNewLine(node);
if (startsOnNewLine === undefined) {
- return (format & 32768) !== 0;
+ return (format & 65536) !== 0;
}
return startsOnNewLine;
}
- return (format & 32768) !== 0;
+ return (format & 65536) !== 0;
}
function needsIndentation(parent, node1, node2) {
parent = skipSynthesizedParentheses(parent);
@@ -68011,7 +68704,7 @@ var ts;
&& ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile);
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 193 && ts.nodeIsSynthesized(node)) {
+ while (node.kind === 195 && ts.nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -68023,7 +68716,7 @@ var ts;
else if (ts.isIdentifier(node) && (ts.nodeIsSynthesized(node) || !node.parent || !currentSourceFile || (node.parent && currentSourceFile && ts.getSourceFileOfNode(node) !== ts.getOriginalNode(currentSourceFile)))) {
return ts.idText(node);
}
- else if (node.kind === 9 && node.textSourceNode) {
+ else if (node.kind === 10 && node.textSourceNode) {
return getTextOfNode(node.textSourceNode, includeTrivia);
}
else if (ts.isLiteralExpression(node) && (ts.nodeIsSynthesized(node) || !node.parent)) {
@@ -68032,7 +68725,7 @@ var ts;
return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node, includeTrivia);
}
function getLiteralTextOfNode(node, neverAsciiEscape) {
- if (node.kind === 9 && node.textSourceNode) {
+ if (node.kind === 10 && node.textSourceNode) {
var textSourceNode = node.textSourceNode;
if (ts.isIdentifier(textSourceNode)) {
return neverAsciiEscape || (ts.getEmitFlags(node) & 16777216) ?
@@ -68070,81 +68763,81 @@ var ts;
if (!node)
return;
switch (node.kind) {
- case 216:
- ts.forEach(node.statements, generateNames);
- break;
- case 231:
- case 229:
- case 221:
- case 222:
- generateNames(node.statement);
- break;
- case 220:
- generateNames(node.thenStatement);
- generateNames(node.elseStatement);
- break;
- case 223:
- case 225:
- case 224:
- generateNames(node.initializer);
- generateNames(node.statement);
- break;
- case 230:
- generateNames(node.caseBlock);
- break;
- case 244:
- ts.forEach(node.clauses, generateNames);
- break;
- case 269:
- case 270:
+ case 218:
ts.forEach(node.statements, generateNames);
break;
case 233:
+ case 231:
+ case 223:
+ case 224:
+ generateNames(node.statement);
+ break;
+ case 222:
+ generateNames(node.thenStatement);
+ generateNames(node.elseStatement);
+ break;
+ case 225:
+ case 227:
+ case 226:
+ generateNames(node.initializer);
+ generateNames(node.statement);
+ break;
+ case 232:
+ generateNames(node.caseBlock);
+ break;
+ case 246:
+ ts.forEach(node.clauses, generateNames);
+ break;
+ case 271:
+ case 272:
+ ts.forEach(node.statements, generateNames);
+ break;
+ case 235:
generateNames(node.tryBlock);
generateNames(node.catchClause);
generateNames(node.finallyBlock);
break;
- case 272:
+ case 274:
generateNames(node.variableDeclaration);
generateNames(node.block);
break;
- case 217:
+ case 219:
generateNames(node.declarationList);
break;
- case 236:
+ case 238:
ts.forEach(node.declarations, generateNames);
break;
- case 235:
- case 149:
- case 184:
- case 238:
+ case 237:
+ case 151:
+ case 186:
+ case 240:
generateNameIfNeeded(node.name);
break;
- case 237:
+ case 239:
generateNameIfNeeded(node.name);
if (ts.getEmitFlags(node) & 524288) {
ts.forEach(node.parameters, generateNames);
generateNames(node.body);
}
break;
- case 182:
- case 183:
+ case 184:
+ case 185:
ts.forEach(node.elements, generateNames);
break;
- case 247:
+ case 249:
generateNames(node.importClause);
break;
- case 248:
+ case 250:
generateNameIfNeeded(node.name);
generateNames(node.namedBindings);
break;
- case 249:
+ case 251:
generateNameIfNeeded(node.name);
break;
- case 250:
+ case 252:
ts.forEach(node.elements, generateNames);
break;
- case 251:
+ case 253:
generateNameIfNeeded(node.propertyName || node.name);
break;
}
@@ -68153,12 +68846,12 @@ var ts;
if (!node)
return;
switch (node.kind) {
- case 273:
- case 274:
- case 152:
+ case 275:
+ case 276:
case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
generateNameIfNeeded(node.name);
break;
}
@@ -68290,23 +68983,23 @@ var ts;
}
function generateNameForNode(node, flags) {
switch (node.kind) {
- case 71:
+ case 72:
return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16), !!(flags & 8));
- case 242:
- case 241:
+ case 244:
+ case 243:
return generateNameForModuleOrEnum(node);
- case 247:
- case 253:
+ case 249:
+ case 255:
return generateNameForImportOrExportDeclaration(node);
- case 237:
- case 238:
- case 252:
+ case 239:
+ case 240:
+ case 254:
return generateNameForExportDefault();
- case 207:
+ case 209:
return generateNameForClassExpression();
- case 154:
case 156:
- case 157:
+ case 158:
+ case 159:
return generateNameForMethodOrAccessor(node);
default:
return makeTempVariableName(0);
@@ -68338,21 +69031,343 @@ var ts;
}
return node;
}
+ function pipelineEmitWithComments(hint, node) {
+ enterComment();
+ hasWrittenComment = false;
+ var emitFlags = ts.getEmitFlags(node);
+ var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end;
+ var isEmittedNode = node.kind !== 307;
+ var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 11;
+ var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 11;
+ var savedContainerPos = containerPos;
+ var savedContainerEnd = containerEnd;
+ var savedDeclarationListContainerEnd = declarationListContainerEnd;
+ if ((pos > 0 || end > 0) && pos !== end) {
+ if (!skipLeadingComments) {
+ emitLeadingComments(pos, isEmittedNode);
+ }
+ if (!skipLeadingComments || (pos >= 0 && (emitFlags & 512) !== 0)) {
+ containerPos = pos;
+ }
+ if (!skipTrailingComments || (end >= 0 && (emitFlags & 1024) !== 0)) {
+ containerEnd = end;
+ if (node.kind === 238) {
+ declarationListContainerEnd = end;
+ }
+ }
+ }
+ ts.forEach(ts.getSyntheticLeadingComments(node), emitLeadingSynthesizedComment);
+ exitComment();
+ var pipelinePhase = getNextPipelinePhase(2, node);
+ if (emitFlags & 2048) {
+ commentsDisabled = true;
+ pipelinePhase(hint, node);
+ commentsDisabled = false;
+ }
+ else {
+ pipelinePhase(hint, node);
+ }
+ enterComment();
+ ts.forEach(ts.getSyntheticTrailingComments(node), emitTrailingSynthesizedComment);
+ if ((pos > 0 || end > 0) && pos !== end) {
+ containerPos = savedContainerPos;
+ containerEnd = savedContainerEnd;
+ declarationListContainerEnd = savedDeclarationListContainerEnd;
+ if (!skipTrailingComments && isEmittedNode) {
+ emitTrailingComments(end);
+ }
+ }
+ exitComment();
+ }
+ function emitLeadingSynthesizedComment(comment) {
+ if (comment.kind === 2) {
+ writer.writeLine();
+ }
+ writeSynthesizedComment(comment);
+ if (comment.hasTrailingNewLine || comment.kind === 2) {
+ writer.writeLine();
+ }
+ else {
+ writer.writeSpace(" ");
+ }
+ }
+ function emitTrailingSynthesizedComment(comment) {
+ if (!writer.isAtStartOfLine()) {
+ writer.writeSpace(" ");
+ }
+ writeSynthesizedComment(comment);
+ if (comment.hasTrailingNewLine) {
+ writer.writeLine();
+ }
+ }
+ function writeSynthesizedComment(comment) {
+ var text = formatSynthesizedComment(comment);
+ var lineMap = comment.kind === 3 ? ts.computeLineStarts(text) : undefined;
+ ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine);
+ }
+ function formatSynthesizedComment(comment) {
+ return comment.kind === 3
+ ? "/*" + comment.text + "*/"
+ : "//" + comment.text;
+ }
+ function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
+ enterComment();
+ var pos = detachedRange.pos, end = detachedRange.end;
+ var emitFlags = ts.getEmitFlags(node);
+ var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0;
+ var skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 1024) !== 0;
+ if (!skipLeadingComments) {
+ emitDetachedCommentsAndUpdateCommentsInfo(detachedRange);
+ }
+ exitComment();
+ if (emitFlags & 2048 && !commentsDisabled) {
+ commentsDisabled = true;
+ emitCallback(node);
+ commentsDisabled = false;
+ }
+ else {
+ emitCallback(node);
+ }
+ enterComment();
+ if (!skipTrailingComments) {
+ emitLeadingComments(detachedRange.end, true);
+ if (hasWrittenComment && !writer.isAtStartOfLine()) {
+ writer.writeLine();
+ }
+ }
+ exitComment();
+ }
+ function emitLeadingComments(pos, isEmittedNode) {
+ hasWrittenComment = false;
+ if (isEmittedNode) {
+ 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 shouldWriteComment(text, pos) {
+ if (printerOptions.onlyPrintJsDocStyle) {
+ return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos));
+ }
+ return true;
+ }
+ function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) {
+ if (!shouldWriteComment(currentSourceFile.text, commentPos))
+ return;
+ if (!hasWrittenComment) {
+ ts.emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos);
+ hasWrittenComment = true;
+ }
+ emitPos(commentPos);
+ ts.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
+ emitPos(commentEnd);
+ if (hasTrailingNewLine) {
+ writer.writeLine();
+ }
+ else if (kind === 3) {
+ writer.writeSpace(" ");
+ }
+ }
+ function emitLeadingCommentsOfPosition(pos) {
+ if (commentsDisabled || pos === -1) {
+ return;
+ }
+ emitLeadingComments(pos, true);
+ }
+ function emitTrailingComments(pos) {
+ forEachTrailingCommentToEmit(pos, emitTrailingComment);
+ }
+ function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) {
+ if (!shouldWriteComment(currentSourceFile.text, commentPos))
+ return;
+ if (!writer.isAtStartOfLine()) {
+ writer.writeSpace(" ");
+ }
+ emitPos(commentPos);
+ ts.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
+ emitPos(commentEnd);
+ if (hasTrailingNewLine) {
+ writer.writeLine();
+ }
+ }
+ function emitTrailingCommentsOfPosition(pos, prefixSpace) {
+ if (commentsDisabled) {
+ return;
+ }
+ enterComment();
+ forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : emitTrailingCommentOfPosition);
+ exitComment();
+ }
+ function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) {
+ emitPos(commentPos);
+ ts.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 {
+ ts.forEachLeadingCommentRange(currentSourceFile.text, pos, cb, pos);
+ }
+ }
+ }
+ function forEachTrailingCommentToEmit(end, cb) {
+ if (currentSourceFile && (containerEnd === -1 || (end !== containerEnd && end !== declarationListContainerEnd))) {
+ ts.forEachTrailingCommentRange(currentSourceFile.text, end, cb);
+ }
+ }
+ function hasDetachedComments(pos) {
+ return detachedCommentsInfo !== undefined && ts.last(detachedCommentsInfo).nodePos === pos;
+ }
+ function forEachLeadingCommentWithoutDetachedComments(cb) {
+ var pos = ts.last(detachedCommentsInfo).detachedCommentEndPos;
+ if (detachedCommentsInfo.length - 1) {
+ detachedCommentsInfo.pop();
+ }
+ else {
+ detachedCommentsInfo = undefined;
+ }
+ ts.forEachLeadingCommentRange(currentSourceFile.text, pos, cb, pos);
+ }
+ function emitDetachedCommentsAndUpdateCommentsInfo(range) {
+ var currentDetachedCommentInfo = ts.emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled);
+ if (currentDetachedCommentInfo) {
+ if (detachedCommentsInfo) {
+ detachedCommentsInfo.push(currentDetachedCommentInfo);
+ }
+ else {
+ detachedCommentsInfo = [currentDetachedCommentInfo];
+ }
+ }
+ }
+ function emitComment(text, lineMap, writer, commentPos, commentEnd, newLine) {
+ if (!shouldWriteComment(currentSourceFile.text, commentPos))
+ return;
+ emitPos(commentPos);
+ ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine);
+ emitPos(commentEnd);
+ }
+ function isTripleSlashComment(commentPos, commentEnd) {
+ return ts.isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd);
+ }
+ function pipelineEmitWithSourceMap(hint, node) {
+ var pipelinePhase = getNextPipelinePhase(3, node);
+ if (ts.isUnparsedSource(node) && node.sourceMapText !== undefined) {
+ var parsed = ts.tryParseRawSourceMap(node.sourceMapText);
+ if (parsed) {
+ sourceMapGenerator.appendSourceMap(writer.getLine(), writer.getColumn(), parsed, node.sourceMapPath);
+ }
+ pipelinePhase(hint, node);
+ }
+ else {
+ var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b;
+ var emitFlags = ts.getEmitFlags(node);
+ if (node.kind !== 307
+ && (emitFlags & 16) === 0
+ && pos >= 0) {
+ emitSourcePos(source, skipSourceTrivia(source, pos));
+ }
+ if (emitFlags & 64) {
+ sourceMapsDisabled = true;
+ pipelinePhase(hint, node);
+ sourceMapsDisabled = false;
+ }
+ else {
+ pipelinePhase(hint, node);
+ }
+ if (node.kind !== 307
+ && (emitFlags & 32) === 0
+ && end >= 0) {
+ emitSourcePos(source, end);
+ }
+ }
+ }
+ function skipSourceTrivia(source, pos) {
+ return source.skipTrivia ? source.skipTrivia(pos) : ts.skipTrivia(sourceMapSource.text, pos);
+ }
+ function emitPos(pos) {
+ if (sourceMapsDisabled || ts.positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) {
+ return;
+ }
+ var _a = ts.getLineAndCharacterOfPosition(currentSourceFile, pos), sourceLine = _a.line, sourceCharacter = _a.character;
+ sourceMapGenerator.addMapping(writer.getLine(), writer.getColumn(), sourceMapSourceIndex, sourceLine, sourceCharacter, undefined);
+ }
+ function emitSourcePos(source, pos) {
+ if (source !== sourceMapSource) {
+ var savedSourceMapSource = sourceMapSource;
+ setSourceMapSource(source);
+ emitPos(pos);
+ setSourceMapSource(savedSourceMapSource);
+ }
+ else {
+ emitPos(pos);
+ }
+ }
+ function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) {
+ if (sourceMapsDisabled || node && ts.isInJsonFile(node)) {
+ return emitCallback(token, writer, tokenPos);
+ }
+ var emitNode = node && node.emitNode;
+ var emitFlags = emitNode && emitNode.flags || 0;
+ var range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token];
+ var source = range && range.source || sourceMapSource;
+ tokenPos = skipSourceTrivia(source, range ? range.pos : tokenPos);
+ if ((emitFlags & 128) === 0 && tokenPos >= 0) {
+ emitSourcePos(source, tokenPos);
+ }
+ tokenPos = emitCallback(token, writer, tokenPos);
+ if (range)
+ tokenPos = range.end;
+ if ((emitFlags & 256) === 0 && tokenPos >= 0) {
+ emitSourcePos(source, tokenPos);
+ }
+ return tokenPos;
+ }
+ function setSourceMapSource(source) {
+ if (sourceMapsDisabled) {
+ return;
+ }
+ sourceMapSource = source;
+ if (isJsonSourceMapSource(source)) {
+ return;
+ }
+ sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName);
+ if (printerOptions.inlineSources) {
+ sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text);
+ }
+ }
+ function isJsonSourceMapSource(sourceFile) {
+ return ts.fileExtensionIs(sourceFile.fileName, ".json");
+ }
}
ts.createPrinter = createPrinter;
function createBracketsMap() {
var brackets = [];
- brackets[512] = ["{", "}"];
- brackets[1024] = ["(", ")"];
- brackets[2048] = ["<", ">"];
- brackets[4096] = ["[", "]"];
+ brackets[1024] = ["{", "}"];
+ brackets[2048] = ["(", ")"];
+ brackets[4096] = ["<", ">"];
+ brackets[8192] = ["[", "]"];
return brackets;
}
function getOpeningBracket(format) {
- return brackets[format & 7680][0];
+ return brackets[format & 15360][0];
}
function getClosingBracket(format) {
- return brackets[format & 7680][1];
+ return brackets[format & 15360][1];
}
})(ts || (ts = {}));
var ts;
@@ -68984,7 +69999,7 @@ var ts;
}
}
ts.flattenDiagnosticMessageText = flattenDiagnosticMessageText;
- function loadWithLocalCache(names, containingFile, loader) {
+ function loadWithLocalCache(names, containingFile, redirectedReference, loader) {
if (names.length === 0) {
return [];
}
@@ -68997,7 +70012,7 @@ var ts;
result = cache.get(name);
}
else {
- cache.set(name, result = loader(name, containingFile));
+ cache.set(name, result = loader(name, containingFile, redirectedReference));
}
resolutions.push(result);
}
@@ -69010,6 +70025,7 @@ var ts;
if (program.getRootFileNames().length !== rootFileNames.length) {
return false;
}
+ var seenResolvedRefs;
if (!ts.arrayIsEqualTo(program.getProjectReferences(), projectReferences, projectReferenceUptoDate)) {
return false;
}
@@ -69029,7 +70045,7 @@ var ts;
return true;
function sourceFileNotUptoDate(sourceFile) {
return !sourceFileVersionUptoDate(sourceFile) ||
- hasInvalidatedResolution(sourceFile.resolvedPath);
+ hasInvalidatedResolution(sourceFile.path);
}
function sourceFileVersionUptoDate(sourceFile) {
return sourceFile.version === getSourceVersion(sourceFile.resolvedPath);
@@ -69038,9 +70054,20 @@ var ts;
if (!ts.projectReferenceIsEqualTo(oldRef, newRef)) {
return false;
}
- var oldResolvedRef = program.getResolvedProjectReferences()[index];
+ return resolvedProjectReferenceUptoDate(program.getResolvedProjectReferences()[index], oldRef);
+ }
+ function resolvedProjectReferenceUptoDate(oldResolvedRef, oldRef) {
if (oldResolvedRef) {
- return sourceFileVersionUptoDate(oldResolvedRef.sourceFile);
+ if (ts.contains(seenResolvedRefs, oldResolvedRef)) {
+ return true;
+ }
+ if (!sourceFileVersionUptoDate(oldResolvedRef.sourceFile)) {
+ return false;
+ }
+ (seenResolvedRefs || (seenResolvedRefs = [])).push(oldResolvedRef);
+ return !ts.forEach(oldResolvedRef.references, function (childResolvedRef, index) {
+ return !resolvedProjectReferenceUptoDate(childResolvedRef, oldResolvedRef.commandLine.projectReferences[index]);
+ });
}
return !fileExists(resolveProjectReferencePath(oldRef));
}
@@ -69080,7 +70107,7 @@ var ts;
var diagnosticsProducingTypeChecker;
var noDiagnosticsTypeChecker;
var classifiableNames;
- var modifiedFilePaths;
+ var ambientModuleNameToUnmodifiedFileName = ts.createMap();
var cachedSemanticDiagnosticsForFile = {};
var cachedDeclarationDiagnosticsForFile = {};
var resolvedTypeReferenceDirectives = ts.createMap();
@@ -69101,12 +70128,11 @@ var ts;
var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
var hasEmitBlockingDiagnostics = ts.createMap();
var _compilerOptionsObjectLiteralSyntax;
- var _referencesArrayLiteralSyntax;
var moduleResolutionCache;
var resolveModuleNamesWorker;
var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;
if (host.resolveModuleNames) {
- resolveModuleNamesWorker = function (moduleNames, containingFile, reusedNames) { return host.resolveModuleNames(ts.Debug.assertEachDefined(moduleNames), containingFile, reusedNames).map(function (resolved) {
+ resolveModuleNamesWorker = function (moduleNames, containingFile, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.assertEachDefined(moduleNames), containingFile, reusedNames, redirectedReference).map(function (resolved) {
if (!resolved || resolved.extension !== undefined) {
return resolved;
}
@@ -69117,16 +70143,16 @@ var ts;
}
else {
moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); });
- var loader_1 = function (moduleName, containingFile) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache).resolvedModule; };
- resolveModuleNamesWorker = function (moduleNames, containingFile) { return loadWithLocalCache(ts.Debug.assertEachDefined(moduleNames), containingFile, loader_1); };
+ var loader_1 = function (moduleName, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache, redirectedReference).resolvedModule; };
+ resolveModuleNamesWorker = function (moduleNames, containingFile, _reusedNames, redirectedReference) { return loadWithLocalCache(ts.Debug.assertEachDefined(moduleNames), containingFile, redirectedReference, loader_1); };
}
var resolveTypeReferenceDirectiveNamesWorker;
if (host.resolveTypeReferenceDirectives) {
- resolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile) { return host.resolveTypeReferenceDirectives(ts.Debug.assertEachDefined(typeDirectiveNames), containingFile); };
+ resolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference) { return host.resolveTypeReferenceDirectives(ts.Debug.assertEachDefined(typeDirectiveNames), containingFile, redirectedReference); };
}
else {
- var loader_2 = function (typesRef, containingFile) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host).resolvedTypeReferenceDirective; };
- resolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile) { return loadWithLocalCache(ts.Debug.assertEachDefined(typeReferenceDirectiveNames), containingFile, loader_2); };
+ var loader_2 = function (typesRef, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference).resolvedTypeReferenceDirective; };
+ resolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference) { return loadWithLocalCache(ts.Debug.assertEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, loader_2); };
}
var packageIdToSourceFile = ts.createMap();
var sourceFileToPackageName = ts.createMap();
@@ -69134,7 +70160,7 @@ var ts;
var filesByName = ts.createMap();
var missingFilePaths;
var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createMap() : undefined;
- var resolvedProjectReferences = projectReferences ? [] : undefined;
+ var resolvedProjectReferences;
var projectReferenceRedirects;
var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
var structuralIsReused = tryReuseStructureFromOldProgram();
@@ -69142,22 +70168,24 @@ var ts;
processingDefaultLibFiles = [];
processingOtherFiles = [];
if (projectReferences) {
- for (var _i = 0, projectReferences_1 = projectReferences; _i < projectReferences_1.length; _i++) {
- var ref = projectReferences_1[_i];
- var parsedRef = parseProjectReferenceConfigFile(ref);
- resolvedProjectReferences.push(parsedRef);
- if (parsedRef) {
- var out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out;
- if (out) {
- var dtsOutfile = ts.changeExtension(out, ".d.ts");
- processSourceFile(dtsOutfile, false, false, undefined);
+ if (!resolvedProjectReferences) {
+ resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile);
+ }
+ if (rootNames.length) {
+ for (var _i = 0, resolvedProjectReferences_1 = resolvedProjectReferences; _i < resolvedProjectReferences_1.length; _i++) {
+ var parsedRef = resolvedProjectReferences_1[_i];
+ if (parsedRef) {
+ var out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out;
+ if (out) {
+ var dtsOutfile = ts.changeExtension(out, ".d.ts");
+ processSourceFile(dtsOutfile, false, false, undefined);
+ }
}
- addProjectReferenceRedirects(parsedRef.commandLine);
}
}
}
ts.forEach(rootNames, function (name) { return processRootFile(name, false, false); });
- var typeReferences = ts.getAutomaticTypeDirectiveNames(options, host);
+ var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray;
if (typeReferences.length) {
var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory();
var containingFilename = ts.combinePaths(containingDirectory, "__inferred type names__.ts");
@@ -69166,7 +70194,7 @@ var ts;
processTypeReferenceDirective(typeReferences[i], resolutions[i]);
}
}
- if (!skipDefaultLib) {
+ if (rootNames.length && !skipDefaultLib) {
var defaultLibraryFileName = getDefaultLibraryFileName();
if (!options.lib && defaultLibraryFileName) {
processRootFile(defaultLibraryFileName, true, false);
@@ -69187,10 +70215,17 @@ var ts;
var oldSourceFiles = oldProgram.getSourceFiles();
for (var _a = 0, oldSourceFiles_1 = oldSourceFiles; _a < oldSourceFiles_1.length; _a++) {
var oldSourceFile = oldSourceFiles_1[_a];
- if (!getSourceFile(oldSourceFile.path) || shouldCreateNewSourceFile) {
- host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions());
+ var newFile = getSourceFileByPath(oldSourceFile.resolvedPath);
+ if (shouldCreateNewSourceFile || !newFile ||
+ (oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path)) {
+ host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));
}
}
+ oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) {
+ if (resolvedProjectReference && !getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) {
+ host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), false);
+ }
+ });
}
oldProgram = undefined;
program = {
@@ -69230,7 +70265,10 @@ var ts;
getResolvedModuleWithFailedLookupLocationsFromCache: getResolvedModuleWithFailedLookupLocationsFromCache,
getProjectReferences: getProjectReferences,
getResolvedProjectReferences: getResolvedProjectReferences,
- getProjectReferenceRedirect: getProjectReferenceRedirect
+ getProjectReferenceRedirect: getProjectReferenceRedirect,
+ getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
+ getResolvedProjectReferenceByPath: getResolvedProjectReferenceByPath,
+ forEachResolvedProjectReference: forEachResolvedProjectReference
};
verifyCompilerOptions();
ts.performance.mark("afterProgram");
@@ -69287,11 +70325,11 @@ var ts;
}
return classifiableNames;
}
- function resolveModuleNamesReusingOldState(moduleNames, containingFile, file, oldProgramState) {
+ function resolveModuleNamesReusingOldState(moduleNames, containingFile, file) {
if (structuralIsReused === 0 && !file.ambientModuleNames.length) {
- return resolveModuleNamesWorker(moduleNames, containingFile);
+ return resolveModuleNamesWorker(moduleNames, containingFile, undefined, getResolvedProjectReferenceToRedirect(file.originalFileName));
}
- var oldSourceFile = oldProgramState.program && oldProgramState.program.getSourceFile(containingFile);
+ var oldSourceFile = oldProgram && oldProgram.getSourceFile(containingFile);
if (oldSourceFile !== file && file.resolvedModules) {
var result_5 = [];
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
@@ -69326,7 +70364,7 @@ var ts;
}
}
else {
- resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, oldProgramState);
+ resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName);
}
if (resolvesToAmbientModuleInNonModifiedFile) {
(result || (result = new Array(moduleNames.length)))[i] = predictedToResolveToAmbientModuleMarker;
@@ -69336,7 +70374,7 @@ var ts;
}
}
var resolutions = unknownModuleNames && unknownModuleNames.length
- ? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames)
+ ? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames, getResolvedProjectReferenceToRedirect(file.originalFileName))
: ts.emptyArray;
if (!result) {
ts.Debug.assert(resolutions.length === moduleNames.length);
@@ -69356,25 +70394,37 @@ var ts;
}
ts.Debug.assert(j === resolutions.length);
return result;
- function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, oldProgramState) {
- if (!oldProgramState.program) {
- return false;
- }
- var resolutionToFile = ts.getResolvedModule(oldProgramState.oldSourceFile, moduleName);
- var resolvedFile = resolutionToFile && oldProgramState.program.getSourceFile(resolutionToFile.resolvedFileName);
+ function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
+ var resolutionToFile = ts.getResolvedModule(oldSourceFile, moduleName);
+ var resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) {
return false;
}
- var firstUnmodifiedFile = oldProgramState.program.getSourceFiles().find(function (f) { return !ts.contains(oldProgramState.modifiedFilePaths, f.path) && ts.contains(f.ambientModuleNames, moduleName); });
- if (!firstUnmodifiedFile) {
+ var unmodifiedFile = ambientModuleNameToUnmodifiedFileName.get(moduleName);
+ if (!unmodifiedFile) {
return false;
}
if (ts.isTraceEnabled(options, host)) {
- ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified, moduleName, firstUnmodifiedFile.fileName);
+ ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified, moduleName, unmodifiedFile);
}
return true;
}
}
+ function canReuseProjectReferences() {
+ return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, index, parent) {
+ var newRef = (parent ? parent.commandLine.projectReferences : projectReferences)[index];
+ var newResolvedRef = parseProjectReferenceConfigFile(newRef);
+ if (oldResolvedRef) {
+ return !newResolvedRef || newResolvedRef.sourceFile !== oldResolvedRef.sourceFile;
+ }
+ else {
+ return newResolvedRef !== undefined;
+ }
+ }, function (oldProjectReferences, parent) {
+ var newReferences = parent ? getResolvedProjectReferenceByPath(parent.sourceFile.path).commandLine.projectReferences : projectReferences;
+ return !ts.arrayIsEqualTo(oldProjectReferences, newReferences, ts.projectReferenceIsEqualTo);
+ });
+ }
function tryReuseStructureFromOldProgram() {
if (!oldProgram) {
return 0;
@@ -69391,33 +70441,13 @@ var ts;
if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) {
return oldProgram.structureIsReused = 0;
}
- var oldProjectReferences = oldProgram.getProjectReferences();
- if (!ts.arrayIsEqualTo(oldProjectReferences, projectReferences, ts.projectReferenceIsEqualTo)) {
+ if (!canReuseProjectReferences()) {
return oldProgram.structureIsReused = 0;
}
- var oldRefs = oldProgram.getResolvedProjectReferences();
if (projectReferences) {
- ts.Debug.assert(!!oldRefs);
- for (var i = 0; i < projectReferences.length; i++) {
- var oldRef = oldRefs[i];
- var newRef = parseProjectReferenceConfigFile(projectReferences[i]);
- if (oldRef) {
- if (!newRef || newRef.sourceFile !== oldRef.sourceFile) {
- return oldProgram.structureIsReused = 0;
- }
- }
- else {
- if (newRef !== undefined) {
- return oldProgram.structureIsReused = 0;
- }
- }
- }
- }
- else {
- ts.Debug.assert(!oldRefs);
+ resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile);
}
var newSourceFiles = [];
- var filePaths = [];
var modifiedSourceFiles = [];
oldProgram.structureIsReused = 2;
if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) {
@@ -69455,7 +70485,6 @@ var ts;
newSourceFile.originalFileName = oldSourceFile.originalFileName;
newSourceFile.resolvedPath = oldSourceFile.resolvedPath;
newSourceFile.fileName = oldSourceFile.fileName;
- filePaths.push(newSourceFile.path);
var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path);
if (packageName !== undefined) {
var prevKind = seenPackageNames.get(packageName);
@@ -69499,14 +70528,22 @@ var ts;
if (oldProgram.structureIsReused !== 2) {
return oldProgram.structureIsReused;
}
- modifiedFilePaths = modifiedSourceFiles.map(function (f) { return f.newFile.path; });
- for (var _a = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _a < modifiedSourceFiles_1.length; _a++) {
- var _b = modifiedSourceFiles_1[_a], oldSourceFile = _b.oldFile, newSourceFile = _b.newFile;
+ var modifiedFiles = modifiedSourceFiles.map(function (f) { return f.oldFile; });
+ for (var _a = 0, oldSourceFiles_3 = oldSourceFiles; _a < oldSourceFiles_3.length; _a++) {
+ var oldFile = oldSourceFiles_3[_a];
+ if (!ts.contains(modifiedFiles, oldFile)) {
+ for (var _b = 0, _c = oldFile.ambientModuleNames; _b < _c.length; _b++) {
+ var moduleName = _c[_b];
+ ambientModuleNameToUnmodifiedFileName.set(moduleName, oldFile.fileName);
+ }
+ }
+ }
+ for (var _d = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _d < modifiedSourceFiles_1.length; _d++) {
+ var _e = modifiedSourceFiles_1[_d], oldSourceFile = _e.oldFile, newSourceFile = _e.newFile;
var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory);
if (resolveModuleNamesWorker) {
var moduleNames = getModuleNames(newSourceFile);
- var oldProgramState = { program: oldProgram, oldSourceFile: oldSourceFile, modifiedFilePaths: modifiedFilePaths };
- var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile, oldProgramState);
+ var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile);
var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo);
if (resolutionsChanged) {
oldProgram.structureIsReused = 1;
@@ -69518,7 +70555,7 @@ var ts;
}
if (resolveTypeReferenceDirectiveNamesWorker) {
var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ref.fileName.toLocaleLowerCase(); });
- var resolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath);
+ var resolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath, getResolvedProjectReferenceToRedirect(newSourceFile.originalFileName));
var resolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, resolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo);
if (resolutionsChanged) {
oldProgram.structureIsReused = 1;
@@ -69536,27 +70573,21 @@ var ts;
return oldProgram.structureIsReused = 1;
}
missingFilePaths = oldProgram.getMissingFilePaths();
- for (var i = 0; i < newSourceFiles.length; i++) {
- filesByName.set(filePaths[i], newSourceFiles[i]);
- if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePaths[i]))) {
- sourceFilesFoundSearchingNodeModules.set(filePaths[i], true);
+ for (var _f = 0, newSourceFiles_1 = newSourceFiles; _f < newSourceFiles_1.length; _f++) {
+ var newSourceFile = newSourceFiles_1[_f];
+ var filePath = newSourceFile.path;
+ addFileToFilesByName(newSourceFile, filePath, newSourceFile.resolvedPath);
+ if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePath))) {
+ sourceFilesFoundSearchingNodeModules.set(filePath, true);
}
}
files = newSourceFiles;
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
- for (var _c = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _c < modifiedSourceFiles_2.length; _c++) {
- var modifiedFile = modifiedSourceFiles_2[_c];
+ for (var _g = 0, modifiedSourceFiles_2 = modifiedSourceFiles; _g < modifiedSourceFiles_2.length; _g++) {
+ var modifiedFile = modifiedSourceFiles_2[_g];
fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile.newFile);
}
resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives();
- resolvedProjectReferences = oldProgram.getResolvedProjectReferences();
- if (resolvedProjectReferences) {
- resolvedProjectReferences.forEach(function (ref) {
- if (ref) {
- addProjectReferenceRedirects(ref.commandLine);
- }
- });
- }
sourceFileToPackageName = oldProgram.sourceFileToPackageName;
redirectTargetsMap = oldProgram.redirectTargetsMap;
return oldProgram.structureIsReused = 2;
@@ -69782,62 +70813,62 @@ var ts;
return diagnostics;
function walk(node) {
switch (parent.kind) {
- case 149:
- case 152:
+ case 151:
+ case 154:
if (parent.questionToken === node) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?"));
return;
}
- case 154:
- case 153:
- case 155:
case 156:
+ case 155:
case 157:
- case 194:
+ case 158:
+ case 159:
+ case 196:
+ case 239:
+ case 197:
case 237:
- case 195:
- case 235:
if (parent.type === node) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file));
return;
}
}
switch (node.kind) {
- case 246:
+ case 248:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file));
return;
- case 252:
+ case 254:
if (node.isExportEquals) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 271:
+ case 273:
var heritageClause = node;
- if (heritageClause.token === 108) {
+ if (heritageClause.token === 109) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 239:
+ case 241:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file));
return;
- case 242:
+ case 244:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file));
return;
- case 240:
+ case 242:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file));
return;
- case 241:
+ case 243:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file));
return;
- case 211:
+ case 213:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file));
return;
- case 210:
+ case 212:
diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file));
return;
- case 192:
+ case 194:
ts.Debug.fail();
}
var prevParent = parent;
@@ -69850,46 +70881,46 @@ var ts;
diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning));
}
switch (parent.kind) {
- case 238:
- case 154:
- case 153:
- case 155:
+ case 240:
case 156:
+ case 155:
case 157:
- case 194:
- case 237:
- case 195:
+ case 158:
+ case 159:
+ case 196:
+ case 239:
+ case 197:
if (nodes === parent.typeParameters) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file));
return;
}
- case 217:
+ case 219:
if (nodes === parent.modifiers) {
- return checkModifiers(nodes, parent.kind === 217);
+ return checkModifiers(nodes, parent.kind === 219);
}
break;
- case 152:
+ case 154:
if (nodes === parent.modifiers) {
for (var _i = 0, _a = nodes; _i < _a.length; _i++) {
var modifier = _a[_i];
- if (modifier.kind !== 115) {
+ if (modifier.kind !== 116) {
diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
}
}
return;
}
break;
- case 149:
+ case 151:
if (nodes === parent.modifiers) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 189:
- case 190:
- case 209:
- case 259:
- case 260:
+ case 191:
+ case 192:
+ case 211:
+ case 261:
+ case 262:
if (nodes === parent.typeArguments) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file));
return;
@@ -69905,21 +70936,21 @@ var ts;
for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) {
var modifier = modifiers_1[_i];
switch (modifier.kind) {
- case 76:
+ case 77:
if (isConstValid) {
continue;
}
- case 114:
- case 112:
+ case 115:
case 113:
- case 132:
- case 124:
- case 117:
+ case 114:
+ case 133:
+ case 125:
+ case 118:
diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
break;
- case 115:
- case 84:
- case 79:
+ case 116:
+ case 85:
+ case 80:
}
}
}
@@ -69964,10 +70995,22 @@ var ts;
return sourceFile.isDeclarationFile ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}
function getOptionsDiagnostics() {
- return ts.sortAndDeduplicateDiagnostics(ts.concatenate(fileProcessingDiagnostics.getGlobalDiagnostics(), ts.concatenate(programDiagnostics.getGlobalDiagnostics(), options.configFile ? programDiagnostics.getDiagnostics(options.configFile.fileName) : [])));
+ return ts.sortAndDeduplicateDiagnostics(ts.concatenate(fileProcessingDiagnostics.getGlobalDiagnostics(), ts.concatenate(programDiagnostics.getGlobalDiagnostics(), getOptionsDiagnosticsOfConfigFile())));
+ }
+ function getOptionsDiagnosticsOfConfigFile() {
+ if (!options.configFile) {
+ return ts.emptyArray;
+ }
+ var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName);
+ forEachResolvedProjectReference(function (resolvedRef) {
+ if (resolvedRef) {
+ diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName));
+ }
+ });
+ return diagnostics;
}
function getGlobalDiagnostics() {
- return ts.sortAndDeduplicateDiagnostics(getDiagnosticsProducingTypeChecker().getGlobalDiagnostics().slice());
+ return rootNames.length ? ts.sortAndDeduplicateDiagnostics(getDiagnosticsProducingTypeChecker().getGlobalDiagnostics().slice()) : ts.emptyArray;
}
function getConfigFileParsingDiagnostics() {
return configFileParsingDiagnostics || ts.emptyArray;
@@ -69979,9 +71022,9 @@ var ts;
return a.fileName === b.fileName;
}
function moduleNameIsEqualTo(a, b) {
- return a.kind === 71
- ? b.kind === 71 && a.escapedText === b.escapedText
- : b.kind === 9 && a.text === b.text;
+ return a.kind === 72
+ ? b.kind === 72 && a.escapedText === b.escapedText
+ : b.kind === 10 && a.text === b.text;
}
function collectExternalModuleReferences(file) {
if (file.imports) {
@@ -70005,12 +71048,9 @@ var ts;
for (var _i = 0, _a = file.statements; _i < _a.length; _i++) {
var node = _a[_i];
collectModuleReferences(node, false);
- if ((file.flags & 524288) || isJavaScriptFile) {
- collectDynamicImportOrRequireCalls(node);
- }
}
if ((file.flags & 524288) || isJavaScriptFile) {
- collectDynamicImportOrRequireCalls(file.endOfFileToken);
+ collectDynamicImportOrRequireCalls(file);
}
file.imports = imports || ts.emptyArray;
file.moduleAugmentations = moduleAugmentations || ts.emptyArray;
@@ -70044,23 +71084,35 @@ var ts;
}
}
}
- function collectDynamicImportOrRequireCalls(node) {
- if (ts.isRequireCall(node, true)) {
- imports = ts.append(imports, node.arguments[0]);
- }
- else if (ts.isImportCall(node) && node.arguments.length === 1 && ts.isStringLiteralLike(node.arguments[0])) {
- imports = ts.append(imports, node.arguments[0]);
- }
- else if (ts.isLiteralImportTypeNode(node)) {
- imports = ts.append(imports, node.argument.literal);
- }
- collectDynamicImportOrRequireCallsForEachChild(node);
- if (ts.hasJSDocNodes(node)) {
- ts.forEach(node.jsDoc, collectDynamicImportOrRequireCallsForEachChild);
+ function collectDynamicImportOrRequireCalls(file) {
+ var r = /import|require/g;
+ while (r.exec(file.text) !== null) {
+ var node = getNodeAtPosition(file, r.lastIndex);
+ if (ts.isRequireCall(node, true)) {
+ imports = ts.append(imports, node.arguments[0]);
+ }
+ else if (ts.isImportCall(node) && node.arguments.length === 1 && ts.isStringLiteralLike(node.arguments[0])) {
+ imports = ts.append(imports, node.arguments[0]);
+ }
+ else if (ts.isLiteralImportTypeNode(node)) {
+ imports = ts.append(imports, node.argument.literal);
+ }
}
}
- function collectDynamicImportOrRequireCallsForEachChild(node) {
- ts.forEachChild(node, collectDynamicImportOrRequireCalls);
+ function getNodeAtPosition(sourceFile, position) {
+ var current = sourceFile;
+ var getContainingChild = function (child) {
+ if (child.pos <= position && (position < child.end || (position === child.end && (child.kind === 1)))) {
+ return child;
+ }
+ };
+ while (true) {
+ var child = isJavaScriptFile && ts.hasJSDocNodes(current) && ts.forEach(current.jsDoc, getContainingChild) || ts.forEachChild(current, getContainingChild);
+ if (!child) {
+ return current;
+ }
+ current = child;
+ }
}
}
function getLibFileFromReference(ref) {
@@ -70205,7 +71257,7 @@ var ts;
if (fileFromPackageId) {
var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path, toPath(fileName), originalFileName);
redirectTargetsMap.add(fileFromPackageId.path, fileName);
- filesByName.set(path, dupFile);
+ addFileToFilesByName(dupFile, path, redirectedPath);
sourceFileToPackageName.set(path, packageId.name);
processingOtherFiles.push(dupFile);
return dupFile;
@@ -70215,10 +71267,7 @@ var ts;
sourceFileToPackageName.set(path, packageId.name);
}
}
- filesByName.set(path, file);
- if (redirectedPath) {
- filesByName.set(redirectedPath, file);
- }
+ addFileToFilesByName(file, path, redirectedPath);
if (file) {
sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);
file.path = path;
@@ -70250,20 +71299,73 @@ var ts;
}
return file;
}
+ function addFileToFilesByName(file, path, redirectedPath) {
+ filesByName.set(path, file);
+ if (redirectedPath) {
+ filesByName.set(redirectedPath, file);
+ }
+ }
function getProjectReferenceRedirect(fileName) {
- if (!projectReferenceRedirects || ts.fileExtensionIs(fileName, ".d.ts") || !ts.fileExtensionIsOneOf(fileName, ts.supportedTSExtensions)) {
+ if (!resolvedProjectReferences || !resolvedProjectReferences.length || ts.fileExtensionIs(fileName, ".d.ts") || !ts.fileExtensionIsOneOf(fileName, ts.supportedTSExtensions)) {
return undefined;
}
- return ts.forEach(projectReferenceRedirects, function (referencedProject) {
- if (!ts.contains(referencedProject.fileNames, fileName, isSameFile)) {
+ var referencedProject = getResolvedProjectReferenceToRedirect(fileName);
+ if (!referencedProject) {
+ return undefined;
+ }
+ var out = referencedProject.commandLine.options.outFile || referencedProject.commandLine.options.out;
+ return out ?
+ ts.changeExtension(out, ".d.ts") :
+ ts.getOutputDeclarationFileName(fileName, referencedProject.commandLine);
+ }
+ function getResolvedProjectReferenceToRedirect(fileName) {
+ return forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) {
+ if (!referencedProject ||
+ toPath(options.configFilePath) === referenceProjectPath ||
+ !ts.contains(referencedProject.commandLine.fileNames, fileName, isSameFile)) {
return undefined;
}
- var out = referencedProject.options.outFile || referencedProject.options.out;
- return out ?
- ts.changeExtension(out, ".d.ts") :
- ts.getOutputDeclarationFileName(fileName, referencedProject);
+ return referencedProject;
});
}
+ function forEachResolvedProjectReference(cb) {
+ return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) {
+ var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index];
+ var resolvedRefPath = toPath(resolveProjectReferencePath(ref));
+ return cb(resolvedRef, resolvedRefPath);
+ });
+ }
+ function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
+ var seenResolvedRefs;
+ return worker(projectReferences, resolvedProjectReferences, undefined, cbResolvedRef, cbRef);
+ function worker(projectReferences, resolvedProjectReferences, parent, cbResolvedRef, cbRef) {
+ if (cbRef) {
+ var result = cbRef(projectReferences, parent);
+ if (result) {
+ return result;
+ }
+ }
+ return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) {
+ if (ts.contains(seenResolvedRefs, resolvedRef)) {
+ return undefined;
+ }
+ var result = cbResolvedRef(resolvedRef, index, parent);
+ if (result) {
+ return result;
+ }
+ if (!resolvedRef)
+ return undefined;
+ (seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef);
+ return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef, cbResolvedRef, cbRef);
+ });
+ }
+ }
+ function getResolvedProjectReferenceByPath(projectReferencePath) {
+ if (!projectReferenceRedirects) {
+ return undefined;
+ }
+ return projectReferenceRedirects.get(projectReferencePath) || undefined;
+ }
function processReferencedFiles(file, isDefaultLib) {
ts.forEach(file.referencedFiles, function (ref) {
var referencedFileName = resolveTripleslashReference(ref.fileName, file.originalFileName);
@@ -70275,7 +71377,7 @@ var ts;
if (!typeDirectives) {
return;
}
- var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName);
+ var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName, getResolvedProjectReferenceToRedirect(file.originalFileName));
for (var i = 0; i < typeDirectives.length; i++) {
var ref = file.typeReferenceDirectives[i];
var resolvedTypeReferenceDirective = resolutions[i];
@@ -70291,6 +71393,8 @@ var ts;
}
var saveResolution = true;
if (resolvedTypeReferenceDirective) {
+ if (resolvedTypeReferenceDirective.isExternalLibraryImport)
+ currentNodeModulesDepth++;
if (resolvedTypeReferenceDirective.primary) {
processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, false, resolvedTypeReferenceDirective.packageId, refFile, refPos, refEnd);
}
@@ -70308,6 +71412,8 @@ var ts;
processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, false, false, resolvedTypeReferenceDirective.packageId, refFile, refPos, refEnd);
}
}
+ if (resolvedTypeReferenceDirective.isExternalLibraryImport)
+ currentNodeModulesDepth--;
}
else {
fileProcessingDiagnostics.add(createDiagnostic(refFile, refPos, refEnd, ts.Diagnostics.Cannot_find_type_definition_file_for_0, typeReferenceDirective));
@@ -70350,8 +71456,7 @@ var ts;
collectExternalModuleReferences(file);
if (file.imports.length || file.moduleAugmentations.length) {
var moduleNames = getModuleNames(file);
- var oldProgramState = { program: oldProgram, oldSourceFile: oldProgram && oldProgram.getSourceFile(file.fileName), modifiedFilePaths: modifiedFilePaths };
- var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file, oldProgramState);
+ var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file);
ts.Debug.assert(resolutions.length === moduleNames.length);
for (var i = 0; i < moduleNames.length; i++) {
var resolution = resolutions[i];
@@ -70411,18 +71516,32 @@ var ts;
return allFilesBelongToPath;
}
function parseProjectReferenceConfigFile(ref) {
+ if (!projectReferenceRedirects) {
+ projectReferenceRedirects = ts.createMap();
+ }
var refPath = resolveProjectReferencePath(ref);
+ var sourceFilePath = toPath(refPath);
+ var fromCache = projectReferenceRedirects.get(sourceFilePath);
+ if (fromCache !== undefined) {
+ return fromCache || undefined;
+ }
var basePath = ts.getNormalizedAbsolutePath(ts.getDirectoryPath(refPath), host.getCurrentDirectory());
var sourceFile = host.getSourceFile(refPath, 100);
+ addFileToFilesByName(sourceFile, sourceFilePath, undefined);
if (sourceFile === undefined) {
+ projectReferenceRedirects.set(sourceFilePath, false);
return undefined;
}
- sourceFile.path = toPath(refPath);
+ sourceFile.path = sourceFilePath;
+ sourceFile.resolvedPath = sourceFilePath;
+ sourceFile.originalFileName = refPath;
var commandLine = ts.parseJsonSourceFileConfigFileContent(sourceFile, configParsingHost, basePath, undefined, refPath);
- return { commandLine: commandLine, sourceFile: sourceFile };
- }
- function addProjectReferenceRedirects(referencedProject) {
- (projectReferenceRedirects || (projectReferenceRedirects = [])).push(referencedProject);
+ var resolvedRef = { commandLine: commandLine, sourceFile: sourceFile };
+ projectReferenceRedirects.set(sourceFilePath, resolvedRef);
+ if (commandLine.projectReferences) {
+ resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile);
+ }
+ return resolvedRef;
}
function verifyCompilerOptions() {
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
@@ -70458,30 +71577,7 @@ var ts;
createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration");
}
}
- if (projectReferences) {
- for (var i = 0; i < projectReferences.length; i++) {
- var ref = projectReferences[i];
- var resolvedRefOpts = resolvedProjectReferences[i] && resolvedProjectReferences[i].commandLine.options;
- if (resolvedRefOpts === undefined) {
- createDiagnosticForReference(i, ts.Diagnostics.File_0_does_not_exist, ref.path);
- continue;
- }
- if (!resolvedRefOpts.composite) {
- createDiagnosticForReference(i, ts.Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path);
- }
- if (ref.prepend) {
- var out = resolvedRefOpts.outFile || resolvedRefOpts.out;
- if (out) {
- if (!host.fileExists(out)) {
- createDiagnosticForReference(i, ts.Diagnostics.Output_file_0_from_project_1_does_not_exist, out, ref.path);
- }
- }
- else {
- createDiagnosticForReference(i, ts.Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set, ref.path);
- }
- }
- }
- }
+ verifyProjectReferences();
if (options.composite) {
var sourceFiles = files.filter(function (f) { return !f.isDeclarationFile; });
if (rootNames.length < sourceFiles.length) {
@@ -70558,12 +71654,12 @@ var ts;
}
var languageVersion = options.target || 0;
var outFile = options.outFile || options.out;
- var firstNonAmbientExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) && !f.isDeclarationFile ? f : undefined; });
+ var firstNonAmbientExternalModuleSourceFile = ts.find(files, function (f) { return ts.isExternalModule(f) && !f.isDeclarationFile; });
if (options.isolatedModules) {
if (options.module === ts.ModuleKind.None && languageVersion < 2) {
createDiagnosticForOptionName(ts.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target");
}
- var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !f.isDeclarationFile ? f : undefined; });
+ var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !f.isDeclarationFile && f.scriptKind !== 6; });
if (firstNonExternalModuleSourceFile) {
var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided));
@@ -70594,7 +71690,7 @@ var ts;
options.sourceRoot ||
options.mapRoot) {
var dir = getCommonSourceDirectory();
- if (options.outDir && dir === "" && ts.forEach(files, function (file) { return ts.getRootLength(file.fileName) > 1; })) {
+ if (options.outDir && dir === "" && files.some(function (file) { return ts.getRootLength(file.fileName) > 1; })) {
createDiagnosticForOptionName(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir");
}
}
@@ -70658,6 +71754,34 @@ var ts;
}
}
}
+ function verifyProjectReferences() {
+ forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) {
+ var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index];
+ var parentFile = parent && parent.sourceFile;
+ if (!resolvedRef) {
+ createDiagnosticForReference(parentFile, index, ts.Diagnostics.File_0_not_found, ref.path);
+ return;
+ }
+ var options = resolvedRef.commandLine.options;
+ if (!options.composite) {
+ var inputs = parent ? parent.commandLine.fileNames : rootNames;
+ if (inputs.length) {
+ createDiagnosticForReference(parentFile, index, ts.Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path);
+ }
+ }
+ if (ref.prepend) {
+ var out = options.outFile || options.out;
+ if (out) {
+ if (!host.fileExists(out)) {
+ createDiagnosticForReference(parentFile, index, ts.Diagnostics.Output_file_0_from_project_1_does_not_exist, out, ref.path);
+ }
+ }
+ else {
+ createDiagnosticForReference(parentFile, index, ts.Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set, ref.path);
+ }
+ }
+ });
+ }
function createDiagnosticForOptionPathKeyValue(key, valueIndex, message, arg0, arg1, arg2) {
var needCompilerDiagnostic = true;
var pathsSyntax = getOptionPathsSyntax();
@@ -70708,10 +71832,10 @@ var ts;
function createOptionValueDiagnostic(option1, message, arg0) {
createDiagnosticForOption(false, option1, undefined, message, arg0);
}
- function createDiagnosticForReference(index, message, arg0, arg1) {
- var referencesSyntax = getProjectReferencesSyntax();
+ function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {
+ var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile || options.configFile, "references"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });
if (referencesSyntax && referencesSyntax.elements.length > index) {
- programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, referencesSyntax.elements[index], message, arg0, arg1));
+ programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1));
}
else {
programDiagnostics.add(ts.createCompilerDiagnostic(message, arg0, arg1));
@@ -70725,22 +71849,6 @@ var ts;
programDiagnostics.add(ts.createCompilerDiagnostic(message, arg0, arg1, arg2));
}
}
- function getProjectReferencesSyntax() {
- if (_referencesArrayLiteralSyntax === undefined) {
- _referencesArrayLiteralSyntax = null;
- if (options.configFile) {
- var jsonObjectLiteral = ts.getTsConfigObjectLiteralExpression(options.configFile);
- for (var _i = 0, _a = ts.getPropertyAssignment(jsonObjectLiteral, "references"); _i < _a.length; _i++) {
- var prop = _a[_i];
- if (ts.isArrayLiteralExpression(prop.initializer)) {
- _referencesArrayLiteralSyntax = prop.initializer;
- break;
- }
- }
- }
- }
- return _referencesArrayLiteralSyntax;
- }
function getCompilerOptionsObjectLiteralSyntax() {
if (_compilerOptionsObjectLiteralSyntax === undefined) {
_compilerOptionsObjectLiteralSyntax = null;
@@ -70809,7 +71917,8 @@ var ts;
readFile: function (f) { return host.readFile(f); },
useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
- onUnRecoverableConfigFileDiagnostic: function () { return undefined; }
+ onUnRecoverableConfigFileDiagnostic: function () { return undefined; },
+ trace: host.trace ? function (s) { return host.trace(s); } : undefined
};
}
ts.parseConfigHostFromCompilerHost = parseConfigHostFromCompilerHost;
@@ -70852,7 +71961,7 @@ var ts;
var res = imports.map(function (i) { return i.text; });
for (var _i = 0, moduleAugmentations_1 = moduleAugmentations; _i < moduleAugmentations_1.length; _i++) {
var aug = moduleAugmentations_1[_i];
- if (aug.kind === 9) {
+ if (aug.kind === 10) {
res.push(aug.text);
}
}
@@ -71029,6 +72138,10 @@ var ts;
var latestSignature;
if (sourceFile.isDeclarationFile) {
latestSignature = sourceFile.version;
+ if (exportedModulesMapCache && latestSignature !== prevSignature) {
+ var references = state.referencedMap ? state.referencedMap.get(sourceFile.path) : undefined;
+ exportedModulesMapCache.set(sourceFile.path, references || false);
+ }
}
else {
var emitOutput = ts.getFileEmitOutput(programOfThisState, sourceFile, true, cancellationToken);
@@ -71082,7 +72195,7 @@ var ts;
if (compilerOptions.outFile || compilerOptions.out) {
return getAllFileNames(state, programOfThisState);
}
- if (!state.referencedMap || (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile))) {
+ if (!state.referencedMap || isFileAffectingGlobalScope(sourceFile)) {
return getAllFileNames(state, programOfThisState);
}
var seenMap = ts.createMap();
@@ -71128,6 +72241,13 @@ var ts;
}
return true;
}
+ function containsGlobalScopeAugmentation(sourceFile) {
+ return ts.some(sourceFile.moduleAugmentations, function (augmentation) { return ts.isGlobalScopeAugmentation(augmentation.parent); });
+ }
+ function isFileAffectingGlobalScope(sourceFile) {
+ return containsGlobalScopeAugmentation(sourceFile) ||
+ !ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile);
+ }
function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) {
if (state.allFilesExcludingDefaultLibraryFile) {
return state.allFilesExcludingDefaultLibraryFile;
@@ -71156,7 +72276,7 @@ var ts;
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
}
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {
- if (!ts.isExternalModule(sourceFileWithUpdatedShape) && !containsOnlyAmbientModules(sourceFileWithUpdatedShape)) {
+ if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
}
var compilerOptions = programOfThisState.getCompilerOptions();
@@ -71194,8 +72314,9 @@ var ts;
}
state.changedFilesSet = ts.createMap();
var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);
+ var oldCompilerOptions = useOldState ? oldState.program.getCompilerOptions() : undefined;
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
- !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldState.program.getCompilerOptions());
+ !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
if (useOldState) {
if (!oldState.currentChangedFilePath) {
ts.Debug.assert(!oldState.affectedFiles && (!oldState.currentAffectedFilesSignatures || !oldState.currentAffectedFilesSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated");
@@ -71207,6 +72328,8 @@ var ts;
}
var referencedMap = state.referencedMap;
var oldReferencedMap = useOldState ? oldState.referencedMap : undefined;
+ var copyDeclarationFileDiagnostics = canCopySemanticDiagnostics && !compilerOptions.skipLibCheck === !oldCompilerOptions.skipLibCheck;
+ var copyLibFileDiagnostics = copyDeclarationFileDiagnostics && !compilerOptions.skipDefaultLibCheck === !oldCompilerOptions.skipDefaultLibCheck;
state.fileInfos.forEach(function (info, sourceFilePath) {
var oldInfo;
var newReferences;
@@ -71218,6 +72341,13 @@ var ts;
state.changedFilesSet.set(sourceFilePath, true);
}
else if (canCopySemanticDiagnostics) {
+ var sourceFile = state.program.getSourceFileByPath(sourceFilePath);
+ if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics) {
+ return;
+ }
+ if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics) {
+ return;
+ }
var diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
if (diagnostics) {
state.semanticDiagnosticsPerFile.set(sourceFilePath, diagnostics);
@@ -71279,31 +72409,64 @@ var ts;
if (removeSemanticDiagnosticsOf(state, affectedFile.path)) {
return;
}
+ if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles && !state.cleanedDiagnosticsOfLibFiles) {
+ state.cleanedDiagnosticsOfLibFiles = true;
+ var options_2 = state.program.getCompilerOptions();
+ if (ts.forEach(state.program.getSourceFiles(), function (f) {
+ return state.program.isSourceFileDefaultLibrary(f) &&
+ !ts.skipTypeChecking(f, options_2) &&
+ removeSemanticDiagnosticsOf(state, f.path);
+ })) {
+ return;
+ }
+ }
if (!state.exportedModulesMap || state.affectedFiles.length === 1 || !state.changedFilesSet.has(affectedFile.path)) {
return;
}
ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
+ var seenFileAndExportsOfFile = ts.createMap();
if (ts.forEachEntry(state.currentAffectedFilesExportedModulesMap, function (exportedModules, exportedFromPath) {
return exportedModules &&
exportedModules.has(affectedFile.path) &&
- removeSemanticDiagnosticsOfFilesReferencingPath(state, exportedFromPath);
+ removeSemanticDiagnosticsOfFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile);
})) {
return;
}
ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) {
return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) &&
exportedModules.has(affectedFile.path) &&
- removeSemanticDiagnosticsOfFilesReferencingPath(state, exportedFromPath);
+ removeSemanticDiagnosticsOfFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile);
});
}
- function removeSemanticDiagnosticsOfFilesReferencingPath(state, referencedPath) {
+ function removeSemanticDiagnosticsOfFilesReferencingPath(state, referencedPath, seenFileAndExportsOfFile) {
return ts.forEachEntry(state.referencedMap, function (referencesInFile, filePath) {
- return referencesInFile.has(referencedPath) && removeSemanticDiagnosticsOf(state, filePath);
+ return referencesInFile.has(referencedPath) && removeSemanticDiagnosticsOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile);
+ });
+ }
+ function removeSemanticDiagnosticsOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile) {
+ if (!ts.addToSeen(seenFileAndExportsOfFile, filePath)) {
+ return false;
+ }
+ if (removeSemanticDiagnosticsOf(state, filePath)) {
+ return true;
+ }
+ ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
+ if (ts.forEachEntry(state.currentAffectedFilesExportedModulesMap, function (exportedModules, exportedFromPath) {
+ return exportedModules &&
+ exportedModules.has(filePath) &&
+ removeSemanticDiagnosticsOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile);
+ })) {
+ return true;
+ }
+ return !!ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) {
+ return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) &&
+ exportedModules.has(filePath) &&
+ removeSemanticDiagnosticsOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile);
});
}
function removeSemanticDiagnosticsOf(state, path) {
if (!state.semanticDiagnosticsFromOldState) {
- return false;
+ return true;
}
state.semanticDiagnosticsFromOldState.delete(path);
state.semanticDiagnosticsPerFile.delete(path);
@@ -71513,6 +72676,10 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
+ function isPathInNodeModulesStartingWithDot(path) {
+ return ts.stringContains(path, "/node_modules/.");
+ }
+ ts.isPathInNodeModulesStartingWithDot = isPathInNodeModulesStartingWithDot;
ts.maxNumberOfFilesToIterateForInvalidation = 256;
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
var filesWithChangedSetOfUnresolvedImports;
@@ -71523,11 +72690,11 @@ var ts;
var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); });
var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost();
var resolvedModuleNames = ts.createMap();
- var perDirectoryResolvedModuleNames = ts.createMap();
- var nonRelaticeModuleNameCache = ts.createMap();
- var moduleResolutionCache = ts.createModuleResolutionCacheWithMaps(perDirectoryResolvedModuleNames, nonRelaticeModuleNameCache, getCurrentDirectory(), resolutionHost.getCanonicalFileName);
+ var perDirectoryResolvedModuleNames = ts.createCacheWithRedirects();
+ var nonRelativeModuleNameCache = ts.createCacheWithRedirects();
+ var moduleResolutionCache = ts.createModuleResolutionCacheWithMaps(perDirectoryResolvedModuleNames, nonRelativeModuleNameCache, getCurrentDirectory(), resolutionHost.getCanonicalFileName);
var resolvedTypeReferenceDirectives = ts.createMap();
- var perDirectoryResolvedTypeReferenceDirectives = ts.createMap();
+ var perDirectoryResolvedTypeReferenceDirectives = ts.createCacheWithRedirects();
var failedLookupDefaultExtensions = [".ts", ".tsx", ".js", ".jsx", ".json"];
var customFailedLookupPaths = ts.createMap();
var directoryWatchesOfFailedLookups = ts.createMap();
@@ -71542,6 +72709,7 @@ var ts;
resolveModuleNames: resolveModuleNames,
getResolvedModuleWithFailedLookupLocationsFromCache: getResolvedModuleWithFailedLookupLocationsFromCache,
resolveTypeReferenceDirectives: resolveTypeReferenceDirectives,
+ removeResolutionsFromProjectReferenceRedirects: removeResolutionsFromProjectReferenceRedirects,
removeResolutionsOfFile: removeResolutionsOfFile,
invalidateResolutionOfFile: invalidateResolutionOfFile,
setFilesWithInvalidatedNonRelativeUnresolvedImports: setFilesWithInvalidatedNonRelativeUnresolvedImports,
@@ -71599,7 +72767,7 @@ var ts;
}
function clearPerDirectoryResolutions() {
perDirectoryResolvedModuleNames.clear();
- nonRelaticeModuleNameCache.clear();
+ nonRelativeModuleNameCache.clear();
perDirectoryResolvedTypeReferenceDirectives.clear();
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);
nonRelativeExternalModuleResolutions.clear();
@@ -71615,8 +72783,8 @@ var ts;
}
});
}
- function resolveModuleName(moduleName, containingFile, compilerOptions, host) {
- var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache);
+ function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) {
+ var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference);
if (!resolutionHost.getGlobalCache) {
return primaryResult;
}
@@ -71629,10 +72797,11 @@ var ts;
}
return primaryResult;
}
- function resolveNamesWithLocalCache(names, containingFile, cache, perDirectoryCache, loader, getResolutionWithResolvedFileName, reusedNames, logChanges) {
+ function resolveNamesWithLocalCache(names, containingFile, redirectedReference, cache, perDirectoryCacheWithRedirects, loader, getResolutionWithResolvedFileName, shouldRetryResolution, reusedNames, logChanges) {
var path = resolutionHost.toPath(containingFile);
var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path);
var dirPath = ts.getDirectoryPath(path);
+ var perDirectoryCache = perDirectoryCacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
var perDirectoryResolution = perDirectoryCache.get(dirPath);
if (!perDirectoryResolution) {
perDirectoryResolution = ts.createMap();
@@ -71641,20 +72810,25 @@ var ts;
var resolvedModules = [];
var compilerOptions = resolutionHost.getCompilationSettings();
var hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);
+ var program = resolutionHost.getCurrentProgram();
+ var oldRedirect = program && program.getResolvedProjectReferenceToRedirect(containingFile);
+ var unmatchedRedirects = oldRedirect ?
+ !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path :
+ !!redirectedReference;
var seenNamesInFile = ts.createMap();
for (var _i = 0, names_2 = names; _i < names_2.length; _i++) {
var name = names_2[_i];
var resolution = resolutionsInFile.get(name);
if (!seenNamesInFile.has(name) &&
- allFilesHaveInvalidatedResolution || !resolution || resolution.isInvalidated ||
- (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && !getResolutionWithResolvedFileName(resolution))) {
+ allFilesHaveInvalidatedResolution || unmatchedRedirects || !resolution || resolution.isInvalidated ||
+ (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) {
var existingResolution = resolution;
var resolutionInDirectory = perDirectoryResolution.get(name);
if (resolutionInDirectory) {
resolution = resolutionInDirectory;
}
else {
- resolution = loader(name, containingFile, compilerOptions, resolutionHost);
+ resolution = loader(name, containingFile, compilerOptions, resolutionHost, redirectedReference);
perDirectoryResolution.set(name, resolution);
}
resolutionsInFile.set(name, resolution);
@@ -71696,11 +72870,11 @@ var ts;
return oldResult.resolvedFileName === newResult.resolvedFileName;
}
}
- function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile) {
- return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, undefined, false);
+ function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) {
+ return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, redirectedReference, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; }, undefined, false);
}
- function resolveModuleNames(moduleNames, containingFile, reusedNames) {
- return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChangesWhenResolvingModule);
+ function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) {
+ return resolveNamesWithLocalCache(moduleNames, containingFile, redirectedReference, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); }, reusedNames, logChangesWhenResolvingModule);
}
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) {
var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile));
@@ -71733,12 +72907,6 @@ var ts;
}
return true;
}
- function filterFSRootDirectoriesToWatch(watchPath, dirPath) {
- if (!canWatchDirectory(dirPath)) {
- watchPath.ignore = true;
- }
- return watchPath;
- }
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath) {
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
@@ -71754,12 +72922,12 @@ var ts;
return getDirectoryToWatchFromFailedLookupLocationDirectory(ts.getDirectoryPath(ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())), ts.getDirectoryPath(failedLookupLocationPath));
}
function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath) {
- while (ts.stringContains(dirPath, ts.nodeModulesPathPart)) {
+ while (ts.pathContainsNodeModules(dirPath)) {
dir = ts.getDirectoryPath(dir);
dirPath = ts.getDirectoryPath(dirPath);
}
if (isNodeModulesDirectory(dirPath)) {
- return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, ts.getDirectoryPath(dirPath));
+ return canWatchDirectory(ts.getDirectoryPath(dirPath)) ? { dir: dir, dirPath: dirPath } : undefined;
}
var nonRecursive = true;
var subDirectoryPath, subDirectory;
@@ -71776,7 +72944,7 @@ var ts;
dir = ts.getDirectoryPath(dir);
}
}
- return filterFSRootDirectoriesToWatch({ dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive: nonRecursive }, dirPath);
+ return canWatchDirectory(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive: nonRecursive } : undefined;
}
function isPathWithDefaultFailedLookupExtension(path) {
return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
@@ -71804,8 +72972,9 @@ var ts;
for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) {
var failedLookupLocation = failedLookupLocations_1[_i];
var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
- var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _a.dir, dirPath = _a.dirPath, nonRecursive = _a.nonRecursive, ignore = _a.ignore;
- if (!ignore) {
+ var toWatch = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
+ if (toWatch) {
+ var dir = toWatch.dir, dirPath = toWatch.dirPath, nonRecursive = toWatch.nonRecursive;
if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1);
@@ -71855,8 +73024,9 @@ var ts;
for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) {
var failedLookupLocation = failedLookupLocations_2[_i];
var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
- var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _a.dirPath, ignore = _a.ignore;
- if (!ignore) {
+ var toWatch = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
+ if (toWatch) {
+ var dirPath = toWatch.dirPath;
var refCount = customFailedLookupPaths.get(failedLookupLocationPath);
if (refCount) {
if (refCount === 1) {
@@ -71901,6 +73071,20 @@ var ts;
cache.delete(filePath);
}
}
+ function removeResolutionsFromProjectReferenceRedirects(filePath) {
+ if (!ts.fileExtensionIs(filePath, ".json")) {
+ return;
+ }
+ var program = resolutionHost.getCurrentProgram();
+ if (!program) {
+ return;
+ }
+ var resolvedProjectReference = program.getResolvedProjectReferenceByPath(filePath);
+ if (!resolvedProjectReference) {
+ return;
+ }
+ resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); });
+ }
function removeResolutionsOfFile(filePath) {
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath);
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath);
@@ -71955,6 +73139,8 @@ var ts;
isChangedFailedLookupLocation = function (location) { return isInDirectoryPath(fileOrDirectoryPath, resolutionHost.toPath(location)); };
}
else {
+ if (isPathInNodeModulesStartingWithDot(fileOrDirectoryPath))
+ return false;
var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath);
if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) ||
isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) {
@@ -71988,8 +73174,8 @@ var ts;
if (isInDirectoryPath(rootPath, typeRootPath)) {
return rootPath;
}
- var _a = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath), dirPath = _a.dirPath, ignore = _a.ignore;
- return !ignore && directoryWatchesOfFailedLookups.has(dirPath) ? dirPath : undefined;
+ var toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath);
+ return toWatch && directoryWatchesOfFailedLookups.has(toWatch.dirPath) ? toWatch.dirPath : undefined;
}
function createTypeRootsWatch(typeRootPath, typeRoot) {
return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) {
@@ -72440,6 +73626,23 @@ var ts;
return result;
}
ts.parseConfigFileWithSystem = parseConfigFileWithSystem;
+ function getErrorCountForSummary(diagnostics) {
+ return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
+ }
+ ts.getErrorCountForSummary = getErrorCountForSummary;
+ function getWatchErrorSummaryDiagnosticMessage(errorCount) {
+ return errorCount === 1 ?
+ ts.Diagnostics.Found_1_error_Watching_for_file_changes :
+ ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
+ }
+ ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
+ function getErrorSummaryText(errorCount, newLine) {
+ if (errorCount === 0)
+ return "";
+ var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
+ }
+ ts.getErrorSummaryText = getErrorSummaryText;
function emitFilesAndReportErrors(program, reportDiagnostic, writeFileName, reportSummary, writeFile) {
var diagnostics = program.getConfigFileParsingDiagnostics().slice();
var configFileParsingDiagnosticsLength = diagnostics.length;
@@ -72471,7 +73674,7 @@ var ts;
}
}
if (reportSummary) {
- reportSummary(diagnostics.filter(function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }).length);
+ reportSummary(getErrorCountForSummary(diagnostics));
}
if (emitSkipped && diagnostics.length > 0) {
return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
@@ -72544,15 +73747,7 @@ var ts;
function emitFilesAndReportErrorUsingBuilder(builderProgram) {
var compilerOptions = builderProgram.getCompilerOptions();
var newLine = ts.getNewLineCharacter(compilerOptions, function () { return system.newLine; });
- var reportSummary = function (errorCount) {
- if (errorCount === 1) {
- onWatchStatusChange(ts.createCompilerDiagnostic(ts.Diagnostics.Found_1_error_Watching_for_file_changes, errorCount), newLine, compilerOptions);
- }
- else {
- onWatchStatusChange(ts.createCompilerDiagnostic(ts.Diagnostics.Found_0_errors_Watching_for_file_changes, errorCount, errorCount), newLine, compilerOptions);
- }
- };
- emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName, reportSummary);
+ emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName, function (errorCount) { return onWatchStatusChange(ts.createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), newLine, compilerOptions); });
}
}
function reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic) {
@@ -72619,7 +73814,8 @@ var ts;
fileExists: function (path) { return host.fileExists(path); },
readFile: readFile,
getCurrentDirectory: getCurrentDirectory,
- onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic
+ onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic,
+ trace: host.trace ? function (s) { return host.trace(s); } : undefined
};
var newLine = updateNewLine();
if (configFileName && host.configFileParsingResult) {
@@ -72681,11 +73877,11 @@ var ts;
ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) :
currentDirectory, false);
compilerHost.resolveModuleNames = host.resolveModuleNames ?
- (function (moduleNames, containingFile, reusedNames) { return host.resolveModuleNames(moduleNames, containingFile, reusedNames); }) :
- (function (moduleNames, containingFile, reusedNames) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames); });
+ (function (moduleNames, containingFile, reusedNames, redirectedReference) { return host.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference); }) :
+ (function (moduleNames, containingFile, reusedNames, redirectedReference) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference); });
compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ?
- (function (typeDirectiveNames, containingFile) { return host.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); }) :
- (function (typeDirectiveNames, containingFile) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); });
+ (function (typeDirectiveNames, containingFile, redirectedReference) { return host.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference); }) :
+ (function (typeDirectiveNames, containingFile, redirectedReference) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference); });
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
synchronizeProgram();
watchConfigFileWildCardDirectories();
@@ -72843,8 +74039,8 @@ var ts;
var hostSourceFile = sourceFilesCache.get(path);
return !hostSourceFile || isFileMissingOnHost(hostSourceFile) ? undefined : hostSourceFile.version.toString();
}
- function onReleaseOldSourceFile(oldSourceFile, _oldOptions) {
- var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.path);
+ function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
+ var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
if (hostSourceFileInfo) {
if (isFileMissingOnHost(hostSourceFileInfo)) {
(missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path);
@@ -72853,8 +74049,10 @@ var ts;
if (hostSourceFileInfo.fileWatcher) {
hostSourceFileInfo.fileWatcher.close();
}
- sourceFilesCache.delete(oldSourceFile.path);
- resolutionCache.removeResolutionsOfFile(oldSourceFile.path);
+ sourceFilesCache.delete(oldSourceFile.resolvedPath);
+ if (!hasSourceFileByPath) {
+ resolutionCache.removeResolutionsOfFile(oldSourceFile.path);
+ }
}
}
}
@@ -72928,6 +74126,7 @@ var ts;
if (eventKind === ts.FileWatcherEventKind.Deleted && sourceFilesCache.get(path)) {
resolutionCache.invalidateResolutionOfFile(path);
}
+ resolutionCache.removeResolutionsFromProjectReferenceRedirects(path);
nextSourceFileVersion(path);
scheduleProgramUpdate();
}
@@ -72964,6 +74163,8 @@ var ts;
cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
}
nextSourceFileVersion(fileOrDirectoryPath);
+ if (ts.isPathInNodeModulesStartingWithDot(fileOrDirectoryPath))
+ return;
if (fileOrDirectoryPath !== directory && ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, compilerOptions)) {
writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
return;
@@ -73140,7 +74341,7 @@ var ts;
};
}
ts.createBuilderStatusReporter = createBuilderStatusReporter;
- function createSolutionBuilderHost(system, reportDiagnostic, reportSolutionBuilderStatus) {
+ function createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus) {
if (system === void 0) { system = ts.sys; }
var host = ts.createCompilerHostWorker({}, undefined, system);
host.getModifiedTime = system.getModifiedTime ? function (path) { return system.getModifiedTime(path); } : function () { return undefined; };
@@ -73150,10 +74351,15 @@ var ts;
host.reportSolutionBuilderStatus = reportSolutionBuilderStatus || createBuilderStatusReporter(system);
return host;
}
+ function createSolutionBuilderHost(system, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary) {
+ if (system === void 0) { system = ts.sys; }
+ var host = createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus);
+ host.reportErrorSummary = reportErrorSummary;
+ return host;
+ }
ts.createSolutionBuilderHost = createSolutionBuilderHost;
function createSolutionBuilderWithWatchHost(system, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus) {
- if (system === void 0) { system = ts.sys; }
- var host = createSolutionBuilderHost(system, reportDiagnostic, reportSolutionBuilderStatus);
+ var host = createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus);
var watchHost = ts.createWatchHost(system, reportWatchStatus);
host.onWatchStatusChange = watchHost.onWatchStatusChange;
host.watchFile = watchHost.watchFile;
@@ -73494,9 +74700,7 @@ var ts;
globalDependencyGraph = undefined;
}
projectStatus.removeKey(resolved);
- if (options.watch) {
- diagnostics.removeKey(resolved);
- }
+ diagnostics.removeKey(resolved);
addProjToQueue(resolved, reloadLevel);
}
function addProjToQueue(proj, reloadLevel) {
@@ -73555,15 +74759,20 @@ var ts;
}
}
function reportErrorSummary() {
- if (options.watch) {
+ if (options.watch || host.reportErrorSummary) {
getGlobalDependencyGraph().buildQueue.forEach(function (project) {
if (!projectErrorsReported.hasKey(project)) {
reportErrors(diagnostics.getValue(project) || ts.emptyArray);
}
});
var totalErrors_1 = 0;
- diagnostics.forEach(function (singleProjectErrors) { return totalErrors_1 += singleProjectErrors.filter(function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }).length; });
- reportWatchStatus(totalErrors_1 === 1 ? ts.Diagnostics.Found_1_error_Watching_for_file_changes : ts.Diagnostics.Found_0_errors_Watching_for_file_changes, totalErrors_1);
+ diagnostics.forEach(function (singleProjectErrors) { return totalErrors_1 += ts.getErrorCountForSummary(singleProjectErrors); });
+ if (options.watch) {
+ reportWatchStatus(ts.getWatchErrorSummaryDiagnosticMessage(totalErrors_1), totalErrors_1);
+ }
+ else {
+ host.reportErrorSummary(totalErrors_1);
+ }
}
}
function buildSingleInvalidatedProject(resolved, reloadLevel) {
@@ -73713,9 +74922,7 @@ var ts;
type: UpToDateStatusType.UpToDate,
newestDeclarationFileContentChangedTime: anyDtsChanged ? maximumDate : newestDeclarationFileContentChangedTime
};
- if (options.watch) {
- diagnostics.removeKey(proj);
- }
+ diagnostics.removeKey(proj);
projectStatus.setValue(proj, status);
return resultFlags;
function buildErrors(diagnostics, errorFlags, errorType) {
@@ -73834,10 +75041,8 @@ var ts;
}
function reportAndStoreErrors(proj, errors) {
reportErrors(errors);
- if (options.watch) {
- projectErrorsReported.setValue(proj, true);
- diagnostics.setValue(proj, errors);
- }
+ projectErrorsReported.setValue(proj, true);
+ diagnostics.setValue(proj, errors);
}
function reportErrors(errors) {
errors.forEach(function (err) { return host.reportDiagnostic(err); });
@@ -73942,10 +75147,12 @@ var ts;
if (builtin !== undefined)
return builtin;
var entries = getEntriesOfObject(value);
- return { kind: 3, name: name, members: ts.flatMap(entries, function (_a) {
- var key = _a.key, value = _a.value;
- return getValueInfo(key, value, recurser);
- }) };
+ var hasNontrivialPrototype = Object.getPrototypeOf(value) !== Object.prototype;
+ var members = ts.flatMap(entries, function (_a) {
+ var key = _a.key, value = _a.value;
+ return getValueInfo(key, value, recurser);
+ });
+ return { kind: 3, name: name, hasNontrivialPrototype: hasNontrivialPrototype, members: members };
}
return { kind: 0, name: name, typeName: isNullOrUndefined(value) ? "any" : typeof value };
}, function (isCircularReference, keyStack) { return anyValue(name, " " + (isCircularReference ? "Circular reference" : "Too-deep object hierarchy") + " from " + keyStack.join(".")); });
@@ -74145,6 +75352,11 @@ var ts;
var commandLineOptions = commandLine.options;
if (configFileName) {
var configParseResult = ts.parseConfigFileWithSystem(configFileName, commandLineOptions, ts.sys, reportDiagnostic); // TODO: GH#18217
+ if (commandLineOptions.showConfig) {
+ // tslint:disable-next-line:no-null-keyword
+ ts.sys.write(JSON.stringify(ts.convertToTSConfig(configParseResult, configFileName, ts.sys), null, 4) + ts.sys.newLine);
+ return ts.sys.exit(ts.ExitStatus.Success);
+ }
updateReportDiagnostic(configParseResult.options);
if (ts.isWatchSet(configParseResult.options)) {
reportWatchModeWithoutSysSupport();
@@ -74155,6 +75367,11 @@ var ts;
}
}
else {
+ if (commandLineOptions.showConfig) {
+ // tslint:disable-next-line:no-null-keyword
+ ts.sys.write(JSON.stringify(ts.convertToTSConfig(commandLine, ts.combinePaths(ts.sys.getCurrentDirectory(), "tsconfig.json"), ts.sys), null, 4) + ts.sys.newLine);
+ return ts.sys.exit(ts.ExitStatus.Success);
+ }
updateReportDiagnostic(commandLineOptions);
if (ts.isWatchSet(commandLineOptions)) {
reportWatchModeWithoutSysSupport();
@@ -74198,7 +75415,9 @@ var ts;
reportWatchModeWithoutSysSupport();
}
// TODO: change this to host if watch => watchHost otherwiue without wathc
- var builder = ts.createSolutionBuilder(ts.createSolutionBuilderWithWatchHost(ts.sys, reportDiagnostic, ts.createBuilderStatusReporter(ts.sys, shouldBePretty()), createWatchStatusReporter()), projects, buildOptions);
+ var builder = ts.createSolutionBuilder(buildOptions.watch ?
+ ts.createSolutionBuilderWithWatchHost(ts.sys, reportDiagnostic, ts.createBuilderStatusReporter(ts.sys, shouldBePretty()), createWatchStatusReporter()) :
+ ts.createSolutionBuilderHost(ts.sys, reportDiagnostic, ts.createBuilderStatusReporter(ts.sys, shouldBePretty()), createReportErrorSummary(buildOptions)), projects, buildOptions);
if (buildOptions.clean) {
return ts.sys.exit(builder.cleanAllProjects());
}
@@ -74208,6 +75427,11 @@ var ts;
}
return ts.sys.exit(builder.buildAllProjects());
}
+ function createReportErrorSummary(options) {
+ return shouldBePretty(options) ?
+ function (errorCount) { return ts.sys.write(ts.getErrorSummaryText(errorCount, ts.sys.newLine)); } :
+ undefined;
+ }
function performCompilation(rootNames, projectReferences, options, configFileParsingDiagnostics) {
var host = ts.createCompilerHost(options);
enableStatistics(options);
@@ -74219,7 +75443,7 @@ var ts;
configFileParsingDiagnostics: configFileParsingDiagnostics
};
var program = ts.createProgram(programOptions);
- var exitStatus = ts.emitFilesAndReportErrors(program, reportDiagnostic, function (s) { return ts.sys.write(s + ts.sys.newLine); });
+ var exitStatus = ts.emitFilesAndReportErrors(program, reportDiagnostic, function (s) { return ts.sys.write(s + ts.sys.newLine); }, createReportErrorSummary(options));
reportStatistics(program);
return ts.sys.exit(exitStatus);
}
diff --git a/lib/tsserver.js b/lib/tsserver.js
index ac46ae0c134..2e2de2b5623 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || (function () {
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
- }
+ };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
@@ -491,10 +491,33 @@ var ts;
return result;
}
ts.flatten = flatten;
+ /**
+ * Maps an array. If the mapped value is an array, it is spread into the result.
+ *
+ * @param array The array to map.
+ * @param mapfn The callback used to map the result into one or more values.
+ */
function flatMap(array, mapfn) {
var result;
if (array) {
- result = [];
+ for (var i = 0; i < array.length; i++) {
+ var v = mapfn(array[i], i);
+ if (v) {
+ if (isArray(v)) {
+ result = addRange(result, v);
+ }
+ else {
+ result = append(result, v);
+ }
+ }
+ }
+ }
+ return result || ts.emptyArray;
+ }
+ ts.flatMap = flatMap;
+ function flatMapToMutable(array, mapfn) {
+ var result = [];
+ if (array) {
for (var i = 0; i < array.length; i++) {
var v = mapfn(array[i], i);
if (v) {
@@ -509,7 +532,7 @@ var ts;
}
return result;
}
- ts.flatMap = flatMap;
+ ts.flatMapToMutable = flatMapToMutable;
function flatMapIterator(iter, mapfn) {
var first = iter.next();
if (first.done) {
@@ -748,7 +771,7 @@ var ts;
*/
function deduplicateSorted(array, comparer) {
if (array.length === 0)
- return [];
+ return ts.emptyArray;
var last = array[0];
var deduplicated = [last];
for (var i = 1; i < array.length; i++) {
@@ -779,7 +802,7 @@ var ts;
}
ts.insertSorted = insertSorted;
function sortAndDeduplicate(array, comparer, equalityComparer) {
- return deduplicateSorted(sort(array, comparer), equalityComparer || comparer);
+ return deduplicateSorted(sort(array, comparer), equalityComparer || comparer || compareStringsCaseSensitive);
}
ts.sortAndDeduplicate = sortAndDeduplicate;
function arrayIsEqualTo(array1, array2, equalityComparer) {
@@ -932,7 +955,7 @@ var ts;
* Returns a new sorted array.
*/
function sort(array, comparer) {
- return array.slice().sort(comparer);
+ return (array.length === 0 ? array : array.slice().sort(comparer));
}
ts.sort = sort;
function arrayIterator(array) {
@@ -1038,12 +1061,25 @@ var ts;
* @param offset An offset into `array` at which to start the search.
*/
function binarySearch(array, value, keySelector, keyComparer, offset) {
- if (!array || array.length === 0) {
+ return binarySearchKey(array, keySelector(value), keySelector, keyComparer, offset);
+ }
+ ts.binarySearch = binarySearch;
+ /**
+ * Performs a binary search, finding the index at which an object with `key` occurs in `array`.
+ * If no such index is found, returns the 2's-complement of first index at which
+ * `array[index]` exceeds `key`.
+ * @param array A sorted array whose first element must be no larger than number
+ * @param key The key to be searched for in the array.
+ * @param keySelector A callback used to select the search key from each element of `array`.
+ * @param keyComparer A callback used to compare two keys in a sorted array.
+ * @param offset An offset into `array` at which to start the search.
+ */
+ function binarySearchKey(array, key, keySelector, keyComparer, offset) {
+ if (!some(array)) {
return -1;
}
var low = offset || 0;
var high = array.length - 1;
- var key = keySelector(value);
while (low <= high) {
var middle = low + ((high - low) >> 1);
var midKey = keySelector(array[middle]);
@@ -1060,7 +1096,7 @@ var ts;
}
return ~low;
}
- ts.binarySearch = binarySearch;
+ ts.binarySearchKey = binarySearchKey;
function reduceLeft(array, f, initial, start, count) {
if (array && array.length > 0) {
var size = array.length;
@@ -1984,6 +2020,33 @@ var ts;
var counts;
var marks;
var measures;
+ function createTimerIf(condition, measureName, startMarkName, endMarkName) {
+ return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer;
+ }
+ performance.createTimerIf = createTimerIf;
+ function createTimer(measureName, startMarkName, endMarkName) {
+ var enterCount = 0;
+ return {
+ enter: enter,
+ exit: exit
+ };
+ function enter() {
+ if (++enterCount === 1) {
+ mark(startMarkName);
+ }
+ }
+ function exit() {
+ if (--enterCount === 0) {
+ mark(endMarkName);
+ measure(measureName, startMarkName, endMarkName);
+ }
+ else if (enterCount < 0) {
+ ts.Debug.fail("enter/exit count does not match.");
+ }
+ }
+ }
+ performance.createTimer = createTimer;
+ performance.nullTimer = { enter: ts.noop, exit: ts.noop };
/**
* Marks a performance event.
*
@@ -2438,368 +2501,370 @@ var ts;
SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia";
// Literals
SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral";
- SyntaxKind[SyntaxKind["StringLiteral"] = 9] = "StringLiteral";
- SyntaxKind[SyntaxKind["JsxText"] = 10] = "JsxText";
- SyntaxKind[SyntaxKind["JsxTextAllWhiteSpaces"] = 11] = "JsxTextAllWhiteSpaces";
- SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral";
- SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 13] = "NoSubstitutionTemplateLiteral";
+ SyntaxKind[SyntaxKind["BigIntLiteral"] = 9] = "BigIntLiteral";
+ SyntaxKind[SyntaxKind["StringLiteral"] = 10] = "StringLiteral";
+ SyntaxKind[SyntaxKind["JsxText"] = 11] = "JsxText";
+ SyntaxKind[SyntaxKind["JsxTextAllWhiteSpaces"] = 12] = "JsxTextAllWhiteSpaces";
+ SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 13] = "RegularExpressionLiteral";
+ SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 14] = "NoSubstitutionTemplateLiteral";
// Pseudo-literals
- SyntaxKind[SyntaxKind["TemplateHead"] = 14] = "TemplateHead";
- SyntaxKind[SyntaxKind["TemplateMiddle"] = 15] = "TemplateMiddle";
- SyntaxKind[SyntaxKind["TemplateTail"] = 16] = "TemplateTail";
+ SyntaxKind[SyntaxKind["TemplateHead"] = 15] = "TemplateHead";
+ SyntaxKind[SyntaxKind["TemplateMiddle"] = 16] = "TemplateMiddle";
+ SyntaxKind[SyntaxKind["TemplateTail"] = 17] = "TemplateTail";
// Punctuation
- SyntaxKind[SyntaxKind["OpenBraceToken"] = 17] = "OpenBraceToken";
- SyntaxKind[SyntaxKind["CloseBraceToken"] = 18] = "CloseBraceToken";
- SyntaxKind[SyntaxKind["OpenParenToken"] = 19] = "OpenParenToken";
- SyntaxKind[SyntaxKind["CloseParenToken"] = 20] = "CloseParenToken";
- SyntaxKind[SyntaxKind["OpenBracketToken"] = 21] = "OpenBracketToken";
- SyntaxKind[SyntaxKind["CloseBracketToken"] = 22] = "CloseBracketToken";
- SyntaxKind[SyntaxKind["DotToken"] = 23] = "DotToken";
- SyntaxKind[SyntaxKind["DotDotDotToken"] = 24] = "DotDotDotToken";
- SyntaxKind[SyntaxKind["SemicolonToken"] = 25] = "SemicolonToken";
- SyntaxKind[SyntaxKind["CommaToken"] = 26] = "CommaToken";
- SyntaxKind[SyntaxKind["LessThanToken"] = 27] = "LessThanToken";
- SyntaxKind[SyntaxKind["LessThanSlashToken"] = 28] = "LessThanSlashToken";
- SyntaxKind[SyntaxKind["GreaterThanToken"] = 29] = "GreaterThanToken";
- SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 30] = "LessThanEqualsToken";
- SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 31] = "GreaterThanEqualsToken";
- SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 32] = "EqualsEqualsToken";
- SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 33] = "ExclamationEqualsToken";
- SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 34] = "EqualsEqualsEqualsToken";
- SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 35] = "ExclamationEqualsEqualsToken";
- SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 36] = "EqualsGreaterThanToken";
- SyntaxKind[SyntaxKind["PlusToken"] = 37] = "PlusToken";
- SyntaxKind[SyntaxKind["MinusToken"] = 38] = "MinusToken";
- SyntaxKind[SyntaxKind["AsteriskToken"] = 39] = "AsteriskToken";
- SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 40] = "AsteriskAsteriskToken";
- SyntaxKind[SyntaxKind["SlashToken"] = 41] = "SlashToken";
- SyntaxKind[SyntaxKind["PercentToken"] = 42] = "PercentToken";
- SyntaxKind[SyntaxKind["PlusPlusToken"] = 43] = "PlusPlusToken";
- SyntaxKind[SyntaxKind["MinusMinusToken"] = 44] = "MinusMinusToken";
- SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 45] = "LessThanLessThanToken";
- SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 46] = "GreaterThanGreaterThanToken";
- SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 47] = "GreaterThanGreaterThanGreaterThanToken";
- SyntaxKind[SyntaxKind["AmpersandToken"] = 48] = "AmpersandToken";
- SyntaxKind[SyntaxKind["BarToken"] = 49] = "BarToken";
- SyntaxKind[SyntaxKind["CaretToken"] = 50] = "CaretToken";
- SyntaxKind[SyntaxKind["ExclamationToken"] = 51] = "ExclamationToken";
- SyntaxKind[SyntaxKind["TildeToken"] = 52] = "TildeToken";
- SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 53] = "AmpersandAmpersandToken";
- SyntaxKind[SyntaxKind["BarBarToken"] = 54] = "BarBarToken";
- SyntaxKind[SyntaxKind["QuestionToken"] = 55] = "QuestionToken";
- SyntaxKind[SyntaxKind["ColonToken"] = 56] = "ColonToken";
- SyntaxKind[SyntaxKind["AtToken"] = 57] = "AtToken";
+ SyntaxKind[SyntaxKind["OpenBraceToken"] = 18] = "OpenBraceToken";
+ SyntaxKind[SyntaxKind["CloseBraceToken"] = 19] = "CloseBraceToken";
+ SyntaxKind[SyntaxKind["OpenParenToken"] = 20] = "OpenParenToken";
+ SyntaxKind[SyntaxKind["CloseParenToken"] = 21] = "CloseParenToken";
+ SyntaxKind[SyntaxKind["OpenBracketToken"] = 22] = "OpenBracketToken";
+ SyntaxKind[SyntaxKind["CloseBracketToken"] = 23] = "CloseBracketToken";
+ SyntaxKind[SyntaxKind["DotToken"] = 24] = "DotToken";
+ SyntaxKind[SyntaxKind["DotDotDotToken"] = 25] = "DotDotDotToken";
+ SyntaxKind[SyntaxKind["SemicolonToken"] = 26] = "SemicolonToken";
+ SyntaxKind[SyntaxKind["CommaToken"] = 27] = "CommaToken";
+ SyntaxKind[SyntaxKind["LessThanToken"] = 28] = "LessThanToken";
+ SyntaxKind[SyntaxKind["LessThanSlashToken"] = 29] = "LessThanSlashToken";
+ SyntaxKind[SyntaxKind["GreaterThanToken"] = 30] = "GreaterThanToken";
+ SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 31] = "LessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 32] = "GreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 33] = "EqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 34] = "ExclamationEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 35] = "EqualsEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 36] = "ExclamationEqualsEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 37] = "EqualsGreaterThanToken";
+ SyntaxKind[SyntaxKind["PlusToken"] = 38] = "PlusToken";
+ SyntaxKind[SyntaxKind["MinusToken"] = 39] = "MinusToken";
+ SyntaxKind[SyntaxKind["AsteriskToken"] = 40] = "AsteriskToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 41] = "AsteriskAsteriskToken";
+ SyntaxKind[SyntaxKind["SlashToken"] = 42] = "SlashToken";
+ SyntaxKind[SyntaxKind["PercentToken"] = 43] = "PercentToken";
+ SyntaxKind[SyntaxKind["PlusPlusToken"] = 44] = "PlusPlusToken";
+ SyntaxKind[SyntaxKind["MinusMinusToken"] = 45] = "MinusMinusToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 46] = "LessThanLessThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 47] = "GreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 48] = "GreaterThanGreaterThanGreaterThanToken";
+ SyntaxKind[SyntaxKind["AmpersandToken"] = 49] = "AmpersandToken";
+ SyntaxKind[SyntaxKind["BarToken"] = 50] = "BarToken";
+ SyntaxKind[SyntaxKind["CaretToken"] = 51] = "CaretToken";
+ SyntaxKind[SyntaxKind["ExclamationToken"] = 52] = "ExclamationToken";
+ SyntaxKind[SyntaxKind["TildeToken"] = 53] = "TildeToken";
+ SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 54] = "AmpersandAmpersandToken";
+ SyntaxKind[SyntaxKind["BarBarToken"] = 55] = "BarBarToken";
+ SyntaxKind[SyntaxKind["QuestionToken"] = 56] = "QuestionToken";
+ SyntaxKind[SyntaxKind["ColonToken"] = 57] = "ColonToken";
+ SyntaxKind[SyntaxKind["AtToken"] = 58] = "AtToken";
// Assignments
- SyntaxKind[SyntaxKind["EqualsToken"] = 58] = "EqualsToken";
- SyntaxKind[SyntaxKind["PlusEqualsToken"] = 59] = "PlusEqualsToken";
- SyntaxKind[SyntaxKind["MinusEqualsToken"] = 60] = "MinusEqualsToken";
- SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 61] = "AsteriskEqualsToken";
- SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 62] = "AsteriskAsteriskEqualsToken";
- SyntaxKind[SyntaxKind["SlashEqualsToken"] = 63] = "SlashEqualsToken";
- SyntaxKind[SyntaxKind["PercentEqualsToken"] = 64] = "PercentEqualsToken";
- SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 65] = "LessThanLessThanEqualsToken";
- SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 66] = "GreaterThanGreaterThanEqualsToken";
- SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 67] = "GreaterThanGreaterThanGreaterThanEqualsToken";
- SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 68] = "AmpersandEqualsToken";
- SyntaxKind[SyntaxKind["BarEqualsToken"] = 69] = "BarEqualsToken";
- SyntaxKind[SyntaxKind["CaretEqualsToken"] = 70] = "CaretEqualsToken";
+ SyntaxKind[SyntaxKind["EqualsToken"] = 59] = "EqualsToken";
+ SyntaxKind[SyntaxKind["PlusEqualsToken"] = 60] = "PlusEqualsToken";
+ SyntaxKind[SyntaxKind["MinusEqualsToken"] = 61] = "MinusEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 62] = "AsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 63] = "AsteriskAsteriskEqualsToken";
+ SyntaxKind[SyntaxKind["SlashEqualsToken"] = 64] = "SlashEqualsToken";
+ SyntaxKind[SyntaxKind["PercentEqualsToken"] = 65] = "PercentEqualsToken";
+ SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 66] = "LessThanLessThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 67] = "GreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 68] = "GreaterThanGreaterThanGreaterThanEqualsToken";
+ SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 69] = "AmpersandEqualsToken";
+ SyntaxKind[SyntaxKind["BarEqualsToken"] = 70] = "BarEqualsToken";
+ SyntaxKind[SyntaxKind["CaretEqualsToken"] = 71] = "CaretEqualsToken";
// Identifiers
- SyntaxKind[SyntaxKind["Identifier"] = 71] = "Identifier";
+ SyntaxKind[SyntaxKind["Identifier"] = 72] = "Identifier";
// Reserved words
- SyntaxKind[SyntaxKind["BreakKeyword"] = 72] = "BreakKeyword";
- SyntaxKind[SyntaxKind["CaseKeyword"] = 73] = "CaseKeyword";
- SyntaxKind[SyntaxKind["CatchKeyword"] = 74] = "CatchKeyword";
- SyntaxKind[SyntaxKind["ClassKeyword"] = 75] = "ClassKeyword";
- SyntaxKind[SyntaxKind["ConstKeyword"] = 76] = "ConstKeyword";
- SyntaxKind[SyntaxKind["ContinueKeyword"] = 77] = "ContinueKeyword";
- SyntaxKind[SyntaxKind["DebuggerKeyword"] = 78] = "DebuggerKeyword";
- SyntaxKind[SyntaxKind["DefaultKeyword"] = 79] = "DefaultKeyword";
- SyntaxKind[SyntaxKind["DeleteKeyword"] = 80] = "DeleteKeyword";
- SyntaxKind[SyntaxKind["DoKeyword"] = 81] = "DoKeyword";
- SyntaxKind[SyntaxKind["ElseKeyword"] = 82] = "ElseKeyword";
- SyntaxKind[SyntaxKind["EnumKeyword"] = 83] = "EnumKeyword";
- SyntaxKind[SyntaxKind["ExportKeyword"] = 84] = "ExportKeyword";
- SyntaxKind[SyntaxKind["ExtendsKeyword"] = 85] = "ExtendsKeyword";
- SyntaxKind[SyntaxKind["FalseKeyword"] = 86] = "FalseKeyword";
- SyntaxKind[SyntaxKind["FinallyKeyword"] = 87] = "FinallyKeyword";
- SyntaxKind[SyntaxKind["ForKeyword"] = 88] = "ForKeyword";
- SyntaxKind[SyntaxKind["FunctionKeyword"] = 89] = "FunctionKeyword";
- SyntaxKind[SyntaxKind["IfKeyword"] = 90] = "IfKeyword";
- SyntaxKind[SyntaxKind["ImportKeyword"] = 91] = "ImportKeyword";
- SyntaxKind[SyntaxKind["InKeyword"] = 92] = "InKeyword";
- SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 93] = "InstanceOfKeyword";
- SyntaxKind[SyntaxKind["NewKeyword"] = 94] = "NewKeyword";
- SyntaxKind[SyntaxKind["NullKeyword"] = 95] = "NullKeyword";
- SyntaxKind[SyntaxKind["ReturnKeyword"] = 96] = "ReturnKeyword";
- SyntaxKind[SyntaxKind["SuperKeyword"] = 97] = "SuperKeyword";
- SyntaxKind[SyntaxKind["SwitchKeyword"] = 98] = "SwitchKeyword";
- SyntaxKind[SyntaxKind["ThisKeyword"] = 99] = "ThisKeyword";
- SyntaxKind[SyntaxKind["ThrowKeyword"] = 100] = "ThrowKeyword";
- SyntaxKind[SyntaxKind["TrueKeyword"] = 101] = "TrueKeyword";
- SyntaxKind[SyntaxKind["TryKeyword"] = 102] = "TryKeyword";
- SyntaxKind[SyntaxKind["TypeOfKeyword"] = 103] = "TypeOfKeyword";
- SyntaxKind[SyntaxKind["VarKeyword"] = 104] = "VarKeyword";
- SyntaxKind[SyntaxKind["VoidKeyword"] = 105] = "VoidKeyword";
- SyntaxKind[SyntaxKind["WhileKeyword"] = 106] = "WhileKeyword";
- SyntaxKind[SyntaxKind["WithKeyword"] = 107] = "WithKeyword";
+ SyntaxKind[SyntaxKind["BreakKeyword"] = 73] = "BreakKeyword";
+ SyntaxKind[SyntaxKind["CaseKeyword"] = 74] = "CaseKeyword";
+ SyntaxKind[SyntaxKind["CatchKeyword"] = 75] = "CatchKeyword";
+ SyntaxKind[SyntaxKind["ClassKeyword"] = 76] = "ClassKeyword";
+ SyntaxKind[SyntaxKind["ConstKeyword"] = 77] = "ConstKeyword";
+ SyntaxKind[SyntaxKind["ContinueKeyword"] = 78] = "ContinueKeyword";
+ SyntaxKind[SyntaxKind["DebuggerKeyword"] = 79] = "DebuggerKeyword";
+ SyntaxKind[SyntaxKind["DefaultKeyword"] = 80] = "DefaultKeyword";
+ SyntaxKind[SyntaxKind["DeleteKeyword"] = 81] = "DeleteKeyword";
+ SyntaxKind[SyntaxKind["DoKeyword"] = 82] = "DoKeyword";
+ SyntaxKind[SyntaxKind["ElseKeyword"] = 83] = "ElseKeyword";
+ SyntaxKind[SyntaxKind["EnumKeyword"] = 84] = "EnumKeyword";
+ SyntaxKind[SyntaxKind["ExportKeyword"] = 85] = "ExportKeyword";
+ SyntaxKind[SyntaxKind["ExtendsKeyword"] = 86] = "ExtendsKeyword";
+ SyntaxKind[SyntaxKind["FalseKeyword"] = 87] = "FalseKeyword";
+ SyntaxKind[SyntaxKind["FinallyKeyword"] = 88] = "FinallyKeyword";
+ SyntaxKind[SyntaxKind["ForKeyword"] = 89] = "ForKeyword";
+ SyntaxKind[SyntaxKind["FunctionKeyword"] = 90] = "FunctionKeyword";
+ SyntaxKind[SyntaxKind["IfKeyword"] = 91] = "IfKeyword";
+ SyntaxKind[SyntaxKind["ImportKeyword"] = 92] = "ImportKeyword";
+ SyntaxKind[SyntaxKind["InKeyword"] = 93] = "InKeyword";
+ SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 94] = "InstanceOfKeyword";
+ SyntaxKind[SyntaxKind["NewKeyword"] = 95] = "NewKeyword";
+ SyntaxKind[SyntaxKind["NullKeyword"] = 96] = "NullKeyword";
+ SyntaxKind[SyntaxKind["ReturnKeyword"] = 97] = "ReturnKeyword";
+ SyntaxKind[SyntaxKind["SuperKeyword"] = 98] = "SuperKeyword";
+ SyntaxKind[SyntaxKind["SwitchKeyword"] = 99] = "SwitchKeyword";
+ SyntaxKind[SyntaxKind["ThisKeyword"] = 100] = "ThisKeyword";
+ SyntaxKind[SyntaxKind["ThrowKeyword"] = 101] = "ThrowKeyword";
+ SyntaxKind[SyntaxKind["TrueKeyword"] = 102] = "TrueKeyword";
+ SyntaxKind[SyntaxKind["TryKeyword"] = 103] = "TryKeyword";
+ SyntaxKind[SyntaxKind["TypeOfKeyword"] = 104] = "TypeOfKeyword";
+ SyntaxKind[SyntaxKind["VarKeyword"] = 105] = "VarKeyword";
+ SyntaxKind[SyntaxKind["VoidKeyword"] = 106] = "VoidKeyword";
+ SyntaxKind[SyntaxKind["WhileKeyword"] = 107] = "WhileKeyword";
+ SyntaxKind[SyntaxKind["WithKeyword"] = 108] = "WithKeyword";
// Strict mode reserved words
- SyntaxKind[SyntaxKind["ImplementsKeyword"] = 108] = "ImplementsKeyword";
- SyntaxKind[SyntaxKind["InterfaceKeyword"] = 109] = "InterfaceKeyword";
- SyntaxKind[SyntaxKind["LetKeyword"] = 110] = "LetKeyword";
- SyntaxKind[SyntaxKind["PackageKeyword"] = 111] = "PackageKeyword";
- SyntaxKind[SyntaxKind["PrivateKeyword"] = 112] = "PrivateKeyword";
- SyntaxKind[SyntaxKind["ProtectedKeyword"] = 113] = "ProtectedKeyword";
- SyntaxKind[SyntaxKind["PublicKeyword"] = 114] = "PublicKeyword";
- SyntaxKind[SyntaxKind["StaticKeyword"] = 115] = "StaticKeyword";
- SyntaxKind[SyntaxKind["YieldKeyword"] = 116] = "YieldKeyword";
+ SyntaxKind[SyntaxKind["ImplementsKeyword"] = 109] = "ImplementsKeyword";
+ SyntaxKind[SyntaxKind["InterfaceKeyword"] = 110] = "InterfaceKeyword";
+ SyntaxKind[SyntaxKind["LetKeyword"] = 111] = "LetKeyword";
+ SyntaxKind[SyntaxKind["PackageKeyword"] = 112] = "PackageKeyword";
+ SyntaxKind[SyntaxKind["PrivateKeyword"] = 113] = "PrivateKeyword";
+ SyntaxKind[SyntaxKind["ProtectedKeyword"] = 114] = "ProtectedKeyword";
+ SyntaxKind[SyntaxKind["PublicKeyword"] = 115] = "PublicKeyword";
+ SyntaxKind[SyntaxKind["StaticKeyword"] = 116] = "StaticKeyword";
+ SyntaxKind[SyntaxKind["YieldKeyword"] = 117] = "YieldKeyword";
// Contextual keywords
- SyntaxKind[SyntaxKind["AbstractKeyword"] = 117] = "AbstractKeyword";
- SyntaxKind[SyntaxKind["AsKeyword"] = 118] = "AsKeyword";
- SyntaxKind[SyntaxKind["AnyKeyword"] = 119] = "AnyKeyword";
- SyntaxKind[SyntaxKind["AsyncKeyword"] = 120] = "AsyncKeyword";
- SyntaxKind[SyntaxKind["AwaitKeyword"] = 121] = "AwaitKeyword";
- SyntaxKind[SyntaxKind["BooleanKeyword"] = 122] = "BooleanKeyword";
- SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword";
- SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword";
- SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword";
- SyntaxKind[SyntaxKind["InferKeyword"] = 126] = "InferKeyword";
- SyntaxKind[SyntaxKind["IsKeyword"] = 127] = "IsKeyword";
- SyntaxKind[SyntaxKind["KeyOfKeyword"] = 128] = "KeyOfKeyword";
- SyntaxKind[SyntaxKind["ModuleKeyword"] = 129] = "ModuleKeyword";
- SyntaxKind[SyntaxKind["NamespaceKeyword"] = 130] = "NamespaceKeyword";
- SyntaxKind[SyntaxKind["NeverKeyword"] = 131] = "NeverKeyword";
- SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 132] = "ReadonlyKeyword";
- SyntaxKind[SyntaxKind["RequireKeyword"] = 133] = "RequireKeyword";
- SyntaxKind[SyntaxKind["NumberKeyword"] = 134] = "NumberKeyword";
- SyntaxKind[SyntaxKind["ObjectKeyword"] = 135] = "ObjectKeyword";
- SyntaxKind[SyntaxKind["SetKeyword"] = 136] = "SetKeyword";
- SyntaxKind[SyntaxKind["StringKeyword"] = 137] = "StringKeyword";
- SyntaxKind[SyntaxKind["SymbolKeyword"] = 138] = "SymbolKeyword";
- SyntaxKind[SyntaxKind["TypeKeyword"] = 139] = "TypeKeyword";
- SyntaxKind[SyntaxKind["UndefinedKeyword"] = 140] = "UndefinedKeyword";
- SyntaxKind[SyntaxKind["UniqueKeyword"] = 141] = "UniqueKeyword";
- SyntaxKind[SyntaxKind["UnknownKeyword"] = 142] = "UnknownKeyword";
- SyntaxKind[SyntaxKind["FromKeyword"] = 143] = "FromKeyword";
- SyntaxKind[SyntaxKind["GlobalKeyword"] = 144] = "GlobalKeyword";
- SyntaxKind[SyntaxKind["OfKeyword"] = 145] = "OfKeyword";
+ SyntaxKind[SyntaxKind["AbstractKeyword"] = 118] = "AbstractKeyword";
+ SyntaxKind[SyntaxKind["AsKeyword"] = 119] = "AsKeyword";
+ SyntaxKind[SyntaxKind["AnyKeyword"] = 120] = "AnyKeyword";
+ SyntaxKind[SyntaxKind["AsyncKeyword"] = 121] = "AsyncKeyword";
+ SyntaxKind[SyntaxKind["AwaitKeyword"] = 122] = "AwaitKeyword";
+ SyntaxKind[SyntaxKind["BooleanKeyword"] = 123] = "BooleanKeyword";
+ SyntaxKind[SyntaxKind["ConstructorKeyword"] = 124] = "ConstructorKeyword";
+ SyntaxKind[SyntaxKind["DeclareKeyword"] = 125] = "DeclareKeyword";
+ SyntaxKind[SyntaxKind["GetKeyword"] = 126] = "GetKeyword";
+ SyntaxKind[SyntaxKind["InferKeyword"] = 127] = "InferKeyword";
+ SyntaxKind[SyntaxKind["IsKeyword"] = 128] = "IsKeyword";
+ SyntaxKind[SyntaxKind["KeyOfKeyword"] = 129] = "KeyOfKeyword";
+ SyntaxKind[SyntaxKind["ModuleKeyword"] = 130] = "ModuleKeyword";
+ SyntaxKind[SyntaxKind["NamespaceKeyword"] = 131] = "NamespaceKeyword";
+ SyntaxKind[SyntaxKind["NeverKeyword"] = 132] = "NeverKeyword";
+ SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 133] = "ReadonlyKeyword";
+ SyntaxKind[SyntaxKind["RequireKeyword"] = 134] = "RequireKeyword";
+ SyntaxKind[SyntaxKind["NumberKeyword"] = 135] = "NumberKeyword";
+ SyntaxKind[SyntaxKind["ObjectKeyword"] = 136] = "ObjectKeyword";
+ SyntaxKind[SyntaxKind["SetKeyword"] = 137] = "SetKeyword";
+ SyntaxKind[SyntaxKind["StringKeyword"] = 138] = "StringKeyword";
+ SyntaxKind[SyntaxKind["SymbolKeyword"] = 139] = "SymbolKeyword";
+ SyntaxKind[SyntaxKind["TypeKeyword"] = 140] = "TypeKeyword";
+ SyntaxKind[SyntaxKind["UndefinedKeyword"] = 141] = "UndefinedKeyword";
+ SyntaxKind[SyntaxKind["UniqueKeyword"] = 142] = "UniqueKeyword";
+ SyntaxKind[SyntaxKind["UnknownKeyword"] = 143] = "UnknownKeyword";
+ SyntaxKind[SyntaxKind["FromKeyword"] = 144] = "FromKeyword";
+ SyntaxKind[SyntaxKind["GlobalKeyword"] = 145] = "GlobalKeyword";
+ SyntaxKind[SyntaxKind["BigIntKeyword"] = 146] = "BigIntKeyword";
+ SyntaxKind[SyntaxKind["OfKeyword"] = 147] = "OfKeyword";
// Parse tree nodes
// Names
- SyntaxKind[SyntaxKind["QualifiedName"] = 146] = "QualifiedName";
- SyntaxKind[SyntaxKind["ComputedPropertyName"] = 147] = "ComputedPropertyName";
+ SyntaxKind[SyntaxKind["QualifiedName"] = 148] = "QualifiedName";
+ SyntaxKind[SyntaxKind["ComputedPropertyName"] = 149] = "ComputedPropertyName";
// Signature elements
- SyntaxKind[SyntaxKind["TypeParameter"] = 148] = "TypeParameter";
- SyntaxKind[SyntaxKind["Parameter"] = 149] = "Parameter";
- SyntaxKind[SyntaxKind["Decorator"] = 150] = "Decorator";
+ SyntaxKind[SyntaxKind["TypeParameter"] = 150] = "TypeParameter";
+ SyntaxKind[SyntaxKind["Parameter"] = 151] = "Parameter";
+ SyntaxKind[SyntaxKind["Decorator"] = 152] = "Decorator";
// TypeMember
- SyntaxKind[SyntaxKind["PropertySignature"] = 151] = "PropertySignature";
- SyntaxKind[SyntaxKind["PropertyDeclaration"] = 152] = "PropertyDeclaration";
- SyntaxKind[SyntaxKind["MethodSignature"] = 153] = "MethodSignature";
- SyntaxKind[SyntaxKind["MethodDeclaration"] = 154] = "MethodDeclaration";
- SyntaxKind[SyntaxKind["Constructor"] = 155] = "Constructor";
- SyntaxKind[SyntaxKind["GetAccessor"] = 156] = "GetAccessor";
- SyntaxKind[SyntaxKind["SetAccessor"] = 157] = "SetAccessor";
- SyntaxKind[SyntaxKind["CallSignature"] = 158] = "CallSignature";
- SyntaxKind[SyntaxKind["ConstructSignature"] = 159] = "ConstructSignature";
- SyntaxKind[SyntaxKind["IndexSignature"] = 160] = "IndexSignature";
+ SyntaxKind[SyntaxKind["PropertySignature"] = 153] = "PropertySignature";
+ SyntaxKind[SyntaxKind["PropertyDeclaration"] = 154] = "PropertyDeclaration";
+ SyntaxKind[SyntaxKind["MethodSignature"] = 155] = "MethodSignature";
+ SyntaxKind[SyntaxKind["MethodDeclaration"] = 156] = "MethodDeclaration";
+ SyntaxKind[SyntaxKind["Constructor"] = 157] = "Constructor";
+ SyntaxKind[SyntaxKind["GetAccessor"] = 158] = "GetAccessor";
+ SyntaxKind[SyntaxKind["SetAccessor"] = 159] = "SetAccessor";
+ SyntaxKind[SyntaxKind["CallSignature"] = 160] = "CallSignature";
+ SyntaxKind[SyntaxKind["ConstructSignature"] = 161] = "ConstructSignature";
+ SyntaxKind[SyntaxKind["IndexSignature"] = 162] = "IndexSignature";
// Type
- SyntaxKind[SyntaxKind["TypePredicate"] = 161] = "TypePredicate";
- SyntaxKind[SyntaxKind["TypeReference"] = 162] = "TypeReference";
- SyntaxKind[SyntaxKind["FunctionType"] = 163] = "FunctionType";
- SyntaxKind[SyntaxKind["ConstructorType"] = 164] = "ConstructorType";
- SyntaxKind[SyntaxKind["TypeQuery"] = 165] = "TypeQuery";
- SyntaxKind[SyntaxKind["TypeLiteral"] = 166] = "TypeLiteral";
- SyntaxKind[SyntaxKind["ArrayType"] = 167] = "ArrayType";
- SyntaxKind[SyntaxKind["TupleType"] = 168] = "TupleType";
- SyntaxKind[SyntaxKind["OptionalType"] = 169] = "OptionalType";
- SyntaxKind[SyntaxKind["RestType"] = 170] = "RestType";
- SyntaxKind[SyntaxKind["UnionType"] = 171] = "UnionType";
- SyntaxKind[SyntaxKind["IntersectionType"] = 172] = "IntersectionType";
- SyntaxKind[SyntaxKind["ConditionalType"] = 173] = "ConditionalType";
- SyntaxKind[SyntaxKind["InferType"] = 174] = "InferType";
- SyntaxKind[SyntaxKind["ParenthesizedType"] = 175] = "ParenthesizedType";
- SyntaxKind[SyntaxKind["ThisType"] = 176] = "ThisType";
- SyntaxKind[SyntaxKind["TypeOperator"] = 177] = "TypeOperator";
- SyntaxKind[SyntaxKind["IndexedAccessType"] = 178] = "IndexedAccessType";
- SyntaxKind[SyntaxKind["MappedType"] = 179] = "MappedType";
- SyntaxKind[SyntaxKind["LiteralType"] = 180] = "LiteralType";
- SyntaxKind[SyntaxKind["ImportType"] = 181] = "ImportType";
+ SyntaxKind[SyntaxKind["TypePredicate"] = 163] = "TypePredicate";
+ SyntaxKind[SyntaxKind["TypeReference"] = 164] = "TypeReference";
+ SyntaxKind[SyntaxKind["FunctionType"] = 165] = "FunctionType";
+ SyntaxKind[SyntaxKind["ConstructorType"] = 166] = "ConstructorType";
+ SyntaxKind[SyntaxKind["TypeQuery"] = 167] = "TypeQuery";
+ SyntaxKind[SyntaxKind["TypeLiteral"] = 168] = "TypeLiteral";
+ SyntaxKind[SyntaxKind["ArrayType"] = 169] = "ArrayType";
+ SyntaxKind[SyntaxKind["TupleType"] = 170] = "TupleType";
+ SyntaxKind[SyntaxKind["OptionalType"] = 171] = "OptionalType";
+ SyntaxKind[SyntaxKind["RestType"] = 172] = "RestType";
+ SyntaxKind[SyntaxKind["UnionType"] = 173] = "UnionType";
+ SyntaxKind[SyntaxKind["IntersectionType"] = 174] = "IntersectionType";
+ SyntaxKind[SyntaxKind["ConditionalType"] = 175] = "ConditionalType";
+ SyntaxKind[SyntaxKind["InferType"] = 176] = "InferType";
+ SyntaxKind[SyntaxKind["ParenthesizedType"] = 177] = "ParenthesizedType";
+ SyntaxKind[SyntaxKind["ThisType"] = 178] = "ThisType";
+ SyntaxKind[SyntaxKind["TypeOperator"] = 179] = "TypeOperator";
+ SyntaxKind[SyntaxKind["IndexedAccessType"] = 180] = "IndexedAccessType";
+ SyntaxKind[SyntaxKind["MappedType"] = 181] = "MappedType";
+ SyntaxKind[SyntaxKind["LiteralType"] = 182] = "LiteralType";
+ SyntaxKind[SyntaxKind["ImportType"] = 183] = "ImportType";
// Binding patterns
- SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 182] = "ObjectBindingPattern";
- SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 183] = "ArrayBindingPattern";
- SyntaxKind[SyntaxKind["BindingElement"] = 184] = "BindingElement";
+ SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 184] = "ObjectBindingPattern";
+ SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 185] = "ArrayBindingPattern";
+ SyntaxKind[SyntaxKind["BindingElement"] = 186] = "BindingElement";
// Expression
- SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 185] = "ArrayLiteralExpression";
- SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 186] = "ObjectLiteralExpression";
- SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 187] = "PropertyAccessExpression";
- SyntaxKind[SyntaxKind["ElementAccessExpression"] = 188] = "ElementAccessExpression";
- SyntaxKind[SyntaxKind["CallExpression"] = 189] = "CallExpression";
- SyntaxKind[SyntaxKind["NewExpression"] = 190] = "NewExpression";
- SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 191] = "TaggedTemplateExpression";
- SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 192] = "TypeAssertionExpression";
- SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 193] = "ParenthesizedExpression";
- SyntaxKind[SyntaxKind["FunctionExpression"] = 194] = "FunctionExpression";
- SyntaxKind[SyntaxKind["ArrowFunction"] = 195] = "ArrowFunction";
- SyntaxKind[SyntaxKind["DeleteExpression"] = 196] = "DeleteExpression";
- SyntaxKind[SyntaxKind["TypeOfExpression"] = 197] = "TypeOfExpression";
- SyntaxKind[SyntaxKind["VoidExpression"] = 198] = "VoidExpression";
- SyntaxKind[SyntaxKind["AwaitExpression"] = 199] = "AwaitExpression";
- SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 200] = "PrefixUnaryExpression";
- SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 201] = "PostfixUnaryExpression";
- SyntaxKind[SyntaxKind["BinaryExpression"] = 202] = "BinaryExpression";
- SyntaxKind[SyntaxKind["ConditionalExpression"] = 203] = "ConditionalExpression";
- SyntaxKind[SyntaxKind["TemplateExpression"] = 204] = "TemplateExpression";
- SyntaxKind[SyntaxKind["YieldExpression"] = 205] = "YieldExpression";
- SyntaxKind[SyntaxKind["SpreadElement"] = 206] = "SpreadElement";
- SyntaxKind[SyntaxKind["ClassExpression"] = 207] = "ClassExpression";
- SyntaxKind[SyntaxKind["OmittedExpression"] = 208] = "OmittedExpression";
- SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 209] = "ExpressionWithTypeArguments";
- SyntaxKind[SyntaxKind["AsExpression"] = 210] = "AsExpression";
- SyntaxKind[SyntaxKind["NonNullExpression"] = 211] = "NonNullExpression";
- SyntaxKind[SyntaxKind["MetaProperty"] = 212] = "MetaProperty";
- SyntaxKind[SyntaxKind["SyntheticExpression"] = 213] = "SyntheticExpression";
+ SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 187] = "ArrayLiteralExpression";
+ SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 188] = "ObjectLiteralExpression";
+ SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 189] = "PropertyAccessExpression";
+ SyntaxKind[SyntaxKind["ElementAccessExpression"] = 190] = "ElementAccessExpression";
+ SyntaxKind[SyntaxKind["CallExpression"] = 191] = "CallExpression";
+ SyntaxKind[SyntaxKind["NewExpression"] = 192] = "NewExpression";
+ SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 193] = "TaggedTemplateExpression";
+ SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 194] = "TypeAssertionExpression";
+ SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 195] = "ParenthesizedExpression";
+ SyntaxKind[SyntaxKind["FunctionExpression"] = 196] = "FunctionExpression";
+ SyntaxKind[SyntaxKind["ArrowFunction"] = 197] = "ArrowFunction";
+ SyntaxKind[SyntaxKind["DeleteExpression"] = 198] = "DeleteExpression";
+ SyntaxKind[SyntaxKind["TypeOfExpression"] = 199] = "TypeOfExpression";
+ SyntaxKind[SyntaxKind["VoidExpression"] = 200] = "VoidExpression";
+ SyntaxKind[SyntaxKind["AwaitExpression"] = 201] = "AwaitExpression";
+ SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 202] = "PrefixUnaryExpression";
+ SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 203] = "PostfixUnaryExpression";
+ SyntaxKind[SyntaxKind["BinaryExpression"] = 204] = "BinaryExpression";
+ SyntaxKind[SyntaxKind["ConditionalExpression"] = 205] = "ConditionalExpression";
+ SyntaxKind[SyntaxKind["TemplateExpression"] = 206] = "TemplateExpression";
+ SyntaxKind[SyntaxKind["YieldExpression"] = 207] = "YieldExpression";
+ SyntaxKind[SyntaxKind["SpreadElement"] = 208] = "SpreadElement";
+ SyntaxKind[SyntaxKind["ClassExpression"] = 209] = "ClassExpression";
+ SyntaxKind[SyntaxKind["OmittedExpression"] = 210] = "OmittedExpression";
+ SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 211] = "ExpressionWithTypeArguments";
+ SyntaxKind[SyntaxKind["AsExpression"] = 212] = "AsExpression";
+ SyntaxKind[SyntaxKind["NonNullExpression"] = 213] = "NonNullExpression";
+ SyntaxKind[SyntaxKind["MetaProperty"] = 214] = "MetaProperty";
+ SyntaxKind[SyntaxKind["SyntheticExpression"] = 215] = "SyntheticExpression";
// Misc
- SyntaxKind[SyntaxKind["TemplateSpan"] = 214] = "TemplateSpan";
- SyntaxKind[SyntaxKind["SemicolonClassElement"] = 215] = "SemicolonClassElement";
+ SyntaxKind[SyntaxKind["TemplateSpan"] = 216] = "TemplateSpan";
+ SyntaxKind[SyntaxKind["SemicolonClassElement"] = 217] = "SemicolonClassElement";
// Element
- SyntaxKind[SyntaxKind["Block"] = 216] = "Block";
- SyntaxKind[SyntaxKind["VariableStatement"] = 217] = "VariableStatement";
- SyntaxKind[SyntaxKind["EmptyStatement"] = 218] = "EmptyStatement";
- SyntaxKind[SyntaxKind["ExpressionStatement"] = 219] = "ExpressionStatement";
- SyntaxKind[SyntaxKind["IfStatement"] = 220] = "IfStatement";
- SyntaxKind[SyntaxKind["DoStatement"] = 221] = "DoStatement";
- SyntaxKind[SyntaxKind["WhileStatement"] = 222] = "WhileStatement";
- SyntaxKind[SyntaxKind["ForStatement"] = 223] = "ForStatement";
- SyntaxKind[SyntaxKind["ForInStatement"] = 224] = "ForInStatement";
- SyntaxKind[SyntaxKind["ForOfStatement"] = 225] = "ForOfStatement";
- SyntaxKind[SyntaxKind["ContinueStatement"] = 226] = "ContinueStatement";
- SyntaxKind[SyntaxKind["BreakStatement"] = 227] = "BreakStatement";
- SyntaxKind[SyntaxKind["ReturnStatement"] = 228] = "ReturnStatement";
- SyntaxKind[SyntaxKind["WithStatement"] = 229] = "WithStatement";
- SyntaxKind[SyntaxKind["SwitchStatement"] = 230] = "SwitchStatement";
- SyntaxKind[SyntaxKind["LabeledStatement"] = 231] = "LabeledStatement";
- SyntaxKind[SyntaxKind["ThrowStatement"] = 232] = "ThrowStatement";
- SyntaxKind[SyntaxKind["TryStatement"] = 233] = "TryStatement";
- SyntaxKind[SyntaxKind["DebuggerStatement"] = 234] = "DebuggerStatement";
- SyntaxKind[SyntaxKind["VariableDeclaration"] = 235] = "VariableDeclaration";
- SyntaxKind[SyntaxKind["VariableDeclarationList"] = 236] = "VariableDeclarationList";
- SyntaxKind[SyntaxKind["FunctionDeclaration"] = 237] = "FunctionDeclaration";
- SyntaxKind[SyntaxKind["ClassDeclaration"] = 238] = "ClassDeclaration";
- SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 239] = "InterfaceDeclaration";
- SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 240] = "TypeAliasDeclaration";
- SyntaxKind[SyntaxKind["EnumDeclaration"] = 241] = "EnumDeclaration";
- SyntaxKind[SyntaxKind["ModuleDeclaration"] = 242] = "ModuleDeclaration";
- SyntaxKind[SyntaxKind["ModuleBlock"] = 243] = "ModuleBlock";
- SyntaxKind[SyntaxKind["CaseBlock"] = 244] = "CaseBlock";
- SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 245] = "NamespaceExportDeclaration";
- SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 246] = "ImportEqualsDeclaration";
- SyntaxKind[SyntaxKind["ImportDeclaration"] = 247] = "ImportDeclaration";
- SyntaxKind[SyntaxKind["ImportClause"] = 248] = "ImportClause";
- SyntaxKind[SyntaxKind["NamespaceImport"] = 249] = "NamespaceImport";
- SyntaxKind[SyntaxKind["NamedImports"] = 250] = "NamedImports";
- SyntaxKind[SyntaxKind["ImportSpecifier"] = 251] = "ImportSpecifier";
- SyntaxKind[SyntaxKind["ExportAssignment"] = 252] = "ExportAssignment";
- SyntaxKind[SyntaxKind["ExportDeclaration"] = 253] = "ExportDeclaration";
- SyntaxKind[SyntaxKind["NamedExports"] = 254] = "NamedExports";
- SyntaxKind[SyntaxKind["ExportSpecifier"] = 255] = "ExportSpecifier";
- SyntaxKind[SyntaxKind["MissingDeclaration"] = 256] = "MissingDeclaration";
+ SyntaxKind[SyntaxKind["Block"] = 218] = "Block";
+ SyntaxKind[SyntaxKind["VariableStatement"] = 219] = "VariableStatement";
+ SyntaxKind[SyntaxKind["EmptyStatement"] = 220] = "EmptyStatement";
+ SyntaxKind[SyntaxKind["ExpressionStatement"] = 221] = "ExpressionStatement";
+ SyntaxKind[SyntaxKind["IfStatement"] = 222] = "IfStatement";
+ SyntaxKind[SyntaxKind["DoStatement"] = 223] = "DoStatement";
+ SyntaxKind[SyntaxKind["WhileStatement"] = 224] = "WhileStatement";
+ SyntaxKind[SyntaxKind["ForStatement"] = 225] = "ForStatement";
+ SyntaxKind[SyntaxKind["ForInStatement"] = 226] = "ForInStatement";
+ SyntaxKind[SyntaxKind["ForOfStatement"] = 227] = "ForOfStatement";
+ SyntaxKind[SyntaxKind["ContinueStatement"] = 228] = "ContinueStatement";
+ SyntaxKind[SyntaxKind["BreakStatement"] = 229] = "BreakStatement";
+ SyntaxKind[SyntaxKind["ReturnStatement"] = 230] = "ReturnStatement";
+ SyntaxKind[SyntaxKind["WithStatement"] = 231] = "WithStatement";
+ SyntaxKind[SyntaxKind["SwitchStatement"] = 232] = "SwitchStatement";
+ SyntaxKind[SyntaxKind["LabeledStatement"] = 233] = "LabeledStatement";
+ SyntaxKind[SyntaxKind["ThrowStatement"] = 234] = "ThrowStatement";
+ SyntaxKind[SyntaxKind["TryStatement"] = 235] = "TryStatement";
+ SyntaxKind[SyntaxKind["DebuggerStatement"] = 236] = "DebuggerStatement";
+ SyntaxKind[SyntaxKind["VariableDeclaration"] = 237] = "VariableDeclaration";
+ SyntaxKind[SyntaxKind["VariableDeclarationList"] = 238] = "VariableDeclarationList";
+ SyntaxKind[SyntaxKind["FunctionDeclaration"] = 239] = "FunctionDeclaration";
+ SyntaxKind[SyntaxKind["ClassDeclaration"] = 240] = "ClassDeclaration";
+ SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 241] = "InterfaceDeclaration";
+ SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 242] = "TypeAliasDeclaration";
+ SyntaxKind[SyntaxKind["EnumDeclaration"] = 243] = "EnumDeclaration";
+ SyntaxKind[SyntaxKind["ModuleDeclaration"] = 244] = "ModuleDeclaration";
+ SyntaxKind[SyntaxKind["ModuleBlock"] = 245] = "ModuleBlock";
+ SyntaxKind[SyntaxKind["CaseBlock"] = 246] = "CaseBlock";
+ SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 247] = "NamespaceExportDeclaration";
+ SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 248] = "ImportEqualsDeclaration";
+ SyntaxKind[SyntaxKind["ImportDeclaration"] = 249] = "ImportDeclaration";
+ SyntaxKind[SyntaxKind["ImportClause"] = 250] = "ImportClause";
+ SyntaxKind[SyntaxKind["NamespaceImport"] = 251] = "NamespaceImport";
+ SyntaxKind[SyntaxKind["NamedImports"] = 252] = "NamedImports";
+ SyntaxKind[SyntaxKind["ImportSpecifier"] = 253] = "ImportSpecifier";
+ SyntaxKind[SyntaxKind["ExportAssignment"] = 254] = "ExportAssignment";
+ SyntaxKind[SyntaxKind["ExportDeclaration"] = 255] = "ExportDeclaration";
+ SyntaxKind[SyntaxKind["NamedExports"] = 256] = "NamedExports";
+ SyntaxKind[SyntaxKind["ExportSpecifier"] = 257] = "ExportSpecifier";
+ SyntaxKind[SyntaxKind["MissingDeclaration"] = 258] = "MissingDeclaration";
// Module references
- SyntaxKind[SyntaxKind["ExternalModuleReference"] = 257] = "ExternalModuleReference";
+ SyntaxKind[SyntaxKind["ExternalModuleReference"] = 259] = "ExternalModuleReference";
// JSX
- SyntaxKind[SyntaxKind["JsxElement"] = 258] = "JsxElement";
- SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 259] = "JsxSelfClosingElement";
- SyntaxKind[SyntaxKind["JsxOpeningElement"] = 260] = "JsxOpeningElement";
- SyntaxKind[SyntaxKind["JsxClosingElement"] = 261] = "JsxClosingElement";
- SyntaxKind[SyntaxKind["JsxFragment"] = 262] = "JsxFragment";
- SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 263] = "JsxOpeningFragment";
- SyntaxKind[SyntaxKind["JsxClosingFragment"] = 264] = "JsxClosingFragment";
- SyntaxKind[SyntaxKind["JsxAttribute"] = 265] = "JsxAttribute";
- SyntaxKind[SyntaxKind["JsxAttributes"] = 266] = "JsxAttributes";
- SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 267] = "JsxSpreadAttribute";
- SyntaxKind[SyntaxKind["JsxExpression"] = 268] = "JsxExpression";
+ SyntaxKind[SyntaxKind["JsxElement"] = 260] = "JsxElement";
+ SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 261] = "JsxSelfClosingElement";
+ SyntaxKind[SyntaxKind["JsxOpeningElement"] = 262] = "JsxOpeningElement";
+ SyntaxKind[SyntaxKind["JsxClosingElement"] = 263] = "JsxClosingElement";
+ SyntaxKind[SyntaxKind["JsxFragment"] = 264] = "JsxFragment";
+ SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 265] = "JsxOpeningFragment";
+ SyntaxKind[SyntaxKind["JsxClosingFragment"] = 266] = "JsxClosingFragment";
+ SyntaxKind[SyntaxKind["JsxAttribute"] = 267] = "JsxAttribute";
+ SyntaxKind[SyntaxKind["JsxAttributes"] = 268] = "JsxAttributes";
+ SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 269] = "JsxSpreadAttribute";
+ SyntaxKind[SyntaxKind["JsxExpression"] = 270] = "JsxExpression";
// Clauses
- SyntaxKind[SyntaxKind["CaseClause"] = 269] = "CaseClause";
- SyntaxKind[SyntaxKind["DefaultClause"] = 270] = "DefaultClause";
- SyntaxKind[SyntaxKind["HeritageClause"] = 271] = "HeritageClause";
- SyntaxKind[SyntaxKind["CatchClause"] = 272] = "CatchClause";
+ SyntaxKind[SyntaxKind["CaseClause"] = 271] = "CaseClause";
+ SyntaxKind[SyntaxKind["DefaultClause"] = 272] = "DefaultClause";
+ SyntaxKind[SyntaxKind["HeritageClause"] = 273] = "HeritageClause";
+ SyntaxKind[SyntaxKind["CatchClause"] = 274] = "CatchClause";
// Property assignments
- SyntaxKind[SyntaxKind["PropertyAssignment"] = 273] = "PropertyAssignment";
- SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 274] = "ShorthandPropertyAssignment";
- SyntaxKind[SyntaxKind["SpreadAssignment"] = 275] = "SpreadAssignment";
+ SyntaxKind[SyntaxKind["PropertyAssignment"] = 275] = "PropertyAssignment";
+ SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 276] = "ShorthandPropertyAssignment";
+ SyntaxKind[SyntaxKind["SpreadAssignment"] = 277] = "SpreadAssignment";
// Enum
- SyntaxKind[SyntaxKind["EnumMember"] = 276] = "EnumMember";
+ SyntaxKind[SyntaxKind["EnumMember"] = 278] = "EnumMember";
// Top-level nodes
- SyntaxKind[SyntaxKind["SourceFile"] = 277] = "SourceFile";
- SyntaxKind[SyntaxKind["Bundle"] = 278] = "Bundle";
- SyntaxKind[SyntaxKind["UnparsedSource"] = 279] = "UnparsedSource";
- SyntaxKind[SyntaxKind["InputFiles"] = 280] = "InputFiles";
+ SyntaxKind[SyntaxKind["SourceFile"] = 279] = "SourceFile";
+ SyntaxKind[SyntaxKind["Bundle"] = 280] = "Bundle";
+ SyntaxKind[SyntaxKind["UnparsedSource"] = 281] = "UnparsedSource";
+ SyntaxKind[SyntaxKind["InputFiles"] = 282] = "InputFiles";
// JSDoc nodes
- SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 281] = "JSDocTypeExpression";
+ SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 283] = "JSDocTypeExpression";
// The * type
- SyntaxKind[SyntaxKind["JSDocAllType"] = 282] = "JSDocAllType";
+ SyntaxKind[SyntaxKind["JSDocAllType"] = 284] = "JSDocAllType";
// The ? type
- SyntaxKind[SyntaxKind["JSDocUnknownType"] = 283] = "JSDocUnknownType";
- SyntaxKind[SyntaxKind["JSDocNullableType"] = 284] = "JSDocNullableType";
- SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 285] = "JSDocNonNullableType";
- SyntaxKind[SyntaxKind["JSDocOptionalType"] = 286] = "JSDocOptionalType";
- SyntaxKind[SyntaxKind["JSDocFunctionType"] = 287] = "JSDocFunctionType";
- SyntaxKind[SyntaxKind["JSDocVariadicType"] = 288] = "JSDocVariadicType";
- SyntaxKind[SyntaxKind["JSDocComment"] = 289] = "JSDocComment";
- SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 290] = "JSDocTypeLiteral";
- SyntaxKind[SyntaxKind["JSDocSignature"] = 291] = "JSDocSignature";
- SyntaxKind[SyntaxKind["JSDocTag"] = 292] = "JSDocTag";
- SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 293] = "JSDocAugmentsTag";
- SyntaxKind[SyntaxKind["JSDocClassTag"] = 294] = "JSDocClassTag";
- SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 295] = "JSDocCallbackTag";
- SyntaxKind[SyntaxKind["JSDocEnumTag"] = 296] = "JSDocEnumTag";
- SyntaxKind[SyntaxKind["JSDocParameterTag"] = 297] = "JSDocParameterTag";
- SyntaxKind[SyntaxKind["JSDocReturnTag"] = 298] = "JSDocReturnTag";
- SyntaxKind[SyntaxKind["JSDocThisTag"] = 299] = "JSDocThisTag";
- SyntaxKind[SyntaxKind["JSDocTypeTag"] = 300] = "JSDocTypeTag";
- SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 301] = "JSDocTemplateTag";
- SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 302] = "JSDocTypedefTag";
- SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 303] = "JSDocPropertyTag";
+ SyntaxKind[SyntaxKind["JSDocUnknownType"] = 285] = "JSDocUnknownType";
+ SyntaxKind[SyntaxKind["JSDocNullableType"] = 286] = "JSDocNullableType";
+ SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 287] = "JSDocNonNullableType";
+ SyntaxKind[SyntaxKind["JSDocOptionalType"] = 288] = "JSDocOptionalType";
+ SyntaxKind[SyntaxKind["JSDocFunctionType"] = 289] = "JSDocFunctionType";
+ SyntaxKind[SyntaxKind["JSDocVariadicType"] = 290] = "JSDocVariadicType";
+ SyntaxKind[SyntaxKind["JSDocComment"] = 291] = "JSDocComment";
+ SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 292] = "JSDocTypeLiteral";
+ SyntaxKind[SyntaxKind["JSDocSignature"] = 293] = "JSDocSignature";
+ SyntaxKind[SyntaxKind["JSDocTag"] = 294] = "JSDocTag";
+ SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 295] = "JSDocAugmentsTag";
+ SyntaxKind[SyntaxKind["JSDocClassTag"] = 296] = "JSDocClassTag";
+ SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 297] = "JSDocCallbackTag";
+ SyntaxKind[SyntaxKind["JSDocEnumTag"] = 298] = "JSDocEnumTag";
+ SyntaxKind[SyntaxKind["JSDocParameterTag"] = 299] = "JSDocParameterTag";
+ SyntaxKind[SyntaxKind["JSDocReturnTag"] = 300] = "JSDocReturnTag";
+ SyntaxKind[SyntaxKind["JSDocThisTag"] = 301] = "JSDocThisTag";
+ SyntaxKind[SyntaxKind["JSDocTypeTag"] = 302] = "JSDocTypeTag";
+ SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 303] = "JSDocTemplateTag";
+ SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 304] = "JSDocTypedefTag";
+ SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 305] = "JSDocPropertyTag";
// Synthesized list
- SyntaxKind[SyntaxKind["SyntaxList"] = 304] = "SyntaxList";
+ SyntaxKind[SyntaxKind["SyntaxList"] = 306] = "SyntaxList";
// Transformation nodes
- SyntaxKind[SyntaxKind["NotEmittedStatement"] = 305] = "NotEmittedStatement";
- SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 306] = "PartiallyEmittedExpression";
- SyntaxKind[SyntaxKind["CommaListExpression"] = 307] = "CommaListExpression";
- SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 308] = "MergeDeclarationMarker";
- SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 309] = "EndOfDeclarationMarker";
+ SyntaxKind[SyntaxKind["NotEmittedStatement"] = 307] = "NotEmittedStatement";
+ SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 308] = "PartiallyEmittedExpression";
+ SyntaxKind[SyntaxKind["CommaListExpression"] = 309] = "CommaListExpression";
+ SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 310] = "MergeDeclarationMarker";
+ SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 311] = "EndOfDeclarationMarker";
// Enum value count
- SyntaxKind[SyntaxKind["Count"] = 310] = "Count";
+ SyntaxKind[SyntaxKind["Count"] = 312] = "Count";
// Markers
- SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment";
- SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment";
- SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 59] = "FirstCompoundAssignment";
- SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 70] = "LastCompoundAssignment";
- SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord";
- SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord";
- SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword";
- SyntaxKind[SyntaxKind["LastKeyword"] = 145] = "LastKeyword";
- SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord";
- SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord";
- SyntaxKind[SyntaxKind["FirstTypeNode"] = 161] = "FirstTypeNode";
- SyntaxKind[SyntaxKind["LastTypeNode"] = 181] = "LastTypeNode";
- SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation";
- SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation";
+ SyntaxKind[SyntaxKind["FirstAssignment"] = 59] = "FirstAssignment";
+ SyntaxKind[SyntaxKind["LastAssignment"] = 71] = "LastAssignment";
+ SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 60] = "FirstCompoundAssignment";
+ SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 71] = "LastCompoundAssignment";
+ SyntaxKind[SyntaxKind["FirstReservedWord"] = 73] = "FirstReservedWord";
+ SyntaxKind[SyntaxKind["LastReservedWord"] = 108] = "LastReservedWord";
+ SyntaxKind[SyntaxKind["FirstKeyword"] = 73] = "FirstKeyword";
+ SyntaxKind[SyntaxKind["LastKeyword"] = 147] = "LastKeyword";
+ SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 109] = "FirstFutureReservedWord";
+ SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 117] = "LastFutureReservedWord";
+ SyntaxKind[SyntaxKind["FirstTypeNode"] = 163] = "FirstTypeNode";
+ SyntaxKind[SyntaxKind["LastTypeNode"] = 183] = "LastTypeNode";
+ SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation";
+ SyntaxKind[SyntaxKind["LastPunctuation"] = 71] = "LastPunctuation";
SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken";
- SyntaxKind[SyntaxKind["LastToken"] = 145] = "LastToken";
+ SyntaxKind[SyntaxKind["LastToken"] = 147] = "LastToken";
SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken";
SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken";
SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken";
- SyntaxKind[SyntaxKind["LastLiteralToken"] = 13] = "LastLiteralToken";
- SyntaxKind[SyntaxKind["FirstTemplateToken"] = 13] = "FirstTemplateToken";
- SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken";
- SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator";
- SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator";
- SyntaxKind[SyntaxKind["FirstNode"] = 146] = "FirstNode";
- SyntaxKind[SyntaxKind["FirstJSDocNode"] = 281] = "FirstJSDocNode";
- SyntaxKind[SyntaxKind["LastJSDocNode"] = 303] = "LastJSDocNode";
- SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 292] = "FirstJSDocTagNode";
- SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 303] = "LastJSDocTagNode";
- /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 117] = "FirstContextualKeyword";
- /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 145] = "LastContextualKeyword";
+ SyntaxKind[SyntaxKind["LastLiteralToken"] = 14] = "LastLiteralToken";
+ SyntaxKind[SyntaxKind["FirstTemplateToken"] = 14] = "FirstTemplateToken";
+ SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken";
+ SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 28] = "FirstBinaryOperator";
+ SyntaxKind[SyntaxKind["LastBinaryOperator"] = 71] = "LastBinaryOperator";
+ SyntaxKind[SyntaxKind["FirstNode"] = 148] = "FirstNode";
+ SyntaxKind[SyntaxKind["FirstJSDocNode"] = 283] = "FirstJSDocNode";
+ SyntaxKind[SyntaxKind["LastJSDocNode"] = 305] = "LastJSDocNode";
+ SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 294] = "FirstJSDocTagNode";
+ SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 305] = "LastJSDocTagNode";
+ /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 118] = "FirstContextualKeyword";
+ /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 147] = "LastContextualKeyword";
})(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));
var NodeFlags;
(function (NodeFlags) {
@@ -3089,14 +3154,15 @@ var ts;
// of a type, such as the global `Promise` type in lib.d.ts).
TypeReferenceSerializationKind[TypeReferenceSerializationKind["VoidNullableOrNeverType"] = 2] = "VoidNullableOrNeverType";
TypeReferenceSerializationKind[TypeReferenceSerializationKind["NumberLikeType"] = 3] = "NumberLikeType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["StringLikeType"] = 4] = "StringLikeType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["BooleanType"] = 5] = "BooleanType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["ArrayLikeType"] = 6] = "ArrayLikeType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["ESSymbolType"] = 7] = "ESSymbolType";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["Promise"] = 8] = "Promise";
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithCallSignature"] = 9] = "TypeWithCallSignature";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["BigIntLikeType"] = 4] = "BigIntLikeType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["StringLikeType"] = 5] = "StringLikeType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["BooleanType"] = 6] = "BooleanType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["ArrayLikeType"] = 7] = "ArrayLikeType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["ESSymbolType"] = 8] = "ESSymbolType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["Promise"] = 9] = "Promise";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["TypeWithCallSignature"] = 10] = "TypeWithCallSignature";
// with call signatures.
- TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 10] = "ObjectType";
+ TypeReferenceSerializationKind[TypeReferenceSerializationKind["ObjectType"] = 11] = "ObjectType";
})(TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {}));
var SymbolFlags;
(function (SymbolFlags) {
@@ -3251,29 +3317,27 @@ var ts;
TypeFlags[TypeFlags["Number"] = 8] = "Number";
TypeFlags[TypeFlags["Boolean"] = 16] = "Boolean";
TypeFlags[TypeFlags["Enum"] = 32] = "Enum";
- TypeFlags[TypeFlags["StringLiteral"] = 64] = "StringLiteral";
- TypeFlags[TypeFlags["NumberLiteral"] = 128] = "NumberLiteral";
- TypeFlags[TypeFlags["BooleanLiteral"] = 256] = "BooleanLiteral";
- TypeFlags[TypeFlags["EnumLiteral"] = 512] = "EnumLiteral";
- TypeFlags[TypeFlags["ESSymbol"] = 1024] = "ESSymbol";
- TypeFlags[TypeFlags["UniqueESSymbol"] = 2048] = "UniqueESSymbol";
- TypeFlags[TypeFlags["Void"] = 4096] = "Void";
- TypeFlags[TypeFlags["Undefined"] = 8192] = "Undefined";
- TypeFlags[TypeFlags["Null"] = 16384] = "Null";
- TypeFlags[TypeFlags["Never"] = 32768] = "Never";
- TypeFlags[TypeFlags["TypeParameter"] = 65536] = "TypeParameter";
- TypeFlags[TypeFlags["Object"] = 131072] = "Object";
- TypeFlags[TypeFlags["Union"] = 262144] = "Union";
- TypeFlags[TypeFlags["Intersection"] = 524288] = "Intersection";
- TypeFlags[TypeFlags["Index"] = 1048576] = "Index";
- TypeFlags[TypeFlags["IndexedAccess"] = 2097152] = "IndexedAccess";
- TypeFlags[TypeFlags["Conditional"] = 4194304] = "Conditional";
- TypeFlags[TypeFlags["Substitution"] = 8388608] = "Substitution";
- TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive";
- /* @internal */
- TypeFlags[TypeFlags["FreshLiteral"] = 33554432] = "FreshLiteral";
- /* @internal */
- TypeFlags[TypeFlags["UnionOfPrimitiveTypes"] = 67108864] = "UnionOfPrimitiveTypes";
+ TypeFlags[TypeFlags["BigInt"] = 64] = "BigInt";
+ TypeFlags[TypeFlags["StringLiteral"] = 128] = "StringLiteral";
+ TypeFlags[TypeFlags["NumberLiteral"] = 256] = "NumberLiteral";
+ TypeFlags[TypeFlags["BooleanLiteral"] = 512] = "BooleanLiteral";
+ TypeFlags[TypeFlags["EnumLiteral"] = 1024] = "EnumLiteral";
+ TypeFlags[TypeFlags["BigIntLiteral"] = 2048] = "BigIntLiteral";
+ TypeFlags[TypeFlags["ESSymbol"] = 4096] = "ESSymbol";
+ TypeFlags[TypeFlags["UniqueESSymbol"] = 8192] = "UniqueESSymbol";
+ TypeFlags[TypeFlags["Void"] = 16384] = "Void";
+ TypeFlags[TypeFlags["Undefined"] = 32768] = "Undefined";
+ TypeFlags[TypeFlags["Null"] = 65536] = "Null";
+ TypeFlags[TypeFlags["Never"] = 131072] = "Never";
+ TypeFlags[TypeFlags["TypeParameter"] = 262144] = "TypeParameter";
+ TypeFlags[TypeFlags["Object"] = 524288] = "Object";
+ TypeFlags[TypeFlags["Union"] = 1048576] = "Union";
+ TypeFlags[TypeFlags["Intersection"] = 2097152] = "Intersection";
+ TypeFlags[TypeFlags["Index"] = 4194304] = "Index";
+ TypeFlags[TypeFlags["IndexedAccess"] = 8388608] = "IndexedAccess";
+ TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional";
+ TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution";
+ TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive";
/* @internal */
TypeFlags[TypeFlags["ContainsWideningType"] = 134217728] = "ContainsWideningType";
/* @internal */
@@ -3283,40 +3347,41 @@ var ts;
/* @internal */
TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown";
/* @internal */
- TypeFlags[TypeFlags["Nullable"] = 24576] = "Nullable";
- TypeFlags[TypeFlags["Literal"] = 448] = "Literal";
- TypeFlags[TypeFlags["Unit"] = 27072] = "Unit";
- TypeFlags[TypeFlags["StringOrNumberLiteral"] = 192] = "StringOrNumberLiteral";
+ TypeFlags[TypeFlags["Nullable"] = 98304] = "Nullable";
+ TypeFlags[TypeFlags["Literal"] = 2944] = "Literal";
+ TypeFlags[TypeFlags["Unit"] = 109440] = "Unit";
+ TypeFlags[TypeFlags["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral";
/* @internal */
- TypeFlags[TypeFlags["StringOrNumberLiteralOrUnique"] = 2240] = "StringOrNumberLiteralOrUnique";
+ TypeFlags[TypeFlags["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique";
/* @internal */
- TypeFlags[TypeFlags["DefinitelyFalsy"] = 29120] = "DefinitelyFalsy";
- TypeFlags[TypeFlags["PossiblyFalsy"] = 29148] = "PossiblyFalsy";
+ TypeFlags[TypeFlags["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy";
+ TypeFlags[TypeFlags["PossiblyFalsy"] = 117724] = "PossiblyFalsy";
/* @internal */
- TypeFlags[TypeFlags["Intrinsic"] = 16839967] = "Intrinsic";
+ TypeFlags[TypeFlags["Intrinsic"] = 67359327] = "Intrinsic";
/* @internal */
- TypeFlags[TypeFlags["Primitive"] = 32764] = "Primitive";
- TypeFlags[TypeFlags["StringLike"] = 68] = "StringLike";
- TypeFlags[TypeFlags["NumberLike"] = 168] = "NumberLike";
- TypeFlags[TypeFlags["BooleanLike"] = 272] = "BooleanLike";
- TypeFlags[TypeFlags["EnumLike"] = 544] = "EnumLike";
- TypeFlags[TypeFlags["ESSymbolLike"] = 3072] = "ESSymbolLike";
- TypeFlags[TypeFlags["VoidLike"] = 12288] = "VoidLike";
+ TypeFlags[TypeFlags["Primitive"] = 131068] = "Primitive";
+ TypeFlags[TypeFlags["StringLike"] = 132] = "StringLike";
+ TypeFlags[TypeFlags["NumberLike"] = 296] = "NumberLike";
+ TypeFlags[TypeFlags["BigIntLike"] = 2112] = "BigIntLike";
+ TypeFlags[TypeFlags["BooleanLike"] = 528] = "BooleanLike";
+ TypeFlags[TypeFlags["EnumLike"] = 1056] = "EnumLike";
+ TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike";
+ TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike";
/* @internal */
- TypeFlags[TypeFlags["DisjointDomains"] = 16809468] = "DisjointDomains";
- TypeFlags[TypeFlags["UnionOrIntersection"] = 786432] = "UnionOrIntersection";
- TypeFlags[TypeFlags["StructuredType"] = 917504] = "StructuredType";
- TypeFlags[TypeFlags["TypeVariable"] = 2162688] = "TypeVariable";
- TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 14745600] = "InstantiableNonPrimitive";
- TypeFlags[TypeFlags["InstantiablePrimitive"] = 1048576] = "InstantiablePrimitive";
- TypeFlags[TypeFlags["Instantiable"] = 15794176] = "Instantiable";
- TypeFlags[TypeFlags["StructuredOrInstantiable"] = 16711680] = "StructuredOrInstantiable";
+ TypeFlags[TypeFlags["DisjointDomains"] = 67238908] = "DisjointDomains";
+ TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection";
+ TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType";
+ TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable";
+ TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive";
+ TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive";
+ TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable";
+ TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable";
// 'Narrowable' types are types where narrowing actually narrows.
// This *should* be every type other than null, undefined, void, and never
- TypeFlags[TypeFlags["Narrowable"] = 33492479] = "Narrowable";
- TypeFlags[TypeFlags["NotUnionOrUnit"] = 16909315] = "NotUnionOrUnit";
+ TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable";
+ TypeFlags[TypeFlags["NotUnionOrUnit"] = 67637251] = "NotUnionOrUnit";
/* @internal */
- TypeFlags[TypeFlags["NotPrimitiveUnion"] = 16748579] = "NotPrimitiveUnion";
+ TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion";
/* @internal */
TypeFlags[TypeFlags["RequiresWidening"] = 402653184] = "RequiresWidening";
/* @internal */
@@ -3351,6 +3416,7 @@ var ts;
ObjectFlags[ObjectFlags["JsxAttributes"] = 4096] = "JsxAttributes";
ObjectFlags[ObjectFlags["MarkerType"] = 8192] = "MarkerType";
ObjectFlags[ObjectFlags["JSLiteral"] = 16384] = "JSLiteral";
+ ObjectFlags[ObjectFlags["FreshLiteral"] = 32768] = "FreshLiteral";
ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface";
})(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {}));
/* @internal */
@@ -3362,6 +3428,13 @@ var ts;
Variance[Variance["Bivariant"] = 3] = "Bivariant";
Variance[Variance["Independent"] = 4] = "Independent";
})(Variance = ts.Variance || (ts.Variance = {}));
+ /* @internal */
+ var JsxReferenceKind;
+ (function (JsxReferenceKind) {
+ JsxReferenceKind[JsxReferenceKind["Component"] = 0] = "Component";
+ JsxReferenceKind[JsxReferenceKind["Function"] = 1] = "Function";
+ JsxReferenceKind[JsxReferenceKind["Mixed"] = 2] = "Mixed";
+ })(JsxReferenceKind = ts.JsxReferenceKind || (ts.JsxReferenceKind = {}));
var SignatureKind;
(function (SignatureKind) {
SignatureKind[SignatureKind["Call"] = 0] = "Call";
@@ -3422,6 +3495,15 @@ var ts;
AssignmentDeclarationKind[AssignmentDeclarationKind["Property"] = 5] = "Property";
// F.prototype = { ... }
AssignmentDeclarationKind[AssignmentDeclarationKind["Prototype"] = 6] = "Prototype";
+ // Object.defineProperty(x, 'name', { value: any, writable?: boolean (false by default) });
+ // Object.defineProperty(x, 'name', { get: Function, set: Function });
+ // Object.defineProperty(x, 'name', { get: Function });
+ // Object.defineProperty(x, 'name', { set: Function });
+ AssignmentDeclarationKind[AssignmentDeclarationKind["ObjectDefinePropertyValue"] = 7] = "ObjectDefinePropertyValue";
+ // Object.defineProperty(exports || module.exports, 'name', ...);
+ AssignmentDeclarationKind[AssignmentDeclarationKind["ObjectDefinePropertyExports"] = 8] = "ObjectDefinePropertyExports";
+ // Object.defineProperty(Foo.prototype, 'name', ...);
+ AssignmentDeclarationKind[AssignmentDeclarationKind["ObjectDefinePrototypeProperty"] = 9] = "ObjectDefinePrototypeProperty";
})(AssignmentDeclarationKind = ts.AssignmentDeclarationKind || (ts.AssignmentDeclarationKind = {}));
var DiagnosticCategory;
(function (DiagnosticCategory) {
@@ -3789,6 +3871,7 @@ var ts;
EmitHint[EmitHint["IdentifierName"] = 2] = "IdentifierName";
EmitHint[EmitHint["MappedTypeParameter"] = 3] = "MappedTypeParameter";
EmitHint[EmitHint["Unspecified"] = 4] = "Unspecified";
+ EmitHint[EmitHint["EmbeddedStatement"] = 5] = "EmbeddedStatement";
})(EmitHint = ts.EmitHint || (ts.EmitHint = {}));
var ListFormat;
(function (ListFormat) {
@@ -3803,64 +3886,66 @@ var ts;
ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited";
ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited";
ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited";
- ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask";
- ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma";
+ ListFormat[ListFormat["AsteriskDelimited"] = 32] = "AsteriskDelimited";
+ ListFormat[ListFormat["DelimitersMask"] = 60] = "DelimitersMask";
+ ListFormat[ListFormat["AllowTrailingComma"] = 64] = "AllowTrailingComma";
// Whitespace
- ListFormat[ListFormat["Indented"] = 64] = "Indented";
- ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces";
- ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings";
+ ListFormat[ListFormat["Indented"] = 128] = "Indented";
+ ListFormat[ListFormat["SpaceBetweenBraces"] = 256] = "SpaceBetweenBraces";
+ ListFormat[ListFormat["SpaceBetweenSiblings"] = 512] = "SpaceBetweenSiblings";
// Brackets/Braces
- ListFormat[ListFormat["Braces"] = 512] = "Braces";
- ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis";
- ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets";
- ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets";
- ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask";
- ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined";
- ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty";
- ListFormat[ListFormat["Optional"] = 24576] = "Optional";
+ ListFormat[ListFormat["Braces"] = 1024] = "Braces";
+ ListFormat[ListFormat["Parenthesis"] = 2048] = "Parenthesis";
+ ListFormat[ListFormat["AngleBrackets"] = 4096] = "AngleBrackets";
+ ListFormat[ListFormat["SquareBrackets"] = 8192] = "SquareBrackets";
+ ListFormat[ListFormat["BracketsMask"] = 15360] = "BracketsMask";
+ ListFormat[ListFormat["OptionalIfUndefined"] = 16384] = "OptionalIfUndefined";
+ ListFormat[ListFormat["OptionalIfEmpty"] = 32768] = "OptionalIfEmpty";
+ ListFormat[ListFormat["Optional"] = 49152] = "Optional";
// Other
- ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine";
- ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine";
- ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments";
- ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty";
- ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement";
+ ListFormat[ListFormat["PreferNewLine"] = 65536] = "PreferNewLine";
+ ListFormat[ListFormat["NoTrailingNewLine"] = 131072] = "NoTrailingNewLine";
+ ListFormat[ListFormat["NoInterveningComments"] = 262144] = "NoInterveningComments";
+ ListFormat[ListFormat["NoSpaceIfEmpty"] = 524288] = "NoSpaceIfEmpty";
+ ListFormat[ListFormat["SingleElement"] = 1048576] = "SingleElement";
// Precomputed Formats
- ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers";
- ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses";
- ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 384] = "SingleLineTypeLiteralMembers";
- ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 16449] = "MultiLineTypeLiteralMembers";
- ListFormat[ListFormat["TupleTypeElements"] = 272] = "TupleTypeElements";
- ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents";
- ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents";
- ListFormat[ListFormat["ObjectBindingPatternElements"] = 262576] = "ObjectBindingPatternElements";
- ListFormat[ListFormat["ArrayBindingPatternElements"] = 262448] = "ArrayBindingPatternElements";
- ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties";
- ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements";
- ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements";
- ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments";
- ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments";
- ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans";
- ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements";
- ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements";
- ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList";
- ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements";
+ ListFormat[ListFormat["Modifiers"] = 262656] = "Modifiers";
+ ListFormat[ListFormat["HeritageClauses"] = 512] = "HeritageClauses";
+ ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 768] = "SingleLineTypeLiteralMembers";
+ ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 32897] = "MultiLineTypeLiteralMembers";
+ ListFormat[ListFormat["TupleTypeElements"] = 528] = "TupleTypeElements";
+ ListFormat[ListFormat["UnionTypeConstituents"] = 516] = "UnionTypeConstituents";
+ ListFormat[ListFormat["IntersectionTypeConstituents"] = 520] = "IntersectionTypeConstituents";
+ ListFormat[ListFormat["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements";
+ ListFormat[ListFormat["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements";
+ ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties";
+ ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements";
+ ListFormat[ListFormat["CommaListElements"] = 528] = "CommaListElements";
+ ListFormat[ListFormat["CallExpressionArguments"] = 2576] = "CallExpressionArguments";
+ ListFormat[ListFormat["NewExpressionArguments"] = 18960] = "NewExpressionArguments";
+ ListFormat[ListFormat["TemplateExpressionSpans"] = 262144] = "TemplateExpressionSpans";
+ ListFormat[ListFormat["SingleLineBlockStatements"] = 768] = "SingleLineBlockStatements";
+ ListFormat[ListFormat["MultiLineBlockStatements"] = 129] = "MultiLineBlockStatements";
+ ListFormat[ListFormat["VariableDeclarationList"] = 528] = "VariableDeclarationList";
+ ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 768] = "SingleLineFunctionBodyStatements";
ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements";
ListFormat[ListFormat["ClassHeritageClauses"] = 0] = "ClassHeritageClauses";
- ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers";
- ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers";
- ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers";
- ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses";
- ListFormat[ListFormat["NamedImportsOrExportsElements"] = 262576] = "NamedImportsOrExportsElements";
- ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren";
- ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes";
- ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements";
- ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes";
- ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements";
- ListFormat[ListFormat["Decorators"] = 24577] = "Decorators";
- ListFormat[ListFormat["TypeArguments"] = 26896] = "TypeArguments";
- ListFormat[ListFormat["TypeParameters"] = 26896] = "TypeParameters";
- ListFormat[ListFormat["Parameters"] = 1296] = "Parameters";
- ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters";
+ ListFormat[ListFormat["ClassMembers"] = 129] = "ClassMembers";
+ ListFormat[ListFormat["InterfaceMembers"] = 129] = "InterfaceMembers";
+ ListFormat[ListFormat["EnumMembers"] = 145] = "EnumMembers";
+ ListFormat[ListFormat["CaseBlockClauses"] = 129] = "CaseBlockClauses";
+ ListFormat[ListFormat["NamedImportsOrExportsElements"] = 525136] = "NamedImportsOrExportsElements";
+ ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 262144] = "JsxElementOrFragmentChildren";
+ ListFormat[ListFormat["JsxElementAttributes"] = 262656] = "JsxElementAttributes";
+ ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 163969] = "CaseOrDefaultClauseStatements";
+ ListFormat[ListFormat["HeritageClauseTypes"] = 528] = "HeritageClauseTypes";
+ ListFormat[ListFormat["SourceFileStatements"] = 131073] = "SourceFileStatements";
+ ListFormat[ListFormat["Decorators"] = 49153] = "Decorators";
+ ListFormat[ListFormat["TypeArguments"] = 53776] = "TypeArguments";
+ ListFormat[ListFormat["TypeParameters"] = 53776] = "TypeParameters";
+ ListFormat[ListFormat["Parameters"] = 2576] = "Parameters";
+ ListFormat[ListFormat["IndexSignatureParameters"] = 8848] = "IndexSignatureParameters";
+ ListFormat[ListFormat["JSDocComment"] = 33] = "JSDocComment";
})(ListFormat = ts.ListFormat || (ts.ListFormat = {}));
/* @internal */
var PragmaKindFlags;
@@ -5164,6 +5249,7 @@ var ts;
use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."),
Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."),
use_strict_directive_used_here: diag(1349, ts.DiagnosticCategory.Error, "use_strict_directive_used_here_1349", "'use strict' directive used here."),
+ Print_the_final_configuration_instead_of_building: diag(1350, ts.DiagnosticCategory.Message, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."),
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -5220,14 +5306,14 @@ var ts;
Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: diag(2353, ts.DiagnosticCategory.Error, "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),
This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: diag(2354, ts.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", "This syntax requires an imported helper but module '{0}' cannot be found."),
A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: diag(2355, ts.DiagnosticCategory.Error, "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'void' nor 'any' must return a value."),
- An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: diag(2356, ts.DiagnosticCategory.Error, "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number' or an enum type."),
+ An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, ts.DiagnosticCategory.Error, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),
The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts.DiagnosticCategory.Error, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),
The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360", "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'."),
The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2361, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361", "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter."),
- The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type."),
- The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type."),
+ The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
+ The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."),
Operator_0_cannot_be_applied_to_types_1_and_2: diag(2365, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_types_1_and_2_2365", "Operator '{0}' cannot be applied to types '{1}' and '{2}'."),
Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: diag(2366, ts.DiagnosticCategory.Error, "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", "Function lacks ending return statement and return type does not include 'undefined'."),
@@ -5434,9 +5520,9 @@ var ts;
No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),
Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"),
Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."),
Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."),
Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."),
_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."),
@@ -5534,6 +5620,13 @@ var ts;
Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),
Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"),
It_is_highly_likely_that_you_are_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "It_is_highly_likely_that_you_are_missing_a_semicolon_2734", "It is highly likely that you are missing a semicolon."),
+ Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),
+ Operator_0_cannot_be_applied_to_type_1: diag(2736, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."),
+ BigInt_literals_are_not_available_when_targeting_lower_than_ESNext: diag(2737, ts.DiagnosticCategory.Error, "BigInt_literals_are_not_available_when_targeting_lower_than_ESNext_2737", "BigInt literals are not available when targeting lower than ESNext."),
+ An_outer_value_of_this_is_shadowed_by_this_container: diag(2738, ts.DiagnosticCategory.Message, "An_outer_value_of_this_is_shadowed_by_this_container_2738", "An outer value of 'this' is shadowed by this container."),
+ Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"),
+ Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),
+ Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."),
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -5850,6 +5943,9 @@ var ts;
Did_you_mean_to_call_this_expression: diag(6212, ts.DiagnosticCategory.Message, "Did_you_mean_to_call_this_expression_6212", "Did you mean to call this expression?"),
Did_you_mean_to_use_new_with_this_expression: diag(6213, ts.DiagnosticCategory.Message, "Did_you_mean_to_use_new_with_this_expression_6213", "Did you mean to use 'new' with this expression?"),
Enable_strict_bind_call_and_apply_methods_on_functions: diag(6214, ts.DiagnosticCategory.Message, "Enable_strict_bind_call_and_apply_methods_on_functions_6214", "Enable strict 'bind', 'call', and 'apply' methods on functions."),
+ Using_compiler_options_of_project_reference_redirect_0: diag(6215, ts.DiagnosticCategory.Message, "Using_compiler_options_of_project_reference_redirect_0_6215", "Using compiler options of project reference redirect '{0}'."),
+ Found_1_error: diag(6216, ts.DiagnosticCategory.Message, "Found_1_error_6216", "Found 1 error."),
+ Found_0_errors: diag(6217, ts.DiagnosticCategory.Message, "Found_0_errors_6217", "Found {0} errors."),
Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"),
Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"),
Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
@@ -5890,6 +5986,7 @@ var ts;
_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, ts.DiagnosticCategory.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, ts.DiagnosticCategory.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."),
Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, ts.DiagnosticCategory.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, ts.DiagnosticCategory.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, ts.DiagnosticCategory.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'."),
Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: diag(7016, ts.DiagnosticCategory.Error, "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", "Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),
Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: diag(7017, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017", "Element implicitly has an 'any' type because type '{0}' has no index signature."),
@@ -5917,6 +6014,14 @@ var ts;
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: diag(7040, ts.DiagnosticCategory.Error, "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040", "If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}`"),
The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any: diag(7041, ts.DiagnosticCategory.Error, "The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any_7041", "The containing arrow function captures the global value of 'this' which implicitly has type 'any'."),
Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: diag(7042, ts.DiagnosticCategory.Error, "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042", "Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),
+ Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7043, ts.DiagnosticCategory.Suggestion, "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043", "Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
+ Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7044, ts.DiagnosticCategory.Suggestion, "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044", "Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
+ Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7045, ts.DiagnosticCategory.Suggestion, "Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045", "Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
+ Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage: diag(7046, ts.DiagnosticCategory.Suggestion, "Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046", "Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),
+ Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage: diag(7047, ts.DiagnosticCategory.Suggestion, "Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047", "Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),
+ Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),
+ Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),
+ _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."),
@@ -6078,6 +6183,8 @@ var ts;
Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"),
Generate_types_for_0: diag(95067, ts.DiagnosticCategory.Message, "Generate_types_for_0_95067", "Generate types for '{0}'"),
Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"),
+ Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"),
+ Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"),
};
})(ts || (ts = {}));
var ts;
@@ -6085,93 +6192,94 @@ var ts;
var _a;
/* @internal */
function tokenIsIdentifierOrKeyword(token) {
- return token >= 71 /* Identifier */;
+ return token >= 72 /* Identifier */;
}
ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;
/* @internal */
function tokenIsIdentifierOrKeywordOrGreaterThan(token) {
- return token === 29 /* GreaterThanToken */ || tokenIsIdentifierOrKeyword(token);
+ return token === 30 /* GreaterThanToken */ || tokenIsIdentifierOrKeyword(token);
}
ts.tokenIsIdentifierOrKeywordOrGreaterThan = tokenIsIdentifierOrKeywordOrGreaterThan;
var textToKeywordObj = (_a = {
- abstract: 117 /* AbstractKeyword */,
- any: 119 /* AnyKeyword */,
- as: 118 /* AsKeyword */,
- boolean: 122 /* BooleanKeyword */,
- break: 72 /* BreakKeyword */,
- case: 73 /* CaseKeyword */,
- catch: 74 /* CatchKeyword */,
- class: 75 /* ClassKeyword */,
- continue: 77 /* ContinueKeyword */,
- const: 76 /* ConstKeyword */
+ abstract: 118 /* AbstractKeyword */,
+ any: 120 /* AnyKeyword */,
+ as: 119 /* AsKeyword */,
+ bigint: 146 /* BigIntKeyword */,
+ boolean: 123 /* BooleanKeyword */,
+ break: 73 /* BreakKeyword */,
+ case: 74 /* CaseKeyword */,
+ catch: 75 /* CatchKeyword */,
+ class: 76 /* ClassKeyword */,
+ continue: 78 /* ContinueKeyword */,
+ const: 77 /* ConstKeyword */
},
- _a["" + "constructor"] = 123 /* ConstructorKeyword */,
- _a.debugger = 78 /* DebuggerKeyword */,
- _a.declare = 124 /* DeclareKeyword */,
- _a.default = 79 /* DefaultKeyword */,
- _a.delete = 80 /* DeleteKeyword */,
- _a.do = 81 /* DoKeyword */,
- _a.else = 82 /* ElseKeyword */,
- _a.enum = 83 /* EnumKeyword */,
- _a.export = 84 /* ExportKeyword */,
- _a.extends = 85 /* ExtendsKeyword */,
- _a.false = 86 /* FalseKeyword */,
- _a.finally = 87 /* FinallyKeyword */,
- _a.for = 88 /* ForKeyword */,
- _a.from = 143 /* FromKeyword */,
- _a.function = 89 /* FunctionKeyword */,
- _a.get = 125 /* GetKeyword */,
- _a.if = 90 /* IfKeyword */,
- _a.implements = 108 /* ImplementsKeyword */,
- _a.import = 91 /* ImportKeyword */,
- _a.in = 92 /* InKeyword */,
- _a.infer = 126 /* InferKeyword */,
- _a.instanceof = 93 /* InstanceOfKeyword */,
- _a.interface = 109 /* InterfaceKeyword */,
- _a.is = 127 /* IsKeyword */,
- _a.keyof = 128 /* KeyOfKeyword */,
- _a.let = 110 /* LetKeyword */,
- _a.module = 129 /* ModuleKeyword */,
- _a.namespace = 130 /* NamespaceKeyword */,
- _a.never = 131 /* NeverKeyword */,
- _a.new = 94 /* NewKeyword */,
- _a.null = 95 /* NullKeyword */,
- _a.number = 134 /* NumberKeyword */,
- _a.object = 135 /* ObjectKeyword */,
- _a.package = 111 /* PackageKeyword */,
- _a.private = 112 /* PrivateKeyword */,
- _a.protected = 113 /* ProtectedKeyword */,
- _a.public = 114 /* PublicKeyword */,
- _a.readonly = 132 /* ReadonlyKeyword */,
- _a.require = 133 /* RequireKeyword */,
- _a.global = 144 /* GlobalKeyword */,
- _a.return = 96 /* ReturnKeyword */,
- _a.set = 136 /* SetKeyword */,
- _a.static = 115 /* StaticKeyword */,
- _a.string = 137 /* StringKeyword */,
- _a.super = 97 /* SuperKeyword */,
- _a.switch = 98 /* SwitchKeyword */,
- _a.symbol = 138 /* SymbolKeyword */,
- _a.this = 99 /* ThisKeyword */,
- _a.throw = 100 /* ThrowKeyword */,
- _a.true = 101 /* TrueKeyword */,
- _a.try = 102 /* TryKeyword */,
- _a.type = 139 /* TypeKeyword */,
- _a.typeof = 103 /* TypeOfKeyword */,
- _a.undefined = 140 /* UndefinedKeyword */,
- _a.unique = 141 /* UniqueKeyword */,
- _a.unknown = 142 /* UnknownKeyword */,
- _a.var = 104 /* VarKeyword */,
- _a.void = 105 /* VoidKeyword */,
- _a.while = 106 /* WhileKeyword */,
- _a.with = 107 /* WithKeyword */,
- _a.yield = 116 /* YieldKeyword */,
- _a.async = 120 /* AsyncKeyword */,
- _a.await = 121 /* AwaitKeyword */,
- _a.of = 145 /* OfKeyword */,
+ _a["" + "constructor"] = 124 /* ConstructorKeyword */,
+ _a.debugger = 79 /* DebuggerKeyword */,
+ _a.declare = 125 /* DeclareKeyword */,
+ _a.default = 80 /* DefaultKeyword */,
+ _a.delete = 81 /* DeleteKeyword */,
+ _a.do = 82 /* DoKeyword */,
+ _a.else = 83 /* ElseKeyword */,
+ _a.enum = 84 /* EnumKeyword */,
+ _a.export = 85 /* ExportKeyword */,
+ _a.extends = 86 /* ExtendsKeyword */,
+ _a.false = 87 /* FalseKeyword */,
+ _a.finally = 88 /* FinallyKeyword */,
+ _a.for = 89 /* ForKeyword */,
+ _a.from = 144 /* FromKeyword */,
+ _a.function = 90 /* FunctionKeyword */,
+ _a.get = 126 /* GetKeyword */,
+ _a.if = 91 /* IfKeyword */,
+ _a.implements = 109 /* ImplementsKeyword */,
+ _a.import = 92 /* ImportKeyword */,
+ _a.in = 93 /* InKeyword */,
+ _a.infer = 127 /* InferKeyword */,
+ _a.instanceof = 94 /* InstanceOfKeyword */,
+ _a.interface = 110 /* InterfaceKeyword */,
+ _a.is = 128 /* IsKeyword */,
+ _a.keyof = 129 /* KeyOfKeyword */,
+ _a.let = 111 /* LetKeyword */,
+ _a.module = 130 /* ModuleKeyword */,
+ _a.namespace = 131 /* NamespaceKeyword */,
+ _a.never = 132 /* NeverKeyword */,
+ _a.new = 95 /* NewKeyword */,
+ _a.null = 96 /* NullKeyword */,
+ _a.number = 135 /* NumberKeyword */,
+ _a.object = 136 /* ObjectKeyword */,
+ _a.package = 112 /* PackageKeyword */,
+ _a.private = 113 /* PrivateKeyword */,
+ _a.protected = 114 /* ProtectedKeyword */,
+ _a.public = 115 /* PublicKeyword */,
+ _a.readonly = 133 /* ReadonlyKeyword */,
+ _a.require = 134 /* RequireKeyword */,
+ _a.global = 145 /* GlobalKeyword */,
+ _a.return = 97 /* ReturnKeyword */,
+ _a.set = 137 /* SetKeyword */,
+ _a.static = 116 /* StaticKeyword */,
+ _a.string = 138 /* StringKeyword */,
+ _a.super = 98 /* SuperKeyword */,
+ _a.switch = 99 /* SwitchKeyword */,
+ _a.symbol = 139 /* SymbolKeyword */,
+ _a.this = 100 /* ThisKeyword */,
+ _a.throw = 101 /* ThrowKeyword */,
+ _a.true = 102 /* TrueKeyword */,
+ _a.try = 103 /* TryKeyword */,
+ _a.type = 140 /* TypeKeyword */,
+ _a.typeof = 104 /* TypeOfKeyword */,
+ _a.undefined = 141 /* UndefinedKeyword */,
+ _a.unique = 142 /* UniqueKeyword */,
+ _a.unknown = 143 /* UnknownKeyword */,
+ _a.var = 105 /* VarKeyword */,
+ _a.void = 106 /* VoidKeyword */,
+ _a.while = 107 /* WhileKeyword */,
+ _a.with = 108 /* WithKeyword */,
+ _a.yield = 117 /* YieldKeyword */,
+ _a.async = 121 /* AsyncKeyword */,
+ _a.await = 122 /* AwaitKeyword */,
+ _a.of = 147 /* OfKeyword */,
_a);
var textToKeyword = ts.createMapFromTemplate(textToKeywordObj);
- var textToToken = ts.createMapFromTemplate(__assign({}, textToKeywordObj, { "{": 17 /* OpenBraceToken */, "}": 18 /* CloseBraceToken */, "(": 19 /* OpenParenToken */, ")": 20 /* CloseParenToken */, "[": 21 /* OpenBracketToken */, "]": 22 /* CloseBracketToken */, ".": 23 /* DotToken */, "...": 24 /* DotDotDotToken */, ";": 25 /* SemicolonToken */, ",": 26 /* CommaToken */, "<": 27 /* LessThanToken */, ">": 29 /* GreaterThanToken */, "<=": 30 /* LessThanEqualsToken */, ">=": 31 /* GreaterThanEqualsToken */, "==": 32 /* EqualsEqualsToken */, "!=": 33 /* ExclamationEqualsToken */, "===": 34 /* EqualsEqualsEqualsToken */, "!==": 35 /* ExclamationEqualsEqualsToken */, "=>": 36 /* EqualsGreaterThanToken */, "+": 37 /* PlusToken */, "-": 38 /* MinusToken */, "**": 40 /* AsteriskAsteriskToken */, "*": 39 /* AsteriskToken */, "/": 41 /* SlashToken */, "%": 42 /* PercentToken */, "++": 43 /* PlusPlusToken */, "--": 44 /* MinusMinusToken */, "<<": 45 /* LessThanLessThanToken */, "": 28 /* LessThanSlashToken */, ">>": 46 /* GreaterThanGreaterThanToken */, ">>>": 47 /* GreaterThanGreaterThanGreaterThanToken */, "&": 48 /* AmpersandToken */, "|": 49 /* BarToken */, "^": 50 /* CaretToken */, "!": 51 /* ExclamationToken */, "~": 52 /* TildeToken */, "&&": 53 /* AmpersandAmpersandToken */, "||": 54 /* BarBarToken */, "?": 55 /* QuestionToken */, ":": 56 /* ColonToken */, "=": 58 /* EqualsToken */, "+=": 59 /* PlusEqualsToken */, "-=": 60 /* MinusEqualsToken */, "*=": 61 /* AsteriskEqualsToken */, "**=": 62 /* AsteriskAsteriskEqualsToken */, "/=": 63 /* SlashEqualsToken */, "%=": 64 /* PercentEqualsToken */, "<<=": 65 /* LessThanLessThanEqualsToken */, ">>=": 66 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 68 /* AmpersandEqualsToken */, "|=": 69 /* BarEqualsToken */, "^=": 70 /* CaretEqualsToken */, "@": 57 /* AtToken */ }));
+ var textToToken = ts.createMapFromTemplate(__assign({}, textToKeywordObj, { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 28 /* LessThanToken */, ">": 30 /* GreaterThanToken */, "<=": 31 /* LessThanEqualsToken */, ">=": 32 /* GreaterThanEqualsToken */, "==": 33 /* EqualsEqualsToken */, "!=": 34 /* ExclamationEqualsToken */, "===": 35 /* EqualsEqualsEqualsToken */, "!==": 36 /* ExclamationEqualsEqualsToken */, "=>": 37 /* EqualsGreaterThanToken */, "+": 38 /* PlusToken */, "-": 39 /* MinusToken */, "**": 41 /* AsteriskAsteriskToken */, "*": 40 /* AsteriskToken */, "/": 42 /* SlashToken */, "%": 43 /* PercentToken */, "++": 44 /* PlusPlusToken */, "--": 45 /* MinusMinusToken */, "<<": 46 /* LessThanLessThanToken */, "": 29 /* LessThanSlashToken */, ">>": 47 /* GreaterThanGreaterThanToken */, ">>>": 48 /* GreaterThanGreaterThanGreaterThanToken */, "&": 49 /* AmpersandToken */, "|": 50 /* BarToken */, "^": 51 /* CaretToken */, "!": 52 /* ExclamationToken */, "~": 53 /* TildeToken */, "&&": 54 /* AmpersandAmpersandToken */, "||": 55 /* BarBarToken */, "?": 56 /* QuestionToken */, ":": 57 /* ColonToken */, "=": 59 /* EqualsToken */, "+=": 60 /* PlusEqualsToken */, "-=": 61 /* MinusEqualsToken */, "*=": 62 /* AsteriskEqualsToken */, "**=": 63 /* AsteriskAsteriskEqualsToken */, "/=": 64 /* SlashEqualsToken */, "%=": 65 /* PercentEqualsToken */, "<<=": 66 /* LessThanLessThanEqualsToken */, ">>=": 67 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 69 /* AmpersandEqualsToken */, "|=": 70 /* BarEqualsToken */, "^=": 71 /* CaretEqualsToken */, "@": 58 /* AtToken */ }));
/*
As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers
IdentifierStart ::
@@ -6760,8 +6868,8 @@ var ts;
getTokenValue: function () { return tokenValue; },
hasExtendedUnicodeEscape: function () { return (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0; },
hasPrecedingLineBreak: function () { return (tokenFlags & 1 /* PrecedingLineBreak */) !== 0; },
- isIdentifier: function () { return token === 71 /* Identifier */ || token > 107 /* LastReservedWord */; },
- isReservedWord: function () { return token >= 72 /* FirstReservedWord */ && token <= 107 /* LastReservedWord */; },
+ isIdentifier: function () { return token === 72 /* Identifier */ || token > 108 /* LastReservedWord */; },
+ isReservedWord: function () { return token >= 73 /* FirstReservedWord */ && token <= 108 /* LastReservedWord */; },
isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; },
getTokenFlags: function () { return tokenFlags; },
reScanGreaterToken: reScanGreaterToken,
@@ -6855,18 +6963,29 @@ var ts;
end = pos;
}
}
+ var result;
if (tokenFlags & 512 /* ContainsSeparator */) {
- var result = mainFragment;
+ result = mainFragment;
if (decimalFragment) {
result += "." + decimalFragment;
}
if (scientificFragment) {
result += scientificFragment;
}
- return "" + +result;
}
else {
- return "" + +(text.substring(start, end)); // No need to use all the fragments; no _ removal needed
+ result = text.substring(start, end); // No need to use all the fragments; no _ removal needed
+ }
+ if (decimalFragment !== undefined || tokenFlags & 16 /* Scientific */) {
+ return {
+ type: 8 /* NumericLiteral */,
+ value: "" + +result // if value is not an integer, it can be safely coerced to a number
+ };
+ }
+ else {
+ tokenValue = result;
+ var type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint
+ return { type: type, value: tokenValue };
}
}
function scanOctalDigits() {
@@ -6881,21 +7000,21 @@ var ts;
* returning -1 if the given number is unavailable.
*/
function scanExactNumberOfHexDigits(count, canHaveSeparators) {
- return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false, canHaveSeparators);
+ var valueString = scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false, canHaveSeparators);
+ return valueString ? parseInt(valueString, 16) : -1;
}
/**
* Scans as many hexadecimal digits as are available in the text,
- * returning -1 if the given number of digits was unavailable.
+ * returning "" if the given number of digits was unavailable.
*/
function scanMinimumNumberOfHexDigits(count, canHaveSeparators) {
return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true, canHaveSeparators);
}
function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) {
- var digits = 0;
- var value = 0;
+ var valueChars = [];
var allowSeparator = false;
var isPreviousTokenSeparator = false;
- while (digits < minCount || scanAsManyAsPossible) {
+ while (valueChars.length < minCount || scanAsManyAsPossible) {
var ch = text.charCodeAt(pos);
if (canHaveSeparators && ch === 95 /* _ */) {
tokenFlags |= 512 /* ContainsSeparator */;
@@ -6913,29 +7032,24 @@ var ts;
continue;
}
allowSeparator = canHaveSeparators;
- if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) {
- value = value * 16 + ch - 48 /* _0 */;
+ if (ch >= 65 /* A */ && ch <= 70 /* F */) {
+ ch += 97 /* a */ - 65 /* A */; // standardize hex literals to lowercase
}
- else if (ch >= 65 /* A */ && ch <= 70 /* F */) {
- value = value * 16 + ch - 65 /* A */ + 10;
- }
- else if (ch >= 97 /* a */ && ch <= 102 /* f */) {
- value = value * 16 + ch - 97 /* a */ + 10;
- }
- else {
+ else if (!((ch >= 48 /* _0 */ && ch <= 57 /* _9 */) ||
+ (ch >= 97 /* a */ && ch <= 102 /* f */))) {
break;
}
+ valueChars.push(ch);
pos++;
- digits++;
isPreviousTokenSeparator = false;
}
- if (digits < minCount) {
- value = -1;
+ if (valueChars.length < minCount) {
+ valueChars = [];
}
if (text.charCodeAt(pos - 1) === 95 /* _ */) {
error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);
}
- return value;
+ return String.fromCharCode.apply(String, valueChars);
}
function scanString(jsxAttributeString) {
if (jsxAttributeString === void 0) { jsxAttributeString = false; }
@@ -6987,7 +7101,7 @@ var ts;
contents += text.substring(start, pos);
tokenFlags |= 4 /* Unterminated */;
error(ts.Diagnostics.Unterminated_template_literal);
- resultingToken = startedWithBacktick ? 13 /* NoSubstitutionTemplateLiteral */ : 16 /* TemplateTail */;
+ resultingToken = startedWithBacktick ? 14 /* NoSubstitutionTemplateLiteral */ : 17 /* TemplateTail */;
break;
}
var currChar = text.charCodeAt(pos);
@@ -6995,14 +7109,14 @@ var ts;
if (currChar === 96 /* backtick */) {
contents += text.substring(start, pos);
pos++;
- resultingToken = startedWithBacktick ? 13 /* NoSubstitutionTemplateLiteral */ : 16 /* TemplateTail */;
+ resultingToken = startedWithBacktick ? 14 /* NoSubstitutionTemplateLiteral */ : 17 /* TemplateTail */;
break;
}
// '${'
if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) {
contents += text.substring(start, pos);
pos += 2;
- resultingToken = startedWithBacktick ? 14 /* TemplateHead */ : 15 /* TemplateMiddle */;
+ resultingToken = startedWithBacktick ? 15 /* TemplateHead */ : 16 /* TemplateMiddle */;
break;
}
// Escape character
@@ -7095,7 +7209,8 @@ var ts;
}
}
function scanExtendedUnicodeEscape() {
- var escapedValue = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
+ var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
+ var escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
var isInvalidExtendedEscape = false;
// Validate the value of the digit
if (escapedValue < 0) {
@@ -7183,14 +7298,12 @@ var ts;
}
}
}
- return token = 71 /* Identifier */;
+ return token = 72 /* Identifier */;
}
function scanBinaryOrOctalDigits(base) {
- ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8");
- var value = 0;
+ var value = "";
// For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b.
// Similarly valid octalIntegerLiteral must have at least one octal digit following o or O.
- var numberOfDigits = 0;
var separatorAllowed = false;
var isPreviousTokenSeparator = false;
while (true) {
@@ -7212,27 +7325,42 @@ var ts;
continue;
}
separatorAllowed = true;
- var valueOfCh = ch - 48 /* _0 */;
- if (!isDigit(ch) || valueOfCh >= base) {
+ if (!isDigit(ch) || ch - 48 /* _0 */ >= base) {
break;
}
- value = value * base + valueOfCh;
+ value += text[pos];
pos++;
- numberOfDigits++;
isPreviousTokenSeparator = false;
}
- // Invalid binaryIntegerLiteral or octalIntegerLiteral
- if (numberOfDigits === 0) {
- return -1;
- }
if (text.charCodeAt(pos - 1) === 95 /* _ */) {
// Literal ends with underscore - not allowed
error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);
- return value;
}
return value;
}
+ function checkBigIntSuffix() {
+ if (text.charCodeAt(pos) === 110 /* n */) {
+ tokenValue += "n";
+ // Use base 10 instead of base 2 or base 8 for shorter literals
+ if (tokenFlags & 384 /* BinaryOrOctalSpecifier */) {
+ tokenValue = ts.parsePseudoBigInt(tokenValue) + "n";
+ }
+ pos++;
+ return 9 /* BigIntLiteral */;
+ }
+ else { // not a bigint, so can convert to number in simplified form
+ // Number() may not support 0b or 0o, so use parseInt() instead
+ var numericValue = tokenFlags & 128 /* BinarySpecifier */
+ ? parseInt(tokenValue.slice(2), 2) // skip "0b"
+ : tokenFlags & 256 /* OctalSpecifier */
+ ? parseInt(tokenValue.slice(2), 8) // skip "0o"
+ : +tokenValue;
+ tokenValue = "" + numericValue;
+ return 8 /* NumericLiteral */;
+ }
+ }
function scan() {
+ var _a;
startPos = pos;
tokenFlags = 0;
var asteriskSeen = false;
@@ -7305,48 +7433,48 @@ var ts;
case 33 /* exclamation */:
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 35 /* ExclamationEqualsEqualsToken */;
+ return pos += 3, token = 36 /* ExclamationEqualsEqualsToken */;
}
- return pos += 2, token = 33 /* ExclamationEqualsToken */;
+ return pos += 2, token = 34 /* ExclamationEqualsToken */;
}
pos++;
- return token = 51 /* ExclamationToken */;
+ return token = 52 /* ExclamationToken */;
case 34 /* doubleQuote */:
case 39 /* singleQuote */:
tokenValue = scanString();
- return token = 9 /* StringLiteral */;
+ return token = 10 /* StringLiteral */;
case 96 /* backtick */:
return token = scanTemplateAndSetTokenValue();
case 37 /* percent */:
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 64 /* PercentEqualsToken */;
+ return pos += 2, token = 65 /* PercentEqualsToken */;
}
pos++;
- return token = 42 /* PercentToken */;
+ return token = 43 /* PercentToken */;
case 38 /* ampersand */:
if (text.charCodeAt(pos + 1) === 38 /* ampersand */) {
- return pos += 2, token = 53 /* AmpersandAmpersandToken */;
+ return pos += 2, token = 54 /* AmpersandAmpersandToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 68 /* AmpersandEqualsToken */;
+ return pos += 2, token = 69 /* AmpersandEqualsToken */;
}
pos++;
- return token = 48 /* AmpersandToken */;
+ return token = 49 /* AmpersandToken */;
case 40 /* openParen */:
pos++;
- return token = 19 /* OpenParenToken */;
+ return token = 20 /* OpenParenToken */;
case 41 /* closeParen */:
pos++;
- return token = 20 /* CloseParenToken */;
+ return token = 21 /* CloseParenToken */;
case 42 /* asterisk */:
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 61 /* AsteriskEqualsToken */;
+ return pos += 2, token = 62 /* AsteriskEqualsToken */;
}
if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 62 /* AsteriskAsteriskEqualsToken */;
+ return pos += 3, token = 63 /* AsteriskAsteriskEqualsToken */;
}
- return pos += 2, token = 40 /* AsteriskAsteriskToken */;
+ return pos += 2, token = 41 /* AsteriskAsteriskToken */;
}
pos++;
if (inJSDocType && !asteriskSeen && (tokenFlags & 1 /* PrecedingLineBreak */)) {
@@ -7354,38 +7482,38 @@ var ts;
asteriskSeen = true;
continue;
}
- return token = 39 /* AsteriskToken */;
+ return token = 40 /* AsteriskToken */;
case 43 /* plus */:
if (text.charCodeAt(pos + 1) === 43 /* plus */) {
- return pos += 2, token = 43 /* PlusPlusToken */;
+ return pos += 2, token = 44 /* PlusPlusToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 59 /* PlusEqualsToken */;
+ return pos += 2, token = 60 /* PlusEqualsToken */;
}
pos++;
- return token = 37 /* PlusToken */;
+ return token = 38 /* PlusToken */;
case 44 /* comma */:
pos++;
- return token = 26 /* CommaToken */;
+ return token = 27 /* CommaToken */;
case 45 /* minus */:
if (text.charCodeAt(pos + 1) === 45 /* minus */) {
- return pos += 2, token = 44 /* MinusMinusToken */;
+ return pos += 2, token = 45 /* MinusMinusToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 60 /* MinusEqualsToken */;
+ return pos += 2, token = 61 /* MinusEqualsToken */;
}
pos++;
- return token = 38 /* MinusToken */;
+ return token = 39 /* MinusToken */;
case 46 /* dot */:
if (isDigit(text.charCodeAt(pos + 1))) {
- tokenValue = scanNumber();
+ tokenValue = scanNumber().value;
return token = 8 /* NumericLiteral */;
}
if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {
- return pos += 3, token = 24 /* DotDotDotToken */;
+ return pos += 3, token = 25 /* DotDotDotToken */;
}
pos++;
- return token = 23 /* DotToken */;
+ return token = 24 /* DotToken */;
case 47 /* slash */:
// Single-line comment
if (text.charCodeAt(pos + 1) === 47 /* slash */) {
@@ -7436,43 +7564,43 @@ var ts;
}
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 63 /* SlashEqualsToken */;
+ return pos += 2, token = 64 /* SlashEqualsToken */;
}
pos++;
- return token = 41 /* SlashToken */;
+ return token = 42 /* SlashToken */;
case 48 /* _0 */:
if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) {
pos += 2;
- var value = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ true);
- if (value < 0) {
+ tokenValue = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ true);
+ if (!tokenValue) {
error(ts.Diagnostics.Hexadecimal_digit_expected);
- value = 0;
+ tokenValue = "0";
}
- tokenValue = "" + value;
+ tokenValue = "0x" + tokenValue;
tokenFlags |= 64 /* HexSpecifier */;
- return token = 8 /* NumericLiteral */;
+ return token = checkBigIntSuffix();
}
else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) {
pos += 2;
- var value = scanBinaryOrOctalDigits(/* base */ 2);
- if (value < 0) {
+ tokenValue = scanBinaryOrOctalDigits(/* base */ 2);
+ if (!tokenValue) {
error(ts.Diagnostics.Binary_digit_expected);
- value = 0;
+ tokenValue = "0";
}
- tokenValue = "" + value;
+ tokenValue = "0b" + tokenValue;
tokenFlags |= 128 /* BinarySpecifier */;
- return token = 8 /* NumericLiteral */;
+ return token = checkBigIntSuffix();
}
else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) {
pos += 2;
- var value = scanBinaryOrOctalDigits(/* base */ 8);
- if (value < 0) {
+ tokenValue = scanBinaryOrOctalDigits(/* base */ 8);
+ if (!tokenValue) {
error(ts.Diagnostics.Octal_digit_expected);
- value = 0;
+ tokenValue = "0";
}
- tokenValue = "" + value;
+ tokenValue = "0o" + tokenValue;
tokenFlags |= 256 /* OctalSpecifier */;
- return token = 8 /* NumericLiteral */;
+ return token = checkBigIntSuffix();
}
// Try to parse as an octal
if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) {
@@ -7493,14 +7621,14 @@ var ts;
case 55 /* _7 */:
case 56 /* _8 */:
case 57 /* _9 */:
- tokenValue = scanNumber();
- return token = 8 /* NumericLiteral */;
+ (_a = scanNumber(), token = _a.type, tokenValue = _a.value);
+ return token;
case 58 /* colon */:
pos++;
- return token = 56 /* ColonToken */;
+ return token = 57 /* ColonToken */;
case 59 /* semicolon */:
pos++;
- return token = 25 /* SemicolonToken */;
+ return token = 26 /* SemicolonToken */;
case 60 /* lessThan */:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -7513,20 +7641,20 @@ var ts;
}
if (text.charCodeAt(pos + 1) === 60 /* lessThan */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 65 /* LessThanLessThanEqualsToken */;
+ return pos += 3, token = 66 /* LessThanLessThanEqualsToken */;
}
- return pos += 2, token = 45 /* LessThanLessThanToken */;
+ return pos += 2, token = 46 /* LessThanLessThanToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 30 /* LessThanEqualsToken */;
+ return pos += 2, token = 31 /* LessThanEqualsToken */;
}
if (languageVariant === 1 /* JSX */ &&
text.charCodeAt(pos + 1) === 47 /* slash */ &&
text.charCodeAt(pos + 2) !== 42 /* asterisk */) {
- return pos += 2, token = 28 /* LessThanSlashToken */;
+ return pos += 2, token = 29 /* LessThanSlashToken */;
}
pos++;
- return token = 27 /* LessThanToken */;
+ return token = 28 /* LessThanToken */;
case 61 /* equals */:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -7539,15 +7667,15 @@ var ts;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 34 /* EqualsEqualsEqualsToken */;
+ return pos += 3, token = 35 /* EqualsEqualsEqualsToken */;
}
- return pos += 2, token = 32 /* EqualsEqualsToken */;
+ return pos += 2, token = 33 /* EqualsEqualsToken */;
}
if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) {
- return pos += 2, token = 36 /* EqualsGreaterThanToken */;
+ return pos += 2, token = 37 /* EqualsGreaterThanToken */;
}
pos++;
- return token = 58 /* EqualsToken */;
+ return token = 59 /* EqualsToken */;
case 62 /* greaterThan */:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -7559,25 +7687,25 @@ var ts;
}
}
pos++;
- return token = 29 /* GreaterThanToken */;
+ return token = 30 /* GreaterThanToken */;
case 63 /* question */:
pos++;
- return token = 55 /* QuestionToken */;
+ return token = 56 /* QuestionToken */;
case 91 /* openBracket */:
pos++;
- return token = 21 /* OpenBracketToken */;
+ return token = 22 /* OpenBracketToken */;
case 93 /* closeBracket */:
pos++;
- return token = 22 /* CloseBracketToken */;
+ return token = 23 /* CloseBracketToken */;
case 94 /* caret */:
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 70 /* CaretEqualsToken */;
+ return pos += 2, token = 71 /* CaretEqualsToken */;
}
pos++;
- return token = 50 /* CaretToken */;
+ return token = 51 /* CaretToken */;
case 123 /* openBrace */:
pos++;
- return token = 17 /* OpenBraceToken */;
+ return token = 18 /* OpenBraceToken */;
case 124 /* bar */:
if (isConflictMarkerTrivia(text, pos)) {
pos = scanConflictMarkerTrivia(text, pos, error);
@@ -7589,22 +7717,22 @@ var ts;
}
}
if (text.charCodeAt(pos + 1) === 124 /* bar */) {
- return pos += 2, token = 54 /* BarBarToken */;
+ return pos += 2, token = 55 /* BarBarToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 69 /* BarEqualsToken */;
+ return pos += 2, token = 70 /* BarEqualsToken */;
}
pos++;
- return token = 49 /* BarToken */;
+ return token = 50 /* BarToken */;
case 125 /* closeBrace */:
pos++;
- return token = 18 /* CloseBraceToken */;
+ return token = 19 /* CloseBraceToken */;
case 126 /* tilde */:
pos++;
- return token = 52 /* TildeToken */;
+ return token = 53 /* TildeToken */;
case 64 /* at */:
pos++;
- return token = 57 /* AtToken */;
+ return token = 58 /* AtToken */;
case 92 /* backslash */:
var cookedChar = peekUnicodeEscape();
if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
@@ -7642,29 +7770,29 @@ var ts;
}
}
function reScanGreaterToken() {
- if (token === 29 /* GreaterThanToken */) {
+ if (token === 30 /* GreaterThanToken */) {
if (text.charCodeAt(pos) === 62 /* greaterThan */) {
if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) {
if (text.charCodeAt(pos + 2) === 61 /* equals */) {
- return pos += 3, token = 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */;
+ return pos += 3, token = 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */;
}
- return pos += 2, token = 47 /* GreaterThanGreaterThanGreaterThanToken */;
+ return pos += 2, token = 48 /* GreaterThanGreaterThanGreaterThanToken */;
}
if (text.charCodeAt(pos + 1) === 61 /* equals */) {
- return pos += 2, token = 66 /* GreaterThanGreaterThanEqualsToken */;
+ return pos += 2, token = 67 /* GreaterThanGreaterThanEqualsToken */;
}
pos++;
- return token = 46 /* GreaterThanGreaterThanToken */;
+ return token = 47 /* GreaterThanGreaterThanToken */;
}
if (text.charCodeAt(pos) === 61 /* equals */) {
pos++;
- return token = 31 /* GreaterThanEqualsToken */;
+ return token = 32 /* GreaterThanEqualsToken */;
}
}
return token;
}
function reScanSlashToken() {
- if (token === 41 /* SlashToken */ || token === 63 /* SlashEqualsToken */) {
+ if (token === 42 /* SlashToken */ || token === 64 /* SlashEqualsToken */) {
var p = tokenPos + 1;
var inEscape = false;
var inCharacterClass = false;
@@ -7709,7 +7837,7 @@ var ts;
}
pos = p;
tokenValue = text.substring(tokenPos, pos);
- token = 12 /* RegularExpressionLiteral */;
+ token = 13 /* RegularExpressionLiteral */;
}
return token;
}
@@ -7717,7 +7845,7 @@ var ts;
* Unconditionally back up and scan a template expression portion.
*/
function reScanTemplateToken() {
- ts.Debug.assert(token === 18 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'");
+ ts.Debug.assert(token === 19 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'");
pos = tokenPos;
return token = scanTemplateAndSetTokenValue();
}
@@ -7734,14 +7862,14 @@ var ts;
if (char === 60 /* lessThan */) {
if (text.charCodeAt(pos + 1) === 47 /* slash */) {
pos += 2;
- return token = 28 /* LessThanSlashToken */;
+ return token = 29 /* LessThanSlashToken */;
}
pos++;
- return token = 27 /* LessThanToken */;
+ return token = 28 /* LessThanToken */;
}
if (char === 123 /* openBrace */) {
pos++;
- return token = 17 /* OpenBraceToken */;
+ return token = 18 /* OpenBraceToken */;
}
// First non-whitespace character on this line.
var firstNonWhitespace = 0;
@@ -7773,7 +7901,7 @@ var ts;
}
pos++;
}
- return firstNonWhitespace === -1 ? 11 /* JsxTextAllWhiteSpaces */ : 10 /* JsxText */;
+ return firstNonWhitespace === -1 ? 12 /* JsxTextAllWhiteSpaces */ : 11 /* JsxText */;
}
// Scans a JSX identifier; these differ from normal identifiers in that
// they allow dashes
@@ -7799,7 +7927,7 @@ var ts;
case 34 /* doubleQuote */:
case 39 /* singleQuote */:
tokenValue = scanString(/*jsxAttributeString*/ true);
- return token = 9 /* StringLiteral */;
+ return token = 10 /* StringLiteral */;
default:
// If this scans anything other than `{`, it's a parse error.
return scan();
@@ -7823,36 +7951,36 @@ var ts;
}
return token = 5 /* WhitespaceTrivia */;
case 64 /* at */:
- return token = 57 /* AtToken */;
+ return token = 58 /* AtToken */;
case 10 /* lineFeed */:
case 13 /* carriageReturn */:
tokenFlags |= 1 /* PrecedingLineBreak */;
return token = 4 /* NewLineTrivia */;
case 42 /* asterisk */:
- return token = 39 /* AsteriskToken */;
+ return token = 40 /* AsteriskToken */;
case 123 /* openBrace */:
- return token = 17 /* OpenBraceToken */;
+ return token = 18 /* OpenBraceToken */;
case 125 /* closeBrace */:
- return token = 18 /* CloseBraceToken */;
+ return token = 19 /* CloseBraceToken */;
case 91 /* openBracket */:
- return token = 21 /* OpenBracketToken */;
+ return token = 22 /* OpenBracketToken */;
case 93 /* closeBracket */:
- return token = 22 /* CloseBracketToken */;
+ return token = 23 /* CloseBracketToken */;
case 60 /* lessThan */:
- return token = 27 /* LessThanToken */;
+ return token = 28 /* LessThanToken */;
case 61 /* equals */:
- return token = 58 /* EqualsToken */;
+ return token = 59 /* EqualsToken */;
case 44 /* comma */:
- return token = 26 /* CommaToken */;
+ return token = 27 /* CommaToken */;
case 46 /* dot */:
- return token = 23 /* DotToken */;
+ return token = 24 /* DotToken */;
case 96 /* backtick */:
while (pos < end && text.charCodeAt(pos) !== 96 /* backtick */) {
pos++;
}
tokenValue = text.substring(tokenPos + 1, pos);
pos++;
- return token = 13 /* NoSubstitutionTemplateLiteral */;
+ return token = 14 /* NoSubstitutionTemplateLiteral */;
}
if (isIdentifierStart(ch, 6 /* Latest */)) {
while (isIdentifierPart(text.charCodeAt(pos), 6 /* Latest */) && pos < end) {
@@ -8005,7 +8133,6 @@ var ts;
getText: function () { return str; },
write: writeText,
rawWrite: writeText,
- writeTextOfNode: writeText,
writeKeyword: writeText,
writeOperator: writeText,
writePunctuation: writeText,
@@ -8014,7 +8141,9 @@ var ts;
writeLiteral: writeText,
writeParameter: writeText,
writeProperty: writeText,
- writeSymbol: writeText,
+ writeSymbol: function (s, _) { return writeText(s); },
+ writeTrailingSemicolon: writeText,
+ writeComment: writeText,
getTextPos: function () { return str.length; },
getLine: function () { return 0; },
getColumn: function () { return 0; },
@@ -8213,7 +8342,7 @@ var ts;
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 277 /* SourceFile */) {
+ while (node && node.kind !== 279 /* SourceFile */) {
node = node.parent;
}
return node;
@@ -8221,11 +8350,11 @@ var ts;
ts.getSourceFileOfNode = getSourceFileOfNode;
function isStatementWithLocals(node) {
switch (node.kind) {
- case 216 /* Block */:
- case 244 /* CaseBlock */:
- case 223 /* ForStatement */:
- case 224 /* ForInStatement */:
- case 225 /* ForOfStatement */:
+ case 218 /* Block */:
+ case 246 /* CaseBlock */:
+ case 225 /* ForStatement */:
+ case 226 /* ForInStatement */:
+ case 227 /* ForOfStatement */:
return true;
}
return false;
@@ -8359,7 +8488,7 @@ var ts;
// the syntax list itself considers them as normal trivia. Therefore if we simply skip
// trivia for the list, we may have skipped the JSDocComment as well. So we should process its
// first child to determine the actual position of its first token.
- if (node.kind === 304 /* SyntaxList */ && node._children.length > 0) {
+ if (node.kind === 306 /* SyntaxList */ && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos);
@@ -8378,7 +8507,7 @@ var ts;
}
ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile;
function isJSDocTypeExpressionOrChild(node) {
- return node.kind === 281 /* JSDocTypeExpression */ || (node.parent && isJSDocTypeExpressionOrChild(node.parent));
+ return node.kind === 283 /* JSDocTypeExpression */ || (node.parent && isJSDocTypeExpressionOrChild(node.parent));
}
function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) {
if (includeTrivia === void 0) { includeTrivia = false; }
@@ -8420,32 +8549,34 @@ var ts;
function getLiteralText(node, sourceFile, neverAsciiEscape) {
// If we don't need to downlevel and we can reach the original source text using
// the node's parent reference, then simply get the text as it was originally written.
- if (!nodeIsSynthesized(node) && node.parent && !(ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */)) {
+ if (!nodeIsSynthesized(node) && node.parent && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) ||
+ ts.isBigIntLiteral(node))) {
return getSourceTextOfNodeFromSourceFile(sourceFile, node);
}
var escapeText = neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString;
// If we can't reach the original source text, use the canonical form if it's a number,
// or a (possibly escaped) quoted form of the original text if it's string-like.
switch (node.kind) {
- case 9 /* StringLiteral */:
+ case 10 /* StringLiteral */:
if (node.singleQuote) {
return "'" + escapeText(node.text, 39 /* singleQuote */) + "'";
}
else {
return '"' + escapeText(node.text, 34 /* doubleQuote */) + '"';
}
- case 13 /* NoSubstitutionTemplateLiteral */:
+ case 14 /* NoSubstitutionTemplateLiteral */:
return "`" + escapeText(node.text, 96 /* backtick */) + "`";
- case 14 /* TemplateHead */:
+ case 15 /* TemplateHead */:
// tslint:disable-next-line no-invalid-template-strings
return "`" + escapeText(node.text, 96 /* backtick */) + "${";
- case 15 /* TemplateMiddle */:
+ case 16 /* TemplateMiddle */:
// tslint:disable-next-line no-invalid-template-strings
return "}" + escapeText(node.text, 96 /* backtick */) + "${";
- case 16 /* TemplateTail */:
+ case 17 /* TemplateTail */:
return "}" + escapeText(node.text, 96 /* backtick */) + "`";
case 8 /* NumericLiteral */:
- case 12 /* RegularExpressionLiteral */:
+ case 9 /* BigIntLiteral */:
+ case 13 /* RegularExpressionLiteral */:
return node.text;
}
return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
@@ -8468,15 +8599,15 @@ var ts;
ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
var node = getRootDeclaration(declaration);
- return node.kind === 235 /* VariableDeclaration */ && node.parent.kind === 272 /* CatchClause */;
+ return node.kind === 237 /* VariableDeclaration */ && node.parent.kind === 274 /* CatchClause */;
}
ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement;
function isAmbientModule(node) {
- return ts.isModuleDeclaration(node) && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node));
+ return ts.isModuleDeclaration(node) && (node.name.kind === 10 /* StringLiteral */ || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
function isModuleWithStringLiteralName(node) {
- return ts.isModuleDeclaration(node) && node.name.kind === 9 /* StringLiteral */;
+ return ts.isModuleDeclaration(node) && node.name.kind === 10 /* StringLiteral */;
}
ts.isModuleWithStringLiteralName = isModuleWithStringLiteralName;
function isNonGlobalAmbientModule(node) {
@@ -8500,11 +8631,11 @@ var ts;
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
// The only kind of module that can be missing a body is a shorthand ambient module.
- return node && node.kind === 242 /* ModuleDeclaration */ && (!node.body);
+ return node && node.kind === 244 /* ModuleDeclaration */ && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 277 /* SourceFile */ ||
- node.kind === 242 /* ModuleDeclaration */ ||
+ return node.kind === 279 /* SourceFile */ ||
+ node.kind === 244 /* ModuleDeclaration */ ||
ts.isFunctionLike(node);
}
ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
@@ -8521,9 +8652,9 @@ var ts;
// - defined in the top level scope and source file is an external module
// - defined inside ambient module declaration located in the top level scope and source file not an external module
switch (node.parent.kind) {
- case 277 /* SourceFile */:
+ case 279 /* SourceFile */:
return ts.isExternalModule(node.parent);
- case 243 /* ModuleBlock */:
+ case 245 /* ModuleBlock */:
return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
}
return false;
@@ -8539,22 +8670,22 @@ var ts;
ts.isEffectiveExternalModule = isEffectiveExternalModule;
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 277 /* SourceFile */:
- case 244 /* CaseBlock */:
- case 272 /* CatchClause */:
- case 242 /* ModuleDeclaration */:
- case 223 /* ForStatement */:
- case 224 /* ForInStatement */:
- case 225 /* ForOfStatement */:
- case 155 /* Constructor */:
- case 154 /* MethodDeclaration */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
- case 195 /* ArrowFunction */:
+ case 279 /* SourceFile */:
+ case 246 /* CaseBlock */:
+ case 274 /* CatchClause */:
+ case 244 /* ModuleDeclaration */:
+ case 225 /* ForStatement */:
+ case 226 /* ForInStatement */:
+ case 227 /* ForOfStatement */:
+ case 157 /* Constructor */:
+ case 156 /* MethodDeclaration */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
+ case 197 /* ArrowFunction */:
return true;
- case 216 /* Block */:
+ case 218 /* Block */:
// function block is not considered block-scope container
// see comment in binder.ts: bind(...), case for SyntaxKind.Block
return !ts.isFunctionLike(parentNode);
@@ -8564,9 +8695,9 @@ var ts;
ts.isBlockScope = isBlockScope;
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 295 /* JSDocCallbackTag */:
- case 302 /* JSDocTypedefTag */:
- case 291 /* JSDocSignature */:
+ case 297 /* JSDocCallbackTag */:
+ case 304 /* JSDocTypedefTag */:
+ case 293 /* JSDocSignature */:
return true;
default:
ts.assertType(node);
@@ -8576,25 +8707,25 @@ var ts;
ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
function isDeclarationWithTypeParameterChildren(node) {
switch (node.kind) {
- case 158 /* CallSignature */:
- case 159 /* ConstructSignature */:
- case 153 /* MethodSignature */:
- case 160 /* IndexSignature */:
- case 163 /* FunctionType */:
- case 164 /* ConstructorType */:
- case 287 /* JSDocFunctionType */:
- case 238 /* ClassDeclaration */:
- case 207 /* ClassExpression */:
- case 239 /* InterfaceDeclaration */:
- case 240 /* TypeAliasDeclaration */:
- case 301 /* JSDocTemplateTag */:
- case 237 /* FunctionDeclaration */:
- case 154 /* MethodDeclaration */:
- case 155 /* Constructor */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 194 /* FunctionExpression */:
- case 195 /* ArrowFunction */:
+ case 160 /* CallSignature */:
+ case 161 /* ConstructSignature */:
+ case 155 /* MethodSignature */:
+ case 162 /* IndexSignature */:
+ case 165 /* FunctionType */:
+ case 166 /* ConstructorType */:
+ case 289 /* JSDocFunctionType */:
+ case 240 /* ClassDeclaration */:
+ case 209 /* ClassExpression */:
+ case 241 /* InterfaceDeclaration */:
+ case 242 /* TypeAliasDeclaration */:
+ case 303 /* JSDocTemplateTag */:
+ case 239 /* FunctionDeclaration */:
+ case 156 /* MethodDeclaration */:
+ case 157 /* Constructor */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 196 /* FunctionExpression */:
+ case 197 /* ArrowFunction */:
return true;
default:
ts.assertType(node);
@@ -8604,8 +8735,8 @@ var ts;
ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren;
function isAnyImportSyntax(node) {
switch (node.kind) {
- case 247 /* ImportDeclaration */:
- case 246 /* ImportEqualsDeclaration */:
+ case 249 /* ImportDeclaration */:
+ case 248 /* ImportEqualsDeclaration */:
return true;
default:
return false;
@@ -8614,15 +8745,15 @@ var ts;
ts.isAnyImportSyntax = isAnyImportSyntax;
function isLateVisibilityPaintedStatement(node) {
switch (node.kind) {
- case 247 /* ImportDeclaration */:
- case 246 /* ImportEqualsDeclaration */:
- case 217 /* VariableStatement */:
- case 238 /* ClassDeclaration */:
- case 237 /* FunctionDeclaration */:
- case 242 /* ModuleDeclaration */:
- case 240 /* TypeAliasDeclaration */:
- case 239 /* InterfaceDeclaration */:
- case 241 /* EnumDeclaration */:
+ case 249 /* ImportDeclaration */:
+ case 248 /* ImportEqualsDeclaration */:
+ case 219 /* VariableStatement */:
+ case 240 /* ClassDeclaration */:
+ case 239 /* FunctionDeclaration */:
+ case 244 /* ModuleDeclaration */:
+ case 242 /* TypeAliasDeclaration */:
+ case 241 /* InterfaceDeclaration */:
+ case 243 /* EnumDeclaration */:
return true;
default:
return false;
@@ -8652,12 +8783,13 @@ var ts;
ts.getNameFromIndexInfo = getNameFromIndexInfo;
function getTextOfPropertyName(name) {
switch (name.kind) {
- case 71 /* Identifier */:
+ case 72 /* Identifier */:
return name.escapedText;
- case 9 /* StringLiteral */:
+ case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
+ case 14 /* NoSubstitutionTemplateLiteral */:
return ts.escapeLeadingUnderscores(name.text);
- case 147 /* ComputedPropertyName */:
+ case 149 /* ComputedPropertyName */:
return isStringOrNumericLiteralLike(name.expression) ? ts.escapeLeadingUnderscores(name.expression.text) : undefined; // TODO: GH#18217 Almost all uses of this assume the result to be defined!
default:
return ts.Debug.assertNever(name);
@@ -8666,11 +8798,11 @@ var ts;
ts.getTextOfPropertyName = getTextOfPropertyName;
function entityNameToString(name) {
switch (name.kind) {
- case 71 /* Identifier */:
+ case 72 /* Identifier */:
return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name);
- case 146 /* QualifiedName */:
+ case 148 /* QualifiedName */:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 187 /* PropertyAccessExpression */:
+ case 189 /* PropertyAccessExpression */:
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
default:
throw ts.Debug.assertNever(name);
@@ -8715,7 +8847,7 @@ var ts;
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForArrowFunction(sourceFile, node) {
var pos = ts.skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 216 /* Block */) {
+ if (node.body && node.body.kind === 218 /* Block */) {
var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
if (startLine < endLine) {
@@ -8729,7 +8861,7 @@ var ts;
function getErrorSpanForNode(sourceFile, node) {
var errorNode = node;
switch (node.kind) {
- case 277 /* SourceFile */:
+ case 279 /* SourceFile */:
var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false);
if (pos_1 === sourceFile.text.length) {
// file is empty - return span for the beginning of the file
@@ -8738,25 +8870,25 @@ var ts;
return getSpanOfTokenAtPosition(sourceFile, pos_1);
// This list is a work in progress. Add missing node kinds to improve their error
// spans.
- case 235 /* VariableDeclaration */:
- case 184 /* BindingElement */:
- case 238 /* ClassDeclaration */:
- case 207 /* ClassExpression */:
- case 239 /* InterfaceDeclaration */:
- case 242 /* ModuleDeclaration */:
- case 241 /* EnumDeclaration */:
- case 276 /* EnumMember */:
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
- case 154 /* MethodDeclaration */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 240 /* TypeAliasDeclaration */:
- case 152 /* PropertyDeclaration */:
- case 151 /* PropertySignature */:
+ case 237 /* VariableDeclaration */:
+ case 186 /* BindingElement */:
+ case 240 /* ClassDeclaration */:
+ case 209 /* ClassExpression */:
+ case 241 /* InterfaceDeclaration */:
+ case 244 /* ModuleDeclaration */:
+ case 243 /* EnumDeclaration */:
+ case 278 /* EnumMember */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
+ case 156 /* MethodDeclaration */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 242 /* TypeAliasDeclaration */:
+ case 154 /* PropertyDeclaration */:
+ case 153 /* PropertySignature */:
errorNode = node.name;
break;
- case 195 /* ArrowFunction */:
+ case 197 /* ArrowFunction */:
return getErrorSpanForArrowFunction(sourceFile, node);
}
if (errorNode === undefined) {
@@ -8805,11 +8937,11 @@ var ts;
}
ts.isLet = isLet;
function isSuperCall(n) {
- return n.kind === 189 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */;
+ return n.kind === 191 /* CallExpression */ && n.expression.kind === 98 /* SuperKeyword */;
}
ts.isSuperCall = isSuperCall;
function isImportCall(n) {
- return n.kind === 189 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */;
+ return n.kind === 191 /* CallExpression */ && n.expression.kind === 92 /* ImportKeyword */;
}
ts.isImportCall = isImportCall;
function isLiteralImportTypeNode(n) {
@@ -8817,20 +8949,20 @@ var ts;
}
ts.isLiteralImportTypeNode = isLiteralImportTypeNode;
function isPrologueDirective(node) {
- return node.kind === 219 /* ExpressionStatement */
- && node.expression.kind === 9 /* StringLiteral */;
+ return node.kind === 221 /* ExpressionStatement */
+ && node.expression.kind === 10 /* StringLiteral */;
}
ts.isPrologueDirective = isPrologueDirective;
function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
- return node.kind !== 10 /* JsxText */ ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined;
+ return node.kind !== 11 /* JsxText */ ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined;
}
ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode;
function getJSDocCommentRanges(node, text) {
- var commentRanges = (node.kind === 149 /* Parameter */ ||
- node.kind === 148 /* TypeParameter */ ||
- node.kind === 194 /* FunctionExpression */ ||
- node.kind === 195 /* ArrowFunction */ ||
- node.kind === 193 /* ParenthesizedExpression */) ?
+ var commentRanges = (node.kind === 151 /* Parameter */ ||
+ node.kind === 150 /* TypeParameter */ ||
+ node.kind === 196 /* FunctionExpression */ ||
+ node.kind === 197 /* ArrowFunction */ ||
+ node.kind === 195 /* ParenthesizedExpression */) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
ts.getLeadingCommentRanges(text, node.pos);
// True if the comment starts with '/**' but not if it is '/**/'
@@ -8846,47 +8978,48 @@ var ts;
ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/;
var defaultLibReferenceRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (161 /* FirstTypeNode */ <= node.kind && node.kind <= 181 /* LastTypeNode */) {
+ if (163 /* FirstTypeNode */ <= node.kind && node.kind <= 183 /* LastTypeNode */) {
return true;
}
switch (node.kind) {
- case 119 /* AnyKeyword */:
- case 142 /* UnknownKeyword */:
- case 134 /* NumberKeyword */:
- case 137 /* StringKeyword */:
- case 122 /* BooleanKeyword */:
- case 138 /* SymbolKeyword */:
- case 135 /* ObjectKeyword */:
- case 140 /* UndefinedKeyword */:
- case 131 /* NeverKeyword */:
+ case 120 /* AnyKeyword */:
+ case 143 /* UnknownKeyword */:
+ case 135 /* NumberKeyword */:
+ case 146 /* BigIntKeyword */:
+ case 138 /* StringKeyword */:
+ case 123 /* BooleanKeyword */:
+ case 139 /* SymbolKeyword */:
+ case 136 /* ObjectKeyword */:
+ case 141 /* UndefinedKeyword */:
+ case 132 /* NeverKeyword */:
return true;
- case 105 /* VoidKeyword */:
- return node.parent.kind !== 198 /* VoidExpression */;
- case 209 /* ExpressionWithTypeArguments */:
+ case 106 /* VoidKeyword */:
+ return node.parent.kind !== 200 /* VoidExpression */;
+ case 211 /* ExpressionWithTypeArguments */:
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 148 /* TypeParameter */:
- return node.parent.kind === 179 /* MappedType */ || node.parent.kind === 174 /* InferType */;
+ case 150 /* TypeParameter */:
+ return node.parent.kind === 181 /* MappedType */ || node.parent.kind === 176 /* InferType */;
// Identifiers and qualified names may be type nodes, depending on their context. Climb
// above them to find the lowest container
- case 71 /* Identifier */:
+ case 72 /* Identifier */:
// If the identifier is the RHS of a qualified name, then it's a type iff its parent is.
- if (node.parent.kind === 146 /* QualifiedName */ && node.parent.right === node) {
+ if (node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node) {
node = node.parent;
}
- else if (node.parent.kind === 187 /* PropertyAccessExpression */ && node.parent.name === node) {
+ else if (node.parent.kind === 189 /* PropertyAccessExpression */ && node.parent.name === node) {
node = node.parent;
}
// At this point, node is either a qualified name or an identifier
- ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 146 /* QualifiedName */ || node.kind === 187 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+ ts.Debug.assert(node.kind === 72 /* Identifier */ || node.kind === 148 /* QualifiedName */ || node.kind === 189 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
// falls through
- case 146 /* QualifiedName */:
- case 187 /* PropertyAccessExpression */:
- case 99 /* ThisKeyword */: {
+ case 148 /* QualifiedName */:
+ case 189 /* PropertyAccessExpression */:
+ case 100 /* ThisKeyword */: {
var parent = node.parent;
- if (parent.kind === 165 /* TypeQuery */) {
+ if (parent.kind === 167 /* TypeQuery */) {
return false;
}
- if (parent.kind === 181 /* ImportType */) {
+ if (parent.kind === 183 /* ImportType */) {
return !parent.isTypeOf;
}
// Do not recursively call isPartOfTypeNode on the parent. In the example:
@@ -8895,40 +9028,40 @@ var ts;
//
// Calling isPartOfTypeNode would consider the qualified name A.B a type node.
// Only C and A.B.C are type nodes.
- if (161 /* FirstTypeNode */ <= parent.kind && parent.kind <= 181 /* LastTypeNode */) {
+ if (163 /* FirstTypeNode */ <= parent.kind && parent.kind <= 183 /* LastTypeNode */) {
return true;
}
switch (parent.kind) {
- case 209 /* ExpressionWithTypeArguments */:
+ case 211 /* ExpressionWithTypeArguments */:
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
- case 148 /* TypeParameter */:
+ case 150 /* TypeParameter */:
return node === parent.constraint;
- case 301 /* JSDocTemplateTag */:
+ case 303 /* JSDocTemplateTag */:
return node === parent.constraint;
- case 152 /* PropertyDeclaration */:
- case 151 /* PropertySignature */:
- case 149 /* Parameter */:
- case 235 /* VariableDeclaration */:
+ case 154 /* PropertyDeclaration */:
+ case 153 /* PropertySignature */:
+ case 151 /* Parameter */:
+ case 237 /* VariableDeclaration */:
return node === parent.type;
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
- case 195 /* ArrowFunction */:
- case 155 /* Constructor */:
- case 154 /* MethodDeclaration */:
- case 153 /* MethodSignature */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
+ case 197 /* ArrowFunction */:
+ case 157 /* Constructor */:
+ case 156 /* MethodDeclaration */:
+ case 155 /* MethodSignature */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
return node === parent.type;
- case 158 /* CallSignature */:
- case 159 /* ConstructSignature */:
- case 160 /* IndexSignature */:
+ case 160 /* CallSignature */:
+ case 161 /* ConstructSignature */:
+ case 162 /* IndexSignature */:
return node === parent.type;
- case 192 /* TypeAssertionExpression */:
+ case 194 /* TypeAssertionExpression */:
return node === parent.type;
- case 189 /* CallExpression */:
- case 190 /* NewExpression */:
+ case 191 /* CallExpression */:
+ case 192 /* NewExpression */:
return ts.contains(parent.typeArguments, node);
- case 191 /* TaggedTemplateExpression */:
+ case 193 /* TaggedTemplateExpression */:
// TODO (drosen): TaggedTemplateExpressions may eventually support type arguments.
return false;
}
@@ -8953,23 +9086,23 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 228 /* ReturnStatement */:
+ case 230 /* ReturnStatement */:
return visitor(node);
- case 244 /* CaseBlock */:
- case 216 /* Block */:
- case 220 /* IfStatement */:
- case 221 /* DoStatement */:
- case 222 /* WhileStatement */:
- case 223 /* ForStatement */:
- case 224 /* ForInStatement */:
- case 225 /* ForOfStatement */:
- case 229 /* WithStatement */:
- case 230 /* SwitchStatement */:
- case 269 /* CaseClause */:
- case 270 /* DefaultClause */:
- case 231 /* LabeledStatement */:
- case 233 /* TryStatement */:
- case 272 /* CatchClause */:
+ case 246 /* CaseBlock */:
+ case 218 /* Block */:
+ case 222 /* IfStatement */:
+ case 223 /* DoStatement */:
+ case 224 /* WhileStatement */:
+ case 225 /* ForStatement */:
+ case 226 /* ForInStatement */:
+ case 227 /* ForOfStatement */:
+ case 231 /* WithStatement */:
+ case 232 /* SwitchStatement */:
+ case 271 /* CaseClause */:
+ case 272 /* DefaultClause */:
+ case 233 /* LabeledStatement */:
+ case 235 /* TryStatement */:
+ case 274 /* CatchClause */:
return ts.forEachChild(node, traverse);
}
}
@@ -8979,26 +9112,26 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 205 /* YieldExpression */:
+ case 207 /* YieldExpression */:
visitor(node);
var operand = node.expression;
if (operand) {
traverse(operand);
}
return;
- case 241 /* EnumDeclaration */:
- case 239 /* InterfaceDeclaration */:
- case 242 /* ModuleDeclaration */:
- case 240 /* TypeAliasDeclaration */:
- case 238 /* ClassDeclaration */:
- case 207 /* ClassExpression */:
+ case 243 /* EnumDeclaration */:
+ case 241 /* InterfaceDeclaration */:
+ case 244 /* ModuleDeclaration */:
+ case 242 /* TypeAliasDeclaration */:
+ case 240 /* ClassDeclaration */:
+ case 209 /* ClassExpression */:
// These are not allowed inside a generator now, but eventually they may be allowed
// as local types. Regardless, any yield statements contained within them should be
// skipped in this traversal.
return;
default:
if (ts.isFunctionLike(node)) {
- if (node.name && node.name.kind === 147 /* ComputedPropertyName */) {
+ if (node.name && node.name.kind === 149 /* ComputedPropertyName */) {
// Note that we will not include methods/accessors of a class because they would require
// first descending into the class. This is by design.
traverse(node.name.expression);
@@ -9021,10 +9154,10 @@ var ts;
* @param node The type node.
*/
function getRestParameterElementType(node) {
- if (node && node.kind === 167 /* ArrayType */) {
+ if (node && node.kind === 169 /* ArrayType */) {
return node.elementType;
}
- else if (node && node.kind === 162 /* TypeReference */) {
+ else if (node && node.kind === 164 /* TypeReference */) {
return ts.singleOrUndefined(node.typeArguments);
}
else {
@@ -9034,12 +9167,12 @@ var ts;
ts.getRestParameterElementType = getRestParameterElementType;
function getMembersOfDeclaration(node) {
switch (node.kind) {
- case 239 /* InterfaceDeclaration */:
- case 238 /* ClassDeclaration */:
- case 207 /* ClassExpression */:
- case 166 /* TypeLiteral */:
+ case 241 /* InterfaceDeclaration */:
+ case 240 /* ClassDeclaration */:
+ case 209 /* ClassExpression */:
+ case 168 /* TypeLiteral */:
return node.members;
- case 186 /* ObjectLiteralExpression */:
+ case 188 /* ObjectLiteralExpression */:
return node.properties;
}
}
@@ -9047,14 +9180,14 @@ var ts;
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 184 /* BindingElement */:
- case 276 /* EnumMember */:
- case 149 /* Parameter */:
- case 273 /* PropertyAssignment */:
- case 152 /* PropertyDeclaration */:
- case 151 /* PropertySignature */:
- case 274 /* ShorthandPropertyAssignment */:
- case 235 /* VariableDeclaration */:
+ case 186 /* BindingElement */:
+ case 278 /* EnumMember */:
+ case 151 /* Parameter */:
+ case 275 /* PropertyAssignment */:
+ case 154 /* PropertyDeclaration */:
+ case 153 /* PropertySignature */:
+ case 276 /* ShorthandPropertyAssignment */:
+ case 237 /* VariableDeclaration */:
return true;
}
}
@@ -9066,8 +9199,8 @@ var ts;
}
ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor;
function isVariableDeclarationInVariableStatement(node) {
- return node.parent.kind === 236 /* VariableDeclarationList */
- && node.parent.parent.kind === 217 /* VariableStatement */;
+ return node.parent.kind === 238 /* VariableDeclarationList */
+ && node.parent.parent.kind === 219 /* VariableStatement */;
}
ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
function isValidESSymbolDeclaration(node) {
@@ -9078,13 +9211,13 @@ var ts;
ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 154 /* MethodDeclaration */:
- case 153 /* MethodSignature */:
- case 155 /* Constructor */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
+ case 156 /* MethodDeclaration */:
+ case 155 /* MethodSignature */:
+ case 157 /* Constructor */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
return true;
}
return false;
@@ -9095,7 +9228,7 @@ var ts;
if (beforeUnwrapLabelCallback) {
beforeUnwrapLabelCallback(node);
}
- if (node.statement.kind !== 231 /* LabeledStatement */) {
+ if (node.statement.kind !== 233 /* LabeledStatement */) {
return node.statement;
}
node = node.statement;
@@ -9103,17 +9236,17 @@ var ts;
}
ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel;
function isFunctionBlock(node) {
- return node && node.kind === 216 /* Block */ && ts.isFunctionLike(node.parent);
+ return node && node.kind === 218 /* Block */ && ts.isFunctionLike(node.parent);
}
ts.isFunctionBlock = isFunctionBlock;
function isObjectLiteralMethod(node) {
- return node && node.kind === 154 /* MethodDeclaration */ && node.parent.kind === 186 /* ObjectLiteralExpression */;
+ return node && node.kind === 156 /* MethodDeclaration */ && node.parent.kind === 188 /* ObjectLiteralExpression */;
}
ts.isObjectLiteralMethod = isObjectLiteralMethod;
function isObjectLiteralOrClassExpressionMethod(node) {
- return node.kind === 154 /* MethodDeclaration */ &&
- (node.parent.kind === 186 /* ObjectLiteralExpression */ ||
- node.parent.kind === 207 /* ClassExpression */);
+ return node.kind === 156 /* MethodDeclaration */ &&
+ (node.parent.kind === 188 /* ObjectLiteralExpression */ ||
+ node.parent.kind === 209 /* ClassExpression */);
}
ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
function isIdentifierTypePredicate(predicate) {
@@ -9126,7 +9259,7 @@ var ts;
ts.isThisTypePredicate = isThisTypePredicate;
function getPropertyAssignment(objectLiteral, key, key2) {
return objectLiteral.properties.filter(function (property) {
- if (property.kind === 273 /* PropertyAssignment */) {
+ if (property.kind === 275 /* PropertyAssignment */) {
var propName = getTextOfPropertyName(property.name);
return key === propName || (!!key2 && key2 === propName);
}
@@ -9163,14 +9296,14 @@ var ts;
}
ts.getContainingClass = getContainingClass;
function getThisContainer(node, includeArrowFunctions) {
- ts.Debug.assert(node.kind !== 277 /* SourceFile */);
+ ts.Debug.assert(node.kind !== 279 /* SourceFile */);
while (true) {
node = node.parent;
if (!node) {
return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that.
}
switch (node.kind) {
- case 147 /* ComputedPropertyName */:
+ case 149 /* ComputedPropertyName */:
// If the grandparent node is an object literal (as opposed to a class),
// then the computed property is not a 'this' container.
// A computed property name in a class needs to be a this container
@@ -9185,9 +9318,9 @@ var ts;
// the *body* of the container.
node = node.parent;
break;
- case 150 /* Decorator */:
+ case 152 /* Decorator */:
// Decorators are always applied outside of the body of a class or method.
- if (node.parent.kind === 149 /* Parameter */ && ts.isClassElement(node.parent.parent)) {
+ if (node.parent.kind === 151 /* Parameter */ && ts.isClassElement(node.parent.parent)) {
// If the decorator's parent is a Parameter, we resolve the this container from
// the grandparent class declaration.
node = node.parent.parent;
@@ -9198,26 +9331,26 @@ var ts;
node = node.parent;
}
break;
- case 195 /* ArrowFunction */:
+ case 197 /* ArrowFunction */:
if (!includeArrowFunctions) {
continue;
}
// falls through
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
- case 242 /* ModuleDeclaration */:
- case 152 /* PropertyDeclaration */:
- case 151 /* PropertySignature */:
- case 154 /* MethodDeclaration */:
- case 153 /* MethodSignature */:
- case 155 /* Constructor */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 158 /* CallSignature */:
- case 159 /* ConstructSignature */:
- case 160 /* IndexSignature */:
- case 241 /* EnumDeclaration */:
- case 277 /* SourceFile */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
+ case 244 /* ModuleDeclaration */:
+ case 154 /* PropertyDeclaration */:
+ case 153 /* PropertySignature */:
+ case 156 /* MethodDeclaration */:
+ case 155 /* MethodSignature */:
+ case 157 /* Constructor */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 160 /* CallSignature */:
+ case 161 /* ConstructSignature */:
+ case 162 /* IndexSignature */:
+ case 243 /* EnumDeclaration */:
+ case 279 /* SourceFile */:
return node;
}
}
@@ -9227,9 +9360,9 @@ var ts;
var container = getThisContainer(node, /*includeArrowFunctions*/ false);
if (container) {
switch (container.kind) {
- case 155 /* Constructor */:
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
+ case 157 /* Constructor */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
return container;
}
}
@@ -9251,27 +9384,27 @@ var ts;
return node;
}
switch (node.kind) {
- case 147 /* ComputedPropertyName */:
+ case 149 /* ComputedPropertyName */:
node = node.parent;
break;
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
- case 195 /* ArrowFunction */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
+ case 197 /* ArrowFunction */:
if (!stopOnFunctions) {
continue;
}
// falls through
- case 152 /* PropertyDeclaration */:
- case 151 /* PropertySignature */:
- case 154 /* MethodDeclaration */:
- case 153 /* MethodSignature */:
- case 155 /* Constructor */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
+ case 154 /* PropertyDeclaration */:
+ case 153 /* PropertySignature */:
+ case 156 /* MethodDeclaration */:
+ case 155 /* MethodSignature */:
+ case 157 /* Constructor */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
return node;
- case 150 /* Decorator */:
+ case 152 /* Decorator */:
// Decorators are always applied outside of the body of a class or method.
- if (node.parent.kind === 149 /* Parameter */ && ts.isClassElement(node.parent.parent)) {
+ if (node.parent.kind === 151 /* Parameter */ && ts.isClassElement(node.parent.parent)) {
// If the decorator's parent is a Parameter, we resolve the this container from
// the grandparent class declaration.
node = node.parent.parent;
@@ -9287,14 +9420,14 @@ var ts;
}
ts.getSuperContainer = getSuperContainer;
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 194 /* FunctionExpression */ || func.kind === 195 /* ArrowFunction */) {
+ if (func.kind === 196 /* FunctionExpression */ || func.kind === 197 /* ArrowFunction */) {
var prev = func;
var parent = func.parent;
- while (parent.kind === 193 /* ParenthesizedExpression */) {
+ while (parent.kind === 195 /* ParenthesizedExpression */) {
prev = parent;
parent = parent.parent;
}
- if (parent.kind === 189 /* CallExpression */ && parent.expression === prev) {
+ if (parent.kind === 191 /* CallExpression */ && parent.expression === prev) {
return parent;
}
}
@@ -9305,8 +9438,8 @@ var ts;
*/
function isSuperProperty(node) {
var kind = node.kind;
- return (kind === 187 /* PropertyAccessExpression */ || kind === 188 /* ElementAccessExpression */)
- && node.expression.kind === 97 /* SuperKeyword */;
+ return (kind === 189 /* PropertyAccessExpression */ || kind === 190 /* ElementAccessExpression */)
+ && node.expression.kind === 98 /* SuperKeyword */;
}
ts.isSuperProperty = isSuperProperty;
/**
@@ -9314,20 +9447,20 @@ var ts;
*/
function isThisProperty(node) {
var kind = node.kind;
- return (kind === 187 /* PropertyAccessExpression */ || kind === 188 /* ElementAccessExpression */)
- && node.expression.kind === 99 /* ThisKeyword */;
+ return (kind === 189 /* PropertyAccessExpression */ || kind === 190 /* ElementAccessExpression */)
+ && node.expression.kind === 100 /* ThisKeyword */;
}
ts.isThisProperty = isThisProperty;
function getEntityNameFromTypeNode(node) {
switch (node.kind) {
- case 162 /* TypeReference */:
+ case 164 /* TypeReference */:
return node.typeName;
- case 209 /* ExpressionWithTypeArguments */:
+ case 211 /* ExpressionWithTypeArguments */:
return isEntityNameExpression(node.expression)
? node.expression
: undefined;
- case 71 /* Identifier */:
- case 146 /* QualifiedName */:
+ case 72 /* Identifier */:
+ case 148 /* QualifiedName */:
return node;
}
return undefined;
@@ -9335,10 +9468,10 @@ var ts;
ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
function getInvokedExpression(node) {
switch (node.kind) {
- case 191 /* TaggedTemplateExpression */:
+ case 193 /* TaggedTemplateExpression */:
return node.tag;
- case 260 /* JsxOpeningElement */:
- case 259 /* JsxSelfClosingElement */:
+ case 262 /* JsxOpeningElement */:
+ case 261 /* JsxSelfClosingElement */:
return node.tagName;
default:
return node.expression;
@@ -9347,25 +9480,25 @@ var ts;
ts.getInvokedExpression = getInvokedExpression;
function nodeCanBeDecorated(node, parent, grandparent) {
switch (node.kind) {
- case 238 /* ClassDeclaration */:
+ case 240 /* ClassDeclaration */:
// classes are valid targets
return true;
- case 152 /* PropertyDeclaration */:
+ case 154 /* PropertyDeclaration */:
// property declarations are valid if their parent is a class declaration.
- return parent.kind === 238 /* ClassDeclaration */;
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 154 /* MethodDeclaration */:
+ return parent.kind === 240 /* ClassDeclaration */;
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 156 /* MethodDeclaration */:
// if this method has a body and its parent is a class declaration, this is a valid target.
return node.body !== undefined
- && parent.kind === 238 /* ClassDeclaration */;
- case 149 /* Parameter */:
+ && parent.kind === 240 /* ClassDeclaration */;
+ case 151 /* Parameter */:
// if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target;
return parent.body !== undefined
- && (parent.kind === 155 /* Constructor */
- || parent.kind === 154 /* MethodDeclaration */
- || parent.kind === 157 /* SetAccessor */)
- && grandparent.kind === 238 /* ClassDeclaration */;
+ && (parent.kind === 157 /* Constructor */
+ || parent.kind === 156 /* MethodDeclaration */
+ || parent.kind === 159 /* SetAccessor */)
+ && grandparent.kind === 240 /* ClassDeclaration */;
}
return false;
}
@@ -9381,10 +9514,10 @@ var ts;
ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
function childIsDecorated(node, parent) {
switch (node.kind) {
- case 238 /* ClassDeclaration */:
+ case 240 /* ClassDeclaration */:
return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217
- case 154 /* MethodDeclaration */:
- case 157 /* SetAccessor */:
+ case 156 /* MethodDeclaration */:
+ case 159 /* SetAccessor */:
return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217
default:
return false;
@@ -9393,9 +9526,9 @@ var ts;
ts.childIsDecorated = childIsDecorated;
function isJSXTagName(node) {
var parent = node.parent;
- if (parent.kind === 260 /* JsxOpeningElement */ ||
- parent.kind === 259 /* JsxSelfClosingElement */ ||
- parent.kind === 261 /* JsxClosingElement */) {
+ if (parent.kind === 262 /* JsxOpeningElement */ ||
+ parent.kind === 261 /* JsxSelfClosingElement */ ||
+ parent.kind === 263 /* JsxClosingElement */) {
return parent.tagName === node;
}
return false;
@@ -9403,56 +9536,57 @@ var ts;
ts.isJSXTagName = isJSXTagName;
function isExpressionNode(node) {
switch (node.kind) {
- case 97 /* SuperKeyword */:
- case 95 /* NullKeyword */:
- case 101 /* TrueKeyword */:
- case 86 /* FalseKeyword */:
- case 12 /* RegularExpressionLiteral */:
- case 185 /* ArrayLiteralExpression */:
- case 186 /* ObjectLiteralExpression */:
- case 187 /* PropertyAccessExpression */:
- case 188 /* ElementAccessExpression */:
- case 189 /* CallExpression */:
- case 190 /* NewExpression */:
- case 191 /* TaggedTemplateExpression */:
- case 210 /* AsExpression */:
- case 192 /* TypeAssertionExpression */:
- case 211 /* NonNullExpression */:
- case 193 /* ParenthesizedExpression */:
- case 194 /* FunctionExpression */:
- case 207 /* ClassExpression */:
- case 195 /* ArrowFunction */:
- case 198 /* VoidExpression */:
- case 196 /* DeleteExpression */:
- case 197 /* TypeOfExpression */:
- case 200 /* PrefixUnaryExpression */:
- case 201 /* PostfixUnaryExpression */:
- case 202 /* BinaryExpression */:
- case 203 /* ConditionalExpression */:
- case 206 /* SpreadElement */:
- case 204 /* TemplateExpression */:
- case 13 /* NoSubstitutionTemplateLiteral */:
- case 208 /* OmittedExpression */:
- case 258 /* JsxElement */:
- case 259 /* JsxSelfClosingElement */:
- case 262 /* JsxFragment */:
- case 205 /* YieldExpression */:
- case 199 /* AwaitExpression */:
- case 212 /* MetaProperty */:
+ case 98 /* SuperKeyword */:
+ case 96 /* NullKeyword */:
+ case 102 /* TrueKeyword */:
+ case 87 /* FalseKeyword */:
+ case 13 /* RegularExpressionLiteral */:
+ case 187 /* ArrayLiteralExpression */:
+ case 188 /* ObjectLiteralExpression */:
+ case 189 /* PropertyAccessExpression */:
+ case 190 /* ElementAccessExpression */:
+ case 191 /* CallExpression */:
+ case 192 /* NewExpression */:
+ case 193 /* TaggedTemplateExpression */:
+ case 212 /* AsExpression */:
+ case 194 /* TypeAssertionExpression */:
+ case 213 /* NonNullExpression */:
+ case 195 /* ParenthesizedExpression */:
+ case 196 /* FunctionExpression */:
+ case 209 /* ClassExpression */:
+ case 197 /* ArrowFunction */:
+ case 200 /* VoidExpression */:
+ case 198 /* DeleteExpression */:
+ case 199 /* TypeOfExpression */:
+ case 202 /* PrefixUnaryExpression */:
+ case 203 /* PostfixUnaryExpression */:
+ case 204 /* BinaryExpression */:
+ case 205 /* ConditionalExpression */:
+ case 208 /* SpreadElement */:
+ case 206 /* TemplateExpression */:
+ case 14 /* NoSubstitutionTemplateLiteral */:
+ case 210 /* OmittedExpression */:
+ case 260 /* JsxElement */:
+ case 261 /* JsxSelfClosingElement */:
+ case 264 /* JsxFragment */:
+ case 207 /* YieldExpression */:
+ case 201 /* AwaitExpression */:
+ case 214 /* MetaProperty */:
return true;
- case 146 /* QualifiedName */:
- while (node.parent.kind === 146 /* QualifiedName */) {
+ case 148 /* QualifiedName */:
+ while (node.parent.kind === 148 /* QualifiedName */) {
node = node.parent;
}
- return node.parent.kind === 165 /* TypeQuery */ || isJSXTagName(node);
- case 71 /* Identifier */:
- if (node.parent.kind === 165 /* TypeQuery */ || isJSXTagName(node)) {
+ return node.parent.kind === 167 /* TypeQuery */ || isJSXTagName(node);
+ case 72 /* Identifier */:
+ if (node.parent.kind === 167 /* TypeQuery */ || isJSXTagName(node)) {
return true;
}
// falls through
case 8 /* NumericLiteral */:
- case 9 /* StringLiteral */:
- case 99 /* ThisKeyword */:
+ case 9 /* BigIntLiteral */:
+ case 10 /* StringLiteral */:
+ case 100 /* ThisKeyword */:
return isInExpressionContext(node);
default:
return false;
@@ -9462,49 +9596,49 @@ var ts;
function isInExpressionContext(node) {
var parent = node.parent;
switch (parent.kind) {
- case 235 /* VariableDeclaration */:
- case 149 /* Parameter */:
- case 152 /* PropertyDeclaration */:
- case 151 /* PropertySignature */:
- case 276 /* EnumMember */:
- case 273 /* PropertyAssignment */:
- case 184 /* BindingElement */:
+ case 237 /* VariableDeclaration */:
+ case 151 /* Parameter */:
+ case 154 /* PropertyDeclaration */:
+ case 153 /* PropertySignature */:
+ case 278 /* EnumMember */:
+ case 275 /* PropertyAssignment */:
+ case 186 /* BindingElement */:
return parent.initializer === node;
- case 219 /* ExpressionStatement */:
- case 220 /* IfStatement */:
- case 221 /* DoStatement */:
- case 222 /* WhileStatement */:
- case 228 /* ReturnStatement */:
- case 229 /* WithStatement */:
- case 230 /* SwitchStatement */:
- case 269 /* CaseClause */:
- case 232 /* ThrowStatement */:
+ case 221 /* ExpressionStatement */:
+ case 222 /* IfStatement */:
+ case 223 /* DoStatement */:
+ case 224 /* WhileStatement */:
+ case 230 /* ReturnStatement */:
+ case 231 /* WithStatement */:
+ case 232 /* SwitchStatement */:
+ case 271 /* CaseClause */:
+ case 234 /* ThrowStatement */:
return parent.expression === node;
- case 223 /* ForStatement */:
+ case 225 /* ForStatement */:
var forStatement = parent;
- return (forStatement.initializer === node && forStatement.initializer.kind !== 236 /* VariableDeclarationList */) ||
+ return (forStatement.initializer === node && forStatement.initializer.kind !== 238 /* VariableDeclarationList */) ||
forStatement.condition === node ||
forStatement.incrementor === node;
- case 224 /* ForInStatement */:
- case 225 /* ForOfStatement */:
+ case 226 /* ForInStatement */:
+ case 227 /* ForOfStatement */:
var forInStatement = parent;
- return (forInStatement.initializer === node && forInStatement.initializer.kind !== 236 /* VariableDeclarationList */) ||
+ return (forInStatement.initializer === node && forInStatement.initializer.kind !== 238 /* VariableDeclarationList */) ||
forInStatement.expression === node;
- case 192 /* TypeAssertionExpression */:
- case 210 /* AsExpression */:
+ case 194 /* TypeAssertionExpression */:
+ case 212 /* AsExpression */:
return node === parent.expression;
- case 214 /* TemplateSpan */:
+ case 216 /* TemplateSpan */:
return node === parent.expression;
- case 147 /* ComputedPropertyName */:
+ case 149 /* ComputedPropertyName */:
return node === parent.expression;
- case 150 /* Decorator */:
- case 268 /* JsxExpression */:
- case 267 /* JsxSpreadAttribute */:
- case 275 /* SpreadAssignment */:
+ case 152 /* Decorator */:
+ case 270 /* JsxExpression */:
+ case 269 /* JsxSpreadAttribute */:
+ case 277 /* SpreadAssignment */:
return true;
- case 209 /* ExpressionWithTypeArguments */:
+ case 211 /* ExpressionWithTypeArguments */:
return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
- case 274 /* ShorthandPropertyAssignment */:
+ case 276 /* ShorthandPropertyAssignment */:
return parent.objectAssignmentInitializer === node;
default:
return isExpressionNode(parent);
@@ -9512,7 +9646,7 @@ var ts;
}
ts.isInExpressionContext = isInExpressionContext;
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 246 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 257 /* ExternalModuleReference */;
+ return node.kind === 248 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 259 /* ExternalModuleReference */;
}
ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -9521,7 +9655,7 @@ var ts;
}
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 246 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 257 /* ExternalModuleReference */;
+ return node.kind === 248 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 259 /* ExternalModuleReference */;
}
ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
function isSourceFileJS(file) {
@@ -9549,15 +9683,15 @@ var ts;
ts.isIdentifier(node.typeName) &&
node.typeName.escapedText === "Object" &&
node.typeArguments && node.typeArguments.length === 2 &&
- (node.typeArguments[0].kind === 137 /* StringKeyword */ || node.typeArguments[0].kind === 134 /* NumberKeyword */);
+ (node.typeArguments[0].kind === 138 /* StringKeyword */ || node.typeArguments[0].kind === 135 /* NumberKeyword */);
}
ts.isJSDocIndexSignature = isJSDocIndexSignature;
function isRequireCall(callExpression, checkArgumentIsStringLiteralLike) {
- if (callExpression.kind !== 189 /* CallExpression */) {
+ if (callExpression.kind !== 191 /* CallExpression */) {
return false;
}
var _a = callExpression, expression = _a.expression, args = _a.arguments;
- if (expression.kind !== 71 /* Identifier */ || expression.escapedText !== "require") {
+ if (expression.kind !== 72 /* Identifier */ || expression.escapedText !== "require") {
return false;
}
if (args.length !== 1) {
@@ -9588,16 +9722,16 @@ var ts;
name = node.parent.name;
decl = node.parent;
}
- else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 /* EqualsToken */ && node.parent.right === node) {
+ else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59 /* EqualsToken */ && node.parent.right === node) {
name = node.parent.left;
decl = name;
}
- else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 54 /* BarBarToken */) {
+ else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 55 /* BarBarToken */) {
if (ts.isVariableDeclaration(node.parent.parent) && node.parent.parent.initializer === node.parent) {
name = node.parent.parent.name;
decl = node.parent.parent;
}
- else if (ts.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 58 /* EqualsToken */ && node.parent.parent.right === node.parent) {
+ else if (ts.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 59 /* EqualsToken */ && node.parent.parent.right === node.parent) {
name = node.parent.parent.left;
decl = name;
}
@@ -9612,13 +9746,13 @@ var ts;
}
ts.getDeclarationOfExpando = getDeclarationOfExpando;
function isAssignmentDeclaration(decl) {
- return ts.isBinaryExpression(decl) || ts.isPropertyAccessExpression(decl) || ts.isIdentifier(decl);
+ return ts.isBinaryExpression(decl) || ts.isPropertyAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl);
}
ts.isAssignmentDeclaration = isAssignmentDeclaration;
/** Get the initializer, taking into account defaulted Javascript initializers */
function getEffectiveInitializer(node) {
if (isInJSFile(node) && node.initializer &&
- ts.isBinaryExpression(node.initializer) && node.initializer.operatorToken.kind === 54 /* BarBarToken */ &&
+ ts.isBinaryExpression(node.initializer) && node.initializer.operatorToken.kind === 55 /* BarBarToken */ &&
node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) {
return node.initializer.right;
}
@@ -9631,16 +9765,25 @@ var ts;
return init && getExpandoInitializer(init, isPrototypeAccess(node.name));
}
ts.getDeclaredExpandoInitializer = getDeclaredExpandoInitializer;
+ function hasExpandoValueProperty(node, isPrototypeAssignment) {
+ return ts.forEach(node.properties, function (p) { return ts.isPropertyAssignment(p) && ts.isIdentifier(p.name) && p.name.escapedText === "value" && p.initializer && getExpandoInitializer(p.initializer, isPrototypeAssignment); });
+ }
/**
* Get the assignment 'initializer' -- the righthand side-- when the initializer is container-like (See getExpandoInitializer).
* We treat the right hand side of assignments with container-like initalizers as declarations.
*/
function getAssignedExpandoInitializer(node) {
- if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 /* EqualsToken */) {
+ if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59 /* EqualsToken */) {
var isPrototypeAssignment = isPrototypeAccess(node.parent.left);
return getExpandoInitializer(node.parent.right, isPrototypeAssignment) ||
getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment);
}
+ if (node && ts.isCallExpression(node) && isBindableObjectDefinePropertyCall(node)) {
+ var result = hasExpandoValueProperty(node.arguments[2], node.arguments[1].text === "prototype");
+ if (result) {
+ return result;
+ }
+ }
}
ts.getAssignedExpandoInitializer = getAssignedExpandoInitializer;
/**
@@ -9656,11 +9799,11 @@ var ts;
function getExpandoInitializer(initializer, isPrototypeAssignment) {
if (ts.isCallExpression(initializer)) {
var e = skipParentheses(initializer.expression);
- return e.kind === 194 /* FunctionExpression */ || e.kind === 195 /* ArrowFunction */ ? initializer : undefined;
+ return e.kind === 196 /* FunctionExpression */ || e.kind === 197 /* ArrowFunction */ ? initializer : undefined;
}
- if (initializer.kind === 194 /* FunctionExpression */ ||
- initializer.kind === 207 /* ClassExpression */ ||
- initializer.kind === 195 /* ArrowFunction */) {
+ if (initializer.kind === 196 /* FunctionExpression */ ||
+ initializer.kind === 209 /* ClassExpression */ ||
+ initializer.kind === 197 /* ArrowFunction */) {
return initializer;
}
if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -9677,14 +9820,14 @@ var ts;
* 'window.', 'global.' or 'self.' The second Lhs is otherwise ignored by the binder and checker.
*/
function getDefaultedExpandoInitializer(name, initializer, isPrototypeAssignment) {
- var e = ts.isBinaryExpression(initializer) && initializer.operatorToken.kind === 54 /* BarBarToken */ && getExpandoInitializer(initializer.right, isPrototypeAssignment);
+ var e = ts.isBinaryExpression(initializer) && initializer.operatorToken.kind === 55 /* BarBarToken */ && getExpandoInitializer(initializer.right, isPrototypeAssignment);
if (e && isSameEntityName(name, initializer.left)) {
return e;
}
}
function isDefaultedExpandoInitializer(node) {
var name = ts.isVariableDeclaration(node.parent) ? node.parent.name :
- ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 /* EqualsToken */ ? node.parent.left :
+ ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59 /* EqualsToken */ ? node.parent.left :
undefined;
return name && getExpandoInitializer(node.right, isPrototypeAccess(name)) && isEntityNameExpression(name) && isSameEntityName(name, node.left);
}
@@ -9692,8 +9835,8 @@ var ts;
/** Given an expando initializer, return its declaration name, or the left-hand side of the assignment if it's part of an assignment declaration. */
function getNameOfExpando(node) {
if (ts.isBinaryExpression(node.parent)) {
- var parent = (node.parent.operatorToken.kind === 54 /* BarBarToken */ && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent;
- if (parent.operatorToken.kind === 58 /* EqualsToken */ && ts.isIdentifier(parent.left)) {
+ var parent = (node.parent.operatorToken.kind === 55 /* BarBarToken */ && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent;
+ if (parent.operatorToken.kind === 59 /* EqualsToken */ && ts.isIdentifier(parent.left)) {
return parent.left;
}
}
@@ -9716,7 +9859,7 @@ var ts;
return name.escapedText === initializer.escapedText;
}
if (ts.isIdentifier(name) && ts.isPropertyAccessExpression(initializer)) {
- return (initializer.expression.kind === 99 /* ThisKeyword */ ||
+ return (initializer.expression.kind === 100 /* ThisKeyword */ ||
ts.isIdentifier(initializer.expression) &&
(initializer.expression.escapedText === "window" ||
initializer.expression.escapedText === "self" ||
@@ -9750,8 +9893,31 @@ var ts;
return special === 5 /* Property */ || isInJSFile(expr) ? special : 0 /* None */;
}
ts.getAssignmentDeclarationKind = getAssignmentDeclarationKind;
+ function isBindableObjectDefinePropertyCall(expr) {
+ return ts.length(expr.arguments) === 3 &&
+ ts.isPropertyAccessExpression(expr.expression) &&
+ ts.isIdentifier(expr.expression.expression) &&
+ ts.idText(expr.expression.expression) === "Object" &&
+ ts.idText(expr.expression.name) === "defineProperty" &&
+ isStringOrNumericLiteralLike(expr.arguments[1]) &&
+ isEntityNameExpression(expr.arguments[0]);
+ }
+ ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;
function getAssignmentDeclarationKindWorker(expr) {
- if (expr.operatorToken.kind !== 58 /* EqualsToken */ ||
+ if (ts.isCallExpression(expr)) {
+ if (!isBindableObjectDefinePropertyCall(expr)) {
+ return 0 /* None */;
+ }
+ var entityName = expr.arguments[0];
+ if (isExportsIdentifier(entityName) || isModuleExportsPropertyAccessExpression(entityName)) {
+ return 8 /* ObjectDefinePropertyExports */;
+ }
+ if (ts.isPropertyAccessExpression(entityName) && entityName.name.escapedText === "prototype" && isEntityNameExpression(entityName.expression)) {
+ return 9 /* ObjectDefinePrototypeProperty */;
+ }
+ return 7 /* ObjectDefinePropertyValue */;
+ }
+ if (expr.operatorToken.kind !== 59 /* EqualsToken */ ||
!ts.isPropertyAccessExpression(expr.left)) {
return 0 /* None */;
}
@@ -9763,10 +9929,10 @@ var ts;
return getAssignmentDeclarationPropertyAccessKind(lhs);
}
function getAssignmentDeclarationPropertyAccessKind(lhs) {
- if (lhs.expression.kind === 99 /* ThisKeyword */) {
+ if (lhs.expression.kind === 100 /* ThisKeyword */) {
return 4 /* ThisProperty */;
}
- else if (ts.isIdentifier(lhs.expression) && lhs.expression.escapedText === "module" && lhs.name.escapedText === "exports") {
+ else if (isModuleExportsPropertyAccessExpression(lhs)) {
// module.exports = expr
return 2 /* ModuleExports */;
}
@@ -9805,7 +9971,7 @@ var ts;
ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment;
function isSpecialPropertyDeclaration(expr) {
return isInJSFile(expr) &&
- expr.parent && expr.parent.kind === 219 /* ExpressionStatement */ &&
+ expr.parent && expr.parent.kind === 221 /* ExpressionStatement */ &&
!!ts.getJSDocTypeTag(expr.parent);
}
ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration;
@@ -9814,7 +9980,7 @@ var ts;
return false;
}
var decl = symbol.valueDeclaration;
- return decl.kind === 237 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer);
+ return decl.kind === 239 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer);
}
ts.isFunctionSymbol = isFunctionSymbol;
function importFromModuleSpecifier(node) {
@@ -9823,14 +9989,14 @@ var ts;
ts.importFromModuleSpecifier = importFromModuleSpecifier;
function tryGetImportFromModuleSpecifier(node) {
switch (node.parent.kind) {
- case 247 /* ImportDeclaration */:
- case 253 /* ExportDeclaration */:
+ case 249 /* ImportDeclaration */:
+ case 255 /* ExportDeclaration */:
return node.parent;
- case 257 /* ExternalModuleReference */:
+ case 259 /* ExternalModuleReference */:
return node.parent.parent;
- case 189 /* CallExpression */:
- return node.parent;
- case 180 /* LiteralType */:
+ case 191 /* CallExpression */:
+ return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined;
+ case 182 /* LiteralType */:
ts.Debug.assert(ts.isStringLiteral(node));
return ts.tryCast(node.parent.parent, ts.isImportTypeNode);
default:
@@ -9840,12 +10006,12 @@ var ts;
ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier;
function getExternalModuleName(node) {
switch (node.kind) {
- case 247 /* ImportDeclaration */:
- case 253 /* ExportDeclaration */:
+ case 249 /* ImportDeclaration */:
+ case 255 /* ExportDeclaration */:
return node.moduleSpecifier;
- case 246 /* ImportEqualsDeclaration */:
- return node.moduleReference.kind === 257 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined;
- case 181 /* ImportType */:
+ case 248 /* ImportEqualsDeclaration */:
+ return node.moduleReference.kind === 259 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined;
+ case 183 /* ImportType */:
return isLiteralImportTypeNode(node) ? node.argument.literal : undefined;
default:
return ts.Debug.assertNever(node);
@@ -9854,11 +10020,11 @@ var ts;
ts.getExternalModuleName = getExternalModuleName;
function getNamespaceDeclarationNode(node) {
switch (node.kind) {
- case 247 /* ImportDeclaration */:
+ case 249 /* ImportDeclaration */:
return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport);
- case 246 /* ImportEqualsDeclaration */:
+ case 248 /* ImportEqualsDeclaration */:
return node;
- case 253 /* ExportDeclaration */:
+ case 255 /* ExportDeclaration */:
return undefined;
default:
return ts.Debug.assertNever(node);
@@ -9866,19 +10032,19 @@ var ts;
}
ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
function isDefaultImport(node) {
- return node.kind === 247 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
+ return node.kind === 249 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;
}
ts.isDefaultImport = isDefaultImport;
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 149 /* Parameter */:
- case 154 /* MethodDeclaration */:
- case 153 /* MethodSignature */:
- case 274 /* ShorthandPropertyAssignment */:
- case 273 /* PropertyAssignment */:
- case 152 /* PropertyDeclaration */:
- case 151 /* PropertySignature */:
+ case 151 /* Parameter */:
+ case 156 /* MethodDeclaration */:
+ case 155 /* MethodSignature */:
+ case 276 /* ShorthandPropertyAssignment */:
+ case 275 /* PropertyAssignment */:
+ case 154 /* PropertyDeclaration */:
+ case 153 /* PropertySignature */:
return node.questionToken !== undefined;
}
}
@@ -9886,14 +10052,13 @@ var ts;
}
ts.hasQuestionToken = hasQuestionToken;
function isJSDocConstructSignature(node) {
- return node.kind === 287 /* JSDocFunctionType */ &&
- node.parameters.length > 0 &&
- node.parameters[0].name &&
- node.parameters[0].name.escapedText === "new";
+ var param = ts.isJSDocFunctionType(node) ? ts.firstOrUndefined(node.parameters) : undefined;
+ var name = ts.tryCast(param && param.name, ts.isIdentifier);
+ return !!name && name.escapedText === "new";
}
ts.isJSDocConstructSignature = isJSDocConstructSignature;
function isJSDocTypeAlias(node) {
- return node.kind === 302 /* JSDocTypedefTag */ || node.kind === 295 /* JSDocCallbackTag */;
+ return node.kind === 304 /* JSDocTypedefTag */ || node.kind === 297 /* JSDocCallbackTag */;
}
ts.isJSDocTypeAlias = isJSDocTypeAlias;
function isTypeAlias(node) {
@@ -9903,7 +10068,7 @@ var ts;
function getSourceOfAssignment(node) {
return ts.isExpressionStatement(node) &&
node.expression && ts.isBinaryExpression(node.expression) &&
- node.expression.operatorToken.kind === 58 /* EqualsToken */
+ node.expression.operatorToken.kind === 59 /* EqualsToken */
? node.expression.right
: undefined;
}
@@ -9912,18 +10077,18 @@ var ts;
ts.isBinaryExpression(node.expression) &&
getAssignmentDeclarationKind(node.expression) !== 0 /* None */ &&
ts.isBinaryExpression(node.expression.right) &&
- node.expression.right.operatorToken.kind === 54 /* BarBarToken */
+ node.expression.right.operatorToken.kind === 55 /* BarBarToken */
? node.expression.right.right
: undefined;
}
function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
switch (node.kind) {
- case 217 /* VariableStatement */:
+ case 219 /* VariableStatement */:
var v = getSingleVariableOfVariableStatement(node);
return v && v.initializer;
- case 152 /* PropertyDeclaration */:
+ case 154 /* PropertyDeclaration */:
return node.initializer;
- case 273 /* PropertyAssignment */:
+ case 275 /* PropertyAssignment */:
return node.initializer;
}
}
@@ -9933,7 +10098,7 @@ var ts;
function getNestedModuleDeclaration(node) {
return ts.isModuleDeclaration(node) &&
node.body &&
- node.body.kind === 242 /* ModuleDeclaration */
+ node.body.kind === 244 /* ModuleDeclaration */
? node.body
: undefined;
}
@@ -9948,11 +10113,11 @@ var ts;
if (ts.hasJSDocNodes(node)) {
result = ts.addRange(result, node.jsDoc);
}
- if (node.kind === 149 /* Parameter */) {
+ if (node.kind === 151 /* Parameter */) {
result = ts.addRange(result, ts.getJSDocParameterTags(node));
break;
}
- if (node.kind === 148 /* TypeParameter */) {
+ if (node.kind === 150 /* TypeParameter */) {
result = ts.addRange(result, ts.getJSDocTypeParameterTags(node));
break;
}
@@ -9963,11 +10128,11 @@ var ts;
ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags;
function getNextJSDocCommentLocation(node) {
var parent = node.parent;
- if (parent.kind === 273 /* PropertyAssignment */ ||
- parent.kind === 152 /* PropertyDeclaration */ ||
- parent.kind === 219 /* ExpressionStatement */ && node.kind === 187 /* PropertyAccessExpression */ ||
+ if (parent.kind === 275 /* PropertyAssignment */ ||
+ parent.kind === 154 /* PropertyDeclaration */ ||
+ parent.kind === 221 /* ExpressionStatement */ && node.kind === 189 /* PropertyAccessExpression */ ||
getNestedModuleDeclaration(parent) ||
- ts.isBinaryExpression(node) && node.operatorToken.kind === 58 /* EqualsToken */) {
+ ts.isBinaryExpression(node) && node.operatorToken.kind === 59 /* EqualsToken */) {
return parent;
}
// Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement.
@@ -9978,7 +10143,7 @@ var ts;
// var x = function(name) { return name.length; }
else if (parent.parent &&
(getSingleVariableOfVariableStatement(parent.parent) === node ||
- ts.isBinaryExpression(parent) && parent.operatorToken.kind === 58 /* EqualsToken */)) {
+ ts.isBinaryExpression(parent) && parent.operatorToken.kind === 59 /* EqualsToken */)) {
return parent.parent;
}
else if (parent.parent && parent.parent.parent &&
@@ -10001,7 +10166,7 @@ var ts;
if (!decl) {
return undefined;
}
- var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 71 /* Identifier */ && p.name.escapedText === name; });
+ var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 72 /* Identifier */ && p.name.escapedText === name; });
return parameter && parameter.symbol;
}
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
@@ -10036,7 +10201,7 @@ var ts;
ts.hasRestParameter = hasRestParameter;
function isRestParameter(node) {
var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
- return node.dotDotDotToken !== undefined || !!type && type.kind === 288 /* JSDocVariadicType */;
+ return node.dotDotDotToken !== undefined || !!type && type.kind === 290 /* JSDocVariadicType */;
}
ts.isRestParameter = isRestParameter;
var AssignmentKind;
@@ -10049,31 +10214,31 @@ var ts;
var parent = node.parent;
while (true) {
switch (parent.kind) {
- case 202 /* BinaryExpression */:
+ case 204 /* BinaryExpression */:
var binaryOperator = parent.operatorToken.kind;
return isAssignmentOperator(binaryOperator) && parent.left === node ?
- binaryOperator === 58 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ :
+ binaryOperator === 59 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ :
0 /* None */;
- case 200 /* PrefixUnaryExpression */:
- case 201 /* PostfixUnaryExpression */:
+ case 202 /* PrefixUnaryExpression */:
+ case 203 /* PostfixUnaryExpression */:
var unaryOperator = parent.operator;
- return unaryOperator === 43 /* PlusPlusToken */ || unaryOperator === 44 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
- case 224 /* ForInStatement */:
- case 225 /* ForOfStatement */:
+ return unaryOperator === 44 /* PlusPlusToken */ || unaryOperator === 45 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
+ case 226 /* ForInStatement */:
+ case 227 /* ForOfStatement */:
return parent.initializer === node ? 1 /* Definite */ : 0 /* None */;
- case 193 /* ParenthesizedExpression */:
- case 185 /* ArrayLiteralExpression */:
- case 206 /* SpreadElement */:
- case 211 /* NonNullExpression */:
+ case 195 /* ParenthesizedExpression */:
+ case 187 /* ArrayLiteralExpression */:
+ case 208 /* SpreadElement */:
+ case 213 /* NonNullExpression */:
node = parent;
break;
- case 274 /* ShorthandPropertyAssignment */:
+ case 276 /* ShorthandPropertyAssignment */:
if (parent.name !== node) {
return 0 /* None */;
}
node = parent.parent;
break;
- case 273 /* PropertyAssignment */:
+ case 275 /* PropertyAssignment */:
if (parent.name === node) {
return 0 /* None */;
}
@@ -10100,22 +10265,22 @@ var ts;
*/
function isNodeWithPossibleHoistedDeclaration(node) {
switch (node.kind) {
- case 216 /* Block */:
- case 217 /* VariableStatement */:
- case 229 /* WithStatement */:
- case 220 /* IfStatement */:
- case 230 /* SwitchStatement */:
- case 244 /* CaseBlock */:
- case 269 /* CaseClause */:
- case 270 /* DefaultClause */:
- case 231 /* LabeledStatement */:
- case 223 /* ForStatement */:
- case 224 /* ForInStatement */:
- case 225 /* ForOfStatement */:
- case 221 /* DoStatement */:
- case 222 /* WhileStatement */:
- case 233 /* TryStatement */:
- case 272 /* CatchClause */:
+ case 218 /* Block */:
+ case 219 /* VariableStatement */:
+ case 231 /* WithStatement */:
+ case 222 /* IfStatement */:
+ case 232 /* SwitchStatement */:
+ case 246 /* CaseBlock */:
+ case 271 /* CaseClause */:
+ case 272 /* DefaultClause */:
+ case 233 /* LabeledStatement */:
+ case 225 /* ForStatement */:
+ case 226 /* ForInStatement */:
+ case 227 /* ForOfStatement */:
+ case 223 /* DoStatement */:
+ case 224 /* WhileStatement */:
+ case 235 /* TryStatement */:
+ case 274 /* CatchClause */:
return true;
}
return false;
@@ -10132,33 +10297,33 @@ var ts;
return node;
}
function walkUpParenthesizedTypes(node) {
- return walkUp(node, 175 /* ParenthesizedType */);
+ return walkUp(node, 177 /* ParenthesizedType */);
}
ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes;
function walkUpParenthesizedExpressions(node) {
- return walkUp(node, 193 /* ParenthesizedExpression */);
+ return walkUp(node, 195 /* ParenthesizedExpression */);
}
ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions;
function skipParentheses(node) {
- while (node.kind === 193 /* ParenthesizedExpression */) {
+ while (node.kind === 195 /* ParenthesizedExpression */) {
node = node.expression;
}
return node;
}
ts.skipParentheses = skipParentheses;
function skipParenthesesUp(node) {
- while (node.kind === 193 /* ParenthesizedExpression */) {
+ while (node.kind === 195 /* ParenthesizedExpression */) {
node = node.parent;
}
return node;
}
// a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped
function isDeleteTarget(node) {
- if (node.kind !== 187 /* PropertyAccessExpression */ && node.kind !== 188 /* ElementAccessExpression */) {
+ if (node.kind !== 189 /* PropertyAccessExpression */ && node.kind !== 190 /* ElementAccessExpression */) {
return false;
}
node = walkUpParenthesizedExpressions(node.parent);
- return node && node.kind === 196 /* DeleteExpression */;
+ return node && node.kind === 198 /* DeleteExpression */;
}
ts.isDeleteTarget = isDeleteTarget;
function isNodeDescendantOf(node, ancestor) {
@@ -10179,12 +10344,12 @@ var ts;
function getDeclarationFromName(name) {
var parent = name.parent;
switch (name.kind) {
- case 9 /* StringLiteral */:
+ case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
if (ts.isComputedPropertyName(parent))
return parent.parent;
// falls through
- case 71 /* Identifier */:
+ case 72 /* Identifier */:
if (ts.isDeclaration(parent)) {
return parent.name === name ? parent : undefined;
}
@@ -10207,8 +10372,8 @@ var ts;
}
ts.getDeclarationFromName = getDeclarationFromName;
function isLiteralComputedPropertyDeclarationName(node) {
- return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) &&
- node.parent.kind === 147 /* ComputedPropertyName */ &&
+ return (node.kind === 10 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) &&
+ node.parent.kind === 149 /* ComputedPropertyName */ &&
ts.isDeclaration(node.parent.parent);
}
ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
@@ -10216,32 +10381,32 @@ var ts;
function isIdentifierName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 152 /* PropertyDeclaration */:
- case 151 /* PropertySignature */:
- case 154 /* MethodDeclaration */:
- case 153 /* MethodSignature */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 276 /* EnumMember */:
- case 273 /* PropertyAssignment */:
- case 187 /* PropertyAccessExpression */:
+ case 154 /* PropertyDeclaration */:
+ case 153 /* PropertySignature */:
+ case 156 /* MethodDeclaration */:
+ case 155 /* MethodSignature */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 278 /* EnumMember */:
+ case 275 /* PropertyAssignment */:
+ case 189 /* PropertyAccessExpression */:
// Name in member declaration or property name in property access
return parent.name === node;
- case 146 /* QualifiedName */:
+ case 148 /* QualifiedName */:
// Name on right hand side of dot in a type query or type reference
if (parent.right === node) {
- while (parent.kind === 146 /* QualifiedName */) {
+ while (parent.kind === 148 /* QualifiedName */) {
parent = parent.parent;
}
- return parent.kind === 165 /* TypeQuery */ || parent.kind === 162 /* TypeReference */;
+ return parent.kind === 167 /* TypeQuery */ || parent.kind === 164 /* TypeReference */;
}
return false;
- case 184 /* BindingElement */:
- case 251 /* ImportSpecifier */:
+ case 186 /* BindingElement */:
+ case 253 /* ImportSpecifier */:
// Property name in binding element or import specifier
return parent.propertyName === node;
- case 255 /* ExportSpecifier */:
- case 265 /* JsxAttribute */:
+ case 257 /* ExportSpecifier */:
+ case 267 /* JsxAttribute */:
// Any name in an export specifier or JSX Attribute
return true;
}
@@ -10256,15 +10421,16 @@ var ts;
// export { x as } from ...
// export =
// export default
+ // module.exports =
function isAliasSymbolDeclaration(node) {
- return node.kind === 246 /* ImportEqualsDeclaration */ ||
- node.kind === 245 /* NamespaceExportDeclaration */ ||
- node.kind === 248 /* ImportClause */ && !!node.name ||
- node.kind === 249 /* NamespaceImport */ ||
- node.kind === 251 /* ImportSpecifier */ ||
- node.kind === 255 /* ExportSpecifier */ ||
- node.kind === 252 /* ExportAssignment */ && exportAssignmentIsAlias(node) ||
- ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */;
+ return node.kind === 248 /* ImportEqualsDeclaration */ ||
+ node.kind === 247 /* NamespaceExportDeclaration */ ||
+ node.kind === 250 /* ImportClause */ && !!node.name ||
+ node.kind === 251 /* NamespaceImport */ ||
+ node.kind === 253 /* ImportSpecifier */ ||
+ node.kind === 257 /* ExportSpecifier */ ||
+ node.kind === 254 /* ExportAssignment */ && exportAssignmentIsAlias(node) ||
+ ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node);
}
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
function exportAssignmentIsAlias(node) {
@@ -10284,12 +10450,12 @@ var ts;
}
ts.getEffectiveBaseTypeNode = getEffectiveBaseTypeNode;
function getClassExtendsHeritageElement(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 85 /* ExtendsKeyword */);
+ var heritageClause = getHeritageClause(node.heritageClauses, 86 /* ExtendsKeyword */);
return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined;
}
ts.getClassExtendsHeritageElement = getClassExtendsHeritageElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 108 /* ImplementsKeyword */);
+ var heritageClause = getHeritageClause(node.heritageClauses, 109 /* ImplementsKeyword */);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
@@ -10301,7 +10467,7 @@ var ts;
}
ts.getAllSuperTypeNodes = getAllSuperTypeNodes;
function getInterfaceBaseTypeNodes(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 85 /* ExtendsKeyword */);
+ var heritageClause = getHeritageClause(node.heritageClauses, 86 /* ExtendsKeyword */);
return heritageClause ? heritageClause.types : undefined;
}
ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes;
@@ -10335,11 +10501,11 @@ var ts;
}
ts.getAncestor = getAncestor;
function isKeyword(token) {
- return 72 /* FirstKeyword */ <= token && token <= 145 /* LastKeyword */;
+ return 73 /* FirstKeyword */ <= token && token <= 147 /* LastKeyword */;
}
ts.isKeyword = isKeyword;
function isContextualKeyword(token) {
- return 117 /* FirstContextualKeyword */ <= token && token <= 145 /* LastContextualKeyword */;
+ return 118 /* FirstContextualKeyword */ <= token && token <= 147 /* LastContextualKeyword */;
}
ts.isContextualKeyword = isContextualKeyword;
function isNonContextualKeyword(token) {
@@ -10351,6 +10517,11 @@ var ts;
return token !== undefined && isNonContextualKeyword(token);
}
ts.isStringANonContextualKeyword = isStringANonContextualKeyword;
+ function isIdentifierANonContextualKeyword(_a) {
+ var originalKeywordKind = _a.originalKeywordKind;
+ return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind);
+ }
+ ts.isIdentifierANonContextualKeyword = isIdentifierANonContextualKeyword;
function isTrivia(token) {
return 2 /* FirstTriviaToken */ <= token && token <= 7 /* LastTriviaToken */;
}
@@ -10369,14 +10540,14 @@ var ts;
}
var flags = 0 /* Normal */;
switch (node.kind) {
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
- case 154 /* MethodDeclaration */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
+ case 156 /* MethodDeclaration */:
if (node.asteriskToken) {
flags |= 1 /* Generator */;
}
// falls through
- case 195 /* ArrowFunction */:
+ case 197 /* ArrowFunction */:
if (hasModifier(node, 256 /* Async */)) {
flags |= 2 /* Async */;
}
@@ -10390,10 +10561,10 @@ var ts;
ts.getFunctionFlags = getFunctionFlags;
function isAsyncFunction(node) {
switch (node.kind) {
- case 237 /* FunctionDeclaration */:
- case 194 /* FunctionExpression */:
- case 195 /* ArrowFunction */:
- case 154 /* MethodDeclaration */:
+ case 239 /* FunctionDeclaration */:
+ case 196 /* FunctionExpression */:
+ case 197 /* ArrowFunction */:
+ case 156 /* MethodDeclaration */:
return node.body !== undefined
&& node.asteriskToken === undefined
&& hasModifier(node, 256 /* Async */);
@@ -10418,7 +10589,7 @@ var ts;
}
ts.hasDynamicName = hasDynamicName;
function isDynamicName(name) {
- return name.kind === 147 /* ComputedPropertyName */ &&
+ return name.kind === 149 /* ComputedPropertyName */ &&
!isStringOrNumericLiteralLike(name.expression) &&
!isWellKnownSymbolSyntactically(name.expression);
}
@@ -10434,12 +10605,12 @@ var ts;
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
function getPropertyNameForPropertyNameNode(name) {
switch (name.kind) {
- case 71 /* Identifier */:
+ case 72 /* Identifier */:
return name.escapedText;
- case 9 /* StringLiteral */:
+ case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
return ts.escapeLeadingUnderscores(name.text);
- case 147 /* ComputedPropertyName */:
+ case 149 /* ComputedPropertyName */:
var nameExpression = name.expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name));
@@ -10455,9 +10626,9 @@ var ts;
ts.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode;
function isPropertyNameLiteral(node) {
switch (node.kind) {
- case 71 /* Identifier */:
- case 9 /* StringLiteral */:
- case 13 /* NoSubstitutionTemplateLiteral */:
+ case 72 /* Identifier */:
+ case 10 /* StringLiteral */:
+ case 14 /* NoSubstitutionTemplateLiteral */:
case 8 /* NumericLiteral */:
return true;
default:
@@ -10466,11 +10637,11 @@ var ts;
}
ts.isPropertyNameLiteral = isPropertyNameLiteral;
function getTextOfIdentifierOrLiteral(node) {
- return node.kind === 71 /* Identifier */ ? ts.idText(node) : node.text;
+ return node.kind === 72 /* Identifier */ ? ts.idText(node) : node.text;
}
ts.getTextOfIdentifierOrLiteral = getTextOfIdentifierOrLiteral;
function getEscapedTextOfIdentifierOrLiteral(node) {
- return node.kind === 71 /* Identifier */ ? node.escapedText : ts.escapeLeadingUnderscores(node.text);
+ return node.kind === 72 /* Identifier */ ? node.escapedText : ts.escapeLeadingUnderscores(node.text);
}
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
function getPropertyNameForKnownSymbolName(symbolName) {
@@ -10485,7 +10656,7 @@ var ts;
* Includes the word "Symbol" with unicode escapes
*/
function isESSymbolIdentifier(node) {
- return node.kind === 71 /* Identifier */ && node.escapedText === "Symbol";
+ return node.kind === 72 /* Identifier */ && node.escapedText === "Symbol";
}
ts.isESSymbolIdentifier = isESSymbolIdentifier;
function isPushOrUnshiftIdentifier(node) {
@@ -10494,11 +10665,11 @@ var ts;
ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
function isParameterDeclaration(node) {
var root = getRootDeclaration(node);
- return root.kind === 149 /* Parameter */;
+ return root.kind === 151 /* Parameter */;
}
ts.isParameterDeclaration = isParameterDeclaration;
function getRootDeclaration(node) {
- while (node.kind === 184 /* BindingElement */) {
+ while (node.kind === 186 /* BindingElement */) {
node = node.parent.parent;
}
return node;
@@ -10506,15 +10677,15 @@ var ts;
ts.getRootDeclaration = getRootDeclaration;
function nodeStartsNewLexicalEnvironment(node) {
var kind = node.kind;
- return kind === 155 /* Constructor */
- || kind === 194 /* FunctionExpression */
- || kind === 237 /* FunctionDeclaration */
- || kind === 195 /* ArrowFunction */
- || kind === 154 /* MethodDeclaration */
- || kind === 156 /* GetAccessor */
- || kind === 157 /* SetAccessor */
- || kind === 242 /* ModuleDeclaration */
- || kind === 277 /* SourceFile */;
+ return kind === 157 /* Constructor */
+ || kind === 196 /* FunctionExpression */
+ || kind === 239 /* FunctionDeclaration */
+ || kind === 197 /* ArrowFunction */
+ || kind === 156 /* MethodDeclaration */
+ || kind === 158 /* GetAccessor */
+ || kind === 159 /* SetAccessor */
+ || kind === 244 /* ModuleDeclaration */
+ || kind === 279 /* SourceFile */;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
function nodeIsSynthesized(range) {
@@ -10533,38 +10704,38 @@ var ts;
})(Associativity = ts.Associativity || (ts.Associativity = {}));
function getExpressionAssociativity(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 190 /* NewExpression */ && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 192 /* NewExpression */ && expression.arguments !== undefined;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
ts.getExpressionAssociativity = getExpressionAssociativity;
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 190 /* NewExpression */:
+ case 192 /* NewExpression */:
return hasArguments ? 0 /* Left */ : 1 /* Right */;
- case 200 /* PrefixUnaryExpression */:
- case 197 /* TypeOfExpression */:
- case 198 /* VoidExpression */:
- case 196 /* DeleteExpression */:
- case 199 /* AwaitExpression */:
- case 203 /* ConditionalExpression */:
- case 205 /* YieldExpression */:
+ case 202 /* PrefixUnaryExpression */:
+ case 199 /* TypeOfExpression */:
+ case 200 /* VoidExpression */:
+ case 198 /* DeleteExpression */:
+ case 201 /* AwaitExpression */:
+ case 205 /* ConditionalExpression */:
+ case 207 /* YieldExpression */:
return 1 /* Right */;
- case 202 /* BinaryExpression */:
+ case 204 /* BinaryExpression */:
switch (operator) {
- case 40 /* AsteriskAsteriskToken */:
- case 58 /* EqualsToken */:
- case 59 /* PlusEqualsToken */:
- case 60 /* MinusEqualsToken */:
- case 62 /* AsteriskAsteriskEqualsToken */:
- case 61 /* AsteriskEqualsToken */:
- case 63 /* SlashEqualsToken */:
- case 64 /* PercentEqualsToken */:
- case 65 /* LessThanLessThanEqualsToken */:
- case 66 /* GreaterThanGreaterThanEqualsToken */:
- case 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
- case 68 /* AmpersandEqualsToken */:
- case 70 /* CaretEqualsToken */:
- case 69 /* BarEqualsToken */:
+ case 41 /* AsteriskAsteriskToken */:
+ case 59 /* EqualsToken */:
+ case 60 /* PlusEqualsToken */:
+ case 61 /* MinusEqualsToken */:
+ case 63 /* AsteriskAsteriskEqualsToken */:
+ case 62 /* AsteriskEqualsToken */:
+ case 64 /* SlashEqualsToken */:
+ case 65 /* PercentEqualsToken */:
+ case 66 /* LessThanLessThanEqualsToken */:
+ case 67 /* GreaterThanGreaterThanEqualsToken */:
+ case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
+ case 69 /* AmpersandEqualsToken */:
+ case 71 /* CaretEqualsToken */:
+ case 70 /* BarEqualsToken */:
return 1 /* Right */;
}
}
@@ -10573,15 +10744,15 @@ var ts;
ts.getOperatorAssociativity = getOperatorAssociativity;
function getExpressionPrecedence(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 190 /* NewExpression */ && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 192 /* NewExpression */ && expression.arguments !== undefined;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
ts.getExpressionPrecedence = getExpressionPrecedence;
function getOperator(expression) {
- if (expression.kind === 202 /* BinaryExpression */) {
+ if (expression.kind === 204 /* BinaryExpression */) {
return expression.operatorToken.kind;
}
- else if (expression.kind === 200 /* PrefixUnaryExpression */ || expression.kind === 201 /* PostfixUnaryExpression */) {
+ else if (expression.kind === 202 /* PrefixUnaryExpression */ || expression.kind === 203 /* PostfixUnaryExpression */) {
return expression.operator;
}
else {
@@ -10591,116 +10762,116 @@ var ts;
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 307 /* CommaListExpression */:
+ case 309 /* CommaListExpression */:
return 0;
- case 206 /* SpreadElement */:
+ case 208 /* SpreadElement */:
return 1;
- case 205 /* YieldExpression */:
+ case 207 /* YieldExpression */:
return 2;
- case 203 /* ConditionalExpression */:
+ case 205 /* ConditionalExpression */:
return 4;
- case 202 /* BinaryExpression */:
+ case 204 /* BinaryExpression */:
switch (operatorKind) {
- case 26 /* CommaToken */:
+ case 27 /* CommaToken */:
return 0;
- case 58 /* EqualsToken */:
- case 59 /* PlusEqualsToken */:
- case 60 /* MinusEqualsToken */:
- case 62 /* AsteriskAsteriskEqualsToken */:
- case 61 /* AsteriskEqualsToken */:
- case 63 /* SlashEqualsToken */:
- case 64 /* PercentEqualsToken */:
- case 65 /* LessThanLessThanEqualsToken */:
- case 66 /* GreaterThanGreaterThanEqualsToken */:
- case 67 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
- case 68 /* AmpersandEqualsToken */:
- case 70 /* CaretEqualsToken */:
- case 69 /* BarEqualsToken */:
+ case 59 /* EqualsToken */:
+ case 60 /* PlusEqualsToken */:
+ case 61 /* MinusEqualsToken */:
+ case 63 /* AsteriskAsteriskEqualsToken */:
+ case 62 /* AsteriskEqualsToken */:
+ case 64 /* SlashEqualsToken */:
+ case 65 /* PercentEqualsToken */:
+ case 66 /* LessThanLessThanEqualsToken */:
+ case 67 /* GreaterThanGreaterThanEqualsToken */:
+ case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */:
+ case 69 /* AmpersandEqualsToken */:
+ case 71 /* CaretEqualsToken */:
+ case 70 /* BarEqualsToken */:
return 3;
default:
return getBinaryOperatorPrecedence(operatorKind);
}
- case 200 /* PrefixUnaryExpression */:
- case 197 /* TypeOfExpression */:
- case 198 /* VoidExpression */:
- case 196 /* DeleteExpression */:
- case 199 /* AwaitExpression */:
+ case 202 /* PrefixUnaryExpression */:
+ case 199 /* TypeOfExpression */:
+ case 200 /* VoidExpression */:
+ case 198 /* DeleteExpression */:
+ case 201 /* AwaitExpression */:
return 16;
- case 201 /* PostfixUnaryExpression */:
+ case 203 /* PostfixUnaryExpression */:
return 17;
- case 189 /* CallExpression */:
+ case 191 /* CallExpression */:
return 18;
- case 190 /* NewExpression */:
+ case 192 /* NewExpression */:
return hasArguments ? 19 : 18;
- case 191 /* TaggedTemplateExpression */:
- case 187 /* PropertyAccessExpression */:
- case 188 /* ElementAccessExpression */:
+ case 193 /* TaggedTemplateExpression */:
+ case 189 /* PropertyAccessExpression */:
+ case 190 /* ElementAccessExpression */:
return 19;
- case 99 /* ThisKeyword */:
- case 97 /* SuperKeyword */:
- case 71 /* Identifier */:
- case 95 /* NullKeyword */:
- case 101 /* TrueKeyword */:
- case 86 /* FalseKeyword */:
+ case 100 /* ThisKeyword */:
+ case 98 /* SuperKeyword */:
+ case 72 /* Identifier */:
+ case 96 /* NullKeyword */:
+ case 102 /* TrueKeyword */:
+ case 87 /* FalseKeyword */:
case 8 /* NumericLiteral */:
- case 9 /* StringLiteral */:
- case 185 /* ArrayLiteralExpression */:
- case 186 /* ObjectLiteralExpression */:
- case 194 /* FunctionExpression */:
- case 195 /* ArrowFunction */:
- case 207 /* ClassExpression */:
- case 258 /* JsxElement */:
- case 259 /* JsxSelfClosingElement */:
- case 262 /* JsxFragment */:
- case 12 /* RegularExpressionLiteral */:
- case 13 /* NoSubstitutionTemplateLiteral */:
- case 204 /* TemplateExpression */:
- case 193 /* ParenthesizedExpression */:
- case 208 /* OmittedExpression */:
+ case 9 /* BigIntLiteral */:
+ case 10 /* StringLiteral */:
+ case 187 /* ArrayLiteralExpression */:
+ case 188 /* ObjectLiteralExpression */:
+ case 196 /* FunctionExpression */:
+ case 197 /* ArrowFunction */:
+ case 209 /* ClassExpression */:
+ case 260 /* JsxElement */:
+ case 261 /* JsxSelfClosingElement */:
+ case 264 /* JsxFragment */:
+ case 13 /* RegularExpressionLiteral */:
+ case 14 /* NoSubstitutionTemplateLiteral */:
+ case 206 /* TemplateExpression */:
+ case 195 /* ParenthesizedExpression */:
+ case 210 /* OmittedExpression */:
return 20;
default:
return -1;
}
}
ts.getOperatorPrecedence = getOperatorPrecedence;
- /* @internal */
function getBinaryOperatorPrecedence(kind) {
switch (kind) {
- case 54 /* BarBarToken */:
+ case 55 /* BarBarToken */:
return 5;
- case 53 /* AmpersandAmpersandToken */:
+ case 54 /* AmpersandAmpersandToken */:
return 6;
- case 49 /* BarToken */:
+ case 50 /* BarToken */:
return 7;
- case 50 /* CaretToken */:
+ case 51 /* CaretToken */:
return 8;
- case 48 /* AmpersandToken */:
+ case 49 /* AmpersandToken */:
return 9;
- case 32 /* EqualsEqualsToken */:
- case 33 /* ExclamationEqualsToken */:
- case 34 /* EqualsEqualsEqualsToken */:
- case 35 /* ExclamationEqualsEqualsToken */:
+ case 33 /* EqualsEqualsToken */:
+ case 34 /* ExclamationEqualsToken */:
+ case 35 /* EqualsEqualsEqualsToken */:
+ case 36 /* ExclamationEqualsEqualsToken */:
return 10;
- case 27 /* LessThanToken */:
- case 29 /* GreaterThanToken */:
- case 30 /* LessThanEqualsToken */:
- case 31 /* GreaterThanEqualsToken */:
- case 93 /* InstanceOfKeyword */:
- case 92 /* InKeyword */:
- case 118 /* AsKeyword */:
+ case 28 /* LessThanToken */:
+ case 30 /* GreaterThanToken */:
+ case 31 /* LessThanEqualsToken */:
+ case 32 /* GreaterThanEqualsToken */:
+ case 94 /* InstanceOfKeyword */:
+ case 93 /* InKeyword */:
+ case 119 /* AsKeyword */:
return 11;
- case 45 /* LessThanLessThanToken */:
- case 46 /* GreaterThanGreaterThanToken */:
- case 47 /* GreaterThanGreaterThanGreaterThanToken */:
+ case 46 /* LessThanLessThanToken */:
+ case 47 /* GreaterThanGreaterThanToken */:
+ case 48 /* GreaterThanGreaterThanGreaterThanToken */:
return 12;
- case 37 /* PlusToken */:
- case 38 /* MinusToken */:
+ case 38 /* PlusToken */:
+ case 39 /* MinusToken */:
return 13;
- case 39 /* AsteriskToken */:
- case 41 /* SlashToken */:
- case 42 /* PercentToken */:
+ case 40 /* AsteriskToken */:
+ case 42 /* SlashToken */:
+ case 43 /* PercentToken */:
return 14;
- case 40 /* AsteriskAsteriskToken */:
+ case 41 /* AsteriskAsteriskToken */:
return 15;
}
// -1 is lower than all other precedences. Returning it will cause binary expression
@@ -10768,7 +10939,7 @@ var ts;
if (fileName) {
return fileDiagnostics.get(fileName) || [];
}
- var fileDiags = ts.flatMap(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); });
+ var fileDiags = ts.flatMapToMutable(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); });
if (!nonFileDiagnostics.length) {
return fileDiags;
}
@@ -10826,7 +10997,7 @@ var ts;
}
function isIntrinsicJsxName(name) {
var ch = name.charCodeAt(0);
- return (ch >= 97 /* a */ && ch <= 122 /* z */) || name.indexOf("-") > -1;
+ return (ch >= 97 /* a */ && ch <= 122 /* z */) || ts.stringContains(name, "-");
}
ts.isIntrinsicJsxName = isIntrinsicJsxName;
function get16BitUnicodeEscapeSequence(charCode) {
@@ -10909,16 +11080,10 @@ var ts;
lineStart = true;
}
}
- function writeTextOfNode(text, node) {
- var s = getTextOfNodeFromSourceText(text, node);
- write(s);
- updateLineCountAndPosFor(s);
- }
reset();
return {
write: write,
rawWrite: rawWrite,
- writeTextOfNode: writeTextOfNode,
writeLiteral: writeLiteral,
writeLine: writeLine,
increaseIndent: function () { indent++; },
@@ -10941,10 +11106,77 @@ var ts;
writePunctuation: write,
writeSpace: write,
writeStringLiteral: write,
- writeSymbol: write
+ writeSymbol: function (s, _) { return write(s); },
+ writeTrailingSemicolon: write,
+ writeComment: write
};
}
ts.createTextWriter = createTextWriter;
+ function getTrailingSemicolonOmittingWriter(writer) {
+ var pendingTrailingSemicolon = false;
+ function commitPendingTrailingSemicolon() {
+ if (pendingTrailingSemicolon) {
+ writer.writeTrailingSemicolon(";");
+ pendingTrailingSemicolon = false;
+ }
+ }
+ return __assign({}, writer, { writeTrailingSemicolon: function () {
+ pendingTrailingSemicolon = true;
+ },
+ writeLiteral: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeLiteral(s);
+ },
+ writeStringLiteral: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeStringLiteral(s);
+ },
+ writeSymbol: function (s, sym) {
+ commitPendingTrailingSemicolon();
+ writer.writeSymbol(s, sym);
+ },
+ writePunctuation: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writePunctuation(s);
+ },
+ writeKeyword: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeKeyword(s);
+ },
+ writeOperator: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeOperator(s);
+ },
+ writeParameter: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeParameter(s);
+ },
+ writeSpace: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeSpace(s);
+ },
+ writeProperty: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeProperty(s);
+ },
+ writeComment: function (s) {
+ commitPendingTrailingSemicolon();
+ writer.writeComment(s);
+ },
+ writeLine: function () {
+ commitPendingTrailingSemicolon();
+ writer.writeLine();
+ },
+ increaseIndent: function () {
+ commitPendingTrailingSemicolon();
+ writer.increaseIndent();
+ },
+ decreaseIndent: function () {
+ commitPendingTrailingSemicolon();
+ writer.decreaseIndent();
+ } });
+ }
+ ts.getTrailingSemicolonOmittingWriter = getTrailingSemicolonOmittingWriter;
function getResolvedExternalModuleName(host, file, referenceFile) {
return file.moduleName || getExternalModuleNameFromPath(host, file.fileName, referenceFile && referenceFile.fileName);
}
@@ -11080,11 +11312,11 @@ var ts;
}
ts.parameterIsThisKeyword = parameterIsThisKeyword;
function isThisIdentifier(node) {
- return !!node && node.kind === 71 /* Identifier */ && identifierIsThisKeyword(node);
+ return !!node && node.kind === 72 /* Identifier */ && identifierIsThisKeyword(node);
}
ts.isThisIdentifier = isThisIdentifier;
function identifierIsThisKeyword(id) {
- return id.originalKeywordKind === 99 /* ThisKeyword */;
+ return id.originalKeywordKind === 100 /* ThisKeyword */;
}
ts.identifierIsThisKeyword = identifierIsThisKeyword;
function getAllAccessorDeclarations(declarations, accessor) {
@@ -11095,10 +11327,10 @@ var ts;
var setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 156 /* GetAccessor */) {
+ if (accessor.kind === 158 /* GetAccessor */) {
getAccessor = accessor;
}
- else if (accessor.kind === 157 /* SetAccessor */) {
+ else if (accessor.kind === 159 /* SetAccessor */) {
setAccessor = accessor;
}
else {
@@ -11118,10 +11350,10 @@ var ts;
else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 156 /* GetAccessor */ && !getAccessor) {
+ if (member.kind === 158 /* GetAccessor */ && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 157 /* SetAccessor */ && !setAccessor) {
+ if (member.kind === 159 /* SetAccessor */ && !setAccessor) {
setAccessor = member;
}
}
@@ -11167,7 +11399,7 @@ var ts;
ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
/** template tags are only available when a typedef isn't already using them */
function isNonTypeAliasTemplate(tag) {
- return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 289 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias));
+ return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 291 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias));
}
/**
* Gets the effective type annotation of the value parameter of a set accessor. If the node
@@ -11201,13 +11433,13 @@ var ts;
function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) {
if (comments && comments.length > 0) {
if (leadingSeparator) {
- writer.write(" ");
+ writer.writeSpace(" ");
}
var emitInterveningSeparator = false;
for (var _i = 0, comments_1 = comments; _i < comments_1.length; _i++) {
var comment = comments_1[_i];
if (emitInterveningSeparator) {
- writer.write(" ");
+ writer.writeSpace(" ");
emitInterveningSeparator = false;
}
writeComment(text, lineMap, writer, comment.pos, comment.end, newLine);
@@ -11219,7 +11451,7 @@ var ts;
}
}
if (emitInterveningSeparator && trailingSeparator) {
- writer.write(" ");
+ writer.writeSpace(" ");
}
}
}
@@ -11337,7 +11569,7 @@ var ts;
}
else {
// Single line comment of style //....
- writer.write(text.substring(commentPos, commentEnd));
+ writer.writeComment(text.substring(commentPos, commentEnd));
}
}
ts.writeCommentRange = writeCommentRange;
@@ -11346,14 +11578,14 @@ var ts;
var currentLineText = text.substring(pos, end).replace(/^\s+|\s+$/g, "");
if (currentLineText) {
// trimmed forward and ending spaces text
- writer.write(currentLineText);
+ writer.writeComment(currentLineText);
if (end !== commentEnd) {
writer.writeLine();
}
}
else {
// Empty string - make sure we write empty line
- writer.writeLiteral(newLine);
+ writer.rawWrite(newLine);
}
}
function calculateIndent(text, pos, end) {
@@ -11407,7 +11639,7 @@ var ts;
flags |= modifierToFlag(modifier.kind);
}
}
- if (node.flags & 4 /* NestedNamespace */ || (node.kind === 71 /* Identifier */ && node.isInJSDocNamespace)) {
+ if (node.flags & 4 /* NestedNamespace */ || (node.kind === 72 /* Identifier */ && node.isInJSDocNamespace)) {
flags |= 1 /* Export */;
}
return flags;
@@ -11415,29 +11647,29 @@ var ts;
ts.getModifierFlagsNoCache = getModifierFlagsNoCache;
function modifierToFlag(token) {
switch (token) {
- case 115 /* StaticKeyword */: return 32 /* Static */;
- case 114 /* PublicKeyword */: return 4 /* Public */;
- case 113 /* ProtectedKeyword */: return 16 /* Protected */;
- case 112 /* PrivateKeyword */: return 8 /* Private */;
- case 117 /* AbstractKeyword */: return 128 /* Abstract */;
- case 84 /* ExportKeyword */: return 1 /* Export */;
- case 124 /* DeclareKeyword */: return 2 /* Ambient */;
- case 76 /* ConstKeyword */: return 2048 /* Const */;
- case 79 /* DefaultKeyword */: return 512 /* Default */;
- case 120 /* AsyncKeyword */: return 256 /* Async */;
- case 132 /* ReadonlyKeyword */: return 64 /* Readonly */;
+ case 116 /* StaticKeyword */: return 32 /* Static */;
+ case 115 /* PublicKeyword */: return 4 /* Public */;
+ case 114 /* ProtectedKeyword */: return 16 /* Protected */;
+ case 113 /* PrivateKeyword */: return 8 /* Private */;
+ case 118 /* AbstractKeyword */: return 128 /* Abstract */;
+ case 85 /* ExportKeyword */: return 1 /* Export */;
+ case 125 /* DeclareKeyword */: return 2 /* Ambient */;
+ case 77 /* ConstKeyword */: return 2048 /* Const */;
+ case 80 /* DefaultKeyword */: return 512 /* Default */;
+ case 121 /* AsyncKeyword */: return 256 /* Async */;
+ case 133 /* ReadonlyKeyword */: return 64 /* Readonly */;
}
return 0 /* None */;
}
ts.modifierToFlag = modifierToFlag;
function isLogicalOperator(token) {
- return token === 54 /* BarBarToken */
- || token === 53 /* AmpersandAmpersandToken */
- || token === 51 /* ExclamationToken */;
+ return token === 55 /* BarBarToken */
+ || token === 54 /* AmpersandAmpersandToken */
+ || token === 52 /* ExclamationToken */;
}
ts.isLogicalOperator = isLogicalOperator;
function isAssignmentOperator(token) {
- return token >= 58 /* FirstAssignment */ && token <= 70 /* LastAssignment */;
+ return token >= 59 /* FirstAssignment */ && token <= 71 /* LastAssignment */;
}
ts.isAssignmentOperator = isAssignmentOperator;
/** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */
@@ -11450,14 +11682,14 @@ var ts;
return ts.isExpressionWithTypeArguments(node)
&& ts.isHeritageClause(node.parent)
&& ts.isClassLike(node.parent.parent)
- ? { class: node.parent.parent, isImplements: node.parent.token === 108 /* ImplementsKeyword */ }
+ ? { class: node.parent.parent, isImplements: node.parent.token === 109 /* ImplementsKeyword */ }
: undefined;
}
ts.tryGetClassImplementingOrExtendingExpressionWithTypeArguments = tryGetClassImplementingOrExtendingExpressionWithTypeArguments;
function isAssignmentExpression(node, excludeCompoundAssignment) {
return ts.isBinaryExpression(node)
&& (excludeCompoundAssignment
- ? node.operatorToken.kind === 58 /* EqualsToken */
+ ? node.operatorToken.kind === 59 /* EqualsToken */
: isAssignmentOperator(node.operatorToken.kind))
&& ts.isLeftHandSideExpression(node.left);
}
@@ -11465,8 +11697,8 @@ var ts;
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) {
var kind = node.left.kind;
- return kind === 186 /* ObjectLiteralExpression */
- || kind === 185 /* ArrayLiteralExpression */;
+ return kind === 188 /* ObjectLiteralExpression */
+ || kind === 187 /* ArrayLiteralExpression */;
}
return false;
}
@@ -11476,7 +11708,7 @@ var ts;
}
ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
function isEntityNameExpression(node) {
- return node.kind === 71 /* Identifier */ || isPropertyAccessEntityNameExpression(node);
+ return node.kind === 72 /* Identifier */ || isPropertyAccessEntityNameExpression(node);
}
ts.isEntityNameExpression = isEntityNameExpression;
function isPropertyAccessEntityNameExpression(node) {
@@ -11488,17 +11720,17 @@ var ts;
}
ts.isPrototypeAccess = isPrototypeAccess;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return (node.parent.kind === 146 /* QualifiedName */ && node.parent.right === node) ||
- (node.parent.kind === 187 /* PropertyAccessExpression */ && node.parent.name === node);
+ return (node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node) ||
+ (node.parent.kind === 189 /* PropertyAccessExpression */ && node.parent.name === node);
}
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
function isEmptyObjectLiteral(expression) {
- return expression.kind === 186 /* ObjectLiteralExpression */ &&
+ return expression.kind === 188 /* ObjectLiteralExpression */ &&
expression.properties.length === 0;
}
ts.isEmptyObjectLiteral = isEmptyObjectLiteral;
function isEmptyArrayLiteral(expression) {
- return expression.kind === 185 /* ArrayLiteralExpression */ &&
+ return expression.kind === 187 /* ArrayLiteralExpression */ &&
expression.elements.length === 0;
}
ts.isEmptyArrayLiteral = isEmptyArrayLiteral;
@@ -11863,8 +12095,8 @@ var ts;
var parseNode = ts.getParseTreeNode(node);
if (parseNode) {
switch (parseNode.parent.kind) {
- case 241 /* EnumDeclaration */:
- case 242 /* ModuleDeclaration */:
+ case 243 /* EnumDeclaration */:
+ case 244 /* ModuleDeclaration */:
return parseNode === parseNode.parent.name;
}
}
@@ -11941,35 +12173,35 @@ var ts;
if (!parent)
return 0 /* Read */;
switch (parent.kind) {
- case 193 /* ParenthesizedExpression */:
+ case 195 /* ParenthesizedExpression */:
return accessKind(parent);
- case 201 /* PostfixUnaryExpression */:
- case 200 /* PrefixUnaryExpression */:
+ case 203 /* PostfixUnaryExpression */:
+ case 202 /* PrefixUnaryExpression */:
var operator = parent.operator;
- return operator === 43 /* PlusPlusToken */ || operator === 44 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
- case 202 /* BinaryExpression */:
+ return operator === 44 /* PlusPlusToken */ || operator === 45 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
+ case 204 /* BinaryExpression */:
var _a = parent, left = _a.left, operatorToken = _a.operatorToken;
return left === node && isAssignmentOperator(operatorToken.kind) ?
- operatorToken.kind === 58 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite()
+ operatorToken.kind === 59 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite()
: 0 /* Read */;
- case 187 /* PropertyAccessExpression */:
+ case 189 /* PropertyAccessExpression */:
return parent.name !== node ? 0 /* Read */ : accessKind(parent);
- case 273 /* PropertyAssignment */: {
+ case 275 /* PropertyAssignment */: {
var parentAccess = accessKind(parent.parent);
// In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write.
return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess;
}
- case 274 /* ShorthandPropertyAssignment */:
+ case 276 /* ShorthandPropertyAssignment */:
// Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals.
return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent);
- case 185 /* ArrayLiteralExpression */:
+ case 187 /* ArrayLiteralExpression */:
return accessKind(parent);
default:
return 0 /* Read */;
}
function writeOrReadWrite() {
// If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect.
- return parent.parent && skipParenthesesUp(parent.parent).kind === 219 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
+ return parent.parent && skipParenthesesUp(parent.parent).kind === 221 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
}
}
function reverseAccessKind(a) {
@@ -12072,7 +12304,7 @@ var ts;
}
ts.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol;
function getObjectFlags(type) {
- return type.flags & 131072 /* Object */ ? type.objectFlags : 0;
+ return type.flags & 524288 /* Object */ ? type.objectFlags : 0;
}
ts.getObjectFlags = getObjectFlags;
function typeHasCallOrConstructSignatures(type, checker) {
@@ -12343,9 +12575,9 @@ var ts;
}
ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function getTypeParameterOwner(d) {
- if (d && d.kind === 148 /* TypeParameter */) {
+ if (d && d.kind === 150 /* TypeParameter */) {
for (var current = d; current; current = current.parent) {
- if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 239 /* InterfaceDeclaration */) {
+ if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 241 /* InterfaceDeclaration */) {
return current;
}
}
@@ -12353,7 +12585,7 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
function isParameterPropertyDeclaration(node) {
- return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 155 /* Constructor */;
+ return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 157 /* Constructor */;
}
ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
function isEmptyBindingPattern(node) {
@@ -12383,14 +12615,14 @@ var ts;
node = walkUpBindingElementsAndPatterns(node);
}
var flags = getFlags(node);
- if (node.kind === 235 /* VariableDeclaration */) {
+ if (node.kind === 237 /* VariableDeclaration */) {
node = node.parent;
}
- if (node && node.kind === 236 /* VariableDeclarationList */) {
+ if (node && node.kind === 238 /* VariableDeclarationList */) {
flags |= getFlags(node);
node = node.parent;
}
- if (node && node.kind === 217 /* VariableStatement */) {
+ if (node && node.kind === 219 /* VariableStatement */) {
flags |= getFlags(node);
}
return flags;
@@ -12536,27 +12768,27 @@ var ts;
}
// Covers remaining cases (returning undefined if none match).
switch (hostNode.kind) {
- case 217 /* VariableStatement */:
+ case 219 /* VariableStatement */:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
break;
- case 219 /* ExpressionStatement */:
+ case 221 /* ExpressionStatement */:
var expr = hostNode.expression;
switch (expr.kind) {
- case 187 /* PropertyAccessExpression */:
+ case 189 /* PropertyAccessExpression */:
return expr.name;
- case 188 /* ElementAccessExpression */:
+ case 190 /* ElementAccessExpression */:
var arg = expr.argumentExpression;
if (ts.isIdentifier(arg)) {
return arg;
}
}
break;
- case 193 /* ParenthesizedExpression */: {
+ case 195 /* ParenthesizedExpression */: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 231 /* LabeledStatement */: {
+ case 233 /* LabeledStatement */: {
if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -12580,17 +12812,18 @@ var ts;
/** @internal */
function getNonAssignedNameOfDeclaration(declaration) {
switch (declaration.kind) {
- case 71 /* Identifier */:
+ case 72 /* Identifier */:
return declaration;
- case 303 /* JSDocPropertyTag */:
- case 297 /* JSDocParameterTag */: {
+ case 305 /* JSDocPropertyTag */:
+ case 299 /* JSDocParameterTag */: {
var name = declaration.name;
- if (name.kind === 146 /* QualifiedName */) {
+ if (name.kind === 148 /* QualifiedName */) {
return name.right;
}
break;
}
- case 202 /* BinaryExpression */: {
+ case 191 /* CallExpression */:
+ case 204 /* BinaryExpression */: {
var expr = declaration;
switch (ts.getAssignmentDeclarationKind(expr)) {
case 1 /* ExportsProperty */:
@@ -12598,13 +12831,17 @@ var ts;
case 5 /* Property */:
case 3 /* PrototypeProperty */:
return expr.left.name;
+ case 7 /* ObjectDefinePropertyValue */:
+ case 8 /* ObjectDefinePropertyExports */:
+ case 9 /* ObjectDefinePrototypeProperty */:
+ return expr.arguments[1];
default:
return undefined;
}
}
- case 302 /* JSDocTypedefTag */:
+ case 304 /* JSDocTypedefTag */:
return getNameOfJSDocTypedef(declaration);
- case 252 /* ExportAssignment */: {
+ case 254 /* ExportAssignment */: {
var expression = declaration.expression;
return ts.isIdentifier(expression) ? expression : undefined;
}
@@ -12806,7 +13043,7 @@ var ts;
return ts.emptyArray;
}
if (ts.isJSDocTypeAlias(node)) {
- ts.Debug.assert(node.parent.kind === 289 /* JSDocComment */);
+ ts.Debug.assert(node.parent.kind === 291 /* JSDocComment */);
return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
}
if (node.typeParameters) {
@@ -12840,684 +13077,688 @@ var ts;
return node.kind === 8 /* NumericLiteral */;
}
ts.isNumericLiteral = isNumericLiteral;
+ function isBigIntLiteral(node) {
+ return node.kind === 9 /* BigIntLiteral */;
+ }
+ ts.isBigIntLiteral = isBigIntLiteral;
function isStringLiteral(node) {
- return node.kind === 9 /* StringLiteral */;
+ return node.kind === 10 /* StringLiteral */;
}
ts.isStringLiteral = isStringLiteral;
function isJsxText(node) {
- return node.kind === 10 /* JsxText */;
+ return node.kind === 11 /* JsxText */;
}
ts.isJsxText = isJsxText;
function isRegularExpressionLiteral(node) {
- return node.kind === 12 /* RegularExpressionLiteral */;
+ return node.kind === 13 /* RegularExpressionLiteral */;
}
ts.isRegularExpressionLiteral = isRegularExpressionLiteral;
function isNoSubstitutionTemplateLiteral(node) {
- return node.kind === 13 /* NoSubstitutionTemplateLiteral */;
+ return node.kind === 14 /* NoSubstitutionTemplateLiteral */;
}
ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral;
// Pseudo-literals
function isTemplateHead(node) {
- return node.kind === 14 /* TemplateHead */;
+ return node.kind === 15 /* TemplateHead */;
}
ts.isTemplateHead = isTemplateHead;
function isTemplateMiddle(node) {
- return node.kind === 15 /* TemplateMiddle */;
+ return node.kind === 16 /* TemplateMiddle */;
}
ts.isTemplateMiddle = isTemplateMiddle;
function isTemplateTail(node) {
- return node.kind === 16 /* TemplateTail */;
+ return node.kind === 17 /* TemplateTail */;
}
ts.isTemplateTail = isTemplateTail;
function isIdentifier(node) {
- return node.kind === 71 /* Identifier */;
+ return node.kind === 72 /* Identifier */;
}
ts.isIdentifier = isIdentifier;
// Names
function isQualifiedName(node) {
- return node.kind === 146 /* QualifiedName */;
+ return node.kind === 148 /* QualifiedName */;
}
ts.isQualifiedName = isQualifiedName;
function isComputedPropertyName(node) {
- return node.kind === 147 /* ComputedPropertyName */;
+ return node.kind === 149 /* ComputedPropertyName */;
}
ts.isComputedPropertyName = isComputedPropertyName;
// Signature elements
function isTypeParameterDeclaration(node) {
- return node.kind === 148 /* TypeParameter */;
+ return node.kind === 150 /* TypeParameter */;
}
ts.isTypeParameterDeclaration = isTypeParameterDeclaration;
function isParameter(node) {
- return node.kind === 149 /* Parameter */;
+ return node.kind === 151 /* Parameter */;
}
ts.isParameter = isParameter;
function isDecorator(node) {
- return node.kind === 150 /* Decorator */;
+ return node.kind === 152 /* Decorator */;
}
ts.isDecorator = isDecorator;
// TypeMember
function isPropertySignature(node) {
- return node.kind === 151 /* PropertySignature */;
+ return node.kind === 153 /* PropertySignature */;
}
ts.isPropertySignature = isPropertySignature;
function isPropertyDeclaration(node) {
- return node.kind === 152 /* PropertyDeclaration */;
+ return node.kind === 154 /* PropertyDeclaration */;
}
ts.isPropertyDeclaration = isPropertyDeclaration;
function isMethodSignature(node) {
- return node.kind === 153 /* MethodSignature */;
+ return node.kind === 155 /* MethodSignature */;
}
ts.isMethodSignature = isMethodSignature;
function isMethodDeclaration(node) {
- return node.kind === 154 /* MethodDeclaration */;
+ return node.kind === 156 /* MethodDeclaration */;
}
ts.isMethodDeclaration = isMethodDeclaration;
function isConstructorDeclaration(node) {
- return node.kind === 155 /* Constructor */;
+ return node.kind === 157 /* Constructor */;
}
ts.isConstructorDeclaration = isConstructorDeclaration;
function isGetAccessorDeclaration(node) {
- return node.kind === 156 /* GetAccessor */;
+ return node.kind === 158 /* GetAccessor */;
}
ts.isGetAccessorDeclaration = isGetAccessorDeclaration;
function isSetAccessorDeclaration(node) {
- return node.kind === 157 /* SetAccessor */;
+ return node.kind === 159 /* SetAccessor */;
}
ts.isSetAccessorDeclaration = isSetAccessorDeclaration;
function isCallSignatureDeclaration(node) {
- return node.kind === 158 /* CallSignature */;
+ return node.kind === 160 /* CallSignature */;
}
ts.isCallSignatureDeclaration = isCallSignatureDeclaration;
function isConstructSignatureDeclaration(node) {
- return node.kind === 159 /* ConstructSignature */;
+ return node.kind === 161 /* ConstructSignature */;
}
ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration;
function isIndexSignatureDeclaration(node) {
- return node.kind === 160 /* IndexSignature */;
+ return node.kind === 162 /* IndexSignature */;
}
ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration;
/* @internal */
function isGetOrSetAccessorDeclaration(node) {
- return node.kind === 157 /* SetAccessor */ || node.kind === 156 /* GetAccessor */;
+ return node.kind === 159 /* SetAccessor */ || node.kind === 158 /* GetAccessor */;
}
ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration;
// Type
function isTypePredicateNode(node) {
- return node.kind === 161 /* TypePredicate */;
+ return node.kind === 163 /* TypePredicate */;
}
ts.isTypePredicateNode = isTypePredicateNode;
function isTypeReferenceNode(node) {
- return node.kind === 162 /* TypeReference */;
+ return node.kind === 164 /* TypeReference */;
}
ts.isTypeReferenceNode = isTypeReferenceNode;
function isFunctionTypeNode(node) {
- return node.kind === 163 /* FunctionType */;
+ return node.kind === 165 /* FunctionType */;
}
ts.isFunctionTypeNode = isFunctionTypeNode;
function isConstructorTypeNode(node) {
- return node.kind === 164 /* ConstructorType */;
+ return node.kind === 166 /* ConstructorType */;
}
ts.isConstructorTypeNode = isConstructorTypeNode;
function isTypeQueryNode(node) {
- return node.kind === 165 /* TypeQuery */;
+ return node.kind === 167 /* TypeQuery */;
}
ts.isTypeQueryNode = isTypeQueryNode;
function isTypeLiteralNode(node) {
- return node.kind === 166 /* TypeLiteral */;
+ return node.kind === 168 /* TypeLiteral */;
}
ts.isTypeLiteralNode = isTypeLiteralNode;
function isArrayTypeNode(node) {
- return node.kind === 167 /* ArrayType */;
+ return node.kind === 169 /* ArrayType */;
}
ts.isArrayTypeNode = isArrayTypeNode;
function isTupleTypeNode(node) {
- return node.kind === 168 /* TupleType */;
+ return node.kind === 170 /* TupleType */;
}
ts.isTupleTypeNode = isTupleTypeNode;
function isUnionTypeNode(node) {
- return node.kind === 171 /* UnionType */;
+ return node.kind === 173 /* UnionType */;
}
ts.isUnionTypeNode = isUnionTypeNode;
function isIntersectionTypeNode(node) {
- return node.kind === 172 /* IntersectionType */;
+ return node.kind === 174 /* IntersectionType */;
}
ts.isIntersectionTypeNode = isIntersectionTypeNode;
function isConditionalTypeNode(node) {
- return node.kind === 173 /* ConditionalType */;
+ return node.kind === 175 /* ConditionalType */;
}
ts.isConditionalTypeNode = isConditionalTypeNode;
function isInferTypeNode(node) {
- return node.kind === 174 /* InferType */;
+ return node.kind === 176 /* InferType */;
}
ts.isInferTypeNode = isInferTypeNode;
function isParenthesizedTypeNode(node) {
- return node.kind === 175 /* ParenthesizedType */;
+ return node.kind === 177 /* ParenthesizedType */;
}
ts.isParenthesizedTypeNode = isParenthesizedTypeNode;
function isThisTypeNode(node) {
- return node.kind === 176 /* ThisType */;
+ return node.kind === 178 /* ThisType */;
}
ts.isThisTypeNode = isThisTypeNode;
function isTypeOperatorNode(node) {
- return node.kind === 177 /* TypeOperator */;
+ return node.kind === 179 /* TypeOperator */;
}
ts.isTypeOperatorNode = isTypeOperatorNode;
function isIndexedAccessTypeNode(node) {
- return node.kind === 178 /* IndexedAccessType */;
+ return node.kind === 180 /* IndexedAccessType */;
}
ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode;
function isMappedTypeNode(node) {
- return node.kind === 179 /* MappedType */;
+ return node.kind === 181 /* MappedType */;
}
ts.isMappedTypeNode = isMappedTypeNode;
function isLiteralTypeNode(node) {
- return node.kind === 180 /* LiteralType */;
+ return node.kind === 182 /* LiteralType */;
}
ts.isLiteralTypeNode = isLiteralTypeNode;
function isImportTypeNode(node) {
- return node.kind === 181 /* ImportType */;
+ return node.kind === 183 /* ImportType */;
}
ts.isImportTypeNode = isImportTypeNode;
// Binding patterns
function isObjectBindingPattern(node) {
- return node.kind === 182 /* ObjectBindingPattern */;
+ return node.kind === 184 /* ObjectBindingPattern */;
}
ts.isObjectBindingPattern = isObjectBindingPattern;
function isArrayBindingPattern(node) {
- return node.kind === 183 /* ArrayBindingPattern */;
+ return node.kind === 185 /* ArrayBindingPattern */;
}
ts.isArrayBindingPattern = isArrayBindingPattern;
function isBindingElement(node) {
- return node.kind === 184 /* BindingElement */;
+ return node.kind === 186 /* BindingElement */;
}
ts.isBindingElement = isBindingElement;
// Expression
function isArrayLiteralExpression(node) {
- return node.kind === 185 /* ArrayLiteralExpression */;
+ return node.kind === 187 /* ArrayLiteralExpression */;
}
ts.isArrayLiteralExpression = isArrayLiteralExpression;
function isObjectLiteralExpression(node) {
- return node.kind === 186 /* ObjectLiteralExpression */;
+ return node.kind === 188 /* ObjectLiteralExpression */;
}
ts.isObjectLiteralExpression = isObjectLiteralExpression;
function isPropertyAccessExpression(node) {
- return node.kind === 187 /* PropertyAccessExpression */;
+ return node.kind === 189 /* PropertyAccessExpression */;
}
ts.isPropertyAccessExpression = isPropertyAccessExpression;
function isElementAccessExpression(node) {
- return node.kind === 188 /* ElementAccessExpression */;
+ return node.kind === 190 /* ElementAccessExpression */;
}
ts.isElementAccessExpression = isElementAccessExpression;
function isCallExpression(node) {
- return node.kind === 189 /* CallExpression */;
+ return node.kind === 191 /* CallExpression */;
}
ts.isCallExpression = isCallExpression;
function isNewExpression(node) {
- return node.kind === 190 /* NewExpression */;
+ return node.kind === 192 /* NewExpression */;
}
ts.isNewExpression = isNewExpression;
function isTaggedTemplateExpression(node) {
- return node.kind === 191 /* TaggedTemplateExpression */;
+ return node.kind === 193 /* TaggedTemplateExpression */;
}
ts.isTaggedTemplateExpression = isTaggedTemplateExpression;
function isTypeAssertion(node) {
- return node.kind === 192 /* TypeAssertionExpression */;
+ return node.kind === 194 /* TypeAssertionExpression */;
}
ts.isTypeAssertion = isTypeAssertion;
function isParenthesizedExpression(node) {
- return node.kind === 193 /* ParenthesizedExpression */;
+ return node.kind === 195 /* ParenthesizedExpression */;
}
ts.isParenthesizedExpression = isParenthesizedExpression;
function skipPartiallyEmittedExpressions(node) {
- while (node.kind === 306 /* PartiallyEmittedExpression */) {
+ while (node.kind === 308 /* PartiallyEmittedExpression */) {
node = node.expression;
}
return node;
}
ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions;
function isFunctionExpression(node) {
- return node.kind === 194 /* FunctionExpression */;
+ return node.kind === 196 /* FunctionExpression */;
}
ts.isFunctionExpression = isFunctionExpression;
function isArrowFunction(node) {
- return node.kind === 195 /* ArrowFunction */;
+ return node.kind === 197 /* ArrowFunction */;
}
ts.isArrowFunction = isArrowFunction;
function isDeleteExpression(node) {
- return node.kind === 196 /* DeleteExpression */;
+ return node.kind === 198 /* DeleteExpression */;
}
ts.isDeleteExpression = isDeleteExpression;
function isTypeOfExpression(node) {
- return node.kind === 197 /* TypeOfExpression */;
+ return node.kind === 199 /* TypeOfExpression */;
}
ts.isTypeOfExpression = isTypeOfExpression;
function isVoidExpression(node) {
- return node.kind === 198 /* VoidExpression */;
+ return node.kind === 200 /* VoidExpression */;
}
ts.isVoidExpression = isVoidExpression;
function isAwaitExpression(node) {
- return node.kind === 199 /* AwaitExpression */;
+ return node.kind === 201 /* AwaitExpression */;
}
ts.isAwaitExpression = isAwaitExpression;
function isPrefixUnaryExpression(node) {
- return node.kind === 200 /* PrefixUnaryExpression */;
+ return node.kind === 202 /* PrefixUnaryExpression */;
}
ts.isPrefixUnaryExpression = isPrefixUnaryExpression;
function isPostfixUnaryExpression(node) {
- return node.kind === 201 /* PostfixUnaryExpression */;
+ return node.kind === 203 /* PostfixUnaryExpression */;
}
ts.isPostfixUnaryExpression = isPostfixUnaryExpression;
function isBinaryExpression(node) {
- return node.kind === 202 /* BinaryExpression */;
+ return node.kind === 204 /* BinaryExpression */;
}
ts.isBinaryExpression = isBinaryExpression;
function isConditionalExpression(node) {
- return node.kind === 203 /* ConditionalExpression */;
+ return node.kind === 205 /* ConditionalExpression */;
}
ts.isConditionalExpression = isConditionalExpression;
function isTemplateExpression(node) {
- return node.kind === 204 /* TemplateExpression */;
+ return node.kind === 206 /* TemplateExpression */;
}
ts.isTemplateExpression = isTemplateExpression;
function isYieldExpression(node) {
- return node.kind === 205 /* YieldExpression */;
+ return node.kind === 207 /* YieldExpression */;
}
ts.isYieldExpression = isYieldExpression;
function isSpreadElement(node) {
- return node.kind === 206 /* SpreadElement */;
+ return node.kind === 208 /* SpreadElement */;
}
ts.isSpreadElement = isSpreadElement;
function isClassExpression(node) {
- return node.kind === 207 /* ClassExpression */;
+ return node.kind === 209 /* ClassExpression */;
}
ts.isClassExpression = isClassExpression;
function isOmittedExpression(node) {
- return node.kind === 208 /* OmittedExpression */;
+ return node.kind === 210 /* OmittedExpression */;
}
ts.isOmittedExpression = isOmittedExpression;
function isExpressionWithTypeArguments(node) {
- return node.kind === 209 /* ExpressionWithTypeArguments */;
+ return node.kind === 211 /* ExpressionWithTypeArguments */;
}
ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
function isAsExpression(node) {
- return node.kind === 210 /* AsExpression */;
+ return node.kind === 212 /* AsExpression */;
}
ts.isAsExpression = isAsExpression;
function isNonNullExpression(node) {
- return node.kind === 211 /* NonNullExpression */;
+ return node.kind === 213 /* NonNullExpression */;
}
ts.isNonNullExpression = isNonNullExpression;
function isMetaProperty(node) {
- return node.kind === 212 /* MetaProperty */;
+ return node.kind === 214 /* MetaProperty */;
}
ts.isMetaProperty = isMetaProperty;
// Misc
function isTemplateSpan(node) {
- return node.kind === 214 /* TemplateSpan */;
+ return node.kind === 216 /* TemplateSpan */;
}
ts.isTemplateSpan = isTemplateSpan;
function isSemicolonClassElement(node) {
- return node.kind === 215 /* SemicolonClassElement */;
+ return node.kind === 217 /* SemicolonClassElement */;
}
ts.isSemicolonClassElement = isSemicolonClassElement;
// Block
function isBlock(node) {
- return node.kind === 216 /* Block */;
+ return node.kind === 218 /* Block */;
}
ts.isBlock = isBlock;
function isVariableStatement(node) {
- return node.kind === 217 /* VariableStatement */;
+ return node.kind === 219 /* VariableStatement */;
}
ts.isVariableStatement = isVariableStatement;
function isEmptyStatement(node) {
- return node.kind === 218 /* EmptyStatement */;
+ return node.kind === 220 /* EmptyStatement */;
}
ts.isEmptyStatement = isEmptyStatement;
function isExpressionStatement(node) {
- return node.kind === 219 /* ExpressionStatement */;
+ return node.kind === 221 /* ExpressionStatement */;
}
ts.isExpressionStatement = isExpressionStatement;
function isIfStatement(node) {
- return node.kind === 220 /* IfStatement */;
+ return node.kind === 222 /* IfStatement */;
}
ts.isIfStatement = isIfStatement;
function isDoStatement(node) {
- return node.kind === 221 /* DoStatement */;
+ return node.kind === 223 /* DoStatement */;
}
ts.isDoStatement = isDoStatement;
function isWhileStatement(node) {
- return node.kind === 222 /* WhileStatement */;
+ return node.kind === 224 /* WhileStatement */;
}
ts.isWhileStatement = isWhileStatement;
function isForStatement(node) {
- return node.kind === 223 /* ForStatement */;
+ return node.kind === 225 /* ForStatement */;
}
ts.isForStatement = isForStatement;
function isForInStatement(node) {
- return node.kind === 224 /* ForInStatement */;
+ return node.kind === 226 /* ForInStatement */;
}
ts.isForInStatement = isForInStatement;
function isForOfStatement(node) {
- return node.kind === 225 /* ForOfStatement */;
+ return node.kind === 227 /* ForOfStatement */;
}
ts.isForOfStatement = isForOfStatement;
function isContinueStatement(node) {
- return node.kind === 226 /* ContinueStatement */;
+ return node.kind === 228 /* ContinueStatement */;
}
ts.isContinueStatement = isContinueStatement;
function isBreakStatement(node) {
- return node.kind === 227 /* BreakStatement */;
+ return node.kind === 229 /* BreakStatement */;
}
ts.isBreakStatement = isBreakStatement;
function isBreakOrContinueStatement(node) {
- return node.kind === 227 /* BreakStatement */ || node.kind === 226 /* ContinueStatement */;
+ return node.kind === 229 /* BreakStatement */ || node.kind === 228 /* ContinueStatement */;
}
ts.isBreakOrContinueStatement = isBreakOrContinueStatement;
function isReturnStatement(node) {
- return node.kind === 228 /* ReturnStatement */;
+ return node.kind === 230 /* ReturnStatement */;
}
ts.isReturnStatement = isReturnStatement;
function isWithStatement(node) {
- return node.kind === 229 /* WithStatement */;
+ return node.kind === 231 /* WithStatement */;
}
ts.isWithStatement = isWithStatement;
function isSwitchStatement(node) {
- return node.kind === 230 /* SwitchStatement */;
+ return node.kind === 232 /* SwitchStatement */;
}
ts.isSwitchStatement = isSwitchStatement;
function isLabeledStatement(node) {
- return node.kind === 231 /* LabeledStatement */;
+ return node.kind === 233 /* LabeledStatement */;
}
ts.isLabeledStatement = isLabeledStatement;
function isThrowStatement(node) {
- return node.kind === 232 /* ThrowStatement */;
+ return node.kind === 234 /* ThrowStatement */;
}
ts.isThrowStatement = isThrowStatement;
function isTryStatement(node) {
- return node.kind === 233 /* TryStatement */;
+ return node.kind === 235 /* TryStatement */;
}
ts.isTryStatement = isTryStatement;
function isDebuggerStatement(node) {
- return node.kind === 234 /* DebuggerStatement */;
+ return node.kind === 236 /* DebuggerStatement */;
}
ts.isDebuggerStatement = isDebuggerStatement;
function isVariableDeclaration(node) {
- return node.kind === 235 /* VariableDeclaration */;
+ return node.kind === 237 /* VariableDeclaration */;
}
ts.isVariableDeclaration = isVariableDeclaration;
function isVariableDeclarationList(node) {
- return node.kind === 236 /* VariableDeclarationList */;
+ return node.kind === 238 /* VariableDeclarationList */;
}
ts.isVariableDeclarationList = isVariableDeclarationList;
function isFunctionDeclaration(node) {
- return node.kind === 237 /* FunctionDeclaration */;
+ return node.kind === 239 /* FunctionDeclaration */;
}
ts.isFunctionDeclaration = isFunctionDeclaration;
function isClassDeclaration(node) {
- return node.kind === 238 /* ClassDeclaration */;
+ return node.kind === 240 /* ClassDeclaration */;
}
ts.isClassDeclaration = isClassDeclaration;
function isInterfaceDeclaration(node) {
- return node.kind === 239 /* InterfaceDeclaration */;
+ return node.kind === 241 /* InterfaceDeclaration */;
}
ts.isInterfaceDeclaration = isInterfaceDeclaration;
function isTypeAliasDeclaration(node) {
- return node.kind === 240 /* TypeAliasDeclaration */;
+ return node.kind === 242 /* TypeAliasDeclaration */;
}
ts.isTypeAliasDeclaration = isTypeAliasDeclaration;
function isEnumDeclaration(node) {
- return node.kind === 241 /* EnumDeclaration */;
+ return node.kind === 243 /* EnumDeclaration */;
}
ts.isEnumDeclaration = isEnumDeclaration;
function isModuleDeclaration(node) {
- return node.kind === 242 /* ModuleDeclaration */;
+ return node.kind === 244 /* ModuleDeclaration */;
}
ts.isModuleDeclaration = isModuleDeclaration;
function isModuleBlock(node) {
- return node.kind === 243 /* ModuleBlock */;
+ return node.kind === 245 /* ModuleBlock */;
}
ts.isModuleBlock = isModuleBlock;
function isCaseBlock(node) {
- return node.kind === 244 /* CaseBlock */;
+ return node.kind === 246 /* CaseBlock */;
}
ts.isCaseBlock = isCaseBlock;
function isNamespaceExportDeclaration(node) {
- return node.kind === 245 /* NamespaceExportDeclaration */;
+ return node.kind === 247 /* NamespaceExportDeclaration */;
}
ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration;
function isImportEqualsDeclaration(node) {
- return node.kind === 246 /* ImportEqualsDeclaration */;
+ return node.kind === 248 /* ImportEqualsDeclaration */;
}
ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
function isImportDeclaration(node) {
- return node.kind === 247 /* ImportDeclaration */;
+ return node.kind === 249 /* ImportDeclaration */;
}
ts.isImportDeclaration = isImportDeclaration;
function isImportClause(node) {
- return node.kind === 248 /* ImportClause */;
+ return node.kind === 250 /* ImportClause */;
}
ts.isImportClause = isImportClause;
function isNamespaceImport(node) {
- return node.kind === 249 /* NamespaceImport */;
+ return node.kind === 251 /* NamespaceImport */;
}
ts.isNamespaceImport = isNamespaceImport;
function isNamedImports(node) {
- return node.kind === 250 /* NamedImports */;
+ return node.kind === 252 /* NamedImports */;
}
ts.isNamedImports = isNamedImports;
function isImportSpecifier(node) {
- return node.kind === 251 /* ImportSpecifier */;
+ return node.kind === 253 /* ImportSpecifier */;
}
ts.isImportSpecifier = isImportSpecifier;
function isExportAssignment(node) {
- return node.kind === 252 /* ExportAssignment */;
+ return node.kind === 254 /* ExportAssignment */;
}
ts.isExportAssignment = isExportAssignment;
function isExportDeclaration(node) {
- return node.kind === 253 /* ExportDeclaration */;
+ return node.kind === 255 /* ExportDeclaration */;
}
ts.isExportDeclaration = isExportDeclaration;
function isNamedExports(node) {
- return node.kind === 254 /* NamedExports */;
+ return node.kind === 256 /* NamedExports */;
}
ts.isNamedExports = isNamedExports;
function isExportSpecifier(node) {
- return node.kind === 255 /* ExportSpecifier */;
+ return node.kind === 257 /* ExportSpecifier */;
}
ts.isExportSpecifier = isExportSpecifier;
function isMissingDeclaration(node) {
- return node.kind === 256 /* MissingDeclaration */;
+ return node.kind === 258 /* MissingDeclaration */;
}
ts.isMissingDeclaration = isMissingDeclaration;
// Module References
function isExternalModuleReference(node) {
- return node.kind === 257 /* ExternalModuleReference */;
+ return node.kind === 259 /* ExternalModuleReference */;
}
ts.isExternalModuleReference = isExternalModuleReference;
// JSX
function isJsxElement(node) {
- return node.kind === 258 /* JsxElement */;
+ return node.kind === 260 /* JsxElement */;
}
ts.isJsxElement = isJsxElement;
function isJsxSelfClosingElement(node) {
- return node.kind === 259 /* JsxSelfClosingElement */;
+ return node.kind === 261 /* JsxSelfClosingElement */;
}
ts.isJsxSelfClosingElement = isJsxSelfClosingElement;
function isJsxOpeningElement(node) {
- return node.kind === 260 /* JsxOpeningElement */;
+ return node.kind === 262 /* JsxOpeningElement */;
}
ts.isJsxOpeningElement = isJsxOpeningElement;
function isJsxClosingElement(node) {
- return node.kind === 261 /* JsxClosingElement */;
+ return node.kind === 263 /* JsxClosingElement */;
}
ts.isJsxClosingElement = isJsxClosingElement;
function isJsxFragment(node) {
- return node.kind === 262 /* JsxFragment */;
+ return node.kind === 264 /* JsxFragment */;
}
ts.isJsxFragment = isJsxFragment;
function isJsxOpeningFragment(node) {
- return node.kind === 263 /* JsxOpeningFragment */;
+ return node.kind === 265 /* JsxOpeningFragment */;
}
ts.isJsxOpeningFragment = isJsxOpeningFragment;
function isJsxClosingFragment(node) {
- return node.kind === 264 /* JsxClosingFragment */;
+ return node.kind === 266 /* JsxClosingFragment */;
}
ts.isJsxClosingFragment = isJsxClosingFragment;
function isJsxAttribute(node) {
- return node.kind === 265 /* JsxAttribute */;
+ return node.kind === 267 /* JsxAttribute */;
}
ts.isJsxAttribute = isJsxAttribute;
function isJsxAttributes(node) {
- return node.kind === 266 /* JsxAttributes */;
+ return node.kind === 268 /* JsxAttributes */;
}
ts.isJsxAttributes = isJsxAttributes;
function isJsxSpreadAttribute(node) {
- return node.kind === 267 /* JsxSpreadAttribute */;
+ return node.kind === 269 /* JsxSpreadAttribute */;
}
ts.isJsxSpreadAttribute = isJsxSpreadAttribute;
function isJsxExpression(node) {
- return node.kind === 268 /* JsxExpression */;
+ return node.kind === 270 /* JsxExpression */;
}
ts.isJsxExpression = isJsxExpression;
// Clauses
function isCaseClause(node) {
- return node.kind === 269 /* CaseClause */;
+ return node.kind === 271 /* CaseClause */;
}
ts.isCaseClause = isCaseClause;
function isDefaultClause(node) {
- return node.kind === 270 /* DefaultClause */;
+ return node.kind === 272 /* DefaultClause */;
}
ts.isDefaultClause = isDefaultClause;
function isHeritageClause(node) {
- return node.kind === 271 /* HeritageClause */;
+ return node.kind === 273 /* HeritageClause */;
}
ts.isHeritageClause = isHeritageClause;
function isCatchClause(node) {
- return node.kind === 272 /* CatchClause */;
+ return node.kind === 274 /* CatchClause */;
}
ts.isCatchClause = isCatchClause;
// Property assignments
function isPropertyAssignment(node) {
- return node.kind === 273 /* PropertyAssignment */;
+ return node.kind === 275 /* PropertyAssignment */;
}
ts.isPropertyAssignment = isPropertyAssignment;
function isShorthandPropertyAssignment(node) {
- return node.kind === 274 /* ShorthandPropertyAssignment */;
+ return node.kind === 276 /* ShorthandPropertyAssignment */;
}
ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment;
function isSpreadAssignment(node) {
- return node.kind === 275 /* SpreadAssignment */;
+ return node.kind === 277 /* SpreadAssignment */;
}
ts.isSpreadAssignment = isSpreadAssignment;
// Enum
function isEnumMember(node) {
- return node.kind === 276 /* EnumMember */;
+ return node.kind === 278 /* EnumMember */;
}
ts.isEnumMember = isEnumMember;
// Top-level nodes
function isSourceFile(node) {
- return node.kind === 277 /* SourceFile */;
+ return node.kind === 279 /* SourceFile */;
}
ts.isSourceFile = isSourceFile;
function isBundle(node) {
- return node.kind === 278 /* Bundle */;
+ return node.kind === 280 /* Bundle */;
}
ts.isBundle = isBundle;
function isUnparsedSource(node) {
- return node.kind === 279 /* UnparsedSource */;
+ return node.kind === 281 /* UnparsedSource */;
}
ts.isUnparsedSource = isUnparsedSource;
// JSDoc
function isJSDocTypeExpression(node) {
- return node.kind === 281 /* JSDocTypeExpression */;
+ return node.kind === 283 /* JSDocTypeExpression */;
}
ts.isJSDocTypeExpression = isJSDocTypeExpression;
function isJSDocAllType(node) {
- return node.kind === 282 /* JSDocAllType */;
+ return node.kind === 284 /* JSDocAllType */;
}
ts.isJSDocAllType = isJSDocAllType;
function isJSDocUnknownType(node) {
- return node.kind === 283 /* JSDocUnknownType */;
+ return node.kind === 285 /* JSDocUnknownType */;
}
ts.isJSDocUnknownType = isJSDocUnknownType;
function isJSDocNullableType(node) {
- return node.kind === 284 /* JSDocNullableType */;
+ return node.kind === 286 /* JSDocNullableType */;
}
ts.isJSDocNullableType = isJSDocNullableType;
function isJSDocNonNullableType(node) {
- return node.kind === 285 /* JSDocNonNullableType */;
+ return node.kind === 287 /* JSDocNonNullableType */;
}
ts.isJSDocNonNullableType = isJSDocNonNullableType;
function isJSDocOptionalType(node) {
- return node.kind === 286 /* JSDocOptionalType */;
+ return node.kind === 288 /* JSDocOptionalType */;
}
ts.isJSDocOptionalType = isJSDocOptionalType;
function isJSDocFunctionType(node) {
- return node.kind === 287 /* JSDocFunctionType */;
+ return node.kind === 289 /* JSDocFunctionType */;
}
ts.isJSDocFunctionType = isJSDocFunctionType;
function isJSDocVariadicType(node) {
- return node.kind === 288 /* JSDocVariadicType */;
+ return node.kind === 290 /* JSDocVariadicType */;
}
ts.isJSDocVariadicType = isJSDocVariadicType;
function isJSDoc(node) {
- return node.kind === 289 /* JSDocComment */;
+ return node.kind === 291 /* JSDocComment */;
}
ts.isJSDoc = isJSDoc;
function isJSDocAugmentsTag(node) {
- return node.kind === 293 /* JSDocAugmentsTag */;
+ return node.kind === 295 /* JSDocAugmentsTag */;
}
ts.isJSDocAugmentsTag = isJSDocAugmentsTag;
function isJSDocClassTag(node) {
- return node.kind === 294 /* JSDocClassTag */;
+ return node.kind === 296 /* JSDocClassTag */;
}
ts.isJSDocClassTag = isJSDocClassTag;
function isJSDocEnumTag(node) {
- return node.kind === 296 /* JSDocEnumTag */;
+ return node.kind === 298 /* JSDocEnumTag */;
}
ts.isJSDocEnumTag = isJSDocEnumTag;
function isJSDocThisTag(node) {
- return node.kind === 299 /* JSDocThisTag */;
+ return node.kind === 301 /* JSDocThisTag */;
}
ts.isJSDocThisTag = isJSDocThisTag;
function isJSDocParameterTag(node) {
- return node.kind === 297 /* JSDocParameterTag */;
+ return node.kind === 299 /* JSDocParameterTag */;
}
ts.isJSDocParameterTag = isJSDocParameterTag;
function isJSDocReturnTag(node) {
- return node.kind === 298 /* JSDocReturnTag */;
+ return node.kind === 300 /* JSDocReturnTag */;
}
ts.isJSDocReturnTag = isJSDocReturnTag;
function isJSDocTypeTag(node) {
- return node.kind === 300 /* JSDocTypeTag */;
+ return node.kind === 302 /* JSDocTypeTag */;
}
ts.isJSDocTypeTag = isJSDocTypeTag;
function isJSDocTemplateTag(node) {
- return node.kind === 301 /* JSDocTemplateTag */;
+ return node.kind === 303 /* JSDocTemplateTag */;
}
ts.isJSDocTemplateTag = isJSDocTemplateTag;
function isJSDocTypedefTag(node) {
- return node.kind === 302 /* JSDocTypedefTag */;
+ return node.kind === 304 /* JSDocTypedefTag */;
}
ts.isJSDocTypedefTag = isJSDocTypedefTag;
function isJSDocPropertyTag(node) {
- return node.kind === 303 /* JSDocPropertyTag */;
+ return node.kind === 305 /* JSDocPropertyTag */;
}
ts.isJSDocPropertyTag = isJSDocPropertyTag;
function isJSDocPropertyLikeTag(node) {
- return node.kind === 303 /* JSDocPropertyTag */ || node.kind === 297 /* JSDocParameterTag */;
+ return node.kind === 305 /* JSDocPropertyTag */ || node.kind === 299 /* JSDocParameterTag */;
}
ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag;
function isJSDocTypeLiteral(node) {
- return node.kind === 290 /* JSDocTypeLiteral */;
+ return node.kind === 292 /* JSDocTypeLiteral */;
}
ts.isJSDocTypeLiteral = isJSDocTypeLiteral;
function isJSDocCallbackTag(node) {
- return node.kind === 295 /* JSDocCallbackTag */;
+ return node.kind === 297 /* JSDocCallbackTag */;
}
ts.isJSDocCallbackTag = isJSDocCallbackTag;
function isJSDocSignature(node) {
- return node.kind === 291 /* JSDocSignature */;
+ return node.kind === 293 /* JSDocSignature */;
}
ts.isJSDocSignature = isJSDocSignature;
})(ts || (ts = {}));
@@ -13528,7 +13769,7 @@ var ts;
(function (ts) {
/* @internal */
function isSyntaxList(n) {
- return n.kind === 304 /* SyntaxList */;
+ return n.kind === 306 /* SyntaxList */;
}
ts.isSyntaxList = isSyntaxList;
/* @internal */
@@ -13538,7 +13779,7 @@ var ts;
ts.isNode = isNode;
/* @internal */
function isNodeKind(kind) {
- return kind >= 146 /* FirstNode */;
+ return kind >= 148 /* FirstNode */;
}
ts.isNodeKind = isNodeKind;
/**
@@ -13547,7 +13788,7 @@ var ts;
* Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.
*/
function isToken(n) {
- return n.kind >= 0 /* FirstToken */ && n.kind <= 145 /* LastToken */;
+ return n.kind >= 0 /* FirstToken */ && n.kind <= 147 /* LastToken */;
}
ts.isToken = isToken;
// Node Arrays
@@ -13559,7 +13800,7 @@ var ts;
// Literals
/* @internal */
function isLiteralKind(kind) {
- return 8 /* FirstLiteralToken */ <= kind && kind <= 13 /* LastLiteralToken */;
+ return 8 /* FirstLiteralToken */ <= kind && kind <= 14 /* LastLiteralToken */;
}
ts.isLiteralKind = isLiteralKind;
function isLiteralExpression(node) {
@@ -13569,7 +13810,7 @@ var ts;
// Pseudo-literals
/* @internal */
function isTemplateLiteralKind(kind) {
- return 13 /* FirstTemplateToken */ <= kind && kind <= 16 /* LastTemplateToken */;
+ return 14 /* FirstTemplateToken */ <= kind && kind <= 17 /* LastTemplateToken */;
}
ts.isTemplateLiteralKind = isTemplateLiteralKind;
function isTemplateLiteralToken(node) {
@@ -13578,12 +13819,12 @@ var ts;
ts.isTemplateLiteralToken = isTemplateLiteralToken;
function isTemplateMiddleOrTemplateTail(node) {
var kind = node.kind;
- return kind === 15 /* TemplateMiddle */
- || kind === 16 /* TemplateTail */;
+ return kind === 16 /* TemplateMiddle */
+ || kind === 17 /* TemplateTail */;
}
ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail;
function isStringTextContainingNode(node) {
- return node.kind === 9 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
+ return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
}
ts.isStringTextContainingNode = isStringTextContainingNode;
// Identifiers
@@ -13596,17 +13837,17 @@ var ts;
/* @internal */
function isModifierKind(token) {
switch (token) {
- case 117 /* AbstractKeyword */:
- case 120 /* AsyncKeyword */:
- case 76 /* ConstKeyword */:
- case 124 /* DeclareKeyword */:
- case 79 /* DefaultKeyword */:
- case 84 /* ExportKeyword */:
- case 114 /* PublicKeyword */:
- case 112 /* PrivateKeyword */:
- case 113 /* ProtectedKeyword */:
- case 132 /* ReadonlyKeyword */:
- case 115 /* StaticKeyword */:
+ case 118 /* AbstractKeyword */:
+ case 121 /* AsyncKeyword */:
+ case 77 /* ConstKeyword */:
+ case 125 /* DeclareKeyword */:
+ case 80 /* DefaultKeyword */:
+ case 85 /* ExportKeyword */:
+ case 115 /* PublicKeyword */:
+ case 113 /* PrivateKeyword */:
+ case 114 /* ProtectedKeyword */:
+ case 133 /* ReadonlyKeyword */:
+ case 116 /* StaticKeyword */:
return true;
}
return false;
@@ -13619,7 +13860,7 @@ var ts;
ts.isParameterPropertyModifier = isParameterPropertyModifier;
/* @internal */
function isClassMemberModifier(idToken) {
- return isParameterPropertyModifier(idToken) || idToken === 115 /* StaticKeyword */;
+ return isParameterPropertyModifier(idToken) || idToken === 116 /* StaticKeyword */;
}
ts.isClassMemberModifier = isClassMemberModifier;
function isModifier(node) {
@@ -13628,23 +13869,23 @@ var ts;
ts.isModifier = isModifier;
function isEntityName(node) {
var kind = node.kind;
- return kind === 146 /* QualifiedName */
- || kind === 71 /* Identifier */;
+ return kind === 148 /* QualifiedName */
+ || kind === 72 /* Identifier */;
}
ts.isEntityName = isEntityName;
function isPropertyName(node) {
var kind = node.kind;
- return kind === 71 /* Identifier */
- || kind === 9 /* StringLiteral */
+ return kind === 72 /* Identifier */
+ || kind === 10 /* StringLiteral */
|| kind === 8 /* NumericLiteral */
- || kind === 147 /* ComputedPropertyName */;
+ || kind === 149 /* ComputedPropertyName */;
}
ts.isPropertyName = isPropertyName;
function isBindingName(node) {
var kind = node.kind;
- return kind === 71 /* Identifier */
- || kind === 182 /* ObjectBindingPattern */
- || kind === 183 /* ArrayBindingPattern */;
+ return kind === 72 /* Identifier */
+ || kind === 184 /* ObjectBindingPattern */
+ || kind === 185 /* ArrayBindingPattern */;
}
ts.isBindingName = isBindingName;
// Functions
@@ -13659,13 +13900,13 @@ var ts;
ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration;
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 237 /* FunctionDeclaration */:
- case 154 /* MethodDeclaration */:
- case 155 /* Constructor */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 194 /* FunctionExpression */:
- case 195 /* ArrowFunction */:
+ case 239 /* FunctionDeclaration */:
+ case 156 /* MethodDeclaration */:
+ case 157 /* Constructor */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 196 /* FunctionExpression */:
+ case 197 /* ArrowFunction */:
return true;
default:
return false;
@@ -13674,14 +13915,14 @@ var ts;
/* @internal */
function isFunctionLikeKind(kind) {
switch (kind) {
- case 153 /* MethodSignature */:
- case 158 /* CallSignature */:
- case 291 /* JSDocSignature */:
- case 159 /* ConstructSignature */:
- case 160 /* IndexSignature */:
- case 163 /* FunctionType */:
- case 287 /* JSDocFunctionType */:
- case 164 /* ConstructorType */:
+ case 155 /* MethodSignature */:
+ case 160 /* CallSignature */:
+ case 293 /* JSDocSignature */:
+ case 161 /* ConstructSignature */:
+ case 162 /* IndexSignature */:
+ case 165 /* FunctionType */:
+ case 289 /* JSDocFunctionType */:
+ case 166 /* ConstructorType */:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -13696,29 +13937,29 @@ var ts;
// Classes
function isClassElement(node) {
var kind = node.kind;
- return kind === 155 /* Constructor */
- || kind === 152 /* PropertyDeclaration */
- || kind === 154 /* MethodDeclaration */
- || kind === 156 /* GetAccessor */
- || kind === 157 /* SetAccessor */
- || kind === 160 /* IndexSignature */
- || kind === 215 /* SemicolonClassElement */;
+ return kind === 157 /* Constructor */
+ || kind === 154 /* PropertyDeclaration */
+ || kind === 156 /* MethodDeclaration */
+ || kind === 158 /* GetAccessor */
+ || kind === 159 /* SetAccessor */
+ || kind === 162 /* IndexSignature */
+ || kind === 217 /* SemicolonClassElement */;
}
ts.isClassElement = isClassElement;
function isClassLike(node) {
- return node && (node.kind === 238 /* ClassDeclaration */ || node.kind === 207 /* ClassExpression */);
+ return node && (node.kind === 240 /* ClassDeclaration */ || node.kind === 209 /* ClassExpression */);
}
ts.isClassLike = isClassLike;
function isAccessor(node) {
- return node && (node.kind === 156 /* GetAccessor */ || node.kind === 157 /* SetAccessor */);
+ return node && (node.kind === 158 /* GetAccessor */ || node.kind === 159 /* SetAccessor */);
}
ts.isAccessor = isAccessor;
/* @internal */
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 154 /* MethodDeclaration */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
+ case 156 /* MethodDeclaration */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
return true;
default:
return false;
@@ -13728,11 +13969,11 @@ var ts;
// Type members
function isTypeElement(node) {
var kind = node.kind;
- return kind === 159 /* ConstructSignature */
- || kind === 158 /* CallSignature */
- || kind === 151 /* PropertySignature */
- || kind === 153 /* MethodSignature */
- || kind === 160 /* IndexSignature */;
+ return kind === 161 /* ConstructSignature */
+ || kind === 160 /* CallSignature */
+ || kind === 153 /* PropertySignature */
+ || kind === 155 /* MethodSignature */
+ || kind === 162 /* IndexSignature */;
}
ts.isTypeElement = isTypeElement;
function isClassOrTypeElement(node) {
@@ -13741,37 +13982,38 @@ var ts;
ts.isClassOrTypeElement = isClassOrTypeElement;
function isObjectLiteralElementLike(node) {
var kind = node.kind;
- return kind === 273 /* PropertyAssignment */
- || kind === 274 /* ShorthandPropertyAssignment */
- || kind === 275 /* SpreadAssignment */
- || kind === 154 /* MethodDeclaration */
- || kind === 156 /* GetAccessor */
- || kind === 157 /* SetAccessor */;
+ return kind === 275 /* PropertyAssignment */
+ || kind === 276 /* ShorthandPropertyAssignment */
+ || kind === 277 /* SpreadAssignment */
+ || kind === 156 /* MethodDeclaration */
+ || kind === 158 /* GetAccessor */
+ || kind === 159 /* SetAccessor */;
}
ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
// Type
function isTypeNodeKind(kind) {
- return (kind >= 161 /* FirstTypeNode */ && kind <= 181 /* LastTypeNode */)
- || kind === 119 /* AnyKeyword */
- || kind === 142 /* UnknownKeyword */
- || kind === 134 /* NumberKeyword */
- || kind === 135 /* ObjectKeyword */
- || kind === 122 /* BooleanKeyword */
- || kind === 137 /* StringKeyword */
- || kind === 138 /* SymbolKeyword */
- || kind === 99 /* ThisKeyword */
- || kind === 105 /* VoidKeyword */
- || kind === 140 /* UndefinedKeyword */
- || kind === 95 /* NullKeyword */
- || kind === 131 /* NeverKeyword */
- || kind === 209 /* ExpressionWithTypeArguments */
- || kind === 282 /* JSDocAllType */
- || kind === 283 /* JSDocUnknownType */
- || kind === 284 /* JSDocNullableType */
- || kind === 285 /* JSDocNonNullableType */
- || kind === 286 /* JSDocOptionalType */
- || kind === 287 /* JSDocFunctionType */
- || kind === 288 /* JSDocVariadicType */;
+ return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */)
+ || kind === 120 /* AnyKeyword */
+ || kind === 143 /* UnknownKeyword */
+ || kind === 135 /* NumberKeyword */
+ || kind === 146 /* BigIntKeyword */
+ || kind === 136 /* ObjectKeyword */
+ || kind === 123 /* BooleanKeyword */
+ || kind === 138 /* StringKeyword */
+ || kind === 139 /* SymbolKeyword */
+ || kind === 100 /* ThisKeyword */
+ || kind === 106 /* VoidKeyword */
+ || kind === 141 /* UndefinedKeyword */
+ || kind === 96 /* NullKeyword */
+ || kind === 132 /* NeverKeyword */
+ || kind === 211 /* ExpressionWithTypeArguments */
+ || kind === 284 /* JSDocAllType */
+ || kind === 285 /* JSDocUnknownType */
+ || kind === 286 /* JSDocNullableType */
+ || kind === 287 /* JSDocNonNullableType */
+ || kind === 288 /* JSDocOptionalType */
+ || kind === 289 /* JSDocFunctionType */
+ || kind === 290 /* JSDocVariadicType */;
}
/**
* Node test that determines whether a node is a valid type node.
@@ -13784,8 +14026,8 @@ var ts;
ts.isTypeNode = isTypeNode;
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 163 /* FunctionType */:
- case 164 /* ConstructorType */:
+ case 165 /* FunctionType */:
+ case 166 /* ConstructorType */:
return true;
}
return false;
@@ -13796,8 +14038,8 @@ var ts;
function isBindingPattern(node) {
if (node) {
var kind = node.kind;
- return kind === 183 /* ArrayBindingPattern */
- || kind === 182 /* ObjectBindingPattern */;
+ return kind === 185 /* ArrayBindingPattern */
+ || kind === 184 /* ObjectBindingPattern */;
}
return false;
}
@@ -13805,15 +14047,15 @@ var ts;
/* @internal */
function isAssignmentPattern(node) {
var kind = node.kind;
- return kind === 185 /* ArrayLiteralExpression */
- || kind === 186 /* ObjectLiteralExpression */;
+ return kind === 187 /* ArrayLiteralExpression */
+ || kind === 188 /* ObjectLiteralExpression */;
}
ts.isAssignmentPattern = isAssignmentPattern;
/* @internal */
function isArrayBindingElement(node) {
var kind = node.kind;
- return kind === 184 /* BindingElement */
- || kind === 208 /* OmittedExpression */;
+ return kind === 186 /* BindingElement */
+ || kind === 210 /* OmittedExpression */;
}
ts.isArrayBindingElement = isArrayBindingElement;
/**
@@ -13822,9 +14064,9 @@ var ts;
/* @internal */
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 235 /* VariableDeclaration */:
- case 149 /* Parameter */:
- case 184 /* BindingElement */:
+ case 237 /* VariableDeclaration */:
+ case 151 /* Parameter */:
+ case 186 /* BindingElement */:
return true;
}
return false;
@@ -13845,8 +14087,8 @@ var ts;
/* @internal */
function isObjectBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 182 /* ObjectBindingPattern */:
- case 186 /* ObjectLiteralExpression */:
+ case 184 /* ObjectBindingPattern */:
+ case 188 /* ObjectLiteralExpression */:
return true;
}
return false;
@@ -13858,8 +14100,8 @@ var ts;
/* @internal */
function isArrayBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 183 /* ArrayBindingPattern */:
- case 185 /* ArrayLiteralExpression */:
+ case 185 /* ArrayBindingPattern */:
+ case 187 /* ArrayLiteralExpression */:
return true;
}
return false;
@@ -13868,26 +14110,26 @@ var ts;
/* @internal */
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
var kind = node.kind;
- return kind === 187 /* PropertyAccessExpression */
- || kind === 146 /* QualifiedName */
- || kind === 181 /* ImportType */;
+ return kind === 189 /* PropertyAccessExpression */
+ || kind === 148 /* QualifiedName */
+ || kind === 183 /* ImportType */;
}
ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode;
// Expression
function isPropertyAccessOrQualifiedName(node) {
var kind = node.kind;
- return kind === 187 /* PropertyAccessExpression */
- || kind === 146 /* QualifiedName */;
+ return kind === 189 /* PropertyAccessExpression */
+ || kind === 148 /* QualifiedName */;
}
ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName;
function isCallLikeExpression(node) {
switch (node.kind) {
- case 260 /* JsxOpeningElement */:
- case 259 /* JsxSelfClosingElement */:
- case 189 /* CallExpression */:
- case 190 /* NewExpression */:
- case 191 /* TaggedTemplateExpression */:
- case 150 /* Decorator */:
+ case 262 /* JsxOpeningElement */:
+ case 261 /* JsxSelfClosingElement */:
+ case 191 /* CallExpression */:
+ case 192 /* NewExpression */:
+ case 193 /* TaggedTemplateExpression */:
+ case 152 /* Decorator */:
return true;
default:
return false;
@@ -13895,13 +14137,13 @@ var ts;
}
ts.isCallLikeExpression = isCallLikeExpression;
function isCallOrNewExpression(node) {
- return node.kind === 189 /* CallExpression */ || node.kind === 190 /* NewExpression */;
+ return node.kind === 191 /* CallExpression */ || node.kind === 192 /* NewExpression */;
}
ts.isCallOrNewExpression = isCallOrNewExpression;
function isTemplateLiteral(node) {
var kind = node.kind;
- return kind === 204 /* TemplateExpression */
- || kind === 13 /* NoSubstitutionTemplateLiteral */;
+ return kind === 206 /* TemplateExpression */
+ || kind === 14 /* NoSubstitutionTemplateLiteral */;
}
ts.isTemplateLiteral = isTemplateLiteral;
/* @internal */
@@ -13911,33 +14153,34 @@ var ts;
ts.isLeftHandSideExpression = isLeftHandSideExpression;
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 187 /* PropertyAccessExpression */:
- case 188 /* ElementAccessExpression */:
- case 190 /* NewExpression */:
- case 189 /* CallExpression */:
- case 258 /* JsxElement */:
- case 259 /* JsxSelfClosingElement */:
- case 262 /* JsxFragment */:
- case 191 /* TaggedTemplateExpression */:
- case 185 /* ArrayLiteralExpression */:
- case 193 /* ParenthesizedExpression */:
- case 186 /* ObjectLiteralExpression */:
- case 207 /* ClassExpression */:
- case 194 /* FunctionExpression */:
- case 71 /* Identifier */:
- case 12 /* RegularExpressionLiteral */:
+ case 189 /* PropertyAccessExpression */:
+ case 190 /* ElementAccessExpression */:
+ case 192 /* NewExpression */:
+ case 191 /* CallExpression */:
+ case 260 /* JsxElement */:
+ case 261 /* JsxSelfClosingElement */:
+ case 264 /* JsxFragment */:
+ case 193 /* TaggedTemplateExpression */:
+ case 187 /* ArrayLiteralExpression */:
+ case 195 /* ParenthesizedExpression */:
+ case 188 /* ObjectLiteralExpression */:
+ case 209 /* ClassExpression */:
+ case 196 /* FunctionExpression */:
+ case 72 /* Identifier */:
+ case 13 /* RegularExpressionLiteral */:
case 8 /* NumericLiteral */:
- case 9 /* StringLiteral */:
- case 13 /* NoSubstitutionTemplateLiteral */:
- case 204 /* TemplateExpression */:
- case 86 /* FalseKeyword */:
- case 95 /* NullKeyword */:
- case 99 /* ThisKeyword */:
- case 101 /* TrueKeyword */:
- case 97 /* SuperKeyword */:
- case 211 /* NonNullExpression */:
- case 212 /* MetaProperty */:
- case 91 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression
+ case 9 /* BigIntLiteral */:
+ case 10 /* StringLiteral */:
+ case 14 /* NoSubstitutionTemplateLiteral */:
+ case 206 /* TemplateExpression */:
+ case 87 /* FalseKeyword */:
+ case 96 /* NullKeyword */:
+ case 100 /* ThisKeyword */:
+ case 102 /* TrueKeyword */:
+ case 98 /* SuperKeyword */:
+ case 213 /* NonNullExpression */:
+ case 214 /* MetaProperty */:
+ case 92 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression
return true;
default:
return false;
@@ -13950,13 +14193,13 @@ var ts;
ts.isUnaryExpression = isUnaryExpression;
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 200 /* PrefixUnaryExpression */:
- case 201 /* PostfixUnaryExpression */:
- case 196 /* DeleteExpression */:
- case 197 /* TypeOfExpression */:
- case 198 /* VoidExpression */:
- case 199 /* AwaitExpression */:
- case 192 /* TypeAssertionExpression */:
+ case 202 /* PrefixUnaryExpression */:
+ case 203 /* PostfixUnaryExpression */:
+ case 198 /* DeleteExpression */:
+ case 199 /* TypeOfExpression */:
+ case 200 /* VoidExpression */:
+ case 201 /* AwaitExpression */:
+ case 194 /* TypeAssertionExpression */:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -13965,11 +14208,11 @@ var ts;
/* @internal */
function isUnaryExpressionWithWrite(expr) {
switch (expr.kind) {
- case 201 /* PostfixUnaryExpression */:
+ case 203 /* PostfixUnaryExpression */:
return true;
- case 200 /* PrefixUnaryExpression */:
- return expr.operator === 43 /* PlusPlusToken */ ||
- expr.operator === 44 /* MinusMinusToken */;
+ case 202 /* PrefixUnaryExpression */:
+ return expr.operator === 44 /* PlusPlusToken */ ||
+ expr.operator === 45 /* MinusMinusToken */;
default:
return false;
}
@@ -13986,15 +14229,15 @@ var ts;
ts.isExpression = isExpression;
function isExpressionKind(kind) {
switch (kind) {
- case 203 /* ConditionalExpression */:
- case 205 /* YieldExpression */:
- case 195 /* ArrowFunction */:
- case 202 /* BinaryExpression */:
- case 206 /* SpreadElement */:
- case 210 /* AsExpression */:
- case 208 /* OmittedExpression */:
- case 307 /* CommaListExpression */:
- case 306 /* PartiallyEmittedExpression */:
+ case 205 /* ConditionalExpression */:
+ case 207 /* YieldExpression */:
+ case 197 /* ArrowFunction */:
+ case 204 /* BinaryExpression */:
+ case 208 /* SpreadElement */:
+ case 212 /* AsExpression */:
+ case 210 /* OmittedExpression */:
+ case 309 /* CommaListExpression */:
+ case 308 /* PartiallyEmittedExpression */:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -14002,18 +14245,18 @@ var ts;
}
function isAssertionExpression(node) {
var kind = node.kind;
- return kind === 192 /* TypeAssertionExpression */
- || kind === 210 /* AsExpression */;
+ return kind === 194 /* TypeAssertionExpression */
+ || kind === 212 /* AsExpression */;
}
ts.isAssertionExpression = isAssertionExpression;
/* @internal */
function isPartiallyEmittedExpression(node) {
- return node.kind === 306 /* PartiallyEmittedExpression */;
+ return node.kind === 308 /* PartiallyEmittedExpression */;
}
ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression;
/* @internal */
function isNotEmittedStatement(node) {
- return node.kind === 305 /* NotEmittedStatement */;
+ return node.kind === 307 /* NotEmittedStatement */;
}
ts.isNotEmittedStatement = isNotEmittedStatement;
/* @internal */
@@ -14024,13 +14267,13 @@ var ts;
ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 223 /* ForStatement */:
- case 224 /* ForInStatement */:
- case 225 /* ForOfStatement */:
- case 221 /* DoStatement */:
- case 222 /* WhileStatement */:
+ case 225 /* ForStatement */:
+ case 226 /* ForInStatement */:
+ case 227 /* ForOfStatement */:
+ case 223 /* DoStatement */:
+ case 224 /* WhileStatement */:
return true;
- case 231 /* LabeledStatement */:
+ case 233 /* LabeledStatement */:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
@@ -14038,7 +14281,7 @@ var ts;
ts.isIterationStatement = isIterationStatement;
/* @internal */
function isForInOrOfStatement(node) {
- return node.kind === 224 /* ForInStatement */ || node.kind === 225 /* ForOfStatement */;
+ return node.kind === 226 /* ForInStatement */ || node.kind === 227 /* ForOfStatement */;
}
ts.isForInOrOfStatement = isForInOrOfStatement;
// Element
@@ -14062,113 +14305,113 @@ var ts;
/* @internal */
function isModuleBody(node) {
var kind = node.kind;
- return kind === 243 /* ModuleBlock */
- || kind === 242 /* ModuleDeclaration */
- || kind === 71 /* Identifier */;
+ return kind === 245 /* ModuleBlock */
+ || kind === 244 /* ModuleDeclaration */
+ || kind === 72 /* Identifier */;
}
ts.isModuleBody = isModuleBody;
/* @internal */
function isNamespaceBody(node) {
var kind = node.kind;
- return kind === 243 /* ModuleBlock */
- || kind === 242 /* ModuleDeclaration */;
+ return kind === 245 /* ModuleBlock */
+ || kind === 244 /* ModuleDeclaration */;
}
ts.isNamespaceBody = isNamespaceBody;
/* @internal */
function isJSDocNamespaceBody(node) {
var kind = node.kind;
- return kind === 71 /* Identifier */
- || kind === 242 /* ModuleDeclaration */;
+ return kind === 72 /* Identifier */
+ || kind === 244 /* ModuleDeclaration */;
}
ts.isJSDocNamespaceBody = isJSDocNamespaceBody;
/* @internal */
function isNamedImportBindings(node) {
var kind = node.kind;
- return kind === 250 /* NamedImports */
- || kind === 249 /* NamespaceImport */;
+ return kind === 252 /* NamedImports */
+ || kind === 251 /* NamespaceImport */;
}
ts.isNamedImportBindings = isNamedImportBindings;
/* @internal */
function isModuleOrEnumDeclaration(node) {
- return node.kind === 242 /* ModuleDeclaration */ || node.kind === 241 /* EnumDeclaration */;
+ return node.kind === 244 /* ModuleDeclaration */ || node.kind === 243 /* EnumDeclaration */;
}
ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
function isDeclarationKind(kind) {
- return kind === 195 /* ArrowFunction */
- || kind === 184 /* BindingElement */
- || kind === 238 /* ClassDeclaration */
- || kind === 207 /* ClassExpression */
- || kind === 155 /* Constructor */
- || kind === 241 /* EnumDeclaration */
- || kind === 276 /* EnumMember */
- || kind === 255 /* ExportSpecifier */
- || kind === 237 /* FunctionDeclaration */
- || kind === 194 /* FunctionExpression */
- || kind === 156 /* GetAccessor */
- || kind === 248 /* ImportClause */
- || kind === 246 /* ImportEqualsDeclaration */
- || kind === 251 /* ImportSpecifier */
- || kind === 239 /* InterfaceDeclaration */
- || kind === 265 /* JsxAttribute */
- || kind === 154 /* MethodDeclaration */
- || kind === 153 /* MethodSignature */
- || kind === 242 /* ModuleDeclaration */
- || kind === 245 /* NamespaceExportDeclaration */
- || kind === 249 /* NamespaceImport */
- || kind === 149 /* Parameter */
- || kind === 273 /* PropertyAssignment */
- || kind === 152 /* PropertyDeclaration */
- || kind === 151 /* PropertySignature */
- || kind === 157 /* SetAccessor */
- || kind === 274 /* ShorthandPropertyAssignment */
- || kind === 240 /* TypeAliasDeclaration */
- || kind === 148 /* TypeParameter */
- || kind === 235 /* VariableDeclaration */
- || kind === 302 /* JSDocTypedefTag */
- || kind === 295 /* JSDocCallbackTag */
- || kind === 303 /* JSDocPropertyTag */;
+ return kind === 197 /* ArrowFunction */
+ || kind === 186 /* BindingElement */
+ || kind === 240 /* ClassDeclaration */
+ || kind === 209 /* ClassExpression */
+ || kind === 157 /* Constructor */
+ || kind === 243 /* EnumDeclaration */
+ || kind === 278 /* EnumMember */
+ || kind === 257 /* ExportSpecifier */
+ || kind === 239 /* FunctionDeclaration */
+ || kind === 196 /* FunctionExpression */
+ || kind === 158 /* GetAccessor */
+ || kind === 250 /* ImportClause */
+ || kind === 248 /* ImportEqualsDeclaration */
+ || kind === 253 /* ImportSpecifier */
+ || kind === 241 /* InterfaceDeclaration */
+ || kind === 267 /* JsxAttribute */
+ || kind === 156 /* MethodDeclaration */
+ || kind === 155 /* MethodSignature */
+ || kind === 244 /* ModuleDeclaration */
+ || kind === 247 /* NamespaceExportDeclaration */
+ || kind === 251 /* NamespaceImport */
+ || kind === 151 /* Parameter */
+ || kind === 275 /* PropertyAssignment */
+ || kind === 154 /* PropertyDeclaration */
+ || kind === 153 /* PropertySignature */
+ || kind === 159 /* SetAccessor */
+ || kind === 276 /* ShorthandPropertyAssignment */
+ || kind === 242 /* TypeAliasDeclaration */
+ || kind === 150 /* TypeParameter */
+ || kind === 237 /* VariableDeclaration */
+ || kind === 304 /* JSDocTypedefTag */
+ || kind === 297 /* JSDocCallbackTag */
+ || kind === 305 /* JSDocPropertyTag */;
}
function isDeclarationStatementKind(kind) {
- return kind === 237 /* FunctionDeclaration */
- || kind === 256 /* MissingDeclaration */
- || kind === 238 /* ClassDeclaration */
- || kind === 239 /* InterfaceDeclaration */
- || kind === 240 /* TypeAliasDeclaration */
- || kind === 241 /* EnumDeclaration */
- || kind === 242 /* ModuleDeclaration */
- || kind === 247 /* ImportDeclaration */
- || kind === 246 /* ImportEqualsDeclaration */
- || kind === 253 /* ExportDeclaration */
- || kind === 252 /* ExportAssignment */
- || kind === 245 /* NamespaceExportDeclaration */;
+ return kind === 239 /* FunctionDeclaration */
+ || kind === 258 /* MissingDeclaration */
+ || kind === 240 /* ClassDeclaration */
+ || kind === 241 /* InterfaceDeclaration */
+ || kind === 242 /* TypeAliasDeclaration */
+ || kind === 243 /* EnumDeclaration */
+ || kind === 244 /* ModuleDeclaration */
+ || kind === 249 /* ImportDeclaration */
+ || kind === 248 /* ImportEqualsDeclaration */
+ || kind === 255 /* ExportDeclaration */
+ || kind === 254 /* ExportAssignment */
+ || kind === 247 /* NamespaceExportDeclaration */;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 227 /* BreakStatement */
- || kind === 226 /* ContinueStatement */
- || kind === 234 /* DebuggerStatement */
- || kind === 221 /* DoStatement */
- || kind === 219 /* ExpressionStatement */
- || kind === 218 /* EmptyStatement */
- || kind === 224 /* ForInStatement */
- || kind === 225 /* ForOfStatement */
- || kind === 223 /* ForStatement */
- || kind === 220 /* IfStatement */
- || kind === 231 /* LabeledStatement */
- || kind === 228 /* ReturnStatement */
- || kind === 230 /* SwitchStatement */
- || kind === 232 /* ThrowStatement */
- || kind === 233 /* TryStatement */
- || kind === 217 /* VariableStatement */
- || kind === 222 /* WhileStatement */
- || kind === 229 /* WithStatement */
- || kind === 305 /* NotEmittedStatement */
- || kind === 309 /* EndOfDeclarationMarker */
- || kind === 308 /* MergeDeclarationMarker */;
+ return kind === 229 /* BreakStatement */
+ || kind === 228 /* ContinueStatement */
+ || kind === 236 /* DebuggerStatement */
+ || kind === 223 /* DoStatement */
+ || kind === 221 /* ExpressionStatement */
+ || kind === 220 /* EmptyStatement */
+ || kind === 226 /* ForInStatement */
+ || kind === 227 /* ForOfStatement */
+ || kind === 225 /* ForStatement */
+ || kind === 222 /* IfStatement */
+ || kind === 233 /* LabeledStatement */
+ || kind === 230 /* ReturnStatement */
+ || kind === 232 /* SwitchStatement */
+ || kind === 234 /* ThrowStatement */
+ || kind === 235 /* TryStatement */
+ || kind === 219 /* VariableStatement */
+ || kind === 224 /* WhileStatement */
+ || kind === 231 /* WithStatement */
+ || kind === 307 /* NotEmittedStatement */
+ || kind === 311 /* EndOfDeclarationMarker */
+ || kind === 310 /* MergeDeclarationMarker */;
}
/* @internal */
function isDeclaration(node) {
- if (node.kind === 148 /* TypeParameter */) {
- return node.parent.kind !== 301 /* JSDocTemplateTag */ || ts.isInJSFile(node);
+ if (node.kind === 150 /* TypeParameter */) {
+ return node.parent.kind !== 303 /* JSDocTemplateTag */ || ts.isInJSFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -14195,10 +14438,10 @@ var ts;
}
ts.isStatement = isStatement;
function isBlockStatement(node) {
- if (node.kind !== 216 /* Block */)
+ if (node.kind !== 218 /* Block */)
return false;
if (node.parent !== undefined) {
- if (node.parent.kind === 233 /* TryStatement */ || node.parent.kind === 272 /* CatchClause */) {
+ if (node.parent.kind === 235 /* TryStatement */ || node.parent.kind === 274 /* CatchClause */) {
return false;
}
}
@@ -14208,81 +14451,81 @@ var ts;
/* @internal */
function isModuleReference(node) {
var kind = node.kind;
- return kind === 257 /* ExternalModuleReference */
- || kind === 146 /* QualifiedName */
- || kind === 71 /* Identifier */;
+ return kind === 259 /* ExternalModuleReference */
+ || kind === 148 /* QualifiedName */
+ || kind === 72 /* Identifier */;
}
ts.isModuleReference = isModuleReference;
// JSX
/* @internal */
function isJsxTagNameExpression(node) {
var kind = node.kind;
- return kind === 99 /* ThisKeyword */
- || kind === 71 /* Identifier */
- || kind === 187 /* PropertyAccessExpression */;
+ return kind === 100 /* ThisKeyword */
+ || kind === 72 /* Identifier */
+ || kind === 189 /* PropertyAccessExpression */;
}
ts.isJsxTagNameExpression = isJsxTagNameExpression;
/* @internal */
function isJsxChild(node) {
var kind = node.kind;
- return kind === 258 /* JsxElement */
- || kind === 268 /* JsxExpression */
- || kind === 259 /* JsxSelfClosingElement */
- || kind === 10 /* JsxText */
- || kind === 262 /* JsxFragment */;
+ return kind === 260 /* JsxElement */
+ || kind === 270 /* JsxExpression */
+ || kind === 261 /* JsxSelfClosingElement */
+ || kind === 11 /* JsxText */
+ || kind === 264 /* JsxFragment */;
}
ts.isJsxChild = isJsxChild;
/* @internal */
function isJsxAttributeLike(node) {
var kind = node.kind;
- return kind === 265 /* JsxAttribute */
- || kind === 267 /* JsxSpreadAttribute */;
+ return kind === 267 /* JsxAttribute */
+ || kind === 269 /* JsxSpreadAttribute */;
}
ts.isJsxAttributeLike = isJsxAttributeLike;
/* @internal */
function isStringLiteralOrJsxExpression(node) {
var kind = node.kind;
- return kind === 9 /* StringLiteral */
- || kind === 268 /* JsxExpression */;
+ return kind === 10 /* StringLiteral */
+ || kind === 270 /* JsxExpression */;
}
ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression;
function isJsxOpeningLikeElement(node) {
var kind = node.kind;
- return kind === 260 /* JsxOpeningElement */
- || kind === 259 /* JsxSelfClosingElement */;
+ return kind === 262 /* JsxOpeningElement */
+ || kind === 261 /* JsxSelfClosingElement */;
}
ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement;
// Clauses
function isCaseOrDefaultClause(node) {
var kind = node.kind;
- return kind === 269 /* CaseClause */
- || kind === 270 /* DefaultClause */;
+ return kind === 271 /* CaseClause */
+ || kind === 272 /* DefaultClause */;
}
ts.isCaseOrDefaultClause = isCaseOrDefaultClause;
// JSDoc
/** True if node is of some JSDoc syntax kind. */
/* @internal */
function isJSDocNode(node) {
- return node.kind >= 281 /* FirstJSDocNode */ && node.kind <= 303 /* LastJSDocNode */;
+ return node.kind >= 283 /* FirstJSDocNode */ && node.kind <= 305 /* LastJSDocNode */;
}
ts.isJSDocNode = isJSDocNode;
/** True if node is of a kind that may contain comment text. */
function isJSDocCommentContainingNode(node) {
- return node.kind === 289 /* JSDocComment */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
+ return node.kind === 291 /* JSDocComment */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
}
ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode;
// TODO: determine what this does before making it public.
/* @internal */
function isJSDocTag(node) {
- return node.kind >= 292 /* FirstJSDocTagNode */ && node.kind <= 303 /* LastJSDocTagNode */;
+ return node.kind >= 294 /* FirstJSDocTagNode */ && node.kind <= 305 /* LastJSDocTagNode */;
}
ts.isJSDocTag = isJSDocTag;
function isSetAccessor(node) {
- return node.kind === 157 /* SetAccessor */;
+ return node.kind === 159 /* SetAccessor */;
}
ts.isSetAccessor = isSetAccessor;
function isGetAccessor(node) {
- return node.kind === 156 /* GetAccessor */;
+ return node.kind === 158 /* GetAccessor */;
}
ts.isGetAccessor = isGetAccessor;
/** True if has jsdoc nodes attached to it. */
@@ -14312,12 +14555,12 @@ var ts;
}
ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer;
function isObjectLiteralElement(node) {
- return node.kind === 265 /* JsxAttribute */ || node.kind === 267 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
+ return node.kind === 267 /* JsxAttribute */ || node.kind === 269 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);
}
ts.isObjectLiteralElement = isObjectLiteralElement;
/* @internal */
function isTypeReferenceType(node) {
- return node.kind === 162 /* TypeReference */ || node.kind === 209 /* ExpressionWithTypeArguments */;
+ return node.kind === 164 /* TypeReference */ || node.kind === 211 /* ExpressionWithTypeArguments */;
}
ts.isTypeReferenceType = isTypeReferenceType;
var MAX_SMI_X86 = 1073741823;
@@ -14346,15 +14589,14 @@ var ts;
}
ts.guessIndentation = guessIndentation;
function isStringLiteralLike(node) {
- return node.kind === 9 /* StringLiteral */ || node.kind === 13 /* NoSubstitutionTemplateLiteral */;
+ return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */;
}
ts.isStringLiteralLike = isStringLiteralLike;
})(ts || (ts = {}));
/* @internal */
(function (ts) {
- /** @internal */
function isNamedImportsOrExports(node) {
- return node.kind === 250 /* NamedImports */ || node.kind === 254 /* NamedExports */;
+ return node.kind === 252 /* NamedImports */ || node.kind === 256 /* NamedExports */;
}
ts.isNamedImportsOrExports = isNamedImportsOrExports;
function Symbol(flags, name) {
@@ -14399,10 +14641,9 @@ var ts;
getSignatureConstructor: function () { return Signature; },
getSourceMapSourceConstructor: function () { return SourceMapSource; },
};
- /* @internal */
function formatStringFromArgs(text, args, baseIndex) {
if (baseIndex === void 0) { baseIndex = 0; }
- return text.replace(/{(\d+)}/g, function (_match, index) { return ts.Debug.assertDefined(args[+index + baseIndex]); });
+ return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.assertDefined(args[+index + baseIndex]); });
}
ts.formatStringFromArgs = formatStringFromArgs;
function getLocaleSpecificMessage(message) {
@@ -14431,7 +14672,6 @@ var ts;
};
}
ts.createFileDiagnostic = createFileDiagnostic;
- /* @internal */
function formatMessage(_dummy, message) {
var text = getLocaleSpecificMessage(message);
if (arguments.length > 2) {
@@ -14456,7 +14696,6 @@ var ts;
};
}
ts.createCompilerDiagnostic = createCompilerDiagnostic;
- /* @internal */
function createCompilerDiagnosticFromMessageChain(chain) {
return {
file: undefined,
@@ -14493,14 +14732,12 @@ var ts;
function getDiagnosticFilePath(diagnostic) {
return diagnostic.file ? diagnostic.file.path : undefined;
}
- /* @internal */
function compareDiagnostics(d1, d2) {
return compareDiagnosticsSkipRelatedInformation(d1, d2) ||
compareRelatedInformation(d1, d2) ||
0 /* EqualTo */;
}
ts.compareDiagnostics = compareDiagnostics;
- /* @internal */
function compareDiagnosticsSkipRelatedInformation(d1, d2) {
return ts.compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) ||
ts.compareValues(d1.start, d2.start) ||
@@ -14804,7 +15041,6 @@ var ts;
return rootLength > 0 && rootLength === path.length;
}
ts.isDiskPathRoot = isDiskPathRoot;
- /* @internal */
function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) {
return !isRootedDiskPath(absoluteOrRelativePath)
? absoluteOrRelativePath
@@ -15769,6 +16005,82 @@ var ts;
}
}
ts.getOrUpdate = getOrUpdate;
+ /**
+ * Converts a bigint literal string, e.g. `0x1234n`,
+ * to its decimal string representation, e.g. `4660`.
+ */
+ function parsePseudoBigInt(stringValue) {
+ var log2Base;
+ switch (stringValue.charCodeAt(1)) { // "x" in "0x123"
+ case 98 /* b */:
+ case 66 /* B */: // 0b or 0B
+ log2Base = 1;
+ break;
+ case 111 /* o */:
+ case 79 /* O */: // 0o or 0O
+ log2Base = 3;
+ break;
+ case 120 /* x */:
+ case 88 /* X */: // 0x or 0X
+ log2Base = 4;
+ break;
+ default: // already in decimal; omit trailing "n"
+ var nIndex = stringValue.length - 1;
+ // Skip leading 0s
+ var nonZeroStart = 0;
+ while (stringValue.charCodeAt(nonZeroStart) === 48 /* _0 */) {
+ nonZeroStart++;
+ }
+ return stringValue.slice(nonZeroStart, nIndex) || "0";
+ }
+ // Omit leading "0b", "0o", or "0x", and trailing "n"
+ var startIndex = 2, endIndex = stringValue.length - 1;
+ var bitsNeeded = (endIndex - startIndex) * log2Base;
+ // Stores the value specified by the string as a LE array of 16-bit integers
+ // using Uint16 instead of Uint32 so combining steps can use bitwise operators
+ var segments = new Uint16Array((bitsNeeded >>> 4) + (bitsNeeded & 15 ? 1 : 0));
+ // Add the digits, one at a time
+ for (var i = endIndex - 1, bitOffset = 0; i >= startIndex; i--, bitOffset += log2Base) {
+ var segment = bitOffset >>> 4;
+ var digitChar = stringValue.charCodeAt(i);
+ // Find character range: 0-9 < A-F < a-f
+ var digit = digitChar <= 57 /* _9 */
+ ? digitChar - 48 /* _0 */
+ : 10 + digitChar -
+ (digitChar <= 70 /* F */ ? 65 /* A */ : 97 /* a */);
+ var shiftedDigit = digit << (bitOffset & 15);
+ segments[segment] |= shiftedDigit;
+ var residual = shiftedDigit >>> 16;
+ if (residual)
+ segments[segment + 1] |= residual; // overflows segment
+ }
+ // Repeatedly divide segments by 10 and add remainder to base10Value
+ var base10Value = "";
+ var firstNonzeroSegment = segments.length - 1;
+ var segmentsRemaining = true;
+ while (segmentsRemaining) {
+ var mod10 = 0;
+ segmentsRemaining = false;
+ for (var segment = firstNonzeroSegment; segment >= 0; segment--) {
+ var newSegment = mod10 << 16 | segments[segment];
+ var segmentValue = (newSegment / 10) | 0;
+ segments[segment] = segmentValue;
+ mod10 = newSegment - segmentValue * 10;
+ if (segmentValue && !segmentsRemaining) {
+ firstNonzeroSegment = segment;
+ segmentsRemaining = true;
+ }
+ }
+ base10Value = mod10 + base10Value;
+ }
+ return base10Value;
+ }
+ ts.parsePseudoBigInt = parsePseudoBigInt;
+ function pseudoBigIntToString(_a) {
+ var negative = _a.negative, base10Value = _a.base10Value;
+ return (negative && base10Value !== "0" ? "-" : "") + base10Value;
+ }
+ ts.pseudoBigIntToString = pseudoBigIntToString;
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -15788,10 +16100,10 @@ var ts;
var SourceFileConstructor;
// tslint:enable variable-name
function createNode(kind, pos, end) {
- if (kind === 277 /* SourceFile */) {
+ if (kind === 279 /* SourceFile */) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
- else if (kind === 71 /* Identifier */) {
+ else if (kind === 72 /* Identifier */) {
return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end);
}
else if (!ts.isNodeKind(kind)) {
@@ -15840,19 +16152,19 @@ var ts;
* that they appear in the source code. The language service depends on this property to locate nodes by position.
*/
function forEachChild(node, cbNode, cbNodes) {
- if (!node || node.kind <= 145 /* LastToken */) {
+ if (!node || node.kind <= 147 /* LastToken */) {
return;
}
switch (node.kind) {
- case 146 /* QualifiedName */:
+ case 148 /* QualifiedName */:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.right);
- case 148 /* TypeParameter */:
+ case 150 /* TypeParameter */:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.constraint) ||
visitNode(cbNode, node.default) ||
visitNode(cbNode, node.expression);
- case 274 /* ShorthandPropertyAssignment */:
+ case 276 /* ShorthandPropertyAssignment */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -15860,9 +16172,9 @@ var ts;
visitNode(cbNode, node.exclamationToken) ||
visitNode(cbNode, node.equalsToken) ||
visitNode(cbNode, node.objectAssignmentInitializer);
- case 275 /* SpreadAssignment */:
+ case 277 /* SpreadAssignment */:
return visitNode(cbNode, node.expression);
- case 149 /* Parameter */:
+ case 151 /* Parameter */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.dotDotDotToken) ||
@@ -15870,7 +16182,7 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 152 /* PropertyDeclaration */:
+ case 154 /* PropertyDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -15878,51 +16190,51 @@ var ts;
visitNode(cbNode, node.exclamationToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 151 /* PropertySignature */:
+ case 153 /* PropertySignature */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 273 /* PropertyAssignment */:
+ case 275 /* PropertyAssignment */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.initializer);
- case 235 /* VariableDeclaration */:
+ case 237 /* VariableDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.exclamationToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 184 /* BindingElement */:
+ case 186 /* BindingElement */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.dotDotDotToken) ||
visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 163 /* FunctionType */:
- case 164 /* ConstructorType */:
- case 158 /* CallSignature */:
- case 159 /* ConstructSignature */:
- case 160 /* IndexSignature */:
+ case 165 /* FunctionType */:
+ case 166 /* ConstructorType */:
+ case 160 /* CallSignature */:
+ case 161 /* ConstructSignature */:
+ case 162 /* IndexSignature */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNodes(cbNode, cbNodes, node.typeParameters) ||
visitNodes(cbNode, cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 154 /* MethodDeclaration */:
- case 153 /* MethodSignature */:
- case 155 /* Constructor */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 194 /* FunctionExpression */:
- case 237 /* FunctionDeclaration */:
- case 195 /* ArrowFunction */:
+ case 156 /* MethodDeclaration */:
+ case 155 /* MethodSignature */:
+ case 157 /* Constructor */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 196 /* FunctionExpression */:
+ case 239 /* FunctionDeclaration */:
+ case 197 /* ArrowFunction */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.asteriskToken) ||
@@ -15934,302 +16246,302 @@ var ts;
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.equalsGreaterThanToken) ||
visitNode(cbNode, node.body);
- case 162 /* TypeReference */:
+ case 164 /* TypeReference */:
return visitNode(cbNode, node.typeName) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 161 /* TypePredicate */:
+ case 163 /* TypePredicate */:
return visitNode(cbNode, node.parameterName) ||
visitNode(cbNode, node.type);
- case 165 /* TypeQuery */:
+ case 167 /* TypeQuery */:
return visitNode(cbNode, node.exprName);
- case 166 /* TypeLiteral */:
+ case 168 /* TypeLiteral */:
return visitNodes(cbNode, cbNodes, node.members);
- case 167 /* ArrayType */:
+ case 169 /* ArrayType */:
return visitNode(cbNode, node.elementType);
- case 168 /* TupleType */:
+ case 170 /* TupleType */:
return visitNodes(cbNode, cbNodes, node.elementTypes);
- case 171 /* UnionType */:
- case 172 /* IntersectionType */:
+ case 173 /* UnionType */:
+ case 174 /* IntersectionType */:
return visitNodes(cbNode, cbNodes, node.types);
- case 173 /* ConditionalType */:
+ case 175 /* ConditionalType */:
return visitNode(cbNode, node.checkType) ||
visitNode(cbNode, node.extendsType) ||
visitNode(cbNode, node.trueType) ||
visitNode(cbNode, node.falseType);
- case 174 /* InferType */:
+ case 176 /* InferType */:
return visitNode(cbNode, node.typeParameter);
- case 181 /* ImportType */:
+ case 183 /* ImportType */:
return visitNode(cbNode, node.argument) ||
visitNode(cbNode, node.qualifier) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 175 /* ParenthesizedType */:
- case 177 /* TypeOperator */:
+ case 177 /* ParenthesizedType */:
+ case 179 /* TypeOperator */:
return visitNode(cbNode, node.type);
- case 178 /* IndexedAccessType */:
+ case 180 /* IndexedAccessType */:
return visitNode(cbNode, node.objectType) ||
visitNode(cbNode, node.indexType);
- case 179 /* MappedType */:
+ case 181 /* MappedType */:
return visitNode(cbNode, node.readonlyToken) ||
visitNode(cbNode, node.typeParameter) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type);
- case 180 /* LiteralType */:
+ case 182 /* LiteralType */:
return visitNode(cbNode, node.literal);
- case 182 /* ObjectBindingPattern */:
- case 183 /* ArrayBindingPattern */:
+ case 184 /* ObjectBindingPattern */:
+ case 185 /* ArrayBindingPattern */:
return visitNodes(cbNode, cbNodes, node.elements);
- case 185 /* ArrayLiteralExpression */:
+ case 187 /* ArrayLiteralExpression */:
return visitNodes(cbNode, cbNodes, node.elements);
- case 186 /* ObjectLiteralExpression */:
+ case 188 /* ObjectLiteralExpression */:
return visitNodes(cbNode, cbNodes, node.properties);
- case 187 /* PropertyAccessExpression */:
+ case 189 /* PropertyAccessExpression */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.name);
- case 188 /* ElementAccessExpression */:
+ case 190 /* ElementAccessExpression */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.argumentExpression);
- case 189 /* CallExpression */:
- case 190 /* NewExpression */:
+ case 191 /* CallExpression */:
+ case 192 /* NewExpression */:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNodes(cbNode, cbNodes, node.arguments);
- case 191 /* TaggedTemplateExpression */:
+ case 193 /* TaggedTemplateExpression */:
return visitNode(cbNode, node.tag) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNode(cbNode, node.template);
- case 192 /* TypeAssertionExpression */:
+ case 194 /* TypeAssertionExpression */:
return visitNode(cbNode, node.type) ||
visitNode(cbNode, node.expression);
- case 193 /* ParenthesizedExpression */:
+ case 195 /* ParenthesizedExpression */:
return visitNode(cbNode, node.expression);
- case 196 /* DeleteExpression */:
+ case 198 /* DeleteExpression */:
return visitNode(cbNode, node.expression);
- case 197 /* TypeOfExpression */:
+ case 199 /* TypeOfExpression */:
return visitNode(cbNode, node.expression);
- case 198 /* VoidExpression */:
+ case 200 /* VoidExpression */:
return visitNode(cbNode, node.expression);
- case 200 /* PrefixUnaryExpression */:
+ case 202 /* PrefixUnaryExpression */:
return visitNode(cbNode, node.operand);
- case 205 /* YieldExpression */:
+ case 207 /* YieldExpression */:
return visitNode(cbNode, node.asteriskToken) ||
visitNode(cbNode, node.expression);
- case 199 /* AwaitExpression */:
+ case 201 /* AwaitExpression */:
return visitNode(cbNode, node.expression);
- case 201 /* PostfixUnaryExpression */:
+ case 203 /* PostfixUnaryExpression */:
return visitNode(cbNode, node.operand);
- case 202 /* BinaryExpression */:
+ case 204 /* BinaryExpression */:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.operatorToken) ||
visitNode(cbNode, node.right);
- case 210 /* AsExpression */:
+ case 212 /* AsExpression */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.type);
- case 211 /* NonNullExpression */:
+ case 213 /* NonNullExpression */:
return visitNode(cbNode, node.expression);
- case 212 /* MetaProperty */:
+ case 214 /* MetaProperty */:
return visitNode(cbNode, node.name);
- case 203 /* ConditionalExpression */:
+ case 205 /* ConditionalExpression */:
return visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.whenTrue) ||
visitNode(cbNode, node.colonToken) ||
visitNode(cbNode, node.whenFalse);
- case 206 /* SpreadElement */:
+ case 208 /* SpreadElement */:
return visitNode(cbNode, node.expression);
- case 216 /* Block */:
- case 243 /* ModuleBlock */:
+ case 218 /* Block */:
+ case 245 /* ModuleBlock */:
return visitNodes(cbNode, cbNodes, node.statements);
- case 277 /* SourceFile */:
+ case 279 /* SourceFile */:
return visitNodes(cbNode, cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
- case 217 /* VariableStatement */:
+ case 219 /* VariableStatement */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.declarationList);
- case 236 /* VariableDeclarationList */:
+ case 238 /* VariableDeclarationList */:
return visitNodes(cbNode, cbNodes, node.declarations);
- case 219 /* ExpressionStatement */:
+ case 221 /* ExpressionStatement */:
return visitNode(cbNode, node.expression);
- case 220 /* IfStatement */:
+ case 222 /* IfStatement */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.thenStatement) ||
visitNode(cbNode, node.elseStatement);
- case 221 /* DoStatement */:
+ case 223 /* DoStatement */:
return visitNode(cbNode, node.statement) ||
visitNode(cbNode, node.expression);
- case 222 /* WhileStatement */:
+ case 224 /* WhileStatement */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 223 /* ForStatement */:
+ case 225 /* ForStatement */:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.incrementor) ||
visitNode(cbNode, node.statement);
- case 224 /* ForInStatement */:
+ case 226 /* ForInStatement */:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 225 /* ForOfStatement */:
+ case 227 /* ForOfStatement */:
return visitNode(cbNode, node.awaitModifier) ||
visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 226 /* ContinueStatement */:
- case 227 /* BreakStatement */:
+ case 228 /* ContinueStatement */:
+ case 229 /* BreakStatement */:
return visitNode(cbNode, node.label);
- case 228 /* ReturnStatement */:
+ case 230 /* ReturnStatement */:
return visitNode(cbNode, node.expression);
- case 229 /* WithStatement */:
+ case 231 /* WithStatement */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 230 /* SwitchStatement */:
+ case 232 /* SwitchStatement */:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.caseBlock);
- case 244 /* CaseBlock */:
+ case 246 /* CaseBlock */:
return visitNodes(cbNode, cbNodes, node.clauses);
- case 269 /* CaseClause */:
+ case 271 /* CaseClause */:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.statements);
- case 270 /* DefaultClause */:
+ case 272 /* DefaultClause */:
return visitNodes(cbNode, cbNodes, node.statements);
- case 231 /* LabeledStatement */:
+ case 233 /* LabeledStatement */:
return visitNode(cbNode, node.label) ||
visitNode(cbNode, node.statement);
- case 232 /* ThrowStatement */:
+ case 234 /* ThrowStatement */:
return visitNode(cbNode, node.expression);
- case 233 /* TryStatement */:
+ case 235 /* TryStatement */:
return visitNode(cbNode, node.tryBlock) ||
visitNode(cbNode, node.catchClause) ||
visitNode(cbNode, node.finallyBlock);
- case 272 /* CatchClause */:
+ case 274 /* CatchClause */:
return visitNode(cbNode, node.variableDeclaration) ||
visitNode(cbNode, node.block);
- case 150 /* Decorator */:
+ case 152 /* Decorator */:
return visitNode(cbNode, node.expression);
- case 238 /* ClassDeclaration */:
- case 207 /* ClassExpression */:
+ case 240 /* ClassDeclaration */:
+ case 209 /* ClassExpression */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNode, cbNodes, node.typeParameters) ||
visitNodes(cbNode, cbNodes, node.heritageClauses) ||
visitNodes(cbNode, cbNodes, node.members);
- case 239 /* InterfaceDeclaration */:
+ case 241 /* InterfaceDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNode, cbNodes, node.typeParameters) ||
visitNodes(cbNode, cbNodes, node.heritageClauses) ||
visitNodes(cbNode, cbNodes, node.members);
- case 240 /* TypeAliasDeclaration */:
+ case 242 /* TypeAliasDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNode, cbNodes, node.typeParameters) ||
visitNode(cbNode, node.type);
- case 241 /* EnumDeclaration */:
+ case 243 /* EnumDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNode, cbNodes, node.members);
- case 276 /* EnumMember */:
+ case 278 /* EnumMember */:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 242 /* ModuleDeclaration */:
+ case 244 /* ModuleDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.body);
- case 246 /* ImportEqualsDeclaration */:
+ case 248 /* ImportEqualsDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.moduleReference);
- case 247 /* ImportDeclaration */:
+ case 249 /* ImportDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.importClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 248 /* ImportClause */:
+ case 250 /* ImportClause */:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.namedBindings);
- case 245 /* NamespaceExportDeclaration */:
+ case 247 /* NamespaceExportDeclaration */:
return visitNode(cbNode, node.name);
- case 249 /* NamespaceImport */:
+ case 251 /* NamespaceImport */:
return visitNode(cbNode, node.name);
- case 250 /* NamedImports */:
- case 254 /* NamedExports */:
+ case 252 /* NamedImports */:
+ case 256 /* NamedExports */:
return visitNodes(cbNode, cbNodes, node.elements);
- case 253 /* ExportDeclaration */:
+ case 255 /* ExportDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.exportClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 251 /* ImportSpecifier */:
- case 255 /* ExportSpecifier */:
+ case 253 /* ImportSpecifier */:
+ case 257 /* ExportSpecifier */:
return visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name);
- case 252 /* ExportAssignment */:
+ case 254 /* ExportAssignment */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.expression);
- case 204 /* TemplateExpression */:
+ case 206 /* TemplateExpression */:
return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
- case 214 /* TemplateSpan */:
+ case 216 /* TemplateSpan */:
return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
- case 147 /* ComputedPropertyName */:
+ case 149 /* ComputedPropertyName */:
return visitNode(cbNode, node.expression);
- case 271 /* HeritageClause */:
+ case 273 /* HeritageClause */:
return visitNodes(cbNode, cbNodes, node.types);
- case 209 /* ExpressionWithTypeArguments */:
+ case 211 /* ExpressionWithTypeArguments */:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 257 /* ExternalModuleReference */:
+ case 259 /* ExternalModuleReference */:
return visitNode(cbNode, node.expression);
- case 256 /* MissingDeclaration */:
+ case 258 /* MissingDeclaration */:
return visitNodes(cbNode, cbNodes, node.decorators);
- case 307 /* CommaListExpression */:
+ case 309 /* CommaListExpression */:
return visitNodes(cbNode, cbNodes, node.elements);
- case 258 /* JsxElement */:
+ case 260 /* JsxElement */:
return visitNode(cbNode, node.openingElement) ||
visitNodes(cbNode, cbNodes, node.children) ||
visitNode(cbNode, node.closingElement);
- case 262 /* JsxFragment */:
+ case 264 /* JsxFragment */:
return visitNode(cbNode, node.openingFragment) ||
visitNodes(cbNode, cbNodes, node.children) ||
visitNode(cbNode, node.closingFragment);
- case 259 /* JsxSelfClosingElement */:
- case 260 /* JsxOpeningElement */:
+ case 261 /* JsxSelfClosingElement */:
+ case 262 /* JsxOpeningElement */:
return visitNode(cbNode, node.tagName) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNode(cbNode, node.attributes);
- case 266 /* JsxAttributes */:
+ case 268 /* JsxAttributes */:
return visitNodes(cbNode, cbNodes, node.properties);
- case 265 /* JsxAttribute */:
+ case 267 /* JsxAttribute */:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 267 /* JsxSpreadAttribute */:
+ case 269 /* JsxSpreadAttribute */:
return visitNode(cbNode, node.expression);
- case 268 /* JsxExpression */:
+ case 270 /* JsxExpression */:
return visitNode(cbNode, node.dotDotDotToken) ||
visitNode(cbNode, node.expression);
- case 261 /* JsxClosingElement */:
+ case 263 /* JsxClosingElement */:
return visitNode(cbNode, node.tagName);
- case 169 /* OptionalType */:
- case 170 /* RestType */:
- case 281 /* JSDocTypeExpression */:
- case 285 /* JSDocNonNullableType */:
- case 284 /* JSDocNullableType */:
- case 286 /* JSDocOptionalType */:
- case 288 /* JSDocVariadicType */:
+ case 171 /* OptionalType */:
+ case 172 /* RestType */:
+ case 283 /* JSDocTypeExpression */:
+ case 287 /* JSDocNonNullableType */:
+ case 286 /* JSDocNullableType */:
+ case 288 /* JSDocOptionalType */:
+ case 290 /* JSDocVariadicType */:
return visitNode(cbNode, node.type);
- case 287 /* JSDocFunctionType */:
+ case 289 /* JSDocFunctionType */:
return visitNodes(cbNode, cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 289 /* JSDocComment */:
+ case 291 /* JSDocComment */:
return visitNodes(cbNode, cbNodes, node.tags);
- case 297 /* JSDocParameterTag */:
- case 303 /* JSDocPropertyTag */:
+ case 299 /* JSDocParameterTag */:
+ case 305 /* JSDocPropertyTag */:
if (node.isNameFirst) {
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.typeExpression);
@@ -16238,17 +16550,17 @@ var ts;
return visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.name);
}
- case 298 /* JSDocReturnTag */:
+ case 300 /* JSDocReturnTag */:
return visitNode(cbNode, node.typeExpression);
- case 300 /* JSDocTypeTag */:
+ case 302 /* JSDocTypeTag */:
return visitNode(cbNode, node.typeExpression);
- case 293 /* JSDocAugmentsTag */:
+ case 295 /* JSDocAugmentsTag */:
return visitNode(cbNode, node.class);
- case 301 /* JSDocTemplateTag */:
+ case 303 /* JSDocTemplateTag */:
return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters);
- case 302 /* JSDocTypedefTag */:
+ case 304 /* JSDocTypedefTag */:
if (node.typeExpression &&
- node.typeExpression.kind === 281 /* JSDocTypeExpression */) {
+ node.typeExpression.kind === 283 /* JSDocTypeExpression */) {
return visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.fullName);
}
@@ -16256,20 +16568,20 @@ var ts;
return visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
}
- case 295 /* JSDocCallbackTag */:
+ case 297 /* JSDocCallbackTag */:
return visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
- case 299 /* JSDocThisTag */:
+ case 301 /* JSDocThisTag */:
return visitNode(cbNode, node.typeExpression);
- case 296 /* JSDocEnumTag */:
+ case 298 /* JSDocEnumTag */:
return visitNode(cbNode, node.typeExpression);
- case 291 /* JSDocSignature */:
+ case 293 /* JSDocSignature */:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
ts.forEach(node.typeParameters, cbNode) ||
ts.forEach(node.parameters, cbNode) ||
visitNode(cbNode, node.type);
- case 290 /* JSDocTypeLiteral */:
+ case 292 /* JSDocTypeLiteral */:
if (node.jsDocPropertyTags) {
for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) {
var tag = _a[_i];
@@ -16277,7 +16589,7 @@ var ts;
}
}
return;
- case 306 /* PartiallyEmittedExpression */:
+ case 308 /* PartiallyEmittedExpression */:
return visitNode(cbNode, node.expression);
}
}
@@ -16495,18 +16807,18 @@ var ts;
sourceFile.endOfFileToken = parseTokenNode();
}
else {
- var statement = createNode(219 /* ExpressionStatement */);
+ var statement = createNode(221 /* ExpressionStatement */);
switch (token()) {
- case 21 /* OpenBracketToken */:
+ case 22 /* OpenBracketToken */:
statement.expression = parseArrayLiteralExpression();
break;
- case 101 /* TrueKeyword */:
- case 86 /* FalseKeyword */:
- case 95 /* NullKeyword */:
+ case 102 /* TrueKeyword */:
+ case 87 /* FalseKeyword */:
+ case 96 /* NullKeyword */:
statement.expression = parseTokenNode();
break;
- case 38 /* MinusToken */:
- if (lookAhead(function () { return nextToken() === 8 /* NumericLiteral */ && nextToken() !== 56 /* ColonToken */; })) {
+ case 39 /* MinusToken */:
+ if (lookAhead(function () { return nextToken() === 8 /* NumericLiteral */ && nextToken() !== 57 /* ColonToken */; })) {
statement.expression = parsePrefixUnaryExpression();
}
else {
@@ -16514,8 +16826,8 @@ var ts;
}
break;
case 8 /* NumericLiteral */:
- case 9 /* StringLiteral */:
- if (lookAhead(function () { return nextToken() !== 56 /* ColonToken */; })) {
+ case 10 /* StringLiteral */:
+ if (lookAhead(function () { return nextToken() !== 57 /* ColonToken */; })) {
statement.expression = parseLiteralNode();
break;
}
@@ -16651,7 +16963,7 @@ var ts;
function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) {
// code from createNode is inlined here so createNode won't have to deal with special case of creating source files
// this is quite rare comparing to other nodes and createNode should be as fast as possible
- var sourceFile = new SourceFileConstructor(277 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length);
+ var sourceFile = new SourceFileConstructor(279 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length);
nodeCount++;
sourceFile.text = sourceText;
sourceFile.bindDiagnostics = [];
@@ -16856,20 +17168,20 @@ var ts;
}
// Ignore strict mode flag because we will report an error in type checker instead.
function isIdentifier() {
- if (token() === 71 /* Identifier */) {
+ if (token() === 72 /* Identifier */) {
return true;
}
// If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is
// considered a keyword and is not an identifier.
- if (token() === 116 /* YieldKeyword */ && inYieldContext()) {
+ if (token() === 117 /* YieldKeyword */ && inYieldContext()) {
return false;
}
// If we have a 'await' keyword, and we're in the [Await] context, then 'await' is
// considered a keyword and is not an identifier.
- if (token() === 121 /* AwaitKeyword */ && inAwaitContext()) {
+ if (token() === 122 /* AwaitKeyword */ && inAwaitContext()) {
return false;
}
- return token() > 107 /* LastReservedWord */;
+ return token() > 108 /* LastReservedWord */;
}
function parseExpected(kind, diagnosticMessage, shouldAdvance) {
if (shouldAdvance === void 0) { shouldAdvance = true; }
@@ -16912,29 +17224,29 @@ var ts;
}
function canParseSemicolon() {
// If there's a real semicolon, then we can always parse it out.
- if (token() === 25 /* SemicolonToken */) {
+ if (token() === 26 /* SemicolonToken */) {
return true;
}
// We can parse out an optional semicolon in ASI cases in the following cases.
- return token() === 18 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak();
+ return token() === 19 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak();
}
function parseSemicolon() {
if (canParseSemicolon()) {
- if (token() === 25 /* SemicolonToken */) {
+ if (token() === 26 /* SemicolonToken */) {
// consume the semicolon if it was explicitly provided.
nextToken();
}
return true;
}
else {
- return parseExpected(25 /* SemicolonToken */);
+ return parseExpected(26 /* SemicolonToken */);
}
}
function createNode(kind, pos) {
nodeCount++;
var p = pos >= 0 ? pos : scanner.getStartPos();
return ts.isNodeKind(kind) || kind === 0 /* Unknown */ ? new NodeConstructor(kind, p, p) :
- kind === 71 /* Identifier */ ? new IdentifierConstructor(kind, p, p) :
+ kind === 72 /* Identifier */ ? new IdentifierConstructor(kind, p, p) :
new TokenConstructor(kind, p, p);
}
function createNodeWithJSDoc(kind, pos) {
@@ -16976,7 +17288,7 @@ var ts;
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
var result = createNode(kind);
- if (kind === 71 /* Identifier */) {
+ if (kind === 72 /* Identifier */) {
result.escapedText = "";
}
else if (ts.isLiteralKind(kind) || ts.isTemplateLiteralKind(kind)) {
@@ -16997,9 +17309,9 @@ var ts;
function createIdentifier(isIdentifier, diagnosticMessage) {
identifierCount++;
if (isIdentifier) {
- var node = createNode(71 /* Identifier */);
+ var node = createNode(72 /* Identifier */);
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
- if (token() !== 71 /* Identifier */) {
+ if (token() !== 72 /* Identifier */) {
node.originalKeywordKind = token();
}
node.escapedText = ts.escapeLeadingUnderscores(internIdentifier(scanner.getTokenValue()));
@@ -17008,7 +17320,7 @@ var ts;
}
// Only for end of file because the error gets reported incorrectly on embedded script tags.
var reportAtCurrentPosition = token() === 1 /* EndOfFileToken */;
- return createMissingNode(71 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || ts.Diagnostics.Identifier_expected);
+ return createMissingNode(72 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || ts.Diagnostics.Identifier_expected);
}
function parseIdentifier(diagnosticMessage) {
return createIdentifier(isIdentifier(), diagnosticMessage);
@@ -17018,16 +17330,16 @@ var ts;
}
function isLiteralPropertyName() {
return ts.tokenIsIdentifierOrKeyword(token()) ||
- token() === 9 /* StringLiteral */ ||
+ token() === 10 /* StringLiteral */ ||
token() === 8 /* NumericLiteral */;
}
function parsePropertyNameWorker(allowComputedPropertyNames) {
- if (token() === 9 /* StringLiteral */ || token() === 8 /* NumericLiteral */) {
+ if (token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */) {
var node = parseLiteralNode();
node.text = internIdentifier(node.text);
return node;
}
- if (allowComputedPropertyNames && token() === 21 /* OpenBracketToken */) {
+ if (allowComputedPropertyNames && token() === 22 /* OpenBracketToken */) {
return parseComputedPropertyName();
}
return parseIdentifierName();
@@ -17039,13 +17351,13 @@ var ts;
// PropertyName [Yield]:
// LiteralPropertyName
// ComputedPropertyName[?Yield]
- var node = createNode(147 /* ComputedPropertyName */);
- parseExpected(21 /* OpenBracketToken */);
+ var node = createNode(149 /* ComputedPropertyName */);
+ parseExpected(22 /* OpenBracketToken */);
// We parse any expression (including a comma expression). But the grammar
// says that only an assignment expression is allowed, so the grammar checker
// will error if it sees a comma expression.
node.expression = allowInAnd(parseExpression);
- parseExpected(22 /* CloseBracketToken */);
+ parseExpected(23 /* CloseBracketToken */);
return finishNode(node);
}
function parseContextualModifier(t) {
@@ -17060,20 +17372,20 @@ var ts;
}
function nextTokenCanFollowModifier() {
switch (token()) {
- case 76 /* ConstKeyword */:
+ case 77 /* ConstKeyword */:
// 'const' is only a modifier if followed by 'enum'.
- return nextToken() === 83 /* EnumKeyword */;
- case 84 /* ExportKeyword */:
+ return nextToken() === 84 /* EnumKeyword */;
+ case 85 /* ExportKeyword */:
nextToken();
- if (token() === 79 /* DefaultKeyword */) {
+ if (token() === 80 /* DefaultKeyword */) {
return lookAhead(nextTokenCanFollowDefaultKeyword);
}
- return token() !== 39 /* AsteriskToken */ && token() !== 118 /* AsKeyword */ && token() !== 17 /* OpenBraceToken */ && canFollowModifier();
- case 79 /* DefaultKeyword */:
+ return token() !== 40 /* AsteriskToken */ && token() !== 119 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier();
+ case 80 /* DefaultKeyword */:
return nextTokenCanFollowDefaultKeyword();
- case 115 /* StaticKeyword */:
- case 125 /* GetKeyword */:
- case 136 /* SetKeyword */:
+ case 116 /* StaticKeyword */:
+ case 126 /* GetKeyword */:
+ case 137 /* SetKeyword */:
nextToken();
return canFollowModifier();
default:
@@ -17084,18 +17396,18 @@ var ts;
return ts.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);
}
function canFollowModifier() {
- return token() === 21 /* OpenBracketToken */
- || token() === 17 /* OpenBraceToken */
- || token() === 39 /* AsteriskToken */
- || token() === 24 /* DotDotDotToken */
+ return token() === 22 /* OpenBracketToken */
+ || token() === 18 /* OpenBraceToken */
+ || token() === 40 /* AsteriskToken */
+ || token() === 25 /* DotDotDotToken */
|| isLiteralPropertyName();
}
function nextTokenCanFollowDefaultKeyword() {
nextToken();
- return token() === 75 /* ClassKeyword */ || token() === 89 /* FunctionKeyword */ ||
- token() === 109 /* InterfaceKeyword */ ||
- (token() === 117 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) ||
- (token() === 120 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
+ return token() === 76 /* ClassKeyword */ || token() === 90 /* FunctionKeyword */ ||
+ token() === 110 /* InterfaceKeyword */ ||
+ (token() === 118 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) ||
+ (token() === 121 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
}
// True if positioned at the start of a list element
function isListElement(parsingContext, inErrorRecovery) {
@@ -17113,9 +17425,9 @@ var ts;
// we're parsing. For example, if we have a semicolon in the middle of a class, then
// we really don't want to assume the class is over and we're on a statement in the
// outer module. We just want to consume and move on.
- return !(token() === 25 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement();
+ return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement();
case 2 /* SwitchClauses */:
- return token() === 73 /* CaseKeyword */ || token() === 79 /* DefaultKeyword */;
+ return token() === 74 /* CaseKeyword */ || token() === 80 /* DefaultKeyword */;
case 4 /* TypeMembers */:
return lookAhead(isTypeMemberStart);
case 5 /* ClassMembers */:
@@ -17123,17 +17435,17 @@ var ts;
// not in error recovery. If we're in error recovery, we don't want an errant
// semicolon to be treated as a class member (since they're almost always used
// for statements.
- return lookAhead(isClassMemberStart) || (token() === 25 /* SemicolonToken */ && !inErrorRecovery);
+ return lookAhead(isClassMemberStart) || (token() === 26 /* SemicolonToken */ && !inErrorRecovery);
case 6 /* EnumMembers */:
// Include open bracket computed properties. This technically also lets in indexers,
// which would be a candidate for improved error reporting.
- return token() === 21 /* OpenBracketToken */ || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || isLiteralPropertyName();
case 12 /* ObjectLiteralMembers */:
switch (token()) {
- case 21 /* OpenBracketToken */:
- case 39 /* AsteriskToken */:
- case 24 /* DotDotDotToken */:
- case 23 /* DotToken */: // Not an object literal member, but don't want to close the object (see `tests/cases/fourslash/completionsDotInObjectLiteral.ts`)
+ case 22 /* OpenBracketToken */:
+ case 40 /* AsteriskToken */:
+ case 25 /* DotDotDotToken */:
+ case 24 /* DotToken */: // Not an object literal member, but don't want to close the object (see `tests/cases/fourslash/completionsDotInObjectLiteral.ts`)
return true;
default:
return isLiteralPropertyName();
@@ -17141,11 +17453,11 @@ var ts;
case 18 /* RestProperties */:
return isLiteralPropertyName();
case 9 /* ObjectBindingElements */:
- return token() === 21 /* OpenBracketToken */ || token() === 24 /* DotDotDotToken */ || isLiteralPropertyName();
+ return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName();
case 7 /* HeritageClauseElement */:
// If we see `{ ... }` then only consume it as an expression if it is followed by `,` or `{`
// That way we won't consume the body of a class in its heritage clause.
- if (token() === 17 /* OpenBraceToken */) {
+ if (token() === 18 /* OpenBraceToken */) {
return lookAhead(isValidHeritageClauseObjectLiteral);
}
if (!inErrorRecovery) {
@@ -17160,37 +17472,39 @@ var ts;
case 8 /* VariableDeclarations */:
return isIdentifierOrPattern();
case 10 /* ArrayBindingElements */:
- return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isIdentifierOrPattern();
+ return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isIdentifierOrPattern();
case 19 /* TypeParameters */:
return isIdentifier();
case 15 /* ArrayLiteralMembers */:
- if (token() === 26 /* CommaToken */) {
- return true;
+ switch (token()) {
+ case 27 /* CommaToken */:
+ case 24 /* DotToken */: // Not an array literal member, but don't want to close the array (see `tests/cases/fourslash/completionsDotInArrayLiteralInObjectLiteral.ts`)
+ return true;
}
// falls through
case 11 /* ArgumentExpressions */:
- return token() === 24 /* DotDotDotToken */ || isStartOfExpression();
+ return token() === 25 /* DotDotDotToken */ || isStartOfExpression();
case 16 /* Parameters */:
return isStartOfParameter(/*isJSDocParameter*/ false);
case 17 /* JSDocParameters */:
return isStartOfParameter(/*isJSDocParameter*/ true);
case 20 /* TypeArguments */:
case 21 /* TupleElementTypes */:
- return token() === 26 /* CommaToken */ || isStartOfType();
+ return token() === 27 /* CommaToken */ || isStartOfType();
case 22 /* HeritageClauses */:
return isHeritageClause();
case 23 /* ImportOrExportSpecifiers */:
return ts.tokenIsIdentifierOrKeyword(token());
case 13 /* JsxAttributes */:
- return ts.tokenIsIdentifierOrKeyword(token()) || token() === 17 /* OpenBraceToken */;
+ return ts.tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */;
case 14 /* JsxChildren */:
return true;
}
return ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
- ts.Debug.assert(token() === 17 /* OpenBraceToken */);
- if (nextToken() === 18 /* CloseBraceToken */) {
+ ts.Debug.assert(token() === 18 /* OpenBraceToken */);
+ if (nextToken() === 19 /* CloseBraceToken */) {
// if we see "extends {}" then only treat the {} as what we're extending (and not
// the class body) if we have:
//
@@ -17199,7 +17513,7 @@ var ts;
// extends {} extends
// extends {} implements
var next = nextToken();
- return next === 26 /* CommaToken */ || next === 17 /* OpenBraceToken */ || next === 85 /* ExtendsKeyword */ || next === 108 /* ImplementsKeyword */;
+ return next === 27 /* CommaToken */ || next === 18 /* OpenBraceToken */ || next === 86 /* ExtendsKeyword */ || next === 109 /* ImplementsKeyword */;
}
return true;
}
@@ -17216,8 +17530,8 @@ var ts;
return ts.tokenIsIdentifierOrKeywordOrGreaterThan(token());
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token() === 108 /* ImplementsKeyword */ ||
- token() === 85 /* ExtendsKeyword */) {
+ if (token() === 109 /* ImplementsKeyword */ ||
+ token() === 86 /* ExtendsKeyword */) {
return lookAhead(nextTokenIsStartOfExpression);
}
return false;
@@ -17245,37 +17559,37 @@ var ts;
case 12 /* ObjectLiteralMembers */:
case 9 /* ObjectBindingElements */:
case 23 /* ImportOrExportSpecifiers */:
- return token() === 18 /* CloseBraceToken */;
+ return token() === 19 /* CloseBraceToken */;
case 3 /* SwitchClauseStatements */:
- return token() === 18 /* CloseBraceToken */ || token() === 73 /* CaseKeyword */ || token() === 79 /* DefaultKeyword */;
+ return token() === 19 /* CloseBraceToken */ || token() === 74 /* CaseKeyword */ || token() === 80 /* DefaultKeyword */;
case 7 /* HeritageClauseElement */:
- return token() === 17 /* OpenBraceToken */ || token() === 85 /* ExtendsKeyword */ || token() === 108 /* ImplementsKeyword */;
+ return token() === 18 /* OpenBraceToken */ || token() === 86 /* ExtendsKeyword */ || token() === 109 /* ImplementsKeyword */;
case 8 /* VariableDeclarations */:
return isVariableDeclaratorListTerminator();
case 19 /* TypeParameters */:
// Tokens other than '>' are here for better error recovery
- return token() === 29 /* GreaterThanToken */ || token() === 19 /* OpenParenToken */ || token() === 17 /* OpenBraceToken */ || token() === 85 /* ExtendsKeyword */ || token() === 108 /* ImplementsKeyword */;
+ return token() === 30 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 86 /* ExtendsKeyword */ || token() === 109 /* ImplementsKeyword */;
case 11 /* ArgumentExpressions */:
// Tokens other than ')' are here for better error recovery
- return token() === 20 /* CloseParenToken */ || token() === 25 /* SemicolonToken */;
+ return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */;
case 15 /* ArrayLiteralMembers */:
case 21 /* TupleElementTypes */:
case 10 /* ArrayBindingElements */:
- return token() === 22 /* CloseBracketToken */;
+ return token() === 23 /* CloseBracketToken */;
case 17 /* JSDocParameters */:
case 16 /* Parameters */:
case 18 /* RestProperties */:
// Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery
- return token() === 20 /* CloseParenToken */ || token() === 22 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/;
+ return token() === 21 /* CloseParenToken */ || token() === 23 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/;
case 20 /* TypeArguments */:
// All other tokens should cause the type-argument to terminate except comma token
- return token() !== 26 /* CommaToken */;
+ return token() !== 27 /* CommaToken */;
case 22 /* HeritageClauses */:
- return token() === 17 /* OpenBraceToken */ || token() === 18 /* CloseBraceToken */;
+ return token() === 18 /* OpenBraceToken */ || token() === 19 /* CloseBraceToken */;
case 13 /* JsxAttributes */:
- return token() === 29 /* GreaterThanToken */ || token() === 41 /* SlashToken */;
+ return token() === 30 /* GreaterThanToken */ || token() === 42 /* SlashToken */;
case 14 /* JsxChildren */:
- return token() === 27 /* LessThanToken */ && lookAhead(nextTokenIsSlash);
+ return token() === 28 /* LessThanToken */ && lookAhead(nextTokenIsSlash);
default:
return false;
}
@@ -17295,7 +17609,7 @@ var ts;
// For better error recovery, if we see an '=>' then we just stop immediately. We've got an
// arrow function here and it's going to be very unlikely that we'll resynchronize and get
// another variable declaration.
- if (token() === 36 /* EqualsGreaterThanToken */) {
+ if (token() === 37 /* EqualsGreaterThanToken */) {
return true;
}
// Keep trying to parse out variable declarators.
@@ -17465,20 +17779,20 @@ var ts;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 155 /* Constructor */:
- case 160 /* IndexSignature */:
- case 156 /* GetAccessor */:
- case 157 /* SetAccessor */:
- case 152 /* PropertyDeclaration */:
- case 215 /* SemicolonClassElement */:
+ case 157 /* Constructor */:
+ case 162 /* IndexSignature */:
+ case 158 /* GetAccessor */:
+ case 159 /* SetAccessor */:
+ case 154 /* PropertyDeclaration */:
+ case 217 /* SemicolonClassElement */:
return true;
- case 154 /* MethodDeclaration */:
+ case 156 /* MethodDeclaration */:
// Method declarations are not necessarily reusable. An object-literal
// may have a method calls "constructor(...)" and we must reparse that
// into an actual .ConstructorDeclaration.
var methodDeclaration = node;
- var nameIsConstructor = methodDeclaration.name.kind === 71 /* Identifier */ &&
- methodDeclaration.name.originalKeywordKind === 123 /* ConstructorKeyword */;
+ var nameIsConstructor = methodDeclaration.name.kind === 72 /* Identifier */ &&
+ methodDeclaration.name.originalKeywordKind === 124 /* ConstructorKeyword */;
return !nameIsConstructor;
}
}
@@ -17487,8 +17801,8 @@ var ts;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 269 /* CaseClause */:
- case 270 /* DefaultClause */:
+ case 271 /* CaseClause */:
+ case 272 /* DefaultClause */:
return true;
}
}
@@ -17497,58 +17811,58 @@ var ts;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 237 /* FunctionDeclaration */:
- case 217 /* VariableStatement */:
- case 216 /* Block */:
- case 220 /* IfStatement */:
- case 219 /* ExpressionStatement */:
- case 232 /* ThrowStatement */:
- case 228 /* ReturnStatement */:
- case 230 /* SwitchStatement */:
- case 227 /* BreakStatement */:
- case 226 /* ContinueStatement */:
- case 224 /* ForInStatement */:
- case 225 /* ForOfStatement */:
- case 223 /* ForStatement */:
- case 222 /* WhileStatement */:
- case 229 /* WithStatement */:
- case 218 /* EmptyStatement */:
- case 233 /* TryStatement */:
- case 231 /* LabeledStatement */:
- case 221 /* DoStatement */:
- case 234 /* DebuggerStatement */:
- case 247 /* ImportDeclaration */:
- case 246 /* ImportEqualsDeclaration */:
- case 253 /* ExportDeclaration */:
- case 252 /* ExportAssignment */:
- case 242 /* ModuleDeclaration */:
- case 238 /* ClassDeclaration */:
- case 239 /* InterfaceDeclaration */:
- case 241 /* EnumDeclaration */:
- case 240 /* TypeAliasDeclaration */:
+ case 239 /* FunctionDeclaration */:
+ case 219 /* VariableStatement */:
+ case 218 /* Block */:
+ case 222 /* IfStatement */:
+ case 221 /* ExpressionStatement */:
+ case 234 /* ThrowStatement */:
+ case 230 /* ReturnStatement */:
+ case 232 /* SwitchStatement */:
+ case 229 /* BreakStatement */:
+ case 228 /* ContinueStatement */:
+ case 226 /* ForInStatement */:
+ case 227 /* ForOfStatement */:
+ case 225 /* ForStatement */:
+ case 224 /* WhileStatement */:
+ case 231 /* WithStatement */:
+ case 220 /* EmptyStatement */:
+ case 235 /* TryStatement */:
+ case 233 /* LabeledStatement */:
+ case 223 /* DoStatement */:
+ case 236 /* DebuggerStatement */:
+ case 249 /* ImportDeclaration */:
+ case 248 /* ImportEqualsDeclaration */:
+ case 255 /* ExportDeclaration */:
+ case 254 /* ExportAssignment */:
+ case 244 /* ModuleDeclaration */:
+ case 240 /* ClassDeclaration */:
+ case 241 /* InterfaceDeclaration */:
+ case 243 /* EnumDeclaration */:
+ case 242 /* TypeAliasDeclaration */:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 276 /* EnumMember */;
+ return node.kind === 278 /* EnumMember */;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 159 /* ConstructSignature */:
- case 153 /* MethodSignature */:
- case 160 /* IndexSignature */:
- case 151 /* PropertySignature */:
- case 158 /* CallSignature */:
+ case 161 /* ConstructSignature */:
+ case 155 /* MethodSignature */:
+ case 162 /* IndexSignature */:
+ case 153 /* PropertySignature */:
+ case 160 /* CallSignature */:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 235 /* VariableDeclaration */) {
+ if (node.kind !== 237 /* VariableDeclaration */) {
return false;
}
// Very subtle incremental parsing bug. Consider the following code:
@@ -17569,7 +17883,7 @@ var ts;
return variableDeclarator.initializer === undefined;
}
function isReusableParameter(node) {
- if (node.kind !== 149 /* Parameter */) {
+ if (node.kind !== 151 /* Parameter */) {
return false;
}
// See the comment in isReusableVariableDeclaration for why we do this.
@@ -17626,7 +17940,7 @@ var ts;
var startPos = scanner.getStartPos();
list.push(parseListElement(kind, parseElement));
commaStart = scanner.getTokenPos();
- if (parseOptional(26 /* CommaToken */)) {
+ if (parseOptional(27 /* CommaToken */)) {
// No need to check for a zero length node since we know we parsed a comma
continue;
}
@@ -17636,13 +17950,13 @@ var ts;
}
// We didn't get a comma, and the list wasn't terminated, explicitly parse
// out a comma so we give a good error message.
- parseExpected(26 /* CommaToken */);
+ parseExpected(27 /* CommaToken */);
// If the token was a semicolon, and the caller allows that, then skip it and
// continue. This ensures we get back on track and don't result in tons of
// parse errors. For example, this can happen when people do things like use
// a semicolon to delimit object literal members. Note: we'll have already
// reported an error when we called parseExpected above.
- if (considerSemicolonAsDelimiter && token() === 25 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) {
+ if (considerSemicolonAsDelimiter && token() === 26 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) {
nextToken();
}
if (startPos === scanner.getStartPos()) {
@@ -17693,8 +18007,8 @@ var ts;
function parseEntityName(allowReservedWords, diagnosticMessage) {
var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
var dotPos = scanner.getStartPos();
- while (parseOptional(23 /* DotToken */)) {
- if (token() === 27 /* LessThanToken */) {
+ while (parseOptional(24 /* DotToken */)) {
+ if (token() === 28 /* LessThanToken */) {
// the entity is part of a JSDoc-style generic, so record the trailing dot for later error reporting
entity.jsdocDotPos = dotPos;
break;
@@ -17705,7 +18019,7 @@ var ts;
return entity;
}
function createQualifiedName(entity, name) {
- var node = createNode(146 /* QualifiedName */, entity.pos);
+ var node = createNode(148 /* QualifiedName */, entity.pos);
node.left = entity;
node.right = name;
return finishNode(node);
@@ -17736,33 +18050,33 @@ var ts;
// Report that we need an identifier. However, report it right after the dot,
// and not on the next token. This is because the next token might actually
// be an identifier and the error would be quite confusing.
- return createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);
+ return createMissingNode(72 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);
}
}
return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
}
function parseTemplateExpression() {
- var template = createNode(204 /* TemplateExpression */);
+ var template = createNode(206 /* TemplateExpression */);
template.head = parseTemplateHead();
- ts.Debug.assert(template.head.kind === 14 /* TemplateHead */, "Template head has wrong token kind");
+ ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind");
var list = [];
var listPos = getNodePos();
do {
list.push(parseTemplateSpan());
- } while (ts.last(list).literal.kind === 15 /* TemplateMiddle */);
+ } while (ts.last(list).literal.kind === 16 /* TemplateMiddle */);
template.templateSpans = createNodeArray(list, listPos);
return finishNode(template);
}
function parseTemplateSpan() {
- var span = createNode(214 /* TemplateSpan */);
+ var span = createNode(216 /* TemplateSpan */);
span.expression = allowInAnd(parseExpression);
var literal;
- if (token() === 18 /* CloseBraceToken */) {
+ if (token() === 19 /* CloseBraceToken */) {
reScanTemplateToken();
literal = parseTemplateMiddleOrTemplateTail();
}
else {
- literal = parseExpectedToken(16 /* TemplateTail */, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */));
+ literal = parseExpectedToken(17 /* TemplateTail */, ts.Diagnostics._0_expected, ts.tokenToString(19 /* CloseBraceToken */));
}
span.literal = literal;
return finishNode(span);
@@ -17772,18 +18086,17 @@ var ts;
}
function parseTemplateHead() {
var fragment = parseLiteralLikeNode(token());
- ts.Debug.assert(fragment.kind === 14 /* TemplateHead */, "Template head has wrong token kind");
+ ts.Debug.assert(fragment.kind === 15 /* TemplateHead */, "Template head has wrong token kind");
return fragment;
}
function parseTemplateMiddleOrTemplateTail() {
var fragment = parseLiteralLikeNode(token());
- ts.Debug.assert(fragment.kind === 15 /* TemplateMiddle */ || fragment.kind === 16 /* TemplateTail */, "Template fragment has wrong token kind");
+ ts.Debug.assert(fragment.kind === 16 /* TemplateMiddle */ || fragment.kind === 17 /* TemplateTail */, "Template fragment has wrong token kind");
return fragment;
}
function parseLiteralLikeNode(kind) {
var node = createNode(kind);
- var text = scanner.getTokenValue();
- node.text = text;
+ node.text = scanner.getTokenValue();
if (scanner.hasExtendedUnicodeEscape()) {
node.hasExtendedUnicodeEscape = true;
}
@@ -17805,24 +18118,24 @@ var ts;
}
// TYPES
function parseTypeReference() {
- var node = createNode(162 /* TypeReference */);
+ var node = createNode(164 /* TypeReference */);
node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected);
- if (!scanner.hasPrecedingLineBreak() && token() === 27 /* LessThanToken */) {
- node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 27 /* LessThanToken */, 29 /* GreaterThanToken */);
+ if (!scanner.hasPrecedingLineBreak() && token() === 28 /* LessThanToken */) {
+ node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 28 /* LessThanToken */, 30 /* GreaterThanToken */);
}
return finishNode(node);
}
// If true, we should abort parsing an error function.
function typeHasArrowFunctionBlockingParseError(node) {
switch (node.kind) {
- case 162 /* TypeReference */:
+ case 164 /* TypeReference */:
return ts.nodeIsMissing(node.typeName);
- case 163 /* FunctionType */:
- case 164 /* ConstructorType */: {
+ case 165 /* FunctionType */:
+ case 166 /* ConstructorType */: {
var _a = node, parameters = _a.parameters, type = _a.type;
return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);
}
- case 175 /* ParenthesizedType */:
+ case 177 /* ParenthesizedType */:
return typeHasArrowFunctionBlockingParseError(node.type);
default:
return false;
@@ -17830,20 +18143,20 @@ var ts;
}
function parseThisTypePredicate(lhs) {
nextToken();
- var node = createNode(161 /* TypePredicate */, lhs.pos);
+ var node = createNode(163 /* TypePredicate */, lhs.pos);
node.parameterName = lhs;
node.type = parseType();
return finishNode(node);
}
function parseThisTypeNode() {
- var node = createNode(176 /* ThisType */);
+ var node = createNode(178 /* ThisType */);
nextToken();
return finishNode(node);
}
function parseJSDocAllType(postFixEquals) {
- var result = createNode(282 /* JSDocAllType */);
+ var result = createNode(284 /* JSDocAllType */);
if (postFixEquals) {
- return createPostfixType(286 /* JSDocOptionalType */, result);
+ return createPostfixType(288 /* JSDocOptionalType */, result);
}
else {
nextToken();
@@ -17851,7 +18164,7 @@ var ts;
return finishNode(result);
}
function parseJSDocNonNullableType() {
- var result = createNode(285 /* JSDocNonNullableType */);
+ var result = createNode(287 /* JSDocNonNullableType */);
nextToken();
result.type = parseNonArrayType();
return finishNode(result);
@@ -17869,66 +18182,66 @@ var ts;
// Foo>
// Foo(?=
// (?|
- if (token() === 26 /* CommaToken */ ||
- token() === 18 /* CloseBraceToken */ ||
- token() === 20 /* CloseParenToken */ ||
- token() === 29 /* GreaterThanToken */ ||
- token() === 58 /* EqualsToken */ ||
- token() === 49 /* BarToken */) {
- var result = createNode(283 /* JSDocUnknownType */, pos);
+ if (token() === 27 /* CommaToken */ ||
+ token() === 19 /* CloseBraceToken */ ||
+ token() === 21 /* CloseParenToken */ ||
+ token() === 30 /* GreaterThanToken */ ||
+ token() === 59 /* EqualsToken */ ||
+ token() === 50 /* BarToken */) {
+ var result = createNode(285 /* JSDocUnknownType */, pos);
return finishNode(result);
}
else {
- var result = createNode(284 /* JSDocNullableType */, pos);
+ var result = createNode(286 /* JSDocNullableType */, pos);
result.type = parseType();
return finishNode(result);
}
}
function parseJSDocFunctionType() {
if (lookAhead(nextTokenIsOpenParen)) {
- var result = createNodeWithJSDoc(287 /* JSDocFunctionType */);
+ var result = createNodeWithJSDoc(289 /* JSDocFunctionType */);
nextToken();
- fillSignature(56 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result);
+ fillSignature(57 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result);
return finishNode(result);
}
- var node = createNode(162 /* TypeReference */);
+ var node = createNode(164 /* TypeReference */);
node.typeName = parseIdentifierName();
return finishNode(node);
}
function parseJSDocParameter() {
- var parameter = createNode(149 /* Parameter */);
- if (token() === 99 /* ThisKeyword */ || token() === 94 /* NewKeyword */) {
+ var parameter = createNode(151 /* Parameter */);
+ if (token() === 100 /* ThisKeyword */ || token() === 95 /* NewKeyword */) {
parameter.name = parseIdentifierName();
- parseExpected(56 /* ColonToken */);
+ parseExpected(57 /* ColonToken */);
}
parameter.type = parseJSDocType();
return finishNode(parameter);
}
function parseJSDocType() {
scanner.setInJSDocType(true);
- var dotdotdot = parseOptionalToken(24 /* DotDotDotToken */);
+ var dotdotdot = parseOptionalToken(25 /* DotDotDotToken */);
var type = parseTypeOrTypePredicate();
scanner.setInJSDocType(false);
if (dotdotdot) {
- var variadic = createNode(288 /* JSDocVariadicType */, dotdotdot.pos);
+ var variadic = createNode(290 /* JSDocVariadicType */, dotdotdot.pos);
variadic.type = type;
type = finishNode(variadic);
}
- if (token() === 58 /* EqualsToken */) {
- return createPostfixType(286 /* JSDocOptionalType */, type);
+ if (token() === 59 /* EqualsToken */) {
+ return createPostfixType(288 /* JSDocOptionalType */, type);
}
return type;
}
function parseTypeQuery() {
- var node = createNode(165 /* TypeQuery */);
- parseExpected(103 /* TypeOfKeyword */);
+ var node = createNode(167 /* TypeQuery */);
+ parseExpected(104 /* TypeOfKeyword */);
node.exprName = parseEntityName(/*allowReservedWords*/ true);
return finishNode(node);
}
function parseTypeParameter() {
- var node = createNode(148 /* TypeParameter */);
+ var node = createNode(150 /* TypeParameter */);
node.name = parseIdentifier();
- if (parseOptional(85 /* ExtendsKeyword */)) {
+ if (parseOptional(86 /* ExtendsKeyword */)) {
// It's not uncommon for people to write improper constraints to a generic. If the
// user writes a constraint that is an expression and not an actual type, then parse
// it out as an expression (so we can recover well), but report that a type is needed
@@ -17947,39 +18260,39 @@ var ts;
node.expression = parseUnaryExpressionOrHigher();
}
}
- if (parseOptional(58 /* EqualsToken */)) {
+ if (parseOptional(59 /* EqualsToken */)) {
node.default = parseType();
}
return finishNode(node);
}
function parseTypeParameters() {
- if (token() === 27 /* LessThanToken */) {
- return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 27 /* LessThanToken */, 29 /* GreaterThanToken */);
+ if (token() === 28 /* LessThanToken */) {
+ return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 28 /* LessThanToken */, 30 /* GreaterThanToken */);
}
}
function parseParameterType() {
- if (parseOptional(56 /* ColonToken */)) {
+ if (parseOptional(57 /* ColonToken */)) {
return parseType();
}
return undefined;
}
function isStartOfParameter(isJSDocParameter) {
- return token() === 24 /* DotDotDotToken */ ||
+ return token() === 25 /* DotDotDotToken */ ||
isIdentifierOrPattern() ||
ts.isModifierKind(token()) ||
- token() === 57 /* AtToken */ ||
+ token() === 58 /* AtToken */ ||
isStartOfType(/*inStartOfParameter*/ !isJSDocParameter);
}
function parseParameter() {
- var node = createNodeWithJSDoc(149 /* Parameter */);
- if (token() === 99 /* ThisKeyword */) {
+ var node = createNodeWithJSDoc(151 /* Parameter */);
+ if (token() === 100 /* ThisKeyword */) {
node.name = createIdentifier(/*isIdentifier*/ true);
node.type = parseParameterType();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
- node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */);
+ node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */);
// FormalParameter [Yield,Await]:
// BindingElement[?Yield,?Await]
node.name = parseIdentifierOrPattern();
@@ -17994,7 +18307,7 @@ var ts;
// to avoid this we'll advance cursor to the next token.
nextToken();
}
- node.questionToken = parseOptionalToken(55 /* QuestionToken */);
+ node.questionToken = parseOptionalToken(56 /* QuestionToken */);
node.type = parseParameterType();
node.initializer = parseInitializer();
return finishNode(node);
@@ -18016,16 +18329,16 @@ var ts;
return parametersParsedSuccessfully;
}
function shouldParseReturnType(returnToken, isType) {
- if (returnToken === 36 /* EqualsGreaterThanToken */) {
+ if (returnToken === 37 /* EqualsGreaterThanToken */) {
parseExpected(returnToken);
return true;
}
- else if (parseOptional(56 /* ColonToken */)) {
+ else if (parseOptional(57 /* ColonToken */)) {
return true;
}
- else if (isType && token() === 36 /* EqualsGreaterThanToken */) {
+ else if (isType && token() === 37 /* EqualsGreaterThanToken */) {
// This is easy to get backward, especially in type contexts, so parse the type anyway
- parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */));
+ parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(57 /* ColonToken */));
nextToken();
return true;
}
@@ -18046,7 +18359,7 @@ var ts;
//
// SingleNameBinding [Yield,Await]:
// BindingIdentifier[?Yield,?Await]Initializer [In, ?Yield,?Await] opt
- if (!parseExpected(19 /* OpenParenToken */)) {
+ if (!parseExpected(20 /* OpenParenToken */)) {
signature.parameters = createMissingList();
return false;
}
@@ -18059,12 +18372,12 @@ var ts;
parseDelimitedList(16 /* Parameters */, parseParameter);
setYieldContext(savedYieldContext);
setAwaitContext(savedAwaitContext);
- return parseExpected(20 /* CloseParenToken */);
+ return parseExpected(21 /* CloseParenToken */);
}
function parseTypeMemberSemicolon() {
// We allow type members to be separated by commas or (possibly ASI) semicolons.
// First check if it was a comma. If so, we're done with the member.
- if (parseOptional(26 /* CommaToken */)) {
+ if (parseOptional(27 /* CommaToken */)) {
return;
}
// Didn't have a comma. We must have a (possible ASI) semicolon.
@@ -18072,15 +18385,15 @@ var ts;
}
function parseSignatureMember(kind) {
var node = createNodeWithJSDoc(kind);
- if (kind === 159 /* ConstructSignature */) {
- parseExpected(94 /* NewKeyword */);
+ if (kind === 161 /* ConstructSignature */) {
+ parseExpected(95 /* NewKeyword */);
}
- fillSignature(56 /* ColonToken */, 4 /* Type */, node);
+ fillSignature(57 /* ColonToken */, 4 /* Type */, node);
parseTypeMemberSemicolon();
return finishNode(node);
}
function isIndexSignature() {
- return token() === 21 /* OpenBracketToken */ && lookAhead(isUnambiguouslyIndexSignature);
+ return token() === 22 /* OpenBracketToken */ && lookAhead(isUnambiguouslyIndexSignature);
}
function isUnambiguouslyIndexSignature() {
// The only allowed sequence is:
@@ -18100,7 +18413,7 @@ var ts;
// []
//
nextToken();
- if (token() === 24 /* DotDotDotToken */ || token() === 22 /* CloseBracketToken */) {
+ if (token() === 25 /* DotDotDotToken */ || token() === 23 /* CloseBracketToken */) {
return true;
}
if (ts.isModifierKind(token())) {
@@ -18119,39 +18432,39 @@ var ts;
// A colon signifies a well formed indexer
// A comma should be a badly formed indexer because comma expressions are not allowed
// in computed properties.
- if (token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */) {
+ if (token() === 57 /* ColonToken */ || token() === 27 /* CommaToken */) {
return true;
}
// Question mark could be an indexer with an optional property,
// or it could be a conditional expression in a computed property.
- if (token() !== 55 /* QuestionToken */) {
+ if (token() !== 56 /* QuestionToken */) {
return false;
}
// If any of the following tokens are after the question mark, it cannot
// be a conditional expression, so treat it as an indexer.
nextToken();
- return token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || token() === 22 /* CloseBracketToken */;
+ return token() === 57 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */;
}
function parseIndexSignatureDeclaration(node) {
- node.kind = 160 /* IndexSignature */;
- node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */);
+ node.kind = 162 /* IndexSignature */;
+ node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */);
node.type = parseTypeAnnotation();
parseTypeMemberSemicolon();
return finishNode(node);
}
function parsePropertyOrMethodSignature(node) {
node.name = parsePropertyName();
- node.questionToken = parseOptionalToken(55 /* QuestionToken */);
- if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) {
- node.kind = 153 /* MethodSignature */;
+ node.questionToken = parseOptionalToken(56 /* QuestionToken */);
+ if (token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */) {
+ node.kind = 155 /* MethodSignature */;
// Method signatures don't exist in expression contexts. So they have neither
// [Yield] nor [Await]
- fillSignature(56 /* ColonToken */, 4 /* Type */, node);
+ fillSignature(57 /* ColonToken */, 4 /* Type */, node);
}
else {
- node.kind = 151 /* PropertySignature */;
+ node.kind = 153 /* PropertySignature */;
node.type = parseTypeAnnotation();
- if (token() === 58 /* EqualsToken */) {
+ if (token() === 59 /* EqualsToken */) {
// Although type literal properties cannot not have initializers, we attempt
// to parse an initializer so we can report in the checker that an interface
// property or type literal property cannot have an initializer.
@@ -18163,7 +18476,7 @@ var ts;
}
function isTypeMemberStart() {
// Return true if we have the start of a signature member
- if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) {
+ if (token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */) {
return true;
}
var idToken = false;
@@ -18173,7 +18486,7 @@ var ts;
nextToken();
}
// Index signatures and computed property names are type members
- if (token() === 21 /* OpenBracketToken */) {
+ if (token() === 22 /* OpenBracketToken */) {
return true;
}
// Try to get the first property-like token following all modifiers
@@ -18184,21 +18497,21 @@ var ts;
// If we were able to get any potential identifier, check that it is
// the start of a member declaration
if (idToken) {
- return token() === 19 /* OpenParenToken */ ||
- token() === 27 /* LessThanToken */ ||
- token() === 55 /* QuestionToken */ ||
- token() === 56 /* ColonToken */ ||
- token() === 26 /* CommaToken */ ||
+ return token() === 20 /* OpenParenToken */ ||
+ token() === 28 /* LessThanToken */ ||
+ token() === 56 /* QuestionToken */ ||
+ token() === 57 /* ColonToken */ ||
+ token() === 27 /* CommaToken */ ||
canParseSemicolon();
}
return false;
}
function parseTypeMember() {
- if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) {
- return parseSignatureMember(158 /* CallSignature */);
+ if (token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */) {
+ return parseSignatureMember(160 /* CallSignature */);
}
- if (token() === 94 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(159 /* ConstructSignature */);
+ if (token() === 95 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {
+ return parseSignatureMember(161 /* ConstructSignature */);
}
var node = createNodeWithJSDoc(0 /* Unknown */);
node.modifiers = parseModifiers();
@@ -18209,30 +18522,30 @@ var ts;
}
function nextTokenIsOpenParenOrLessThan() {
nextToken();
- return token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */;
+ return token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */;
}
function nextTokenIsDot() {
- return nextToken() === 23 /* DotToken */;
+ return nextToken() === 24 /* DotToken */;
}
function nextTokenIsOpenParenOrLessThanOrDot() {
switch (nextToken()) {
- case 19 /* OpenParenToken */:
- case 27 /* LessThanToken */:
- case 23 /* DotToken */:
+ case 20 /* OpenParenToken */:
+ case 28 /* LessThanToken */:
+ case 24 /* DotToken */:
return true;
}
return false;
}
function parseTypeLiteral() {
- var node = createNode(166 /* TypeLiteral */);
+ var node = createNode(168 /* TypeLiteral */);
node.members = parseObjectTypeMembers();
return finishNode(node);
}
function parseObjectTypeMembers() {
var members;
- if (parseExpected(17 /* OpenBraceToken */)) {
+ if (parseExpected(18 /* OpenBraceToken */)) {
members = parseList(4 /* TypeMembers */, parseTypeMember);
- parseExpected(18 /* CloseBraceToken */);
+ parseExpected(19 /* CloseBraceToken */);
}
else {
members = createMissingList();
@@ -18241,89 +18554,89 @@ var ts;
}
function isStartOfMappedType() {
nextToken();
- if (token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) {
- return nextToken() === 132 /* ReadonlyKeyword */;
+ if (token() === 38 /* PlusToken */ || token() === 39 /* MinusToken */) {
+ return nextToken() === 133 /* ReadonlyKeyword */;
}
- if (token() === 132 /* ReadonlyKeyword */) {
+ if (token() === 133 /* ReadonlyKeyword */) {
nextToken();
}
- return token() === 21 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 92 /* InKeyword */;
+ return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 93 /* InKeyword */;
}
function parseMappedTypeParameter() {
- var node = createNode(148 /* TypeParameter */);
+ var node = createNode(150 /* TypeParameter */);
node.name = parseIdentifier();
- parseExpected(92 /* InKeyword */);
+ parseExpected(93 /* InKeyword */);
node.constraint = parseType();
return finishNode(node);
}
function parseMappedType() {
- var node = createNode(179 /* MappedType */);
- parseExpected(17 /* OpenBraceToken */);
- if (token() === 132 /* ReadonlyKeyword */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) {
+ var node = createNode(181 /* MappedType */);
+ parseExpected(18 /* OpenBraceToken */);
+ if (token() === 133 /* ReadonlyKeyword */ || token() === 38 /* PlusToken */ || token() === 39 /* MinusToken */) {
node.readonlyToken = parseTokenNode();
- if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) {
- parseExpectedToken(132 /* ReadonlyKeyword */);
+ if (node.readonlyToken.kind !== 133 /* ReadonlyKeyword */) {
+ parseExpectedToken(133 /* ReadonlyKeyword */);
}
}
- parseExpected(21 /* OpenBracketToken */);
+ parseExpected(22 /* OpenBracketToken */);
node.typeParameter = parseMappedTypeParameter();
- parseExpected(22 /* CloseBracketToken */);
- if (token() === 55 /* QuestionToken */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) {
+ parseExpected(23 /* CloseBracketToken */);
+ if (token() === 56 /* QuestionToken */ || token() === 38 /* PlusToken */ || token() === 39 /* MinusToken */) {
node.questionToken = parseTokenNode();
- if (node.questionToken.kind !== 55 /* QuestionToken */) {
- parseExpectedToken(55 /* QuestionToken */);
+ if (node.questionToken.kind !== 56 /* QuestionToken */) {
+ parseExpectedToken(56 /* QuestionToken */);
}
}
node.type = parseTypeAnnotation();
parseSemicolon();
- parseExpected(18 /* CloseBraceToken */);
+ parseExpected(19 /* CloseBraceToken */);
return finishNode(node);
}
function parseTupleElementType() {
var pos = getNodePos();
- if (parseOptional(24 /* DotDotDotToken */)) {
- var node = createNode(170 /* RestType */, pos);
+ if (parseOptional(25 /* DotDotDotToken */)) {
+ var node = createNode(172 /* RestType */, pos);
node.type = parseType();
return finishNode(node);
}
var type = parseType();
- if (!(contextFlags & 2097152 /* JSDoc */) && type.kind === 284 /* JSDocNullableType */ && type.pos === type.type.pos) {
- type.kind = 169 /* OptionalType */;
+ if (!(contextFlags & 2097152 /* JSDoc */) && type.kind === 286 /* JSDocNullableType */ && type.pos === type.type.pos) {
+ type.kind = 171 /* OptionalType */;
}
return type;
}
function parseTupleType() {
- var node = createNode(168 /* TupleType */);
- node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */);
+ var node = createNode(170 /* TupleType */);
+ node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */);
return finishNode(node);
}
function parseParenthesizedType() {
- var node = createNode(175 /* ParenthesizedType */);
- parseExpected(19 /* OpenParenToken */);
+ var node = createNode(177 /* ParenthesizedType */);
+ parseExpected(20 /* OpenParenToken */);
node.type = parseType();
- parseExpected(20 /* CloseParenToken */);
+ parseExpected(21 /* CloseParenToken */);
return finishNode(node);
}
function parseFunctionOrConstructorType() {
var pos = getNodePos();
- var kind = parseOptional(94 /* NewKeyword */) ? 164 /* ConstructorType */ : 163 /* FunctionType */;
+ var kind = parseOptional(95 /* NewKeyword */) ? 166 /* ConstructorType */ : 165 /* FunctionType */;
var node = createNodeWithJSDoc(kind, pos);
- fillSignature(36 /* EqualsGreaterThanToken */, 4 /* Type */, node);
+ fillSignature(37 /* EqualsGreaterThanToken */, 4 /* Type */, node);
return finishNode(node);
}
function parseKeywordAndNoDot() {
var node = parseTokenNode();
- return token() === 23 /* DotToken */ ? undefined : node;
+ return token() === 24 /* DotToken */ ? undefined : node;
}
function parseLiteralTypeNode(negative) {
- var node = createNode(180 /* LiteralType */);
+ var node = createNode(182 /* LiteralType */);
var unaryMinusExpression;
if (negative) {
- unaryMinusExpression = createNode(200 /* PrefixUnaryExpression */);
- unaryMinusExpression.operator = 38 /* MinusToken */;
+ unaryMinusExpression = createNode(202 /* PrefixUnaryExpression */);
+ unaryMinusExpression.operator = 39 /* MinusToken */;
nextToken();
}
- var expression = token() === 101 /* TrueKeyword */ || token() === 86 /* FalseKeyword */
+ var expression = token() === 102 /* TrueKeyword */ || token() === 87 /* FalseKeyword */
? parseTokenNode()
: parseLiteralLikeNode(token());
if (negative) {
@@ -18336,79 +18649,82 @@ var ts;
}
function isStartOfTypeOfImportType() {
nextToken();
- return token() === 91 /* ImportKeyword */;
+ return token() === 92 /* ImportKeyword */;
}
function parseImportType() {
sourceFile.flags |= 524288 /* PossiblyContainsDynamicImport */;
- var node = createNode(181 /* ImportType */);
- if (parseOptional(103 /* TypeOfKeyword */)) {
+ var node = createNode(183 /* ImportType */);
+ if (parseOptional(104 /* TypeOfKeyword */)) {
node.isTypeOf = true;
}
- parseExpected(91 /* ImportKeyword */);
- parseExpected(19 /* OpenParenToken */);
+ parseExpected(92 /* ImportKeyword */);
+ parseExpected(20 /* OpenParenToken */);
node.argument = parseType();
- parseExpected(20 /* CloseParenToken */);
- if (parseOptional(23 /* DotToken */)) {
+ parseExpected(21 /* CloseParenToken */);
+ if (parseOptional(24 /* DotToken */)) {
node.qualifier = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected);
}
node.typeArguments = tryParseTypeArguments();
return finishNode(node);
}
- function nextTokenIsNumericLiteral() {
- return nextToken() === 8 /* NumericLiteral */;
+ function nextTokenIsNumericOrBigIntLiteral() {
+ nextToken();
+ return token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */;
}
function parseNonArrayType() {
switch (token()) {
- case 119 /* AnyKeyword */:
- case 142 /* UnknownKeyword */:
- case 137 /* StringKeyword */:
- case 134 /* NumberKeyword */:
- case 138 /* SymbolKeyword */:
- case 122 /* BooleanKeyword */:
- case 140 /* UndefinedKeyword */:
- case 131 /* NeverKeyword */:
- case 135 /* ObjectKeyword */:
+ case 120 /* AnyKeyword */:
+ case 143 /* UnknownKeyword */:
+ case 138 /* StringKeyword */:
+ case 135 /* NumberKeyword */:
+ case 146 /* BigIntKeyword */:
+ case 139 /* SymbolKeyword */:
+ case 123 /* BooleanKeyword */:
+ case 141 /* UndefinedKeyword */:
+ case 132 /* NeverKeyword */:
+ case 136 /* ObjectKeyword */:
// If these are followed by a dot, then parse these out as a dotted type reference instead.
return tryParse(parseKeywordAndNoDot) || parseTypeReference();
- case 39 /* AsteriskToken */:
+ case 40 /* AsteriskToken */:
return parseJSDocAllType(/*postfixEquals*/ false);
- case 61 /* AsteriskEqualsToken */:
+ case 62 /* AsteriskEqualsToken */:
return parseJSDocAllType(/*postfixEquals*/ true);
- case 55 /* QuestionToken */:
+ case 56 /* QuestionToken */:
return parseJSDocUnknownOrNullableType();
- case 89 /* FunctionKeyword */:
+ case 90 /* FunctionKeyword */:
return parseJSDocFunctionType();
- case 51 /* ExclamationToken */:
+ case 52 /* ExclamationToken */:
return parseJSDocNonNullableType();
- case 13 /* NoSubstitutionTemplateLiteral */:
- case 9 /* StringLiteral */:
+ case 14 /* NoSubstitutionTemplateLiteral */:
+ case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
- case 101 /* TrueKeyword */:
- case 86 /* FalseKeyword */:
+ case 9 /* BigIntLiteral */:
+ case 102 /* TrueKeyword */:
+ case 87 /* FalseKeyword */:
return parseLiteralTypeNode();
- case 38 /* MinusToken */:
- return lookAhead(nextTokenIsNumericLiteral) ? parseLiteralTypeNode(/*negative*/ true) : parseTypeReference();
- case 105 /* VoidKeyword */:
- case 95 /* NullKeyword */:
+ case 39 /* MinusToken */:
+ return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode(/*negative*/ true) : parseTypeReference();
+ case 106 /* VoidKeyword */:
+ case 96 /* NullKeyword */:
return parseTokenNode();
- case 99 /* ThisKeyword */: {
+ case 100 /* ThisKeyword */: {
var thisKeyword = parseThisTypeNode();
- if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 128 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
return parseThisTypePredicate(thisKeyword);
}
else {
return thisKeyword;
}
}
- case 103 /* TypeOfKeyword */:
+ case 104 /* TypeOfKeyword */:
return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery();
- case 17 /* OpenBraceToken */:
+ case 18 /* OpenBraceToken */:
return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral();
- case 21 /* OpenBracketToken */:
+ case 22 /* OpenBracketToken */:
return parseTupleType();
- case 19 /* OpenParenToken */:
+ case 20 /* OpenParenToken */:
return parseParenthesizedType();
- case 91 /* ImportKeyword */:
+ case 92 /* ImportKeyword */:
return parseImportType();
default:
return parseTypeReference();
@@ -18416,42 +18732,44 @@ var ts;
}
function isStartOfType(inStartOfParameter) {
switch (token()) {
- case 119 /* AnyKeyword */:
- case 142 /* UnknownKeyword */:
- case 137 /* StringKeyword */:
- case 134 /* NumberKeyword */:
- case 122 /* BooleanKeyword */:
- case 138 /* SymbolKeyword */:
- case 141 /* UniqueKeyword */:
- case 105 /* VoidKeyword */:
- case 140 /* UndefinedKeyword */:
- case 95 /* NullKeyword */:
- case 99 /* ThisKeyword */:
- case 103 /* TypeOfKeyword */:
- case 131 /* NeverKeyword */:
- case 17 /* OpenBraceToken */:
- case 21 /* OpenBracketToken */:
- case 27 /* LessThanToken */:
- case 49 /* BarToken */:
- case 48 /* AmpersandToken */:
- case 94 /* NewKeyword */:
- case 9 /* StringLiteral */:
+ case 120 /* AnyKeyword */:
+ case 143 /* UnknownKeyword */:
+ case 138 /* StringKeyword */:
+ case 135 /* NumberKeyword */:
+ case 146 /* BigIntKeyword */:
+ case 123 /* BooleanKeyword */:
+ case 139 /* SymbolKeyword */:
+ case 142 /* UniqueKeyword */:
+ case 106 /* VoidKeyword */:
+ case 141 /* UndefinedKeyword */:
+ case 96 /* NullKeyword */:
+ case 100 /* ThisKeyword */:
+ case 104 /* TypeOfKeyword */:
+ case 132 /* NeverKeyword */:
+ case 18 /* OpenBraceToken */:
+ case 22 /* OpenBracketToken */:
+ case 28 /* LessThanToken */:
+ case 50 /* BarToken */:
+ case 49 /* AmpersandToken */:
+ case 95 /* NewKeyword */:
+ case 10 /* StringLiteral */:
case 8 /* NumericLiteral */:
- case 101 /* TrueKeyword */:
- case 86 /* FalseKeyword */:
- case 135 /* ObjectKeyword */:
- case 39 /* AsteriskToken */:
- case 55 /* QuestionToken */:
- case 51 /* ExclamationToken */:
- case 24 /* DotDotDotToken */:
- case 126 /* InferKeyword */:
- case 91 /* ImportKeyword */:
+ case 9 /* BigIntLiteral */:
+ case 102 /* TrueKeyword */:
+ case 87 /* FalseKeyword */:
+ case 136 /* ObjectKeyword */:
+ case 40 /* AsteriskToken */:
+ case 56 /* QuestionToken */:
+ case 52 /* ExclamationToken */:
+ case 25 /* DotDotDotToken */:
+ case 127 /* InferKeyword */:
+ case 92 /* ImportKeyword */:
return true;
- case 89 /* FunctionKeyword */:
+ case 90 /* FunctionKeyword */:
return !inStartOfParameter;
- case 38 /* MinusToken */:
- return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral);
- case 19 /* OpenParenToken */:
+ case 39 /* MinusToken */:
+ return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral);
+ case 20 /* OpenParenToken */:
// Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier,
// or something that starts a type. We don't want to consider things like '(1)' a type.
return !inStartOfParameter && lookAhead(isStartOfParenthesizedOrFunctionType);
@@ -18461,35 +18779,35 @@ var ts;
}
function isStartOfParenthesizedOrFunctionType() {
nextToken();
- return token() === 20 /* CloseParenToken */ || isStartOfParameter(/*isJSDocParameter*/ false) || isStartOfType();
+ return token() === 21 /* CloseParenToken */ || isStartOfParameter(/*isJSDocParameter*/ false) || isStartOfType();
}
function parsePostfixTypeOrHigher() {
var type = parseNonArrayType();
while (!scanner.hasPrecedingLineBreak()) {
switch (token()) {
- case 51 /* ExclamationToken */:
- type = createPostfixType(285 /* JSDocNonNullableType */, type);
+ case 52 /* ExclamationToken */:
+ type = createPostfixType(287 /* JSDocNonNullableType */, type);
break;
- case 55 /* QuestionToken */:
+ case 56 /* QuestionToken */:
// If not in JSDoc and next token is start of a type we have a conditional type
if (!(contextFlags & 2097152 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) {
return type;
}
- type = createPostfixType(284 /* JSDocNullableType */, type);
+ type = createPostfixType(286 /* JSDocNullableType */, type);
break;
- case 21 /* OpenBracketToken */:
- parseExpected(21 /* OpenBracketToken */);
+ case 22 /* OpenBracketToken */:
+ parseExpected(22 /* OpenBracketToken */);
if (isStartOfType()) {
- var node = createNode(178 /* IndexedAccessType */, type.pos);
+ var node = createNode(180 /* IndexedAccessType */, type.pos);
node.objectType = type;
node.indexType = parseType();
- parseExpected(22 /* CloseBracketToken */);
+ parseExpected(23 /* CloseBracketToken */);
type = finishNode(node);
}
else {
- var node = createNode(167 /* ArrayType */, type.pos);
+ var node = createNode(169 /* ArrayType */, type.pos);
node.elementType = type;
- parseExpected(22 /* CloseBracketToken */);
+ parseExpected(23 /* CloseBracketToken */);
type = finishNode(node);
}
break;
@@ -18506,16 +18824,16 @@ var ts;
return finishNode(postfix);
}
function parseTypeOperator(operator) {
- var node = createNode(177 /* TypeOperator */);
+ var node = createNode(179 /* TypeOperator */);
parseExpected(operator);
node.operator = operator;
node.type = parseTypeOperatorOrHigher();
return finishNode(node);
}
function parseInferType() {
- var node = createNode(174 /* InferType */);
- parseExpected(126 /* InferKeyword */);
- var typeParameter = createNode(148 /* TypeParameter */);
+ var node = createNode(176 /* InferType */);
+ parseExpected(127 /* InferKeyword */);
+ var typeParameter = createNode(150 /* TypeParameter */);
typeParameter.name = parseIdentifier();
node.typeParameter = finishNode(typeParameter);
return finishNode(node);
@@ -18523,10 +18841,10 @@ var ts;
function parseTypeOperatorOrHigher() {
var operator = token();
switch (operator) {
- case 128 /* KeyOfKeyword */:
- case 141 /* UniqueKeyword */:
+ case 129 /* KeyOfKeyword */:
+ case 142 /* UniqueKeyword */:
return parseTypeOperator(operator);
- case 126 /* InferKeyword */:
+ case 127 /* InferKeyword */:
return parseInferType();
}
return parsePostfixTypeOrHigher();
@@ -18546,27 +18864,27 @@ var ts;
return type;
}
function parseIntersectionTypeOrHigher() {
- return parseUnionOrIntersectionType(172 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */);
+ return parseUnionOrIntersectionType(174 /* IntersectionType */, parseTypeOperatorOrHigher, 49 /* AmpersandToken */);
}
function parseUnionTypeOrHigher() {
- return parseUnionOrIntersectionType(171 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */);
+ return parseUnionOrIntersectionType(173 /* UnionType */, parseIntersectionTypeOrHigher, 50 /* BarToken */);
}
function isStartOfFunctionType() {
- if (token() === 27 /* LessThanToken */) {
+ if (token() === 28 /* LessThanToken */) {
return true;
}
- return token() === 19 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
+ return token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType);
}
function skipParameterStart() {
if (ts.isModifierKind(token())) {
// Skip modifiers
parseModifiers();
}
- if (isIdentifier() || token() === 99 /* ThisKeyword */) {
+ if (isIdentifier() || token() === 100 /* ThisKeyword */) {
nextToken();
return true;
}
- if (token() === 21 /* OpenBracketToken */ || token() === 17 /* OpenBraceToken */) {
+ if (token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */) {
// Return true if we can parse an array or object binding pattern with no errors
var previousErrorCount = parseDiagnostics.length;
parseIdentifierOrPattern();
@@ -18576,7 +18894,7 @@ var ts;
}
function isUnambiguouslyStartOfFunctionType() {
nextToken();
- if (token() === 20 /* CloseParenToken */ || token() === 24 /* DotDotDotToken */) {
+ if (token() === 21 /* CloseParenToken */ || token() === 25 /* DotDotDotToken */) {
// ( )
// ( ...
return true;
@@ -18584,17 +18902,17 @@ var ts;
if (skipParameterStart()) {
// We successfully skipped modifiers (if any) and an identifier or binding pattern,
// now see if we have something that indicates a parameter declaration
- if (token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ ||
- token() === 55 /* QuestionToken */ || token() === 58 /* EqualsToken */) {
+ if (token() === 57 /* ColonToken */ || token() === 27 /* CommaToken */ ||
+ token() === 56 /* QuestionToken */ || token() === 59 /* EqualsToken */) {
// ( xxx :
// ( xxx ,
// ( xxx ?
// ( xxx =
return true;
}
- if (token() === 20 /* CloseParenToken */) {
+ if (token() === 21 /* CloseParenToken */) {
nextToken();
- if (token() === 36 /* EqualsGreaterThanToken */) {
+ if (token() === 37 /* EqualsGreaterThanToken */) {
// ( xxx ) =>
return true;
}
@@ -18606,7 +18924,7 @@ var ts;
var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
var type = parseType();
if (typePredicateVariable) {
- var node = createNode(161 /* TypePredicate */, typePredicateVariable.pos);
+ var node = createNode(163 /* TypePredicate */, typePredicateVariable.pos);
node.parameterName = typePredicateVariable;
node.type = type;
return finishNode(node);
@@ -18617,7 +18935,7 @@ var ts;
}
function parseTypePredicatePrefix() {
var id = parseIdentifier();
- if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 128 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {
nextToken();
return id;
}
@@ -18628,49 +18946,50 @@ var ts;
return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker);
}
function parseTypeWorker(noConditionalTypes) {
- if (isStartOfFunctionType() || token() === 94 /* NewKeyword */) {
+ if (isStartOfFunctionType() || token() === 95 /* NewKeyword */) {
return parseFunctionOrConstructorType();
}
var type = parseUnionTypeOrHigher();
- if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85 /* ExtendsKeyword */)) {
- var node = createNode(173 /* ConditionalType */, type.pos);
+ if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(86 /* ExtendsKeyword */)) {
+ var node = createNode(175 /* ConditionalType */, type.pos);
node.checkType = type;
// The type following 'extends' is not permitted to be another conditional type
node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true);
- parseExpected(55 /* QuestionToken */);
+ parseExpected(56 /* QuestionToken */);
node.trueType = parseTypeWorker();
- parseExpected(56 /* ColonToken */);
+ parseExpected(57 /* ColonToken */);
node.falseType = parseTypeWorker();
return finishNode(node);
}
return type;
}
function parseTypeAnnotation() {
- return parseOptional(56 /* ColonToken */) ? parseType() : undefined;
+ return parseOptional(57 /* ColonToken */) ? parseType() : undefined;
}
// EXPRESSIONS
function isStartOfLeftHandSideExpression() {
switch (token()) {
- case 99 /* ThisKeyword */:
- case 97 /* SuperKeyword */:
- case 95 /* NullKeyword */:
- case 101 /* TrueKeyword */:
- case 86 /* FalseKeyword */:
+ case 100 /* ThisKeyword */:
+ case 98 /* SuperKeyword */:
+ case 96 /* NullKeyword */:
+ case 102 /* TrueKeyword */:
+ case 87 /* FalseKeyword */:
case 8 /* NumericLiteral */:
- case 9 /* StringLiteral */:
- case 13 /* NoSubstitutionTemplateLiteral */:
- case 14 /* TemplateHead */:
- case 19 /* OpenParenToken */:
- case 21 /* OpenBracketToken */:
- case 17 /* OpenBraceToken */:
- case 89 /* FunctionKeyword */:
- case 75 /* ClassKeyword */:
- case 94 /* NewKeyword */:
- case 41 /* SlashToken */:
- case 63 /* SlashEqualsToken */:
- case 71 /* Identifier */:
+ case 9 /* BigIntLiteral */:
+ case 10 /* StringLiteral */:
+ case 14 /* NoSubstitutionTemplateLiteral */:
+ case 15 /* TemplateHead */:
+ case 20 /* OpenParenToken */:
+ case 22 /* OpenBracketToken */:
+ case 18 /* OpenBraceToken */:
+ case 90 /* FunctionKeyword */:
+ case 76 /* ClassKeyword */:
+ case 95 /* NewKeyword */:
+ case 42 /* SlashToken */:
+ case 64 /* SlashEqualsToken */:
+ case 72 /* Identifier */:
return true;
- case 91 /* ImportKeyword */:
+ case 92 /* ImportKeyword */:
return lookAhead(nextTokenIsOpenParenOrLessThanOrDot);
default:
return isIdentifier();
@@ -18681,18 +19000,18 @@ var ts;
return true;
}
switch (token()) {
- case 37 /* PlusToken */:
- case 38 /* MinusToken */:
- case 52 /* TildeToken */:
- case 51 /* ExclamationToken */:
- case 80 /* DeleteKeyword */:
- case 103 /* TypeOfKeyword */:
- case 105 /* VoidKeyword */:
- case 43 /* PlusPlusToken */:
- case 44 /* MinusMinusToken */:
- case 27 /* LessThanToken */:
- case 121 /* AwaitKeyword */:
- case 116 /* YieldKeyword */:
+ case 38 /* PlusToken */:
+ case 39 /* MinusToken */:
+ case 53 /* TildeToken */:
+ case 52 /* ExclamationToken */:
+ case 81 /* DeleteKeyword */:
+ case 104 /* TypeOfKeyword */:
+ case 106 /* VoidKeyword */:
+ case 44 /* PlusPlusToken */:
+ case 45 /* MinusMinusToken */:
+ case 28 /* LessThanToken */:
+ case 122 /* AwaitKeyword */:
+ case 117 /* YieldKeyword */:
// Yield/await always starts an expression. Either it is an identifier (in which case
// it is definitely an expression). Or it's a keyword (either because we're in
// a generator or async function, or in strict mode (or both)) and it started a yield or await expression.
@@ -18710,10 +19029,10 @@ var ts;
}
function isStartOfExpressionStatement() {
// As per the grammar, none of '{' or 'function' or 'class' can start an expression statement.
- return token() !== 17 /* OpenBraceToken */ &&
- token() !== 89 /* FunctionKeyword */ &&
- token() !== 75 /* ClassKeyword */ &&
- token() !== 57 /* AtToken */ &&
+ return token() !== 18 /* OpenBraceToken */ &&
+ token() !== 90 /* FunctionKeyword */ &&
+ token() !== 76 /* ClassKeyword */ &&
+ token() !== 58 /* AtToken */ &&
isStartOfExpression();
}
function parseExpression() {
@@ -18727,7 +19046,7 @@ var ts;
}
var expr = parseAssignmentExpressionOrHigher();
var operatorToken;
- while ((operatorToken = parseOptionalToken(26 /* CommaToken */))) {
+ while ((operatorToken = parseOptionalToken(27 /* CommaToken */))) {
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher());
}
if (saveDecoratorContext) {
@@ -18736,7 +19055,7 @@ var ts;
return expr;
}
function parseInitializer() {
- return parseOptional(58 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
+ return parseOptional(59 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
}
function parseAssignmentExpressionOrHigher() {
// AssignmentExpression[in,yield]:
@@ -18781,7 +19100,7 @@ var ts;
// To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized
// parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
// identifier and the current token is an arrow.
- if (expr.kind === 71 /* Identifier */ && token() === 36 /* EqualsGreaterThanToken */) {
+ if (expr.kind === 72 /* Identifier */ && token() === 37 /* EqualsGreaterThanToken */) {
return parseSimpleArrowFunctionExpression(expr);
}
// Now see if we might be in cases '2' or '3'.
@@ -18797,7 +19116,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token() === 116 /* YieldKeyword */) {
+ if (token() === 117 /* YieldKeyword */) {
// If we have a 'yield' keyword, and this is a context where yield expressions are
// allowed, then definitely parse out a yield expression.
if (inYieldContext()) {
@@ -18826,15 +19145,15 @@ var ts;
return !scanner.hasPrecedingLineBreak() && isIdentifier();
}
function parseYieldExpression() {
- var node = createNode(205 /* YieldExpression */);
+ var node = createNode(207 /* YieldExpression */);
// YieldExpression[In] :
// yield
// yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield]
// yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield]
nextToken();
if (!scanner.hasPrecedingLineBreak() &&
- (token() === 39 /* AsteriskToken */ || isStartOfExpression())) {
- node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */);
+ (token() === 40 /* AsteriskToken */ || isStartOfExpression())) {
+ node.asteriskToken = parseOptionalToken(40 /* AsteriskToken */);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
@@ -18845,20 +19164,20 @@ var ts;
}
}
function parseSimpleArrowFunctionExpression(identifier, asyncModifier) {
- ts.Debug.assert(token() === 36 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
+ ts.Debug.assert(token() === 37 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
var node;
if (asyncModifier) {
- node = createNode(195 /* ArrowFunction */, asyncModifier.pos);
+ node = createNode(197 /* ArrowFunction */, asyncModifier.pos);
node.modifiers = asyncModifier;
}
else {
- node = createNode(195 /* ArrowFunction */, identifier.pos);
+ node = createNode(197 /* ArrowFunction */, identifier.pos);
}
- var parameter = createNode(149 /* Parameter */, identifier.pos);
+ var parameter = createNode(151 /* Parameter */, identifier.pos);
parameter.name = identifier;
finishNode(parameter);
node.parameters = createNodeArray([parameter], parameter.pos, parameter.end);
- node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */);
+ node.equalsGreaterThanToken = parseExpectedToken(37 /* EqualsGreaterThanToken */);
node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);
return addJSDocComment(finishNode(node));
}
@@ -18883,8 +19202,8 @@ var ts;
// If we have an arrow, then try to parse the body. Even if not, try to parse if we
// have an opening brace, just in case we're in an error state.
var lastToken = token();
- arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */);
- arrowFunction.body = (lastToken === 36 /* EqualsGreaterThanToken */ || lastToken === 17 /* OpenBraceToken */)
+ arrowFunction.equalsGreaterThanToken = parseExpectedToken(37 /* EqualsGreaterThanToken */);
+ arrowFunction.body = (lastToken === 37 /* EqualsGreaterThanToken */ || lastToken === 18 /* OpenBraceToken */)
? parseArrowFunctionExpressionBody(isAsync)
: parseIdentifier();
return finishNode(arrowFunction);
@@ -18894,10 +19213,10 @@ var ts;
// Unknown -> There *might* be a parenthesized arrow function here.
// Speculatively look ahead to be sure, and rollback if not.
function isParenthesizedArrowFunctionExpression() {
- if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */ || token() === 120 /* AsyncKeyword */) {
+ if (token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */ || token() === 121 /* AsyncKeyword */) {
return lookAhead(isParenthesizedArrowFunctionExpressionWorker);
}
- if (token() === 36 /* EqualsGreaterThanToken */) {
+ if (token() === 37 /* EqualsGreaterThanToken */) {
// ERROR RECOVERY TWEAK:
// If we see a standalone => try to parse it as an arrow function expression as that's
// likely what the user intended to write.
@@ -18907,28 +19226,28 @@ var ts;
return 0 /* False */;
}
function isParenthesizedArrowFunctionExpressionWorker() {
- if (token() === 120 /* AsyncKeyword */) {
+ if (token() === 121 /* AsyncKeyword */) {
nextToken();
if (scanner.hasPrecedingLineBreak()) {
return 0 /* False */;
}
- if (token() !== 19 /* OpenParenToken */ && token() !== 27 /* LessThanToken */) {
+ if (token() !== 20 /* OpenParenToken */ && token() !== 28 /* LessThanToken */) {
return 0 /* False */;
}
}
var first = token();
var second = nextToken();
- if (first === 19 /* OpenParenToken */) {
- if (second === 20 /* CloseParenToken */) {
+ if (first === 20 /* OpenParenToken */) {
+ if (second === 21 /* CloseParenToken */) {
// Simple cases: "() =>", "(): ", and "() {".
// This is an arrow function with no parameters.
// The last one is not actually an arrow function,
// but this is probably what the user intended.
var third = nextToken();
switch (third) {
- case 36 /* EqualsGreaterThanToken */:
- case 56 /* ColonToken */:
- case 17 /* OpenBraceToken */:
+ case 37 /* EqualsGreaterThanToken */:
+ case 57 /* ColonToken */:
+ case 18 /* OpenBraceToken */:
return 1 /* True */;
default:
return 0 /* False */;
@@ -18940,42 +19259,42 @@ var ts;
// ({ x }) => { }
// ([ x ])
// ({ x })
- if (second === 21 /* OpenBracketToken */ || second === 17 /* OpenBraceToken */) {
+ if (second === 22 /* OpenBracketToken */ || second === 18 /* OpenBraceToken */) {
return 2 /* Unknown */;
}
// Simple case: "(..."
// This is an arrow function with a rest parameter.
- if (second === 24 /* DotDotDotToken */) {
+ if (second === 25 /* DotDotDotToken */) {
return 1 /* True */;
}
// Check for "(xxx yyy", where xxx is a modifier and yyy is an identifier. This
// isn't actually allowed, but we want to treat it as a lambda so we can provide
// a good error message.
- if (ts.isModifierKind(second) && second !== 120 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) {
+ if (ts.isModifierKind(second) && second !== 121 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) {
return 1 /* True */;
}
// If we had "(" followed by something that's not an identifier,
// then this definitely doesn't look like a lambda. "this" is not
// valid, but we want to parse it and then give a semantic error.
- if (!isIdentifier() && second !== 99 /* ThisKeyword */) {
+ if (!isIdentifier() && second !== 100 /* ThisKeyword */) {
return 0 /* False */;
}
switch (nextToken()) {
- case 56 /* ColonToken */:
+ case 57 /* ColonToken */:
// If we have something like "(a:", then we must have a
// type-annotated parameter in an arrow function expression.
return 1 /* True */;
- case 55 /* QuestionToken */:
+ case 56 /* QuestionToken */:
nextToken();
// If we have "(a?:" or "(a?," or "(a?=" or "(a?)" then it is definitely a lambda.
- if (token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || token() === 58 /* EqualsToken */ || token() === 20 /* CloseParenToken */) {
+ if (token() === 57 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 59 /* EqualsToken */ || token() === 21 /* CloseParenToken */) {
return 1 /* True */;
}
// Otherwise it is definitely not a lambda.
return 0 /* False */;
- case 26 /* CommaToken */:
- case 58 /* EqualsToken */:
- case 20 /* CloseParenToken */:
+ case 27 /* CommaToken */:
+ case 59 /* EqualsToken */:
+ case 21 /* CloseParenToken */:
// If we have "(a," or "(a=" or "(a)" this *could* be an arrow function
return 2 /* Unknown */;
}
@@ -18983,7 +19302,7 @@ var ts;
return 0 /* False */;
}
else {
- ts.Debug.assert(first === 27 /* LessThanToken */);
+ ts.Debug.assert(first === 28 /* LessThanToken */);
// If we have "<" not followed by an identifier,
// then this definitely is not an arrow function.
if (!isIdentifier()) {
@@ -18993,17 +19312,17 @@ var ts;
if (sourceFile.languageVariant === 1 /* JSX */) {
var isArrowFunctionInJsx = lookAhead(function () {
var third = nextToken();
- if (third === 85 /* ExtendsKeyword */) {
+ if (third === 86 /* ExtendsKeyword */) {
var fourth = nextToken();
switch (fourth) {
- case 58 /* EqualsToken */:
- case 29 /* GreaterThanToken */:
+ case 59 /* EqualsToken */:
+ case 30 /* GreaterThanToken */:
return false;
default:
return true;
}
}
- else if (third === 26 /* CommaToken */) {
+ else if (third === 27 /* CommaToken */) {
return true;
}
return false;
@@ -19022,7 +19341,7 @@ var ts;
}
function tryParseAsyncSimpleArrowFunctionExpression() {
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
- if (token() === 120 /* AsyncKeyword */) {
+ if (token() === 121 /* AsyncKeyword */) {
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
var asyncModifier = parseModifiersForArrowFunction();
var expr = parseBinaryExpressionOrHigher(/*precedence*/ 0);
@@ -19035,23 +19354,23 @@ var ts;
// AsyncArrowFunctionExpression:
// 1) async[no LineTerminator here]AsyncArrowBindingIdentifier[?Yield][no LineTerminator here]=>AsyncConciseBody[?In]
// 2) CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await][no LineTerminator here]=>AsyncConciseBody[?In]
- if (token() === 120 /* AsyncKeyword */) {
+ if (token() === 121 /* AsyncKeyword */) {
nextToken();
// If the "async" is followed by "=>" token then it is not a beginning of an async arrow-function
// but instead a simple arrow-function which will be parsed inside "parseAssignmentExpressionOrHigher"
- if (scanner.hasPrecedingLineBreak() || token() === 36 /* EqualsGreaterThanToken */) {
+ if (scanner.hasPrecedingLineBreak() || token() === 37 /* EqualsGreaterThanToken */) {
return 0 /* False */;
}
// Check for un-parenthesized AsyncArrowFunction
var expr = parseBinaryExpressionOrHigher(/*precedence*/ 0);
- if (!scanner.hasPrecedingLineBreak() && expr.kind === 71 /* Identifier */ && token() === 36 /* EqualsGreaterThanToken */) {
+ if (!scanner.hasPrecedingLineBreak() && expr.kind === 72 /* Identifier */ && token() === 37 /* EqualsGreaterThanToken */) {
return 1 /* True */;
}
}
return 0 /* False */;
}
function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) {
- var node = createNodeWithJSDoc(195 /* ArrowFunction */);
+ var node = createNodeWithJSDoc(197 /* ArrowFunction */);
node.modifiers = parseModifiersForArrowFunction();
var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */;
// Arrow functions are never generators.
@@ -19061,7 +19380,7 @@ var ts;
// a => (b => c)
// And think that "(b =>" was actually a parenthesized arrow function with a missing
// close paren.
- if (!fillSignature(56 /* ColonToken */, isAsync, node) && !allowAmbiguity) {
+ if (!fillSignature(57 /* ColonToken */, isAsync, node) && !allowAmbiguity) {
return undefined;
}
// Parsing a signature isn't enough.
@@ -19072,19 +19391,19 @@ var ts;
// - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
//
// So we need just a bit of lookahead to ensure that it can only be a signature.
- if (!allowAmbiguity && token() !== 36 /* EqualsGreaterThanToken */ && token() !== 17 /* OpenBraceToken */) {
+ if (!allowAmbiguity && token() !== 37 /* EqualsGreaterThanToken */ && token() !== 18 /* OpenBraceToken */) {
// Returning undefined here will cause our caller to rewind to where we started from.
return undefined;
}
return node;
}
function parseArrowFunctionExpressionBody(isAsync) {
- if (token() === 17 /* OpenBraceToken */) {
+ if (token() === 18 /* OpenBraceToken */) {
return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */);
}
- if (token() !== 25 /* SemicolonToken */ &&
- token() !== 89 /* FunctionKeyword */ &&
- token() !== 75 /* ClassKeyword */ &&
+ if (token() !== 26 /* SemicolonToken */ &&
+ token() !== 90 /* FunctionKeyword */ &&
+ token() !== 76 /* ClassKeyword */ &&
isStartOfStatement() &&
!isStartOfExpressionStatement()) {
// Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations)
@@ -19109,20 +19428,20 @@ var ts;
}
function parseConditionalExpressionRest(leftOperand) {
// Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher.
- var questionToken = parseOptionalToken(55 /* QuestionToken */);
+ var questionToken = parseOptionalToken(56 /* QuestionToken */);
if (!questionToken) {
return leftOperand;
}
// Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and
// we do not that for the 'whenFalse' part.
- var node = createNode(203 /* ConditionalExpression */, leftOperand.pos);
+ var node = createNode(205 /* ConditionalExpression */, leftOperand.pos);
node.condition = leftOperand;
node.questionToken = questionToken;
node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher);
- node.colonToken = parseExpectedToken(56 /* ColonToken */);
+ node.colonToken = parseExpectedToken(57 /* ColonToken */);
node.whenFalse = ts.nodeIsPresent(node.colonToken)
? parseAssignmentExpressionOrHigher()
- : createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */));
+ : createMissingNode(72 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(57 /* ColonToken */));
return finishNode(node);
}
function parseBinaryExpressionOrHigher(precedence) {
@@ -19130,7 +19449,7 @@ var ts;
return parseBinaryExpressionRest(precedence, leftOperand);
}
function isInOrOfKeyword(t) {
- return t === 92 /* InKeyword */ || t === 145 /* OfKeyword */;
+ return t === 93 /* InKeyword */ || t === 147 /* OfKeyword */;
}
function parseBinaryExpressionRest(precedence, leftOperand) {
while (true) {
@@ -19159,16 +19478,16 @@ var ts;
// ^^token; leftOperand = b. Return b ** c to the caller as a rightOperand
// a ** b - c
// ^token; leftOperand = b. Return b to the caller as a rightOperand
- var consumeCurrentOperator = token() === 40 /* AsteriskAsteriskToken */ ?
+ var consumeCurrentOperator = token() === 41 /* AsteriskAsteriskToken */ ?
newPrecedence >= precedence :
newPrecedence > precedence;
if (!consumeCurrentOperator) {
break;
}
- if (token() === 92 /* InKeyword */ && inDisallowInContext()) {
+ if (token() === 93 /* InKeyword */ && inDisallowInContext()) {
break;
}
- if (token() === 118 /* AsKeyword */) {
+ if (token() === 119 /* AsKeyword */) {
// Make sure we *do* perform ASI for constructs like this:
// var x = foo
// as (Bar)
@@ -19189,51 +19508,51 @@ var ts;
return leftOperand;
}
function isBinaryOperator() {
- if (inDisallowInContext() && token() === 92 /* InKeyword */) {
+ if (inDisallowInContext() && token() === 93 /* InKeyword */) {
return false;
}
return ts.getBinaryOperatorPrecedence(token()) > 0;
}
function makeBinaryExpression(left, operatorToken, right) {
- var node = createNode(202 /* BinaryExpression */, left.pos);
+ var node = createNode(204 /* BinaryExpression */, left.pos);
node.left = left;
node.operatorToken = operatorToken;
node.right = right;
return finishNode(node);
}
function makeAsExpression(left, right) {
- var node = createNode(210 /* AsExpression */, left.pos);
+ var node = createNode(212 /* AsExpression */, left.pos);
node.expression = left;
node.type = right;
return finishNode(node);
}
function parsePrefixUnaryExpression() {
- var node = createNode(200 /* PrefixUnaryExpression */);
+ var node = createNode(202 /* PrefixUnaryExpression */);
node.operator = token();
nextToken();
node.operand = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseDeleteExpression() {
- var node = createNode(196 /* DeleteExpression */);
+ var node = createNode(198 /* DeleteExpression */);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseTypeOfExpression() {
- var node = createNode(197 /* TypeOfExpression */);
+ var node = createNode(199 /* TypeOfExpression */);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseVoidExpression() {
- var node = createNode(198 /* VoidExpression */);
+ var node = createNode(200 /* VoidExpression */);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function isAwaitExpression() {
- if (token() === 121 /* AwaitKeyword */) {
+ if (token() === 122 /* AwaitKeyword */) {
if (inAwaitContext()) {
return true;
}
@@ -19243,7 +19562,7 @@ var ts;
return false;
}
function parseAwaitExpression() {
- var node = createNode(199 /* AwaitExpression */);
+ var node = createNode(201 /* AwaitExpression */);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
@@ -19267,7 +19586,7 @@ var ts;
*/
if (isUpdateExpression()) {
var updateExpression = parseUpdateExpression();
- return token() === 40 /* AsteriskAsteriskToken */ ?
+ return token() === 41 /* AsteriskAsteriskToken */ ?
parseBinaryExpressionRest(ts.getBinaryOperatorPrecedence(token()), updateExpression) :
updateExpression;
}
@@ -19284,10 +19603,10 @@ var ts;
*/
var unaryOperator = token();
var simpleUnaryExpression = parseSimpleUnaryExpression();
- if (token() === 40 /* AsteriskAsteriskToken */) {
+ if (token() === 41 /* AsteriskAsteriskToken */) {
var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
var end = simpleUnaryExpression.end;
- if (simpleUnaryExpression.kind === 192 /* TypeAssertionExpression */) {
+ if (simpleUnaryExpression.kind === 194 /* TypeAssertionExpression */) {
parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);
}
else {
@@ -19312,23 +19631,23 @@ var ts;
*/
function parseSimpleUnaryExpression() {
switch (token()) {
- case 37 /* PlusToken */:
- case 38 /* MinusToken */:
- case 52 /* TildeToken */:
- case 51 /* ExclamationToken */:
+ case 38 /* PlusToken */:
+ case 39 /* MinusToken */:
+ case 53 /* TildeToken */:
+ case 52 /* ExclamationToken */:
return parsePrefixUnaryExpression();
- case 80 /* DeleteKeyword */:
+ case 81 /* DeleteKeyword */:
return parseDeleteExpression();
- case 103 /* TypeOfKeyword */:
+ case 104 /* TypeOfKeyword */:
return parseTypeOfExpression();
- case 105 /* VoidKeyword */:
+ case 106 /* VoidKeyword */:
return parseVoidExpression();
- case 27 /* LessThanToken */:
+ case 28 /* LessThanToken */:
// This is modified UnaryExpression grammar in TypeScript
// UnaryExpression (modified):
// < type > UnaryExpression
return parseTypeAssertion();
- case 121 /* AwaitKeyword */:
+ case 122 /* AwaitKeyword */:
if (isAwaitExpression()) {
return parseAwaitExpression();
}
@@ -19351,16 +19670,16 @@ var ts;
// This function is called inside parseUnaryExpression to decide
// whether to call parseSimpleUnaryExpression or call parseUpdateExpression directly
switch (token()) {
- case 37 /* PlusToken */:
- case 38 /* MinusToken */:
- case 52 /* TildeToken */:
- case 51 /* ExclamationToken */:
- case 80 /* DeleteKeyword */:
- case 103 /* TypeOfKeyword */:
- case 105 /* VoidKeyword */:
- case 121 /* AwaitKeyword */:
+ case 38 /* PlusToken */:
+ case 39 /* MinusToken */:
+ case 53 /* TildeToken */:
+ case 52 /* ExclamationToken */:
+ case 81 /* DeleteKeyword */:
+ case 104 /* TypeOfKeyword */:
+ case 106 /* VoidKeyword */:
+ case 122 /* AwaitKeyword */:
return false;
- case 27 /* LessThanToken */:
+ case 28 /* LessThanToken */:
// If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression
if (sourceFile.languageVariant !== 1 /* JSX */) {
return false;
@@ -19383,21 +19702,21 @@ var ts;
* In TypeScript (2), (3) are parsed as PostfixUnaryExpression. (4), (5) are parsed as PrefixUnaryExpression
*/
function parseUpdateExpression() {
- if (token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) {
- var node = createNode(200 /* PrefixUnaryExpression */);
+ if (token() === 44 /* PlusPlusToken */ || token() === 45 /* MinusMinusToken */) {
+ var node = createNode(202 /* PrefixUnaryExpression */);
node.operator = token();
nextToken();
node.operand = parseLeftHandSideExpressionOrHigher();
return finishNode(node);
}
- else if (sourceFile.languageVariant === 1 /* JSX */ && token() === 27 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) {
+ else if (sourceFile.languageVariant === 1 /* JSX */ && token() === 28 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) {
// JSXElement is part of primaryExpression
return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true);
}
var expression = parseLeftHandSideExpressionOrHigher();
ts.Debug.assert(ts.isLeftHandSideExpression(expression));
- if ((token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) {
- var node = createNode(201 /* PostfixUnaryExpression */, expression.pos);
+ if ((token() === 44 /* PlusPlusToken */ || token() === 45 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) {
+ var node = createNode(203 /* PostfixUnaryExpression */, expression.pos);
node.operand = expression;
node.operator = token();
nextToken();
@@ -19438,7 +19757,7 @@ var ts;
// 3)we have a MemberExpression which either completes the LeftHandSideExpression,
// or starts the beginning of the first four CallExpression productions.
var expression;
- if (token() === 91 /* ImportKeyword */) {
+ if (token() === 92 /* ImportKeyword */) {
if (lookAhead(nextTokenIsOpenParenOrLessThan)) {
// We don't want to eagerly consume all import keyword as import call expression so we look ahead to find "("
// For example:
@@ -19453,8 +19772,8 @@ var ts;
var fullStart = scanner.getStartPos();
nextToken(); // advance past the 'import'
nextToken(); // advance past the dot
- var node = createNode(212 /* MetaProperty */, fullStart);
- node.keywordToken = 91 /* ImportKeyword */;
+ var node = createNode(214 /* MetaProperty */, fullStart);
+ node.keywordToken = 92 /* ImportKeyword */;
node.name = parseIdentifierName();
expression = finishNode(node);
sourceFile.flags |= 1048576 /* PossiblyContainsImportMeta */;
@@ -19464,7 +19783,7 @@ var ts;
}
}
else {
- expression = token() === 97 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher();
+ expression = token() === 98 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher();
}
// Now, we *may* be complete. However, we might have consumed the start of a
// CallExpression. As such, we need to consume the rest of it here to be complete.
@@ -19523,22 +19842,22 @@ var ts;
}
function parseSuperExpression() {
var expression = parseTokenNode();
- if (token() === 19 /* OpenParenToken */ || token() === 23 /* DotToken */ || token() === 21 /* OpenBracketToken */) {
+ if (token() === 20 /* OpenParenToken */ || token() === 24 /* DotToken */ || token() === 22 /* OpenBracketToken */) {
return expression;
}
// If we have seen "super" it must be followed by '(' or '.'.
// If it wasn't then just try to parse out a '.' and report an error.
- var node = createNode(187 /* PropertyAccessExpression */, expression.pos);
+ var node = createNode(189 /* PropertyAccessExpression */, expression.pos);
node.expression = expression;
- parseExpectedToken(23 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
+ parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true);
return finishNode(node);
}
function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) {
var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
var result;
- if (opening.kind === 260 /* JsxOpeningElement */) {
- var node = createNode(258 /* JsxElement */, opening.pos);
+ if (opening.kind === 262 /* JsxOpeningElement */) {
+ var node = createNode(260 /* JsxElement */, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement);
node.closingElement = parseJsxClosingElement(inExpressionContext);
@@ -19547,15 +19866,15 @@ var ts;
}
result = finishNode(node);
}
- else if (opening.kind === 263 /* JsxOpeningFragment */) {
- var node = createNode(262 /* JsxFragment */, opening.pos);
+ else if (opening.kind === 265 /* JsxOpeningFragment */) {
+ var node = createNode(264 /* JsxFragment */, opening.pos);
node.openingFragment = opening;
node.children = parseJsxChildren(node.openingFragment);
node.closingFragment = parseJsxClosingFragment(inExpressionContext);
result = finishNode(node);
}
else {
- ts.Debug.assert(opening.kind === 259 /* JsxSelfClosingElement */);
+ ts.Debug.assert(opening.kind === 261 /* JsxSelfClosingElement */);
// Nothing else to do for self-closing elements
result = opening;
}
@@ -19566,15 +19885,15 @@ var ts;
// 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() === 27 /* LessThanToken */) {
+ if (inExpressionContext && token() === 28 /* LessThanToken */) {
var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); });
if (invalidElement) {
parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element);
- var badNode = createNode(202 /* BinaryExpression */, result.pos);
+ var badNode = createNode(204 /* BinaryExpression */, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
- badNode.operatorToken = createMissingNode(26 /* CommaToken */, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined); // TODO: GH#18217
+ badNode.operatorToken = createMissingNode(27 /* CommaToken */, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined); // TODO: GH#18217
badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos;
return badNode;
}
@@ -19582,8 +19901,8 @@ var ts;
return result;
}
function parseJsxText() {
- var node = createNode(10 /* JsxText */);
- node.containsOnlyWhiteSpaces = currentToken === 11 /* JsxTextAllWhiteSpaces */;
+ var node = createNode(11 /* JsxText */);
+ node.containsOnlyWhiteSpaces = currentToken === 12 /* JsxTextAllWhiteSpaces */;
currentToken = scanner.scanJsxToken();
return finishNode(node);
}
@@ -19599,15 +19918,15 @@ var ts;
parseErrorAtRange(openingTag.tagName, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTag.tagName));
}
return undefined;
- case 28 /* LessThanSlashToken */:
+ case 29 /* LessThanSlashToken */:
case 7 /* ConflictMarkerTrivia */:
return undefined;
- case 10 /* JsxText */:
- case 11 /* JsxTextAllWhiteSpaces */:
+ case 11 /* JsxText */:
+ case 12 /* JsxTextAllWhiteSpaces */:
return parseJsxText();
- case 17 /* OpenBraceToken */:
+ case 18 /* OpenBraceToken */:
return parseJsxExpression(/*inExpressionContext*/ false);
- case 27 /* LessThanToken */:
+ case 28 /* LessThanToken */:
return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ false);
default:
return ts.Debug.assertNever(token);
@@ -19628,16 +19947,16 @@ var ts;
return createNodeArray(list, listPos);
}
function parseJsxAttributes() {
- var jsxAttributes = createNode(266 /* JsxAttributes */);
+ var jsxAttributes = createNode(268 /* JsxAttributes */);
jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute);
return finishNode(jsxAttributes);
}
function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) {
var fullStart = scanner.getStartPos();
- parseExpected(27 /* LessThanToken */);
- if (token() === 29 /* GreaterThanToken */) {
+ parseExpected(28 /* LessThanToken */);
+ if (token() === 30 /* GreaterThanToken */) {
// See below for explanation of scanJsxText
- var node_1 = createNode(263 /* JsxOpeningFragment */, fullStart);
+ var node_1 = createNode(265 /* JsxOpeningFragment */, fullStart);
scanJsxText();
return finishNode(node_1);
}
@@ -19645,23 +19964,23 @@ var ts;
var typeArguments = tryParseTypeArguments();
var attributes = parseJsxAttributes();
var node;
- if (token() === 29 /* GreaterThanToken */) {
+ if (token() === 30 /* GreaterThanToken */) {
// Closing tag, so scan the immediately-following text with the JSX scanning instead
// of regular scanning to avoid treating illegal characters (e.g. '#') as immediate
// scanning errors
- node = createNode(260 /* JsxOpeningElement */, fullStart);
+ node = createNode(262 /* JsxOpeningElement */, fullStart);
scanJsxText();
}
else {
- parseExpected(41 /* SlashToken */);
+ parseExpected(42 /* SlashToken */);
if (inExpressionContext) {
- parseExpected(29 /* GreaterThanToken */);
+ parseExpected(30 /* GreaterThanToken */);
}
else {
- parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
+ parseExpected(30 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
scanJsxText();
}
- node = createNode(259 /* JsxSelfClosingElement */, fullStart);
+ node = createNode(261 /* JsxSelfClosingElement */, fullStart);
}
node.tagName = tagName;
node.typeArguments = typeArguments;
@@ -19675,10 +19994,10 @@ var ts;
// primaryExpression in the form of an identifier and "this" keyword
// We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword
// We only want to consider "this" as a primaryExpression
- var expression = token() === 99 /* ThisKeyword */ ?
+ var expression = token() === 100 /* ThisKeyword */ ?
parseTokenNode() : parseIdentifierName();
- while (parseOptional(23 /* DotToken */)) {
- var propertyAccess = createNode(187 /* PropertyAccessExpression */, expression.pos);
+ while (parseOptional(24 /* DotToken */)) {
+ var propertyAccess = createNode(189 /* PropertyAccessExpression */, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true);
expression = finishNode(propertyAccess);
@@ -19686,33 +20005,33 @@ var ts;
return expression;
}
function parseJsxExpression(inExpressionContext) {
- var node = createNode(268 /* JsxExpression */);
- if (!parseExpected(17 /* OpenBraceToken */)) {
+ var node = createNode(270 /* JsxExpression */);
+ if (!parseExpected(18 /* OpenBraceToken */)) {
return undefined;
}
- if (token() !== 18 /* CloseBraceToken */) {
- node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */);
+ if (token() !== 19 /* CloseBraceToken */) {
+ node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */);
node.expression = parseAssignmentExpressionOrHigher();
}
if (inExpressionContext) {
- parseExpected(18 /* CloseBraceToken */);
+ parseExpected(19 /* CloseBraceToken */);
}
else {
- parseExpected(18 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false);
+ parseExpected(19 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false);
scanJsxText();
}
return finishNode(node);
}
function parseJsxAttribute() {
- if (token() === 17 /* OpenBraceToken */) {
+ if (token() === 18 /* OpenBraceToken */) {
return parseJsxSpreadAttribute();
}
scanJsxIdentifier();
- var node = createNode(265 /* JsxAttribute */);
+ var node = createNode(267 /* JsxAttribute */);
node.name = parseIdentifierName();
- if (token() === 58 /* EqualsToken */) {
+ if (token() === 59 /* EqualsToken */) {
switch (scanJsxAttributeValue()) {
- case 9 /* StringLiteral */:
+ case 10 /* StringLiteral */:
node.initializer = parseLiteralNode();
break;
default:
@@ -19723,72 +20042,72 @@ var ts;
return finishNode(node);
}
function parseJsxSpreadAttribute() {
- var node = createNode(267 /* JsxSpreadAttribute */);
- parseExpected(17 /* OpenBraceToken */);
- parseExpected(24 /* DotDotDotToken */);
+ var node = createNode(269 /* JsxSpreadAttribute */);
+ parseExpected(18 /* OpenBraceToken */);
+ parseExpected(25 /* DotDotDotToken */);
node.expression = parseExpression();
- parseExpected(18 /* CloseBraceToken */);
+ parseExpected(19 /* CloseBraceToken */);
return finishNode(node);
}
function parseJsxClosingElement(inExpressionContext) {
- var node = createNode(261 /* JsxClosingElement */);
- parseExpected(28 /* LessThanSlashToken */);
+ var node = createNode(263 /* JsxClosingElement */);
+ parseExpected(29 /* LessThanSlashToken */);
node.tagName = parseJsxElementName();
if (inExpressionContext) {
- parseExpected(29 /* GreaterThanToken */);
+ parseExpected(30 /* GreaterThanToken */);
}
else {
- parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
+ parseExpected(30 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
scanJsxText();
}
return finishNode(node);
}
function parseJsxClosingFragment(inExpressionContext) {
- var node = createNode(264 /* JsxClosingFragment */);
- parseExpected(28 /* LessThanSlashToken */);
+ var node = createNode(266 /* JsxClosingFragment */);
+ parseExpected(29 /* LessThanSlashToken */);
if (ts.tokenIsIdentifierOrKeyword(token())) {
parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
}
if (inExpressionContext) {
- parseExpected(29 /* GreaterThanToken */);
+ parseExpected(30 /* GreaterThanToken */);
}
else {
- parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
+ parseExpected(30 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);
scanJsxText();
}
return finishNode(node);
}
function parseTypeAssertion() {
- var node = createNode(192 /* TypeAssertionExpression */);
- parseExpected(27 /* LessThanToken */);
+ var node = createNode(194 /* TypeAssertionExpression */);
+ parseExpected(28 /* LessThanToken */);
node.type = parseType();
- parseExpected(29 /* GreaterThanToken */);
+ parseExpected(30 /* GreaterThanToken */);
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseMemberExpressionRest(expression) {
while (true) {
- var dotToken = parseOptionalToken(23 /* DotToken */);
+ var dotToken = parseOptionalToken(24 /* DotToken */);
if (dotToken) {
- var propertyAccess = createNode(187 /* PropertyAccessExpression */, expression.pos);
+ var propertyAccess = createNode(189 /* PropertyAccessExpression */, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true);
expression = finishNode(propertyAccess);
continue;
}
- if (token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {
+ if (token() === 52 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {
nextToken();
- var nonNullExpression = createNode(211 /* NonNullExpression */, expression.pos);
+ var nonNullExpression = createNode(213 /* NonNullExpression */, expression.pos);
nonNullExpression.expression = expression;
expression = finishNode(nonNullExpression);
continue;
}
// when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName
- if (!inDecoratorContext() && parseOptional(21 /* OpenBracketToken */)) {
- var indexedAccess = createNode(188 /* ElementAccessExpression */, expression.pos);
+ if (!inDecoratorContext() && parseOptional(22 /* OpenBracketToken */)) {
+ var indexedAccess = createNode(190 /* ElementAccessExpression */, expression.pos);
indexedAccess.expression = expression;
- if (token() === 22 /* CloseBracketToken */) {
- indexedAccess.argumentExpression = createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);
+ if (token() === 23 /* CloseBracketToken */) {
+ indexedAccess.argumentExpression = createMissingNode(72 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);
}
else {
var argument = allowInAnd(parseExpression);
@@ -19797,7 +20116,7 @@ var ts;
}
indexedAccess.argumentExpression = argument;
}
- parseExpected(22 /* CloseBracketToken */);
+ parseExpected(23 /* CloseBracketToken */);
expression = finishNode(indexedAccess);
continue;
}
@@ -19809,13 +20128,13 @@ var ts;
}
}
function isTemplateStartOfTaggedTemplate() {
- return token() === 13 /* NoSubstitutionTemplateLiteral */ || token() === 14 /* TemplateHead */;
+ return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */;
}
function parseTaggedTemplateRest(tag, typeArguments) {
- var tagExpression = createNode(191 /* TaggedTemplateExpression */, tag.pos);
+ var tagExpression = createNode(193 /* TaggedTemplateExpression */, tag.pos);
tagExpression.tag = tag;
tagExpression.typeArguments = typeArguments;
- tagExpression.template = token() === 13 /* NoSubstitutionTemplateLiteral */
+ tagExpression.template = token() === 14 /* NoSubstitutionTemplateLiteral */
? parseLiteralNode()
: parseTemplateExpression();
return finishNode(tagExpression);
@@ -19823,7 +20142,7 @@ var ts;
function parseCallExpressionRest(expression) {
while (true) {
expression = parseMemberExpressionRest(expression);
- if (token() === 27 /* LessThanToken */) {
+ if (token() === 28 /* LessThanToken */) {
// See if this is the start of a generic invocation. If so, consume it and
// keep checking for postfix expressions. Otherwise, it's just a '<' that's
// part of an arithmetic expression. Break out so we consume it higher in the
@@ -19836,15 +20155,15 @@ var ts;
expression = parseTaggedTemplateRest(expression, typeArguments);
continue;
}
- var callExpr = createNode(189 /* CallExpression */, expression.pos);
+ var callExpr = createNode(191 /* CallExpression */, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
continue;
}
- else if (token() === 19 /* OpenParenToken */) {
- var callExpr = createNode(189 /* CallExpression */, expression.pos);
+ else if (token() === 20 /* OpenParenToken */) {
+ var callExpr = createNode(191 /* CallExpression */, expression.pos);
callExpr.expression = expression;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
@@ -19854,17 +20173,17 @@ var ts;
}
}
function parseArgumentList() {
- parseExpected(19 /* OpenParenToken */);
+ parseExpected(20 /* OpenParenToken */);
var result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression);
- parseExpected(20 /* CloseParenToken */);
+ parseExpected(21 /* CloseParenToken */);
return result;
}
function parseTypeArgumentsInExpression() {
- if (!parseOptional(27 /* LessThanToken */)) {
+ if (!parseOptional(28 /* LessThanToken */)) {
return undefined;
}
var typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType);
- if (!parseExpected(29 /* GreaterThanToken */)) {
+ if (!parseExpected(30 /* GreaterThanToken */)) {
// If it doesn't have the closing `>` then it's definitely not an type argument list.
return undefined;
}
@@ -19876,34 +20195,34 @@ var ts;
}
function canFollowTypeArgumentsInExpression() {
switch (token()) {
- case 19 /* OpenParenToken */: // foo(
- case 13 /* NoSubstitutionTemplateLiteral */: // foo `...`
- case 14 /* TemplateHead */: // foo `...${100}...`
+ case 20 /* OpenParenToken */: // foo(
+ case 14 /* NoSubstitutionTemplateLiteral */: // foo `...`
+ case 15 /* TemplateHead */: // foo