From 3c59481a92370f2c11c512f447bef21d6aec8f1f Mon Sep 17 00:00:00 2001 From: Zhengbo Li Date: Thu, 4 Jun 2015 16:06:12 -0700 Subject: [PATCH 01/42] Add missing overloads for texImage2D and texSubImage2D --- src/lib/dom.generated.d.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 5a4151c0c1c..e1f06f11009 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -7677,10 +7677,10 @@ declare var MediaQueryList: { interface MediaSource extends EventTarget { activeSourceBuffers: SourceBufferList; duration: number; - readyState: string; + readyState: number; sourceBuffers: SourceBufferList; addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; + endOfStream(error?: number): void; removeSourceBuffer(sourceBuffer: SourceBuffer): void; } @@ -8409,7 +8409,7 @@ declare var PopStateEvent: { interface Position { coords: Coordinates; - timestamp: Date; + timestamp: number; } declare var Position: { @@ -11090,9 +11090,17 @@ interface WebGLRenderingContext { stencilMaskSeparate(face: number, mask: number): void; stencilOp(fail: number, zfail: number, zpass: number): void; stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; texParameterf(target: number, pname: number, param: number): void; texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; uniform1f(location: WebGLUniformLocation, x: number): void; uniform1fv(location: WebGLUniformLocation, v: any): void; @@ -12332,10 +12340,11 @@ interface DocumentEvent { createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; createEvent(eventInterface:"CloseEvent"): CloseEvent; createEvent(eventInterface:"CommandEvent"): CommandEvent; createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface:"CustomEvent"): CustomEvent; createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface:"DragEvent"): DragEvent; @@ -12358,8 +12367,6 @@ interface DocumentEvent { createEvent(eventInterface:"MouseEvent"): MouseEvent; createEvent(eventInterface:"MouseEvents"): MouseEvent; createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; createEvent(eventInterface:"MutationEvent"): MutationEvent; createEvent(eventInterface:"MutationEvents"): MutationEvent; createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; @@ -12971,4 +12978,4 @@ declare function addEventListener(type: "unload", listener: (ev: Event) => any, declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; \ No newline at end of file +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; From 6f45524b9ff0f35ac75dd7889ee817bcbb14fe50 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 4 Jun 2015 16:35:30 -0700 Subject: [PATCH 02/42] Update LKG --- bin/lib.d.ts | 20 ++++++++++++++------ bin/lib.dom.d.ts | 21 ++++++++++++++------- bin/lib.es6.d.ts | 20 ++++++++++++++------ bin/tsc.js | 13 +++++++++---- bin/tsserver.js | 13 +++++++++---- bin/typescript.js | 18 ++++++++++++++---- bin/typescriptServices.js | 18 ++++++++++++++---- 7 files changed, 88 insertions(+), 35 deletions(-) diff --git a/bin/lib.d.ts b/bin/lib.d.ts index e583f1ac783..4724459e73d 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -11335,10 +11335,10 @@ declare var MediaQueryList: { interface MediaSource extends EventTarget { activeSourceBuffers: SourceBufferList; duration: number; - readyState: string; + readyState: number; sourceBuffers: SourceBufferList; addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; + endOfStream(error?: number): void; removeSourceBuffer(sourceBuffer: SourceBuffer): void; } @@ -12067,7 +12067,7 @@ declare var PopStateEvent: { interface Position { coords: Coordinates; - timestamp: Date; + timestamp: number; } declare var Position: { @@ -14748,9 +14748,17 @@ interface WebGLRenderingContext { stencilMaskSeparate(face: number, mask: number): void; stencilOp(fail: number, zfail: number, zpass: number): void; stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; texParameterf(target: number, pname: number, param: number): void; texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; uniform1f(location: WebGLUniformLocation, x: number): void; uniform1fv(location: WebGLUniformLocation, v: any): void; @@ -15990,10 +15998,11 @@ interface DocumentEvent { createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; createEvent(eventInterface:"CloseEvent"): CloseEvent; createEvent(eventInterface:"CommandEvent"): CommandEvent; createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface:"CustomEvent"): CustomEvent; createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface:"DragEvent"): DragEvent; @@ -16016,8 +16025,6 @@ interface DocumentEvent { createEvent(eventInterface:"MouseEvent"): MouseEvent; createEvent(eventInterface:"MouseEvents"): MouseEvent; createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; createEvent(eventInterface:"MutationEvent"): MutationEvent; createEvent(eventInterface:"MutationEvents"): MutationEvent; createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; @@ -16630,6 +16637,7 @@ declare function addEventListener(type: "volumechange", listener: (ev: Event) => declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + ///////////////////////////// /// WorkerGlobalScope APIs ///////////////////////////// diff --git a/bin/lib.dom.d.ts b/bin/lib.dom.d.ts index 142486a1662..7d83676acc7 100644 --- a/bin/lib.dom.d.ts +++ b/bin/lib.dom.d.ts @@ -10165,10 +10165,10 @@ declare var MediaQueryList: { interface MediaSource extends EventTarget { activeSourceBuffers: SourceBufferList; duration: number; - readyState: string; + readyState: number; sourceBuffers: SourceBufferList; addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; + endOfStream(error?: number): void; removeSourceBuffer(sourceBuffer: SourceBuffer): void; } @@ -10897,7 +10897,7 @@ declare var PopStateEvent: { interface Position { coords: Coordinates; - timestamp: Date; + timestamp: number; } declare var Position: { @@ -13578,9 +13578,17 @@ interface WebGLRenderingContext { stencilMaskSeparate(face: number, mask: number): void; stencilOp(fail: number, zfail: number, zpass: number): void; stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; texParameterf(target: number, pname: number, param: number): void; texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; uniform1f(location: WebGLUniformLocation, x: number): void; uniform1fv(location: WebGLUniformLocation, v: any): void; @@ -14820,10 +14828,11 @@ interface DocumentEvent { createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; createEvent(eventInterface:"CloseEvent"): CloseEvent; createEvent(eventInterface:"CommandEvent"): CommandEvent; createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface:"CustomEvent"): CustomEvent; createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface:"DragEvent"): DragEvent; @@ -14846,8 +14855,6 @@ interface DocumentEvent { createEvent(eventInterface:"MouseEvent"): MouseEvent; createEvent(eventInterface:"MouseEvents"): MouseEvent; createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; createEvent(eventInterface:"MutationEvent"): MutationEvent; createEvent(eventInterface:"MutationEvents"): MutationEvent; createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; @@ -15459,4 +15466,4 @@ declare function addEventListener(type: "unload", listener: (ev: Event) => any, declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; \ No newline at end of file +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; diff --git a/bin/lib.es6.d.ts b/bin/lib.es6.d.ts index d6ca7245140..396361a49f5 100644 --- a/bin/lib.es6.d.ts +++ b/bin/lib.es6.d.ts @@ -12716,10 +12716,10 @@ declare var MediaQueryList: { interface MediaSource extends EventTarget { activeSourceBuffers: SourceBufferList; duration: number; - readyState: string; + readyState: number; sourceBuffers: SourceBufferList; addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; + endOfStream(error?: number): void; removeSourceBuffer(sourceBuffer: SourceBuffer): void; } @@ -13448,7 +13448,7 @@ declare var PopStateEvent: { interface Position { coords: Coordinates; - timestamp: Date; + timestamp: number; } declare var Position: { @@ -16129,9 +16129,17 @@ interface WebGLRenderingContext { stencilMaskSeparate(face: number, mask: number): void; stencilOp(fail: number, zfail: number, zpass: number): void; stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; texParameterf(target: number, pname: number, param: number): void; texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; uniform1f(location: WebGLUniformLocation, x: number): void; uniform1fv(location: WebGLUniformLocation, v: any): void; @@ -17371,10 +17379,11 @@ interface DocumentEvent { createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent; createEvent(eventInterface:"CloseEvent"): CloseEvent; createEvent(eventInterface:"CommandEvent"): CommandEvent; createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface:"CustomEvent"): CustomEvent; createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface:"DragEvent"): DragEvent; @@ -17397,8 +17406,6 @@ interface DocumentEvent { createEvent(eventInterface:"MouseEvent"): MouseEvent; createEvent(eventInterface:"MouseEvents"): MouseEvent; createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; createEvent(eventInterface:"MutationEvent"): MutationEvent; createEvent(eventInterface:"MutationEvents"): MutationEvent; createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; @@ -18011,6 +18018,7 @@ declare function addEventListener(type: "volumechange", listener: (ev: Event) => declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + ///////////////////////////// /// WorkerGlobalScope APIs ///////////////////////////// diff --git a/bin/tsc.js b/bin/tsc.js index a6d28976046..e7a41e8aa7e 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -21533,7 +21533,12 @@ var ts; return result; } function parenthesizeForAccess(expr) { - if (ts.isLeftHandSideExpression(expr) && expr.kind !== 159 && expr.kind !== 7) { + while (expr.kind === 161) { + expr = expr.expression; + } + if (ts.isLeftHandSideExpression(expr) && + expr.kind !== 159 && + expr.kind !== 7) { return expr; } var node = ts.createSynthesizedNode(162); @@ -21740,7 +21745,7 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 164) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 164) { if (node.expression.kind === 161) { var operand = node.expression.expression; while (operand.kind == 161) { @@ -23727,7 +23732,7 @@ var ts; emitDeclarationName(node); write("\", "); emitDeclarationName(node); - write(")"); + write(");"); } emitExportMemberAssignments(node.name); } @@ -23835,7 +23840,7 @@ var ts; emitDeclarationName(node); write("\", "); emitDeclarationName(node); - write(")"); + write(");"); } emitExportMemberAssignments(node.name); } diff --git a/bin/tsserver.js b/bin/tsserver.js index 194f0768196..8536491127d 100644 --- a/bin/tsserver.js +++ b/bin/tsserver.js @@ -21923,7 +21923,12 @@ var ts; return result; } function parenthesizeForAccess(expr) { - if (ts.isLeftHandSideExpression(expr) && expr.kind !== 159 && expr.kind !== 7) { + while (expr.kind === 161) { + expr = expr.expression; + } + if (ts.isLeftHandSideExpression(expr) && + expr.kind !== 159 && + expr.kind !== 7) { return expr; } var node = ts.createSynthesizedNode(162); @@ -22130,7 +22135,7 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 164) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 164) { if (node.expression.kind === 161) { var operand = node.expression.expression; while (operand.kind == 161) { @@ -24117,7 +24122,7 @@ var ts; emitDeclarationName(node); write("\", "); emitDeclarationName(node); - write(")"); + write(");"); } emitExportMemberAssignments(node.name); } @@ -24225,7 +24230,7 @@ var ts; emitDeclarationName(node); write("\", "); emitDeclarationName(node); - write(")"); + write(");"); } emitExportMemberAssignments(node.name); } diff --git a/bin/typescript.js b/bin/typescript.js index dac610e2504..b393f2ee881 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -25628,6 +25628,11 @@ var ts; return result; } function parenthesizeForAccess(expr) { + // When diagnosing whether the expression needs parentheses, the decision should be based + // on the innermost expression in a chain of nested type assertions. + while (expr.kind === 161 /* TypeAssertionExpression */) { + expr = expr.expression; + } // isLeftHandSideExpression is almost the correct criterion for when it is not necessary // to parenthesize the expression before a dot. The known exceptions are: // @@ -25636,7 +25641,9 @@ var ts; // NumberLiteral // 1.x -> not the same as (1).x // - if (ts.isLeftHandSideExpression(expr) && expr.kind !== 159 /* NewExpression */ && expr.kind !== 7 /* NumericLiteral */) { + if (ts.isLeftHandSideExpression(expr) && + expr.kind !== 159 /* NewExpression */ && + expr.kind !== 7 /* NumericLiteral */) { return expr; } var node = ts.createSynthesizedNode(162 /* ParenthesizedExpression */); @@ -25867,7 +25874,10 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 164 /* ArrowFunction */) { + // If the node is synthesized, it means the emitter put the parentheses there, + // not the user. If we didn't want them, the emitter would not have put them + // there. + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 164 /* ArrowFunction */) { if (node.expression.kind === 161 /* TypeAssertionExpression */) { var operand = node.expression.expression; // Make sure we consider all nested cast expressions, e.g.: @@ -28149,7 +28159,7 @@ var ts; emitDeclarationName(node); write("\", "); emitDeclarationName(node); - write(")"); + write(");"); } emitExportMemberAssignments(node.name); } @@ -28259,7 +28269,7 @@ var ts; emitDeclarationName(node); write("\", "); emitDeclarationName(node); - write(")"); + write(");"); } emitExportMemberAssignments(node.name); } diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index dac610e2504..b393f2ee881 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -25628,6 +25628,11 @@ var ts; return result; } function parenthesizeForAccess(expr) { + // When diagnosing whether the expression needs parentheses, the decision should be based + // on the innermost expression in a chain of nested type assertions. + while (expr.kind === 161 /* TypeAssertionExpression */) { + expr = expr.expression; + } // isLeftHandSideExpression is almost the correct criterion for when it is not necessary // to parenthesize the expression before a dot. The known exceptions are: // @@ -25636,7 +25641,9 @@ var ts; // NumberLiteral // 1.x -> not the same as (1).x // - if (ts.isLeftHandSideExpression(expr) && expr.kind !== 159 /* NewExpression */ && expr.kind !== 7 /* NumericLiteral */) { + if (ts.isLeftHandSideExpression(expr) && + expr.kind !== 159 /* NewExpression */ && + expr.kind !== 7 /* NumericLiteral */) { return expr; } var node = ts.createSynthesizedNode(162 /* ParenthesizedExpression */); @@ -25867,7 +25874,10 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 164 /* ArrowFunction */) { + // If the node is synthesized, it means the emitter put the parentheses there, + // not the user. If we didn't want them, the emitter would not have put them + // there. + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 164 /* ArrowFunction */) { if (node.expression.kind === 161 /* TypeAssertionExpression */) { var operand = node.expression.expression; // Make sure we consider all nested cast expressions, e.g.: @@ -28149,7 +28159,7 @@ var ts; emitDeclarationName(node); write("\", "); emitDeclarationName(node); - write(")"); + write(");"); } emitExportMemberAssignments(node.name); } @@ -28259,7 +28269,7 @@ var ts; emitDeclarationName(node); write("\", "); emitDeclarationName(node); - write(")"); + write(");"); } emitExportMemberAssignments(node.name); } From 7c8a50336d6c1bb56d0daef91cf52d05fc12ff56 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 3 Jun 2015 14:55:42 -0700 Subject: [PATCH 03/42] emit module name for system modules, add moduleName argument to 'transpile' function Conflicts: src/services/services.ts --- src/compiler/emitter.ts | 10 +++++++--- src/compiler/parser.ts | 2 +- src/compiler/types.ts | 2 +- src/services/services.ts | 7 +++++-- .../baselines/reference/systemModule12.errors.txt | 10 ++++++++++ tests/baselines/reference/systemModule12.js | 14 ++++++++++++++ tests/cases/compiler/systemModule12.ts | 5 +++++ 7 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/systemModule12.errors.txt create mode 100644 tests/baselines/reference/systemModule12.js create mode 100644 tests/cases/compiler/systemModule12.ts diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 165f0da5cfd..7d0a29f9e26 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -5477,7 +5477,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { Debug.assert(!exportFunctionForFile); // make sure that name of 'exports' function does not conflict with existing identifiers exportFunctionForFile = makeUniqueName("exports"); - write("System.register(["); + write("System.register("); + if (node.moduleName) { + write(`"${node.moduleName}", `); + } + write("[") for (let i = 0; i < externalImports.length; ++i) { let text = getExternalModuleNameText(externalImports[i]); if (i !== 0) { @@ -5563,8 +5567,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { writeLine(); write("define("); - if (node.amdModuleName) { - write("\"" + node.amdModuleName + "\", "); + if (node.moduleName) { + write("\"" + node.moduleName + "\", "); } emitAMDDependencies(node, /*includeNonAmdDependencies*/ true); write(") {"); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 055fc1b6f74..07da065c1ae 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4820,7 +4820,7 @@ module ts { sourceFile.referencedFiles = referencedFiles; sourceFile.amdDependencies = amdDependencies; - sourceFile.amdModuleName = amdModuleName; + sourceFile.moduleName = amdModuleName; } function setExternalModuleIndicator(sourceFile: SourceFile) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 1db5e57d298..1a72e9fc94a 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1001,7 +1001,7 @@ module ts { text: string; amdDependencies: {path: string; name: string}[]; - amdModuleName: string; + moduleName: string; referencedFiles: FileReference[]; hasNoDefaultLib: boolean; diff --git a/src/services/services.ts b/src/services/services.ts index 6a497c87307..ece411ae1ea 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -735,7 +735,7 @@ module ts { public endOfFileToken: Node; public amdDependencies: { name: string; path: string }[]; - public amdModuleName: string; + public moduleName: string; public referencedFiles: FileReference[]; public syntacticDiagnostics: Diagnostic[]; @@ -1766,7 +1766,7 @@ module ts { * - noLib = true * - noResolve = true */ - export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string { + export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string { let options = compilerOptions ? clone(compilerOptions) : getDefaultCompilerOptions(); options.isolatedModules = true; @@ -1785,6 +1785,9 @@ module ts { // Parse let inputFileName = fileName || "module.ts"; let sourceFile = createSourceFile(inputFileName, input, options.target); + if (moduleName) { + sourceFile.moduleName = moduleName; + } // Store syntactic diagnostics if (diagnostics && sourceFile.parseDiagnostics) { diff --git a/tests/baselines/reference/systemModule12.errors.txt b/tests/baselines/reference/systemModule12.errors.txt new file mode 100644 index 00000000000..5c89e2e65d6 --- /dev/null +++ b/tests/baselines/reference/systemModule12.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/systemModule12.ts(3,15): error TS2307: Cannot find module 'file1'. + + +==== tests/cases/compiler/systemModule12.ts (1 errors) ==== + + /// + import n from 'file1' + ~~~~~~~ +!!! error TS2307: Cannot find module 'file1'. + \ No newline at end of file diff --git a/tests/baselines/reference/systemModule12.js b/tests/baselines/reference/systemModule12.js new file mode 100644 index 00000000000..0b5f5a3e850 --- /dev/null +++ b/tests/baselines/reference/systemModule12.js @@ -0,0 +1,14 @@ +//// [systemModule12.ts] + +/// +import n from 'file1' + + +//// [systemModule12.js] +System.register("NamedModule", [], function(exports_1) { + return { + setters:[], + execute: function() { + } + } +}); diff --git a/tests/cases/compiler/systemModule12.ts b/tests/cases/compiler/systemModule12.ts new file mode 100644 index 00000000000..690fabc0a28 --- /dev/null +++ b/tests/cases/compiler/systemModule12.ts @@ -0,0 +1,5 @@ +// @module: system +// @isolatedModules: true + +/// +import n from 'file1' From 3c630aa247e079af94a6dd045a7d07cad7cb2b26 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 4 Jun 2015 22:22:25 -0700 Subject: [PATCH 04/42] added tests --- tests/cases/unittests/transpile.ts | 33 +++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/tests/cases/unittests/transpile.ts b/tests/cases/unittests/transpile.ts index c906c03a9e0..7aa9106880b 100644 --- a/tests/cases/unittests/transpile.ts +++ b/tests/cases/unittests/transpile.ts @@ -3,9 +3,9 @@ module ts { describe("Transpile", () => { - function runTest(input: string, compilerOptions: ts.CompilerOptions = {}, expectedOutput?: string, expectedDiagnosticCodes: number[] = []): void { + function runTest(input: string, compilerOptions: ts.CompilerOptions = {}, moduleName?: string, expectedOutput?: string, expectedDiagnosticCodes: number[] = []): void { let diagnostics: Diagnostic[] = []; - let result = transpile(input, compilerOptions, "file.ts", diagnostics); + let result = transpile(input, compilerOptions, "file.ts", diagnostics, moduleName); for (let i = 0; i < expectedDiagnosticCodes.length; i++) { assert.equal(expectedDiagnosticCodes[i], diagnostics[i] && diagnostics[i].code, `Could not find expeced diagnostic.`); @@ -19,41 +19,54 @@ module ts { it("Generates correct compilerOptions diagnostics", () => { // Expecting 5047: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." - runTest(`var x = 0;`, {}, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ [5047]); + runTest(`var x = 0;`, {}, /*moduleName*/undefined, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ [5047]); }); it("Generates no diagnostics with valid inputs", () => { // No errors - runTest(`var x = 0;`, { module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []); + runTest(`var x = 0;`, { module: ModuleKind.CommonJS }, /*moduleName*/undefined, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []); }); it("Generates no diagnostics for missing file references", () => { runTest(`/// var x = 0;`, - { module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []); + { module: ModuleKind.CommonJS }, /*moduleName*/undefined, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []); }); it("Generates no diagnostics for missing module imports", () => { runTest(`import {a} from "module2";`, - { module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []); + { module: ModuleKind.CommonJS }, /*moduleName*/undefined, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []); }); it("Generates expected syntactic diagnostics", () => { runTest(`a b`, - { module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ [1005]); /// 1005: ';' Expected + { module: ModuleKind.CommonJS }, /*moduleName*/undefined, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ [1005]); /// 1005: ';' Expected }); it("Does not generate semantic diagnostics", () => { runTest(`var x: string = 0;`, - { module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []); + { module: ModuleKind.CommonJS }, /*moduleName*/undefined, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []); }); it("Generates module output", () => { - runTest(`var x = 0;`, { module: ModuleKind.AMD }, `define(["require", "exports"], function (require, exports) {\r\n var x = 0;\r\n});\r\n`); + runTest(`var x = 0;`, { module: ModuleKind.AMD }, /*moduleName*/undefined, `define(["require", "exports"], function (require, exports) {\r\n var x = 0;\r\n});\r\n`); }); it("Uses correct newLine character", () => { - runTest(`var x = 0;`, { module: ModuleKind.CommonJS, newLine: NewLineKind.LineFeed }, `var x = 0;\n`, /*expectedDiagnosticCodes*/ []); + runTest(`var x = 0;`, { module: ModuleKind.CommonJS, newLine: NewLineKind.LineFeed }, /*moduleName*/undefined, `var x = 0;\n`, /*expectedDiagnosticCodes*/ []); + }); + + it("Sets module name", () => { + let output = + `System.register("NamedModule", [], function(exports_1) {\n var x;\n` + + ` return {\n` + + ` setters:[],\n` + + ` execute: function() {\n` + + ` var x = 1;\n` + + ` }\n` + + ` }\n` + + `});\n`; + runTest("var x = 1;", { module: ModuleKind.System, newLine: NewLineKind.LineFeed }, "NamedModule", output) }); }); } From 26a1ed60171236ea9af4dcc2991537d134eb3164 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 8 Jun 2015 18:31:56 -0700 Subject: [PATCH 05/42] move temp declarations out of object literal --- src/compiler/emitter.ts | 2 +- tests/baselines/reference/systemModule8.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 165f0da5cfd..5919e62633a 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -5327,10 +5327,10 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { emitSetters(exportStarFunction); writeLine(); emitExecute(node, startIndex); - emitTempDeclarations(/*newLine*/ true) decreaseIndent(); writeLine(); write("}"); // return + emitTempDeclarations(/*newLine*/ true) } function emitSetters(exportStarFunction: string) { diff --git a/tests/baselines/reference/systemModule8.js b/tests/baselines/reference/systemModule8.js index 578814d0ab2..14f7a4c6fbe 100644 --- a/tests/baselines/reference/systemModule8.js +++ b/tests/baselines/reference/systemModule8.js @@ -66,6 +66,6 @@ System.register([], function(exports_1) { exports_1("x", x = _b[_i][0]); } } - var _a; } + var _a; }); From 185b2aff088b0c8ad0bf6b04b7511f0bbd5ed146 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 8 Jun 2015 22:46:59 -0700 Subject: [PATCH 06/42] added missing semicolon --- src/compiler/emitter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 5919e62633a..857a5404524 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -5330,7 +5330,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { decreaseIndent(); writeLine(); write("}"); // return - emitTempDeclarations(/*newLine*/ true) + emitTempDeclarations(/*newLine*/ true); } function emitSetters(exportStarFunction: string) { From d0763060c9c837d6c3a235e58271313e54cb3146 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 10 Jun 2015 12:32:24 -0700 Subject: [PATCH 07/42] added more tests --- tests/baselines/reference/systemModule13.js | 21 ++++++++++++ .../reference/systemModule13.symbols | 17 ++++++++++ .../baselines/reference/systemModule13.types | 32 +++++++++++++++++++ tests/cases/compiler/systemModule13.ts | 5 +++ 4 files changed, 75 insertions(+) create mode 100644 tests/baselines/reference/systemModule13.js create mode 100644 tests/baselines/reference/systemModule13.symbols create mode 100644 tests/baselines/reference/systemModule13.types create mode 100644 tests/cases/compiler/systemModule13.ts diff --git a/tests/baselines/reference/systemModule13.js b/tests/baselines/reference/systemModule13.js new file mode 100644 index 00000000000..c66e123c738 --- /dev/null +++ b/tests/baselines/reference/systemModule13.js @@ -0,0 +1,21 @@ +//// [systemModule13.ts] + +export let [x,y,z] = [1, 2, 3]; +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +for ([x] of [[1]]) {} + +//// [systemModule13.js] +System.register([], function(exports_1) { + var x, y, z, z0, z1; + return { + setters:[], + execute: function() { + _a = [1, 2, 3], exports_1("x", x = _a[0]), exports_1("y", y = _a[1]), exports_1("z", z = _a[2]); + _b = { a: true, b: { c: "123" } }, exports_1("z0", z0 = _b.a), exports_1("z1", z1 = _b.b.c); + for (var _i = 0, _c = [[1]]; _i < _c.length; _i++) { + exports_1("x", x = _c[_i][0]); + } + } + } + var _a, _b; +}); diff --git a/tests/baselines/reference/systemModule13.symbols b/tests/baselines/reference/systemModule13.symbols new file mode 100644 index 00000000000..d9e64335c2b --- /dev/null +++ b/tests/baselines/reference/systemModule13.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/systemModule13.ts === + +export let [x,y,z] = [1, 2, 3]; +>x : Symbol(x, Decl(systemModule13.ts, 1, 12)) +>y : Symbol(y, Decl(systemModule13.ts, 1, 14)) +>z : Symbol(z, Decl(systemModule13.ts, 1, 16)) + +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +>z0 : Symbol(z0, Decl(systemModule13.ts, 2, 14)) +>z1 : Symbol(z1, Decl(systemModule13.ts, 2, 25)) +>a : Symbol(a, Decl(systemModule13.ts, 2, 36)) +>b : Symbol(b, Decl(systemModule13.ts, 2, 44)) +>c : Symbol(c, Decl(systemModule13.ts, 2, 49)) + +for ([x] of [[1]]) {} +>x : Symbol(x, Decl(systemModule13.ts, 1, 12)) + diff --git a/tests/baselines/reference/systemModule13.types b/tests/baselines/reference/systemModule13.types new file mode 100644 index 00000000000..35f22be98b8 --- /dev/null +++ b/tests/baselines/reference/systemModule13.types @@ -0,0 +1,32 @@ +=== tests/cases/compiler/systemModule13.ts === + +export let [x,y,z] = [1, 2, 3]; +>x : number +>y : number +>z : number +>[1, 2, 3] : [number, number, number] +>1 : number +>2 : number +>3 : number + +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +>a : any +>z0 : boolean +>b : any +>c : any +>z1 : string +>{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } +>a : boolean +>true : boolean +>b : { c: string; } +>{c: "123"} : { c: string; } +>c : string +>"123" : string + +for ([x] of [[1]]) {} +>[x] : number[] +>x : number +>[[1]] : number[][] +>[1] : number[] +>1 : number + diff --git a/tests/cases/compiler/systemModule13.ts b/tests/cases/compiler/systemModule13.ts new file mode 100644 index 00000000000..2f92d99ab21 --- /dev/null +++ b/tests/cases/compiler/systemModule13.ts @@ -0,0 +1,5 @@ +// @module: system + +export let [x,y,z] = [1, 2, 3]; +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +for ([x] of [[1]]) {} \ No newline at end of file From 25c093673cceb508a4d7f855754c0b9006a0e5f8 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 3 Jun 2015 13:48:34 -0700 Subject: [PATCH 08/42] introduce FileMap to store mappings with filenames as keys --- src/compiler/core.ts | 32 +++++++++++++++++++++++ src/compiler/program.ts | 17 ++++++------ src/services/services.ts | 56 +++++++++++++++++++++------------------- src/services/shims.ts | 10 ++++++- 4 files changed, 80 insertions(+), 35 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index c753f7ff42d..bba10a635e4 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -15,6 +15,38 @@ module ts { True = -1 } + export class FileMap { + private files: Map = {}; + + constructor(private getCanonicalFileName: (fileName: string) => string) { + } + + public set(fileName: string, value: T) { + this.files[this.normalizeKey(fileName)] = value; + } + + public get(fileName: string) { + return this.files[this.normalizeKey(fileName)]; + } + + public contains(fileName: string) { + return hasProperty(this.files, this.normalizeKey(fileName)); + } + + public delete(fileName: string) { + let key = this.normalizeKey(fileName); + delete this.files[key]; + } + + public forEachValue(f: (value: T) => void) { + forEachValue(this.files, f); + } + + private normalizeKey(key: string) { + return this.getCanonicalFileName(normalizeSlashes(key)); + } + } + export const enum Comparison { LessThan = -1, EqualTo = 0, diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 0af94b3d854..fa794bbb77e 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -143,7 +143,6 @@ module ts { export function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program { let program: Program; let files: SourceFile[] = []; - let filesByName: Map = {}; let diagnostics = createDiagnosticCollection(); let seenNoDefaultLib = options.noLib; let commonSourceDirectory: string; @@ -153,6 +152,8 @@ module ts { let start = new Date().getTime(); host = host || createCompilerHost(options); + let filesByName: FileMap = new FileMap(host.getCanonicalFileName); + forEach(rootNames, name => processRootFile(name, false)); if (!seenNoDefaultLib) { processRootFile(host.getDefaultLibFileName(options), true); @@ -233,8 +234,7 @@ module ts { } function getSourceFile(fileName: string) { - fileName = host.getCanonicalFileName(normalizeSlashes(fileName)); - return hasProperty(filesByName, fileName) ? filesByName[fileName] : undefined; + return filesByName.get(fileName); } function getDiagnosticsHelper(sourceFile: SourceFile, getDiagnostics: (sourceFile: SourceFile) => Diagnostic[]): Diagnostic[] { @@ -352,19 +352,19 @@ module ts { // Get source file from normalized fileName function findSourceFile(fileName: string, isDefaultLib: boolean, refFile?: SourceFile, refStart?: number, refLength?: number): SourceFile { let canonicalName = host.getCanonicalFileName(normalizeSlashes(fileName)); - if (hasProperty(filesByName, canonicalName)) { + if (filesByName.contains(canonicalName)) { // We've already looked for this file, use cached result return getSourceFileFromCache(fileName, canonicalName, /*useAbsolutePath*/ false); } else { let normalizedAbsolutePath = getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); let canonicalAbsolutePath = host.getCanonicalFileName(normalizedAbsolutePath); - if (hasProperty(filesByName, canonicalAbsolutePath)) { + if (filesByName.contains(canonicalAbsolutePath)) { return getSourceFileFromCache(normalizedAbsolutePath, canonicalAbsolutePath, /*useAbsolutePath*/ true); } // We haven't looked for this file, do so now and cache result - let file = filesByName[canonicalName] = host.getSourceFile(fileName, options.target, hostErrorMessage => { + let file = host.getSourceFile(fileName, options.target, hostErrorMessage => { if (refFile) { diagnostics.add(createFileDiagnostic(refFile, refStart, refLength, Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); @@ -373,11 +373,12 @@ module ts { diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); } }); + filesByName.set(canonicalName, file); if (file) { seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; // Set the source file for normalized absolute path - filesByName[canonicalAbsolutePath] = file; + filesByName.set(canonicalAbsolutePath, file); if (!options.noResolve) { let basePath = getDirectoryPath(fileName); @@ -396,7 +397,7 @@ module ts { } function getSourceFileFromCache(fileName: string, canonicalName: string, useAbsolutePath: boolean): SourceFile { - let file = filesByName[canonicalName]; + let file = filesByName.get(canonicalName); if (file && host.useCaseSensitiveFileNames()) { let sourceFileName = useAbsolutePath ? getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; if (canonicalName !== sourceFileName) { diff --git a/src/services/services.ts b/src/services/services.ts index ece411ae1ea..b6f95c2f13a 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -960,6 +960,7 @@ module ts { log? (s: string): void; trace? (s: string): void; error? (s: string): void; + useCaseSensitiveFileNames? (): boolean; } // @@ -1630,12 +1631,12 @@ module ts { // at each language service public entry point, since we don't know when // set of scripts handled by the host changes. class HostCache { - private fileNameToEntry: Map; + private fileNameToEntry: FileMap; private _compilationSettings: CompilerOptions; - constructor(private host: LanguageServiceHost, private getCanonicalFileName: (fileName: string) => string) { + constructor(private host: LanguageServiceHost, getCanonicalFileName: (fileName: string) => string) { // script id => script index - this.fileNameToEntry = {}; + this.fileNameToEntry = new FileMap(getCanonicalFileName); // Initialize the list with the root file names let rootFileNames = host.getScriptFileNames(); @@ -1651,10 +1652,6 @@ module ts { return this._compilationSettings; } - private normalizeFileName(fileName: string): string { - return this.getCanonicalFileName(normalizeSlashes(fileName)); - } - private createEntry(fileName: string) { let entry: HostFileInformation; let scriptSnapshot = this.host.getScriptSnapshot(fileName); @@ -1666,15 +1663,16 @@ module ts { }; } - return this.fileNameToEntry[this.normalizeFileName(fileName)] = entry; + this.fileNameToEntry.set(fileName, entry); + return entry; } private getEntry(fileName: string): HostFileInformation { - return lookUp(this.fileNameToEntry, this.normalizeFileName(fileName)); + return this.fileNameToEntry.get(fileName); } private contains(fileName: string): boolean { - return hasProperty(this.fileNameToEntry, this.normalizeFileName(fileName)); + return this.fileNameToEntry.contains(fileName); } public getOrCreateEntry(fileName: string): HostFileInformation { @@ -1688,10 +1686,9 @@ module ts { public getRootFileNames(): string[] { let fileNames: string[] = []; - forEachKey(this.fileNameToEntry, key => { - let entry = this.getEntry(key); - if (entry) { - fileNames.push(entry.hostFileName); + this.fileNameToEntry.forEachValue(value => { + if (value) { + fileNames.push(value.hostFileName); } }); @@ -1885,20 +1882,28 @@ module ts { return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents:*/ true); } - export function createDocumentRegistry(): DocumentRegistry { + function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string { + return useCaseSensitivefileNames + ? ((fileName) => fileName) + : ((fileName) => fileName.toLowerCase()); + } + + + export function createDocumentRegistry(useCaseSensitiveFileNames?: boolean): DocumentRegistry { // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have // for those settings. - let buckets: Map> = {}; + let buckets: Map> = {}; + let getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames || false); function getKeyFromCompilationSettings(settings: CompilerOptions): string { return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString() } - function getBucketForCompilationSettings(settings: CompilerOptions, createIfMissing: boolean): Map { + function getBucketForCompilationSettings(settings: CompilerOptions, createIfMissing: boolean): FileMap { let key = getKeyFromCompilationSettings(settings); let bucket = lookUp(buckets, key); if (!bucket && createIfMissing) { - buckets[key] = bucket = {}; + buckets[key] = bucket = new FileMap(getCanonicalFileName); } return bucket; } @@ -1908,7 +1913,7 @@ module ts { let entries = lookUp(buckets, name); let sourceFiles: { name: string; refCount: number; references: string[]; }[] = []; for (let i in entries) { - let entry = entries[i]; + let entry = entries.get(i); sourceFiles.push({ name: i, refCount: entry.languageServiceRefCount, @@ -1940,18 +1945,19 @@ module ts { acquiring: boolean): SourceFile { let bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ true); - let entry = lookUp(bucket, fileName); + let entry = bucket.get(fileName); if (!entry) { Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?"); // Have never seen this file with these settings. Create a new source file for it. let sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents:*/ false); - bucket[fileName] = entry = { + entry = { sourceFile: sourceFile, languageServiceRefCount: 0, owners: [] }; + bucket.set(fileName, entry); } else { // We have an entry for this file. However, it may be for a different version of @@ -1979,12 +1985,12 @@ module ts { let bucket = getBucketForCompilationSettings(compilationSettings, false); Debug.assert(bucket !== undefined); - let entry = lookUp(bucket, fileName); + let entry = bucket.get(fileName); entry.languageServiceRefCount--; Debug.assert(entry.languageServiceRefCount >= 0); if (entry.languageServiceRefCount === 0) { - delete bucket[fileName]; + bucket.delete(fileName); } } @@ -2412,9 +2418,7 @@ module ts { } } - function getCanonicalFileName(fileName: string) { - return useCaseSensitivefileNames ? fileName : fileName.toLowerCase(); - } + let getCanonicalFileName = createGetCanonicalFileName(useCaseSensitivefileNames); function getValidSourceFile(fileName: string): SourceFile { fileName = normalizeSlashes(fileName); diff --git a/src/services/shims.ts b/src/services/shims.ts index d3f59737538..4dfab444cde 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -56,6 +56,7 @@ module ts { getDefaultLibFileName(options: string): string; getNewLine?(): string; getProjectVersion?(): string; + useCaseSensitiveFileNames?(): boolean; } /** Public interface of the the of a config service shim instance.*/ @@ -270,6 +271,10 @@ module ts { return this.shimHost.getProjectVersion(); } + public useCaseSensitiveFileNames(): boolean { + return this.shimHost.useCaseSensitiveFileNames && this.useCaseSensitiveFileNames(); + } + public getCompilationSettings(): CompilerOptions { var settingsJson = this.shimHost.getCompilationSettings(); if (settingsJson == null || settingsJson == "") { @@ -909,7 +914,7 @@ module ts { export class TypeScriptServicesFactory implements ShimFactory { private _shims: Shim[] = []; - private documentRegistry: DocumentRegistry = createDocumentRegistry(); + private documentRegistry: DocumentRegistry; /* * Returns script API version. @@ -920,6 +925,9 @@ module ts { public createLanguageServiceShim(host: LanguageServiceShimHost): LanguageServiceShim { try { + if (this.documentRegistry === undefined) { + this.documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + } var hostAdapter = new LanguageServiceShimHostAdapter(host); var languageService = createLanguageService(hostAdapter, this.documentRegistry); return new LanguageServiceShimObject(this, host, languageService); From b4f1df2afa039e3c31fd833a2483de5124cb4f90 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 3 Jun 2015 15:22:17 -0700 Subject: [PATCH 09/42] address PR feedback --- src/compiler/core.ts | 38 +++++++++++++++++++++----------------- src/compiler/program.ts | 2 +- src/compiler/types.ts | 8 ++++++++ src/services/services.ts | 6 +++--- src/services/shims.ts | 2 +- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index bba10a635e4..1f04f9968ca 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -15,35 +15,39 @@ module ts { True = -1 } - export class FileMap { - private files: Map = {}; - - constructor(private getCanonicalFileName: (fileName: string) => string) { + export function createFileMap(getCanonicalFileName: (fileName: string) => string): FileMap { + let files: Map = {}; + return { + get, + set, + contains, + delete: deleteItem, + forEachValue: forEachValueInMap } - public set(fileName: string, value: T) { - this.files[this.normalizeKey(fileName)] = value; + function set(fileName: string, value: T) { + files[normalizeKey(fileName)] = value; } - public get(fileName: string) { - return this.files[this.normalizeKey(fileName)]; + function get(fileName: string) { + return files[normalizeKey(fileName)]; } - public contains(fileName: string) { - return hasProperty(this.files, this.normalizeKey(fileName)); + function contains(fileName: string) { + return hasProperty(files, normalizeKey(fileName)); } - public delete(fileName: string) { - let key = this.normalizeKey(fileName); - delete this.files[key]; + function deleteItem (fileName: string) { + let key = normalizeKey(fileName); + delete files[key]; } - public forEachValue(f: (value: T) => void) { - forEachValue(this.files, f); + function forEachValueInMap(f: (value: T) => void) { + forEachValue(files, f); } - private normalizeKey(key: string) { - return this.getCanonicalFileName(normalizeSlashes(key)); + function normalizeKey(key: string) { + return getCanonicalFileName(normalizeSlashes(key)); } } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index fa794bbb77e..5c40230484a 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -152,7 +152,7 @@ module ts { let start = new Date().getTime(); host = host || createCompilerHost(options); - let filesByName: FileMap = new FileMap(host.getCanonicalFileName); + let filesByName = createFileMap(host.getCanonicalFileName); forEach(rootNames, name => processRootFile(name, false)); if (!seenNoDefaultLib) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 1a72e9fc94a..c3ce9d44ae3 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3,6 +3,14 @@ module ts { [index: string]: T; } + export interface FileMap { + get(fileName: string): T; + set(fileName: string, value: T): void; + contains(fileName: string): boolean; + delete(fileName: string): void; + forEachValue(f: (v: T) => void): void; + } + export interface TextRange { pos: number; end: number; diff --git a/src/services/services.ts b/src/services/services.ts index b6f95c2f13a..2329eeb2e83 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1636,7 +1636,7 @@ module ts { constructor(private host: LanguageServiceHost, getCanonicalFileName: (fileName: string) => string) { // script id => script index - this.fileNameToEntry = new FileMap(getCanonicalFileName); + this.fileNameToEntry = createFileMap(getCanonicalFileName); // Initialize the list with the root file names let rootFileNames = host.getScriptFileNames(); @@ -1893,7 +1893,7 @@ module ts { // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have // for those settings. let buckets: Map> = {}; - let getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames || false); + let getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); function getKeyFromCompilationSettings(settings: CompilerOptions): string { return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString() @@ -1903,7 +1903,7 @@ module ts { let key = getKeyFromCompilationSettings(settings); let bucket = lookUp(buckets, key); if (!bucket && createIfMissing) { - buckets[key] = bucket = new FileMap(getCanonicalFileName); + buckets[key] = bucket = createFileMap(getCanonicalFileName); } return bucket; } diff --git a/src/services/shims.ts b/src/services/shims.ts index 4dfab444cde..004393fb3b5 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -272,7 +272,7 @@ module ts { } public useCaseSensitiveFileNames(): boolean { - return this.shimHost.useCaseSensitiveFileNames && this.useCaseSensitiveFileNames(); + return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false; } public getCompilationSettings(): CompilerOptions { From 522248a042cd08594a2de4e0475c0f72f4bf9ba1 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 4 Jun 2015 11:18:05 -0700 Subject: [PATCH 10/42] rename 'FileMap.delete' to 'FileMap.remove' --- src/compiler/core.ts | 4 ++-- src/compiler/types.ts | 2 +- src/services/services.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 1f04f9968ca..d9a1fc5368a 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -21,7 +21,7 @@ module ts { get, set, contains, - delete: deleteItem, + remove, forEachValue: forEachValueInMap } @@ -37,7 +37,7 @@ module ts { return hasProperty(files, normalizeKey(fileName)); } - function deleteItem (fileName: string) { + function remove (fileName: string) { let key = normalizeKey(fileName); delete files[key]; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c3ce9d44ae3..e1f565969d8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -7,7 +7,7 @@ module ts { get(fileName: string): T; set(fileName: string, value: T): void; contains(fileName: string): boolean; - delete(fileName: string): void; + remove(fileName: string): void; forEachValue(f: (v: T) => void): void; } diff --git a/src/services/services.ts b/src/services/services.ts index 2329eeb2e83..521c6db155a 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1990,7 +1990,7 @@ module ts { Debug.assert(entry.languageServiceRefCount >= 0); if (entry.languageServiceRefCount === 0) { - bucket.delete(fileName); + bucket.remove(fileName); } } From ab1512fb1360a33007c891ddc2030b1f507041bc Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 9 Jun 2015 17:00:35 -0700 Subject: [PATCH 11/42] Export server & session without any node specifics --- Jakefile.js | 24 ++++++++++++++++++++ src/harness/harnessLanguageService.ts | 2 +- src/server/editorServices.ts | 29 ++++++++++++------------ src/server/nodeimpl.ts | 7 ++++++ src/server/server.ts | 10 ++++----- src/server/session.ts | 32 +++++++++++++++++++-------- src/server/tsconfig.json | 1 + 7 files changed, 75 insertions(+), 30 deletions(-) create mode 100644 src/server/nodeimpl.ts diff --git a/Jakefile.js b/Jakefile.js index 9b95744d392..9a2f39ee130 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -100,11 +100,20 @@ var serverSources = [ "editorServices.ts", "protocol.d.ts", "session.ts", + "nodeimpl.ts", "server.ts" ].map(function (f) { return path.join(serverDirectory, f); }); +var languageServiceLibrarySources = [ + "editorServices.ts", + "protocol.d.ts", + "session.ts" +].map(function (f) { + return path.join(serverDirectory, f); +}); + var harnessSources = [ "harness.ts", "sourceMapRecorder.ts", @@ -137,6 +146,7 @@ var harnessSources = [ "protocol.d.ts", "session.ts", "client.ts", + "nodeimpl.ts", "editorServices.ts", ].map(function (f) { return path.join(serverDirectory, f); @@ -369,6 +379,20 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca var serverFile = path.join(builtLocalDirectory, "tsserver.js"); compileFile(serverFile, serverSources,[builtLocalDirectory, copyright].concat(serverSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true); +var lsslFile = path.join(builtLocalDirectory, "tslssl.js"); +compileFile( + lsslFile, + languageServiceLibrarySources, + [builtLocalDirectory, copyright].concat(serverSources).concat(languageServiceLibrarySources), + /*prefixes*/ [copyright], + /*useBuiltCompiler*/ true, + /*noOutFile*/ false, + /*generateDeclarations*/ true); + +// Local target to build the language service server library +desc("Builds language service server library"); +task("lssl", [lsslFile]); + // Local target to build the compiler and services desc("Builds the full compiler and services"); task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile]); diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 0e0b8d82918..3796c84863b 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -583,7 +583,7 @@ module Harness.LanguageService { // This host is just a proxy for the clientHost, it uses the client // host to answer server queries about files on disk var serverHost = new SessionServerHost(clientHost); - var server = new ts.server.Session(serverHost, serverHost); + var server = new ts.server.Session(serverHost, new ts.server.NodeEnvironment(), serverHost); // Fake the connection between the client and the server serverHost.writeMessage = client.onMessage.bind(client); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index bc9e685825c..ffb22cc505b 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2,7 +2,6 @@ /// /// /// -/// module ts.server { export interface Logger { @@ -28,7 +27,7 @@ module ts.server { }); } - class ScriptInfo { + export class ScriptInfo { svc: ScriptVersionCache; children: ScriptInfo[] = []; // files referenced by this file defaultProject: Project; // project to use by default for file @@ -80,7 +79,7 @@ module ts.server { } } - class LSHost implements ts.LanguageServiceHost { + export class LSHost implements ts.LanguageServiceHost { ls: ts.LanguageService = null; compilationSettings: ts.CompilerOptions; filenameToScript: ts.Map = {}; @@ -273,7 +272,7 @@ module ts.server { } } - interface ProjectOptions { + export interface ProjectOptions { // these fields can be present in the project file files?: string[]; compilerOptions?: ts.CompilerOptions; @@ -376,7 +375,7 @@ module ts.server { } } - interface ProjectOpenResult { + export interface ProjectOpenResult { success?: boolean; errorMsg?: string; project?: Project; @@ -392,11 +391,11 @@ module ts.server { return copiedList; } - interface ProjectServiceEventHandler { + export interface ProjectServiceEventHandler { (eventName: string, project: Project, fileName: string): void; } - interface HostConfiguration { + export interface HostConfiguration { formatCodeOptions: ts.FormatCodeOptions; hostInfo: string; } @@ -953,7 +952,7 @@ module ts.server { } - class CompilerService { + export class CompilerService { host: LSHost; languageService: ts.LanguageService; classifier: ts.Classifier; @@ -999,7 +998,7 @@ module ts.server { } - interface LineCollection { + export interface LineCollection { charCount(): number; lineCount(): number; isLeaf(): boolean; @@ -1013,7 +1012,7 @@ module ts.server { leaf?: LineLeaf; } - enum CharRangeSection { + export enum CharRangeSection { PreStart, Start, Entire, @@ -1022,7 +1021,7 @@ module ts.server { PostEnd } - interface ILineIndexWalker { + export interface ILineIndexWalker { goSubtree: boolean; done: boolean; leaf(relativeStart: number, relativeLength: number, lineCollection: LineLeaf): void; @@ -1248,7 +1247,7 @@ module ts.server { } // text change information - class TextChange { + export class TextChange { constructor(public pos: number, public deleteLen: number, public insertedText?: string) { } @@ -1371,7 +1370,7 @@ module ts.server { } } - class LineIndexSnapshot implements ts.IScriptSnapshot { + export class LineIndexSnapshot implements ts.IScriptSnapshot { index: LineIndex; changesSincePreviousVersion: TextChange[] = []; @@ -1605,7 +1604,7 @@ module ts.server { } } - class LineNode implements LineCollection { + export class LineNode implements LineCollection { totalChars = 0; totalLines = 0; children: LineCollection[] = []; @@ -1891,7 +1890,7 @@ module ts.server { } } - class LineLeaf implements LineCollection { + export class LineLeaf implements LineCollection { udata: any; constructor(public text: string) { diff --git a/src/server/nodeimpl.ts b/src/server/nodeimpl.ts new file mode 100644 index 00000000000..9694b49aa85 --- /dev/null +++ b/src/server/nodeimpl.ts @@ -0,0 +1,7 @@ +/// +module ts.server { + export class NodeEnvironment implements Environment { + byteLength = Buffer.byteLength; + hrtime = process.hrtime; + } +} \ No newline at end of file diff --git a/src/server/server.ts b/src/server/server.ts index 828deca2b2d..d9737a554d0 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -11,7 +11,7 @@ module ts.server { input: process.stdin, output: process.stdout, terminal: false, - }); + }); class Logger implements ts.server.Logger { fd = -1; @@ -170,11 +170,11 @@ module ts.server { removeFile(file: WatchedFile) { this.watchedFiles = WatchedFileSet.copyListRemovingItem(file, this.watchedFiles); } - } + } class IOSession extends Session { - constructor(host: ServerHost, logger: ts.server.Logger) { - super(host, logger); + constructor(host: ServerHost, env: NodeEnvironment, logger: ts.server.Logger) { + super(host, env, logger); } exit() { @@ -265,7 +265,7 @@ module ts.server { } }; - var ioSession = new IOSession(ts.sys, logger); + var ioSession = new IOSession(ts.sys, new NodeEnvironment(), logger); process.on('uncaughtException', function(err: Error) { ioSession.logError(err, "unknown"); }); diff --git a/src/server/session.ts b/src/server/session.ts index a4cb3e59b4e..60ae0b8ee21 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1,6 +1,5 @@ /// /// -/// /// /// @@ -61,7 +60,7 @@ module ts.server { }; } - interface PendingErrorCheck { + export interface PendingErrorCheck { fileName: string; project: Project; } @@ -108,17 +107,32 @@ module ts.server { export interface ServerHost extends ts.System { } + + export interface Environment { + byteLength: (buf: string, encoding?: string) => number; + hrtime: (start?: number[]) => number[]; //array of seconds, nanoseconds + } + + export interface Message { + type: string, + seq: number + } + + export interface Event extends Message { + event: string; + body?: any; + } export class Session { projectService: ProjectService; pendingOperation = false; fileHash: ts.Map = {}; nextFileId = 1; - errorTimer: NodeJS.Timer; + errorTimer: any; /*NodeJS.Timer | number*/ immediateId: any; changeSeq = 0; - constructor(private host: ServerHost, private logger: Logger) { + constructor(private host: ServerHost, private environment: Environment, private logger: Logger) { this.projectService = new ProjectService(host, logger, (eventName,project,fileName) => { this.handleEvent(eventName, project, fileName); @@ -149,17 +163,17 @@ module ts.server { this.host.write(line + this.host.newLine); } - send(msg: NodeJS._debugger.Message) { + send(msg: Message) { var json = JSON.stringify(msg); if (this.logger.isVerbose()) { this.logger.info(msg.type + ": " + json); } - this.sendLineToClient('Content-Length: ' + (1 + Buffer.byteLength(json, 'utf8')) + + this.sendLineToClient('Content-Length: ' + (1 + this.environment.byteLength(json, 'utf8')) + '\r\n\r\n' + json); } event(info: any, eventName: string) { - var ev: NodeJS._debugger.Event = { + var ev: Event = { seq: 0, type: "event", event: eventName, @@ -838,7 +852,7 @@ module ts.server { onMessage(message: string) { if (this.logger.isVerbose()) { this.logger.info("request: " + message); - var start = process.hrtime(); + var start = this.environment.hrtime(); } try { var request = JSON.parse(message); @@ -980,7 +994,7 @@ module ts.server { } if (this.logger.isVerbose()) { - var elapsed = process.hrtime(start); + var elapsed = this.environment.hrtime(start); var seconds = elapsed[0] var nanoseconds = elapsed[1]; var elapsedMs = ((1e9 * seconds) + nanoseconds)/1000000.0; diff --git a/src/server/tsconfig.json b/src/server/tsconfig.json index 2c8538c61e3..bdc0a36cb86 100644 --- a/src/server/tsconfig.json +++ b/src/server/tsconfig.json @@ -12,6 +12,7 @@ "editorServices.ts", "protocol.d.ts", "server.ts", + "nodeimpl.ts", "session.ts" ] } From 85547915743a3bda34117713e75a4c3f390aa1a8 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 10 Jun 2015 16:19:10 -0700 Subject: [PATCH 12/42] Decouple ts.sys from the editorServices where possible --- src/server/editorServices.ts | 12 +++++++----- tests/cases/unittests/versionCache.ts | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index ffb22cc505b..d31ea53b5f9 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -35,7 +35,7 @@ module ts.server { formatCodeOptions = ts.clone(CompilerService.defaultFormatCodeOptions); constructor(private host: ServerHost, public fileName: string, public content: string, public isOpen = false) { - this.svc = ScriptVersionCache.fromString(content); + this.svc = ScriptVersionCache.fromString(host, content); } setFormatOptions(formatOptions: protocol.FormatOptions): void { @@ -915,7 +915,7 @@ module ts.server { return rawConfig.error; } else { - var parsedCommandLine = ts.parseConfigFile(rawConfig.config, ts.sys, dirPath); + var parsedCommandLine = ts.parseConfigFile(rawConfig.config, this.host, dirPath); if (parsedCommandLine.errors && (parsedCommandLine.errors.length > 0)) { return { errorMsg: "tsconfig option errors" }; } @@ -984,7 +984,7 @@ module ts.server { static defaultFormatCodeOptions: ts.FormatCodeOptions = { IndentSize: 4, TabSize: 4, - NewLineCharacter: ts.sys.newLine, + NewLineCharacter: ts.sys ? ts.sys.newLine : '\n', ConvertTabsToSpaces: true, InsertSpaceAfterCommaDelimiter: true, InsertSpaceAfterSemicolonInForStatements: true, @@ -1262,6 +1262,7 @@ module ts.server { versions: LineIndexSnapshot[] = []; minVersion = 0; // no versions earlier than min version will maintain change history private currentVersion = 0; + private host: System; static changeNumberThreshold = 8; static changeLengthThreshold = 256; @@ -1289,7 +1290,7 @@ module ts.server { } reloadFromFile(filename: string, cb?: () => any) { - var content = ts.sys.readFile(filename); + var content = this.host.readFile(filename); this.reload(content); if (cb) cb(); @@ -1359,10 +1360,11 @@ module ts.server { } } - static fromString(script: string) { + static fromString(host: System, script: string) { var svc = new ScriptVersionCache(); var snap = new LineIndexSnapshot(0, svc); svc.versions[svc.currentVersion] = snap; + svc.host = host; snap.index = new LineIndex(); var lm = LineIndex.linesFromText(script); snap.index.load(lm.lines); diff --git a/tests/cases/unittests/versionCache.ts b/tests/cases/unittests/versionCache.ts index 12cf9c1b817..06c2cadbfe9 100644 --- a/tests/cases/unittests/versionCache.ts +++ b/tests/cases/unittests/versionCache.ts @@ -231,7 +231,7 @@ and grew 1cm per day`; }); it("Edit ScriptVersionCache ", () => { - let svc = server.ScriptVersionCache.fromString(testContent); + let svc = server.ScriptVersionCache.fromString(ts.sys, testContent); let checkText = testContent; for (let i = 0; i < iterationCount; i++) { From 54edbaeea72af18b7536f1d4564a7b5164dc6515 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Mon, 15 Jun 2015 16:28:29 -0700 Subject: [PATCH 13/42] Parse class member with a missing identifier in the presence of a modifier --- src/compiler/parser.ts | 4 +-- ...lassMemberWithMissingIdentifier.errors.txt | 12 ++++++++ .../classMemberWithMissingIdentifier.js | 12 ++++++++ ...assMemberWithMissingIdentifier2.errors.txt | 30 +++++++++++++++++++ .../classMemberWithMissingIdentifier2.js | 13 ++++++++ .../classMemberWithMissingIdentifier.ts | 3 ++ .../classMemberWithMissingIdentifier2.ts | 3 ++ 7 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/classMemberWithMissingIdentifier.errors.txt create mode 100644 tests/baselines/reference/classMemberWithMissingIdentifier.js create mode 100644 tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt create mode 100644 tests/baselines/reference/classMemberWithMissingIdentifier2.js create mode 100644 tests/cases/compiler/classMemberWithMissingIdentifier.ts create mode 100644 tests/cases/compiler/classMemberWithMissingIdentifier2.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 07da065c1ae..35ef6393748 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4207,7 +4207,7 @@ module ts { return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } - if (decorators) { + if (decorators || modifiers) { // treat this as a property declaration with a missing name. let name = createMissingNode(SyntaxKind.Identifier, /*reportAtCurrentPosition*/ true, Diagnostics.Declaration_expected); return parsePropertyDeclaration(fullStart, decorators, modifiers, name, /*questionToken*/ undefined); @@ -4729,7 +4729,7 @@ module ts { case SyntaxKind.ImportKeyword: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: - if (decorators) { + if (decorators || modifiers) { // We reached this point because we encountered an AtToken and assumed a declaration would // follow. For recovery and error reporting purposes, return an incomplete declaration. let node = createMissingNode(SyntaxKind.MissingDeclaration, /*reportAtCurrentPosition*/ true, Diagnostics.Declaration_expected); diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier.errors.txt b/tests/baselines/reference/classMemberWithMissingIdentifier.errors.txt new file mode 100644 index 00000000000..4bbc2d8167d --- /dev/null +++ b/tests/baselines/reference/classMemberWithMissingIdentifier.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/classMemberWithMissingIdentifier.ts(2,11): error TS1146: Declaration expected. +tests/cases/compiler/classMemberWithMissingIdentifier.ts(2,12): error TS1005: '=' expected. + + +==== tests/cases/compiler/classMemberWithMissingIdentifier.ts (2 errors) ==== + class C { + public {}; + +!!! error TS1146: Declaration expected. + ~ +!!! error TS1005: '=' expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier.js b/tests/baselines/reference/classMemberWithMissingIdentifier.js new file mode 100644 index 00000000000..cd1825d0da0 --- /dev/null +++ b/tests/baselines/reference/classMemberWithMissingIdentifier.js @@ -0,0 +1,12 @@ +//// [classMemberWithMissingIdentifier.ts] +class C { + public {}; +} + +//// [classMemberWithMissingIdentifier.js] +var C = (function () { + function C() { + this. = {}; + } + return C; +})(); diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt b/tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt new file mode 100644 index 00000000000..b21e062e3b0 --- /dev/null +++ b/tests/baselines/reference/classMemberWithMissingIdentifier2.errors.txt @@ -0,0 +1,30 @@ +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,11): error TS1146: Declaration expected. +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,12): error TS1005: '=' expected. +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,14): error TS2304: Cannot find name 'name'. +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,18): error TS1005: ']' expected. +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,19): error TS2304: Cannot find name 'string'. +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,25): error TS1005: ',' expected. +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,26): error TS1136: Property assignment expected. +tests/cases/compiler/classMemberWithMissingIdentifier2.ts(2,27): error TS2304: Cannot find name 'VariableDeclaration'. + + +==== tests/cases/compiler/classMemberWithMissingIdentifier2.ts (8 errors) ==== + class C { + public {[name:string]:VariableDeclaration}; + +!!! error TS1146: Declaration expected. + ~ +!!! error TS1005: '=' expected. + ~~~~ +!!! error TS2304: Cannot find name 'name'. + ~ +!!! error TS1005: ']' expected. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1136: Property assignment expected. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'VariableDeclaration'. + } \ No newline at end of file diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier2.js b/tests/baselines/reference/classMemberWithMissingIdentifier2.js new file mode 100644 index 00000000000..e8494755b22 --- /dev/null +++ b/tests/baselines/reference/classMemberWithMissingIdentifier2.js @@ -0,0 +1,13 @@ +//// [classMemberWithMissingIdentifier2.ts] +class C { + public {[name:string]:VariableDeclaration}; +} + +//// [classMemberWithMissingIdentifier2.js] +var C = (function () { + function C() { + this. = (_a = {}, _a[name] = string, _a.VariableDeclaration = VariableDeclaration, _a); + var _a; + } + return C; +})(); diff --git a/tests/cases/compiler/classMemberWithMissingIdentifier.ts b/tests/cases/compiler/classMemberWithMissingIdentifier.ts new file mode 100644 index 00000000000..01ba223f4c4 --- /dev/null +++ b/tests/cases/compiler/classMemberWithMissingIdentifier.ts @@ -0,0 +1,3 @@ +class C { + public {}; +} \ No newline at end of file diff --git a/tests/cases/compiler/classMemberWithMissingIdentifier2.ts b/tests/cases/compiler/classMemberWithMissingIdentifier2.ts new file mode 100644 index 00000000000..e1618659797 --- /dev/null +++ b/tests/cases/compiler/classMemberWithMissingIdentifier2.ts @@ -0,0 +1,3 @@ +class C { + public {[name:string]:VariableDeclaration}; +} \ No newline at end of file From 3b5d73f5cee0921c692e53e5b1e6489a61e8faa9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 16 Jun 2015 12:13:18 -0700 Subject: [PATCH 14/42] Use Object.create(null) in __extends when base is null --- src/compiler/emitter.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8081668f98c..5181a0f17f5 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -21,8 +21,7 @@ namespace ts { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); };`; // emit output for the __decorate helper function From 835f91137c47ed08db90d876359cc735212af73d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 16 Jun 2015 12:18:31 -0700 Subject: [PATCH 15/42] Accepting new baselines --- ...sClassHeritageListMemberTypeAnnotations.js | 3 +- ...accessibleTypeInTypeParameterConstraint.js | 3 +- .../accessOverriddenBaseClassMember1.js | 3 +- .../accessors_spec_section-4.5_inference.js | 3 +- .../reference/aliasUsageInAccessorsOfClass.js | 3 +- .../baselines/reference/aliasUsageInArray.js | 3 +- .../aliasUsageInFunctionExpression.js | 3 +- .../reference/aliasUsageInGenericFunction.js | 3 +- .../reference/aliasUsageInIndexerOfClass.js | 3 +- .../reference/aliasUsageInObjectLiteral.js | 3 +- .../reference/aliasUsageInOrExpression.js | 3 +- ...aliasUsageInTypeArgumentOfExtendsClause.js | 6 +- .../reference/aliasUsageInVarAssignment.js | 3 +- .../reference/ambiguousOverloadResolution.js | 3 +- .../reference/apparentTypeSubtyping.js | 3 +- .../reference/apparentTypeSupertype.js | 3 +- .../reference/arrayAssignmentTest1.js | 3 +- .../reference/arrayAssignmentTest2.js | 3 +- .../reference/arrayBestCommonTypes.js | 3 +- .../reference/arrayLiteralTypeInference.js | 3 +- tests/baselines/reference/arrayLiterals.js | 3 +- .../arrayLiteralsWithRecursiveGenerics.js | 3 +- .../reference/arrowFunctionContexts.js | 3 +- .../assignmentCompatWithCallSignatures3.js | 3 +- .../assignmentCompatWithCallSignatures4.js | 3 +- .../assignmentCompatWithCallSignatures5.js | 3 +- .../assignmentCompatWithCallSignatures6.js | 3 +- ...ssignmentCompatWithConstructSignatures3.js | 3 +- ...ssignmentCompatWithConstructSignatures4.js | 3 +- ...ssignmentCompatWithConstructSignatures5.js | 3 +- ...ssignmentCompatWithConstructSignatures6.js | 3 +- .../assignmentCompatWithNumericIndexer.js | 3 +- .../assignmentCompatWithNumericIndexer3.js | 3 +- .../assignmentCompatWithObjectMembers4.js | 3 +- ...nmentCompatWithObjectMembersOptionality.js | 3 +- ...mentCompatWithObjectMembersOptionality2.js | 3 +- .../assignmentCompatWithStringIndexer.js | 3 +- .../reference/assignmentLHSIsValue.js | 3 +- tests/baselines/reference/autolift4.js | 3 +- tests/baselines/reference/baseCheck.js | 3 +- .../reference/baseIndexSignatureResolution.js | 3 +- .../reference/baseTypeOrderChecking.js | 3 +- .../baseTypeWrappingInstantiationChain.js | 3 +- tests/baselines/reference/bases.js | 3 +- .../bestCommonTypeOfConditionalExpressions.js | 3 +- ...bestCommonTypeOfConditionalExpressions2.js | 3 +- .../reference/bestCommonTypeOfTuple2.js | 3 +- ...allSignatureAssignabilityInInheritance2.js | 3 +- ...allSignatureAssignabilityInInheritance3.js | 3 +- ...allSignatureAssignabilityInInheritance4.js | 3 +- ...allSignatureAssignabilityInInheritance5.js | 3 +- ...allSignatureAssignabilityInInheritance6.js | 3 +- tests/baselines/reference/callWithSpread.js | 3 +- .../reference/captureThisInSuperCall.js | 3 +- tests/baselines/reference/castingTuple.js | 3 +- .../baselines/reference/chainedAssignment3.js | 3 +- ...arameterConstrainedToOtherTypeParameter.js | 3 +- .../reference/checkForObjectTooStrict.js | 3 +- .../reference/circularImportAlias.js | 3 +- ...classConstructorParametersAccessibility.js | 3 +- ...lassConstructorParametersAccessibility2.js | 3 +- ...lassConstructorParametersAccessibility3.js | 3 +- ...clarationMergedInModuleWithContinuation.js | 3 +- .../classDoesNotDependOnBaseTypes.js | 3 +- .../reference/classExtendingClass.js | 3 +- .../reference/classExtendingPrimitive.js | 3 +- .../reference/classExtendingPrimitive2.js | 3 +- .../reference/classExtendingQualifiedName.js | 3 +- .../reference/classExtendingQualifiedName2.js | 3 +- ...sMergedWithModuleNotReferingConstructor.js | 3 +- ...tendsClauseClassNotReferringConstructor.js | 3 +- .../reference/classExtendsEveryObjectType.js | 3 +- .../reference/classExtendsEveryObjectType2.js | 3 +- .../reference/classExtendsInterface.js | 3 +- .../baselines/reference/classExtendsItself.js | 3 +- .../reference/classExtendsItselfIndirectly.js | 3 +- .../classExtendsItselfIndirectly2.js | 3 +- .../classExtendsItselfIndirectly3.js | 18 +- .../classExtendsMultipleBaseClasses.js | 3 +- ...classExtendsShadowedConstructorFunction.js | 3 +- .../classExtendsValidConstructorFunction.js | 3 +- .../classHeritageWithTrailingSeparator.js | 3 +- .../reference/classImplementsClass2.js | 3 +- .../reference/classImplementsClass3.js | 3 +- .../reference/classImplementsClass4.js | 3 +- .../reference/classImplementsClass5.js | 3 +- .../reference/classImplementsClass6.js | 3 +- tests/baselines/reference/classIndexer3.js | 3 +- tests/baselines/reference/classInheritence.js | 3 +- .../reference/classIsSubtypeOfBaseType.js | 3 +- tests/baselines/reference/classOrder2.js | 3 +- tests/baselines/reference/classOrderBug.js | 3 +- .../reference/classSideInheritance1.js | 3 +- .../reference/classSideInheritance2.js | 3 +- .../reference/classSideInheritance3.js | 3 +- tests/baselines/reference/classUpdateTests.js | 3 +- .../classWithBaseClassButNoConstructor.js | 3 +- .../reference/classWithConstructors.js | 3 +- .../reference/classWithProtectedProperty.js | 3 +- .../reference/classWithStaticMembers.js | 3 +- tests/baselines/reference/classdecl.js | 3 +- .../reference/clodulesDerivedClasses.js | 3 +- ...llisionSuperAndLocalFunctionInAccessors.js | 3 +- ...isionSuperAndLocalFunctionInConstructor.js | 3 +- .../collisionSuperAndLocalFunctionInMethod.js | 3 +- ...ollisionSuperAndLocalFunctionInProperty.js | 3 +- .../collisionSuperAndLocalVarInAccessors.js | 3 +- .../collisionSuperAndLocalVarInConstructor.js | 3 +- .../collisionSuperAndLocalVarInMethod.js | 3 +- .../collisionSuperAndLocalVarInProperty.js | 3 +- .../collisionSuperAndNameResolution.js | 3 +- .../reference/collisionSuperAndParameter.js | 3 +- .../reference/collisionSuperAndParameter1.js | 3 +- ...perAndPropertyNameAsConstuctorParameter.js | 3 +- ...xpressionAndLocalVarWithSuperExperssion.js | 3 +- .../reference/commentsInheritance.js | 3 +- .../comparisonOperatorWithIdenticalObjects.js | 3 +- ...ithNoRelationshipObjectsOnCallSignature.js | 3 +- ...lationshipObjectsOnConstructorSignature.js | 3 +- ...thNoRelationshipObjectsOnIndexSignature.js | 3 +- ...nshipObjectsOnInstantiatedCallSignature.js | 3 +- ...jectsOnInstantiatedConstructorSignature.js | 3 +- ...peratorWithSubtypeObjectOnCallSignature.js | 3 +- ...WithSubtypeObjectOnConstructorSignature.js | 3 +- ...eratorWithSubtypeObjectOnIndexSignature.js | 3 +- ...ubtypeObjectOnInstantiatedCallSignature.js | 3 +- ...bjectOnInstantiatedConstructorSignature.js | 3 +- ...isonOperatorWithSubtypeObjectOnProperty.js | 3 +- .../reference/complexClassRelationships.js | 3 +- ...catedGenericRecursiveBaseClassReference.js | 3 +- .../reference/compoundAssignmentLHSIsValue.js | 3 +- .../reference/computedPropertyNames24_ES5.js | 3 +- .../reference/computedPropertyNames25_ES5.js | 3 +- .../reference/computedPropertyNames26_ES5.js | 3 +- .../reference/computedPropertyNames27_ES5.js | 3 +- .../reference/computedPropertyNames28_ES5.js | 3 +- .../reference/computedPropertyNames30_ES5.js | 3 +- .../reference/computedPropertyNames31_ES5.js | 3 +- .../reference/computedPropertyNames43_ES5.js | 3 +- .../reference/computedPropertyNames44_ES5.js | 3 +- .../reference/computedPropertyNames45_ES5.js | 3 +- .../conditionalOperatorWithIdenticalBCT.js | 3 +- .../conditionalOperatorWithoutIdenticalBCT.js | 3 +- .../reference/constantOverloadFunction.js | 3 +- .../constantOverloadFunctionNoSubtypeError.js | 3 +- ...nstraintCheckInGenericBaseTypeReference.js | 3 +- ...uctSignatureAssignabilityInInheritance2.js | 3 +- ...uctSignatureAssignabilityInInheritance3.js | 3 +- ...uctSignatureAssignabilityInInheritance4.js | 3 +- ...uctSignatureAssignabilityInInheritance5.js | 3 +- ...uctSignatureAssignabilityInInheritance6.js | 3 +- tests/baselines/reference/constructorArgs.js | 3 +- ...uctorFunctionTypeIsAssignableToBaseType.js | 3 +- ...ctorFunctionTypeIsAssignableToBaseType2.js | 3 +- .../constructorHasPrototypeProperty.js | 3 +- .../reference/constructorOverloads2.js | 3 +- .../reference/constructorOverloads3.js | 3 +- ...constructorWithIncompleteTypeAnnotation.js | 3 +- .../contextualTypingArrayOfLambdas.js | 3 +- ...contextualTypingOfConditionalExpression.js | 3 +- ...ontextualTypingOfConditionalExpression2.js | 3 +- ...urcePropertyIsRelatableToTargetProperty.js | 3 +- .../declFileForFunctionTypeAsTypeParameter.js | 3 +- ...ileGenericClassWithGenericExtendedClass.js | 3 +- .../reference/declFileGenericType.js | 3 +- .../reference/declFileGenericType2.js | 3 +- ...lictingWithClassReferredByExtendsClause.js | 3 +- ...dsClauseThatHasItsContainerNameConflict.js | 3 +- .../declarationEmit_nameConflicts3.js | 3 +- .../declarationEmit_protectedMembers.js | 3 +- .../reference/declareDottedExtend.js | 3 +- .../reference/decoratorOnClassMethod12.js | 3 +- ...derivedClassConstructorWithoutSuperCall.js | 3 +- ...ClassFunctionOverridesBaseClassAccessor.js | 3 +- .../derivedClassIncludesInheritedMembers.js | 3 +- ...idesIndexersWithAssignmentCompatibility.js | 3 +- .../derivedClassOverridesPrivateFunction1.js | 3 +- .../derivedClassOverridesPrivates.js | 3 +- .../derivedClassOverridesProtectedMembers.js | 3 +- .../derivedClassOverridesProtectedMembers2.js | 3 +- .../derivedClassOverridesProtectedMembers3.js | 3 +- .../derivedClassOverridesProtectedMembers4.js | 3 +- .../derivedClassOverridesPublicMembers.js | 3 +- .../derivedClassOverridesWithoutSubtype.js | 3 +- .../derivedClassParameterProperties.js | 3 +- ...dClassSuperCallsInNonConstructorMembers.js | 3 +- .../derivedClassSuperCallsWithThisArg.js | 3 +- .../reference/derivedClassTransitivity.js | 3 +- .../reference/derivedClassTransitivity2.js | 3 +- .../reference/derivedClassTransitivity3.js | 3 +- .../reference/derivedClassTransitivity4.js | 3 +- .../reference/derivedClassWithAny.js | 3 +- ...ivateInstanceShadowingProtectedInstance.js | 3 +- ...hPrivateInstanceShadowingPublicInstance.js | 3 +- ...thPrivateStaticShadowingProtectedStatic.js | 3 +- ...sWithPrivateStaticShadowingPublicStatic.js | 3 +- .../derivedClassWithoutExplicitConstructor.js | 3 +- ...derivedClassWithoutExplicitConstructor2.js | 3 +- ...derivedClassWithoutExplicitConstructor3.js | 3 +- tests/baselines/reference/derivedClasses.js | 3 +- .../reference/derivedGenericClassWithAny.js | 3 +- ...sesHiddenBaseCallViaSuperPropertyAccess.js | 3 +- .../derivedTypeDoesNotRequireExtendsClause.js | 3 +- .../destructuringParameterDeclaration5.js | 3 +- .../reference/emitThisInSuperMethodCall.js | 3 +- ...rorForwardReferenceForwadingConstructor.js | 3 +- tests/baselines/reference/errorSuperCalls.js | 3 +- .../reference/errorSuperPropertyAccess.js | 3 +- .../reference/errorsInGenericTypeReference.js | 3 +- .../reference/es6ClassSuperCodegenBug.js | 3 +- tests/baselines/reference/es6ClassTest.js | 3 +- tests/baselines/reference/es6ClassTest2.js | 3 +- tests/baselines/reference/es6ClassTest7.js | 3 +- .../exportAssignmentOfGenericType1.js | 3 +- .../exportDeclarationInInternalModule.js | 3 +- tests/baselines/reference/extBaseClass1.js | 3 +- tests/baselines/reference/extBaseClass2.js | 3 +- .../extendAndImplementTheSameBaseType.js | 3 +- .../extendAndImplementTheSameBaseType2.js | 3 +- .../extendBaseClassBeforeItsDeclared.js | 3 +- .../reference/extendNonClassSymbol1.js | 3 +- .../reference/extendNonClassSymbol2.js | 3 +- ...xtendingClassFromAliasAndUsageInIndexer.js | 6 +- .../reference/extendsClauseAlreadySeen.js | 3 +- .../reference/extendsClauseAlreadySeen2.js | 3 +- tests/baselines/reference/for-inStatements.js | 3 +- .../reference/for-inStatementsInvalid.js | 3 +- .../forStatementsMultipleInvalidDecl.js | 3 +- .../reference/functionImplementationErrors.js | 3 +- .../reference/functionImplementations.js | 3 +- .../reference/functionSubtypingOfVarArgs.js | 3 +- .../reference/functionSubtypingOfVarArgs2.js | 3 +- .../reference/generatedContextualTyping.js | 3 +- .../genericBaseClassLiteralProperty.js | 3 +- .../genericBaseClassLiteralProperty2.js | 3 +- ...allWithConstraintsTypeArgumentInference.js | 3 +- .../genericCallWithObjectTypeArgs2.js | 3 +- ...icCallWithObjectTypeArgsAndConstraints2.js | 3 +- ...icCallWithObjectTypeArgsAndConstraints3.js | 3 +- .../genericCallbacksAndClassHierarchy.js | 3 +- ...sInheritsConstructorFromNonGenericClass.js | 3 +- ...cClassPropertyInheritanceSpecialization.js | 3 +- .../reference/genericClassStaticMethod.js | 3 +- tests/baselines/reference/genericClasses3.js | 3 +- ...genericConstraintOnExtendedBuiltinTypes.js | 3 +- ...enericConstraintOnExtendedBuiltinTypes2.js | 3 +- .../genericDerivedTypeWithSpecializedBase.js | 3 +- .../genericDerivedTypeWithSpecializedBase2.js | 3 +- .../reference/genericPrototypeProperty2.js | 3 +- .../reference/genericPrototypeProperty3.js | 3 +- ...ericRecursiveImplicitConstructorErrors2.js | 3 +- ...ericRecursiveImplicitConstructorErrors3.js | 3 +- .../reference/genericTypeAssertions2.js | 3 +- .../reference/genericTypeAssertions4.js | 3 +- .../reference/genericTypeAssertions6.js | 3 +- .../reference/genericTypeConstraints.js | 3 +- ...genericTypeReferenceWithoutTypeArgument.js | 3 +- ...enericTypeReferenceWithoutTypeArgument2.js | 3 +- .../genericWithIndexerOfTypeParameterType2.js | 3 +- .../reference/heterogeneousArrayLiterals.js | 3 +- .../reference/ifDoWhileStatements.js | 3 +- .../illegalSuperCallsInConstructor.js | 3 +- .../implementClausePrecedingExtends.js | 3 +- ...gAnInterfaceExtendingClassWithPrivates2.js | 3 +- ...AnInterfaceExtendingClassWithProtecteds.js | 3 +- .../baselines/reference/importAsBaseClass.js | 3 +- .../reference/importShadowsGlobalName.js | 3 +- .../reference/importUsedInExtendsList1.js | 3 +- .../reference/indexerConstraints2.js | 3 +- .../reference/indirectSelfReference.js | 3 +- .../reference/indirectSelfReferenceGeneric.js | 3 +- .../infinitelyExpandingTypesNonGenericBase.js | 3 +- .../inheritFromGenericTypeParameter.js | 3 +- ...SameNamePrivatePropertiesFromSameOrigin.js | 3 +- tests/baselines/reference/inheritance.js | 3 +- tests/baselines/reference/inheritance1.js | 3 +- ...itanceGrandParentPrivateMemberCollision.js | 3 +- ...tPrivateMemberCollisionWithPublicMember.js | 3 +- ...tPublicMemberCollisionWithPrivateMember.js | 3 +- ...ritanceMemberAccessorOverridingAccessor.js | 3 +- ...heritanceMemberAccessorOverridingMethod.js | 3 +- ...ritanceMemberAccessorOverridingProperty.js | 3 +- ...inheritanceMemberFuncOverridingAccessor.js | 3 +- .../inheritanceMemberFuncOverridingMethod.js | 3 +- ...inheritanceMemberFuncOverridingProperty.js | 3 +- ...ritanceMemberPropertyOverridingAccessor.js | 3 +- ...heritanceMemberPropertyOverridingMethod.js | 3 +- ...ritanceMemberPropertyOverridingProperty.js | 3 +- .../inheritanceOfGenericConstructorMethod1.js | 3 +- .../inheritanceOfGenericConstructorMethod2.js | 3 +- ...ritanceStaticAccessorOverridingAccessor.js | 3 +- ...heritanceStaticAccessorOverridingMethod.js | 3 +- ...ritanceStaticAccessorOverridingProperty.js | 3 +- ...inheritanceStaticFuncOverridingAccessor.js | 3 +- ...eStaticFuncOverridingAccessorOfFuncType.js | 3 +- .../inheritanceStaticFuncOverridingMethod.js | 3 +- ...inheritanceStaticFuncOverridingProperty.js | 3 +- ...eStaticFuncOverridingPropertyOfFuncType.js | 3 +- ...taticFunctionOverridingInstanceProperty.js | 3 +- .../inheritanceStaticMembersCompatible.js | 3 +- .../inheritanceStaticMembersIncompatible.js | 3 +- ...ritanceStaticPropertyOverridingAccessor.js | 3 +- ...heritanceStaticPropertyOverridingMethod.js | 3 +- ...ritanceStaticPropertyOverridingProperty.js | 3 +- .../inheritedConstructorWithRestParams.js | 3 +- .../inheritedConstructorWithRestParams2.js | 3 +- .../inheritedModuleMembersForClodule.js | 3 +- ...nstancePropertiesInheritedIntoClassType.js | 3 +- .../reference/instanceSubtypeCheck2.js | 3 +- .../instantiatedReturnTypeContravariance.js | 3 +- .../reference/interfaceExtendsClass1.js | 3 +- .../interfaceExtendsClassWithPrivate1.js | 3 +- .../interfaceExtendsClassWithPrivate2.js | 3 +- .../reference/interfaceImplementation8.js | 3 +- .../invalidModuleWithStatementsOfEveryKind.js | 3 +- .../invalidMultipleVariableDeclarations.js | 3 +- .../reference/invalidReturnStatements.js | 3 +- .../isolatedModulesImportExportElision.js | 3 +- tests/baselines/reference/lambdaArgCrash.js | 3 +- tests/baselines/reference/lift.js | 3 +- tests/baselines/reference/localTypes1.js | 3 +- tests/baselines/reference/m7Bugs.js | 3 +- .../mergedInterfacesWithInheritedPrivates2.js | 3 +- .../mergedInterfacesWithInheritedPrivates3.js | 3 +- tests/baselines/reference/moduleAsBaseType.js | 3 +- .../moduleImportedForTypeArgumentPosition.js | 3 +- .../moduleWithStatementsOfEveryKind.js | 3 +- .../reference/multipleInheritance.js | 3 +- .../mutuallyRecursiveGenericBaseTypes2.js | 3 +- ...enericClassExtendingGenericClassWithAny.js | 3 +- ...cIndexerConstrainsPropertyDeclarations2.js | 3 +- .../reference/numericIndexerConstraint3.js | 3 +- .../reference/numericIndexerConstraint4.js | 3 +- .../reference/numericIndexerTyping2.js | 3 +- ...objectCreationOfElementAccessExpression.js | 3 +- ...objectTypeHidingMembersOfExtendedObject.js | 3 +- ...objectTypesIdentityWithNumericIndexers1.js | 3 +- ...objectTypesIdentityWithNumericIndexers2.js | 3 +- ...objectTypesIdentityWithNumericIndexers3.js | 3 +- .../objectTypesIdentityWithPrivates.js | 3 +- .../objectTypesIdentityWithPrivates2.js | 3 +- .../objectTypesIdentityWithPrivates3.js | 3 +- .../objectTypesIdentityWithStringIndexers.js | 3 +- .../objectTypesIdentityWithStringIndexers2.js | 3 +- .../optionalConstructorArgInSuper.js | 3 +- .../reference/optionalParamArgsTest.js | 3 +- .../reference/optionalParamInOverride.js | 3 +- tests/baselines/reference/overload1.js | 3 +- .../overloadOnConstConstraintChecks1.js | 3 +- .../overloadOnConstConstraintChecks2.js | 3 +- .../overloadOnConstConstraintChecks3.js | 3 +- .../overloadOnConstConstraintChecks4.js | 3 +- .../overloadOnConstantsInvalidOverload1.js | 3 +- .../baselines/reference/overloadResolution.js | 3 +- .../overloadResolutionClassConstructors.js | 3 +- .../overloadResolutionConstructors.js | 3 +- .../reference/overloadingOnConstants1.js | 3 +- .../reference/overloadingOnConstants2.js | 3 +- .../overridingPrivateStaticMembers.js | 3 +- .../reference/parseErrorInHeritageClause1.js | 3 +- tests/baselines/reference/parser509630.js | 3 +- tests/baselines/reference/parserAstSpans1.js | 3 +- .../reference/parserClassDeclaration1.js | 3 +- .../reference/parserClassDeclaration3.js | 3 +- .../reference/parserClassDeclaration4.js | 3 +- .../reference/parserClassDeclaration5.js | 3 +- .../reference/parserClassDeclaration6.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause2.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause4.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause5.js | 3 +- .../parserGenericsInTypeContexts1.js | 3 +- .../parserGenericsInTypeContexts2.js | 3 +- .../baselines/reference/parserRealSource10.js | 3 +- .../baselines/reference/parserRealSource11.js | 3 +- tests/baselines/reference/parserharness.js | 3 +- tests/baselines/reference/primitiveMembers.js | 3 +- tests/baselines/reference/privacyClass.js | 3 +- .../privacyClassExtendsClauseDeclFile.js | 6 +- tests/baselines/reference/privacyGloClass.js | 3 +- .../reference/privateAccessInSubclass1.js | 3 +- .../privateInstanceMemberAccessibility.js | 3 +- .../privateStaticMemberAccessibility.js | 3 +- .../privateStaticNotAccessibleInClodule2.js | 3 +- .../amd/testGlo.js | 3 +- .../node/testGlo.js | 3 +- .../reference/project/prologueEmit/amd/out.js | 3 +- .../project/prologueEmit/node/out.js | 3 +- .../amd/m'ain.d.ts | 3 - .../amd/m'ain.js | 3 +- .../node/m'ain.d.ts | 3 - .../node/m'ain.js | 3 +- .../reference/propertiesAndIndexers.js | 3 +- tests/baselines/reference/propertyAccess.js | 3 +- ...tyAccessOnTypeParameterWithConstraints2.js | 3 +- ...tyAccessOnTypeParameterWithConstraints3.js | 3 +- ...tyAccessOnTypeParameterWithConstraints5.js | 3 +- ...edClassPropertyAccessibleWithinSubclass.js | 3 +- ...dClassPropertyAccessibleWithinSubclass2.js | 3 +- ...dClassPropertyAccessibleWithinSubclass3.js | 3 +- .../protectedInstanceMemberAccessibility.js | 3 +- tests/baselines/reference/protectedMembers.js | 3 +- ...icClassPropertyAccessibleWithinSubclass.js | 3 +- ...cClassPropertyAccessibleWithinSubclass2.js | 3 +- ...solution-does-not-affect-class-heritage.js | 3 +- .../reference/recursiveBaseCheck3.js | 3 +- .../reference/recursiveBaseCheck4.js | 3 +- .../reference/recursiveBaseCheck6.js | 3 +- .../recursiveBaseConstructorCreation1.js | 3 +- ...ssInstantiationsWithDefaultConstructors.js | 3 +- .../reference/recursiveClassReferenceTest.js | 3 +- .../recursiveClassReferenceTest.js.map | 2 +- .../recursiveClassReferenceTest.sourcemap.txt | 807 +++++++++--------- .../reference/recursiveComplicatedClasses.js | 3 +- ...sivelySpecializedConstructorDeclaration.js | 3 +- ...lassDeclarationWhenInBaseTypeResolution.js | 3 +- .../reference/returnInConstructor1.js | 3 +- tests/baselines/reference/returnStatements.js | 3 +- ...peCheckExtendedClassInsidePublicMethod2.js | 3 +- ...peCheckExtendedClassInsideStaticMethod1.js | 3 +- tests/baselines/reference/scopeTests.js | 3 +- .../reference/shadowPrivateMembers.js | 3 +- ...sWithDefaultConstructorAndExtendsClause.js | 3 +- ...hDefaultConstructorAndExtendsClause.js.map | 2 +- ...tConstructorAndExtendsClause.sourcemap.txt | 75 +- .../specializedInheritedConstructors1.js | 3 +- .../specializedOverloadWithRestParameters.js | 3 +- tests/baselines/reference/staticFactory1.js | 3 +- .../baselines/reference/staticInheritance.js | 3 +- .../staticMemberAccessOffDerivedType1.js | 3 +- tests/baselines/reference/staticPropSuper.js | 3 +- .../reference/strictModeInConstructor.js | 3 +- ...trictModeReservedWordInClassDeclaration.js | 3 +- ...gIndexerConstrainsPropertyDeclarations2.js | 3 +- .../reference/subtypesOfTypeParameter.js | 3 +- .../subtypesOfTypeParameterWithConstraints.js | 3 +- ...subtypesOfTypeParameterWithConstraints4.js | 3 +- ...OfTypeParameterWithRecursiveConstraints.js | 3 +- .../reference/subtypingTransitivity.js | 3 +- .../reference/subtypingWithCallSignatures2.js | 3 +- .../reference/subtypingWithCallSignatures3.js | 3 +- .../reference/subtypingWithCallSignatures4.js | 3 +- .../subtypingWithConstructSignatures2.js | 3 +- .../subtypingWithConstructSignatures3.js | 3 +- .../subtypingWithConstructSignatures4.js | 3 +- .../subtypingWithConstructSignatures5.js | 3 +- .../subtypingWithConstructSignatures6.js | 3 +- .../reference/subtypingWithNumericIndexer.js | 3 +- .../reference/subtypingWithNumericIndexer3.js | 3 +- .../reference/subtypingWithNumericIndexer4.js | 3 +- .../reference/subtypingWithObjectMembers.js | 3 +- .../reference/subtypingWithObjectMembers4.js | 3 +- ...subtypingWithObjectMembersAccessibility.js | 3 +- ...ubtypingWithObjectMembersAccessibility2.js | 3 +- .../reference/subtypingWithStringIndexer.js | 3 +- .../reference/subtypingWithStringIndexer3.js | 3 +- .../reference/subtypingWithStringIndexer4.js | 3 +- tests/baselines/reference/super.js | 3 +- tests/baselines/reference/super1.js | 3 +- tests/baselines/reference/super2.js | 3 +- tests/baselines/reference/superAccess.js | 3 +- tests/baselines/reference/superAccess2.js | 3 +- .../reference/superAccessInFatArrow1.js | 3 +- .../reference/superCallArgsMustMatch.js | 3 +- .../reference/superCallAssignResult.js | 3 +- ...allFromClassThatDerivesFromGenericType1.js | 3 +- ...allFromClassThatDerivesFromGenericType2.js | 3 +- ...eButWithIncorrectNumberOfTypeArguments1.js | 3 +- ...sFromGenericTypeButWithNoTypeArguments1.js | 3 +- ...ivesNonGenericTypeButWithTypeArguments1.js | 3 +- .../reference/superCallInNonStaticMethod.js | 3 +- .../reference/superCallInStaticMethod.js | 3 +- .../reference/superCallOutsideConstructor.js | 3 +- .../superCallParameterContextualTyping1.js | 3 +- .../superCallParameterContextualTyping2.js | 3 +- .../superCallParameterContextualTyping3.js | 3 +- tests/baselines/reference/superCalls.js | 3 +- .../reference/superCallsInConstructor.js | 3 +- tests/baselines/reference/superErrors.js | 3 +- .../baselines/reference/superInCatchBlock1.js | 3 +- .../reference/superInConstructorParam1.js | 3 +- tests/baselines/reference/superInLambdas.js | 3 +- tests/baselines/reference/superNewCall1.js | 3 +- .../reference/superPropertyAccess.js | 3 +- .../reference/superPropertyAccess1.js | 3 +- .../reference/superPropertyAccess2.js | 3 +- .../reference/superPropertyAccessNoError.js | 3 +- .../superWithGenericSpecialization.js | 3 +- .../baselines/reference/superWithGenerics.js | 3 +- .../reference/superWithTypeArgument.js | 3 +- .../reference/superWithTypeArgument2.js | 3 +- .../reference/superWithTypeArgument3.js | 3 +- ...side-object-literal-getters-and-setters.js | 3 +- tests/baselines/reference/switchStatements.js | 3 +- .../reference/targetTypeBaseCalls.js | 3 +- .../reference/thisInInvalidContexts.js | 3 +- .../thisInInvalidContextsExternalModule.js | 3 +- tests/baselines/reference/thisInSuperCall.js | 3 +- tests/baselines/reference/thisInSuperCall1.js | 3 +- tests/baselines/reference/thisInSuperCall2.js | 3 +- tests/baselines/reference/thisInSuperCall3.js | 3 +- tests/baselines/reference/typeAssertions.js | 3 +- .../baselines/reference/typeGuardFunction.js | 3 +- .../reference/typeGuardFunctionErrors.js | 3 +- .../reference/typeGuardFunctionGenerics.js | 3 +- .../reference/typeGuardOfFormInstanceOf.js | 3 +- .../reference/typeGuardOfFormIsType.js | 3 +- tests/baselines/reference/typeMatch2.js | 3 +- tests/baselines/reference/typeOfSuperCall.js | 3 +- .../reference/typeParameterAsBaseClass.js | 3 +- .../reference/typeParameterAsBaseType.js | 3 +- .../reference/typeParameterExtendingUnion1.js | 3 +- .../reference/typeParameterExtendingUnion2.js | 3 +- .../baselines/reference/typeValueConflict1.js | 3 +- .../baselines/reference/typeValueConflict2.js | 3 +- tests/baselines/reference/typeofClass2.js | 3 +- .../typesWithSpecializedCallSignatures.js | 3 +- ...typesWithSpecializedConstructSignatures.js | 3 +- tests/baselines/reference/undeclaredBase.js | 3 +- .../undefinedIsSubtypeOfEverything.js | 3 +- .../baselines/reference/underscoreMapFirst.js | 3 +- .../reference/unionTypeEquivalence.js | 3 +- .../reference/unionTypeFromArrayLiteral.js | 3 +- .../reference/unionTypesAssignability.js | 3 +- tests/baselines/reference/unknownSymbols1.js | 3 +- .../reference/unspecializedConstraints.js | 3 +- ...untypedFunctionCallsWithTypeParameters1.js | 3 +- .../reference/validUseOfThisInSuper.js | 3 +- .../reference/varArgsOnConstructorTypes.js | 3 +- 528 files changed, 972 insertions(+), 1510 deletions(-) delete mode 100644 tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts delete mode 100644 tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index ec30d5b4dc7..3e48462062d 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -24,8 +24,7 @@ module A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A; (function (A) { diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index 4d296bf9ea5..a1386033e9f 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -28,8 +28,7 @@ module A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A; (function (A) { diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index f6d3f29f1ab..e3a4d0602b8 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -19,8 +19,7 @@ class ColoredPoint extends Point { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Point = (function () { function Point(x, y) { diff --git a/tests/baselines/reference/accessors_spec_section-4.5_inference.js b/tests/baselines/reference/accessors_spec_section-4.5_inference.js index 8b75e27031a..808019448b7 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.js @@ -28,8 +28,7 @@ class LanguageSpec_section_4_5_inference { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js index 06c8b55e23d..11e02297e47 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js @@ -38,8 +38,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsage1_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/aliasUsageInArray.js b/tests/baselines/reference/aliasUsageInArray.js index e5d44320c7d..ba0c954a3c2 100644 --- a/tests/baselines/reference/aliasUsageInArray.js +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -32,8 +32,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsageInArray_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.js b/tests/baselines/reference/aliasUsageInFunctionExpression.js index b7b95661ac8..702cbe4d53f 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.js +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -31,8 +31,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsageInFunctionExpression_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.js b/tests/baselines/reference/aliasUsageInGenericFunction.js index 856e6ddb43e..8706dd592eb 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.js +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -35,8 +35,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsageInGenericFunction_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js index e05f5e4f5cd..78ddd2d4a94 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -37,8 +37,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsageInIndexerOfClass_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.js b/tests/baselines/reference/aliasUsageInObjectLiteral.js index cc4b8273e84..f38cdf2111c 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.js +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -32,8 +32,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsageInObjectLiteral_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/aliasUsageInOrExpression.js b/tests/baselines/reference/aliasUsageInOrExpression.js index f382ee2f617..906a2c019d7 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.js +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -35,8 +35,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsageInOrExpression_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 39ff58a5322..27f85bb5fcd 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -35,8 +35,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); var VisualizationModel = (function (_super) { @@ -51,8 +50,7 @@ exports.VisualizationModel = VisualizationModel; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA"); var C = (function () { diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.js b/tests/baselines/reference/aliasUsageInVarAssignment.js index 2de34f00566..bfc63868ff4 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.js +++ b/tests/baselines/reference/aliasUsageInVarAssignment.js @@ -31,8 +31,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("aliasUsageInVarAssignment_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js index 8c2ceb055c7..23c985d2f8d 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -12,8 +12,7 @@ var t: number = f(x, x); // Not an error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js index 087a91fb02c..edc0f21323a 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.js +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -27,8 +27,7 @@ class Derived2 extends Base2 { // error because of the prototy var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js index 0b4462bebe7..2ab84c89513 100644 --- a/tests/baselines/reference/apparentTypeSupertype.js +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -17,8 +17,7 @@ class Derived extends Base { // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index 43aad9921bb..70177b4cba2 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -89,8 +89,7 @@ arr_any = i1; // should be an error - is var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index 5aeb74114bc..61bddd7e8e4 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -63,8 +63,7 @@ arr_any = i1; // should be an error - is var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index 8d2445e2739..95dd299ad43 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -111,8 +111,7 @@ module NonEmptyTypes { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var EmptyTypes; (function (EmptyTypes) { diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index dfd662bbf1c..fc573aa390e 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -55,8 +55,7 @@ var z3: { id: number }[] = var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Action = (function () { function Action() { diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index cb1d25258f2..0f86b7a7f2a 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -41,8 +41,7 @@ var context4: Base[] = [new Derived1(), new Derived1()]; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var arr1 = [[], [1], ['']]; var arr2 = [[null], [1], ['']]; diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index b3c0a0f7877..e303415df08 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -29,8 +29,7 @@ var as = [list, myDerivedList]; // List[] var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var List = (function () { function List() { diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index f4a11fb47ae..5d862dcec8c 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -100,8 +100,7 @@ var asserted2: any; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // Arrow function used in with statement with (window) { diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js index 1ad82ca531b..6f2eaf4d5cc 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -104,8 +104,7 @@ b18 = a18; // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js index 387395525ad..fc6ca05ad30 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -103,8 +103,7 @@ module Errors { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Errors; (function (Errors) { diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js index 2e3790cd529..ddf16c23f48 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -70,8 +70,7 @@ b18 = a18; // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js index a29a607f9ef..e57a5ac07a0 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -47,8 +47,7 @@ b16 = x.a16; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index 32176e764e9..d02c635c584 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -104,8 +104,7 @@ b18 = a18; // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js index 21bace1645c..6f9f20333f2 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -103,8 +103,7 @@ module Errors { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Errors; (function (Errors) { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js index 76be317e95a..bd4c73e65dd 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -70,8 +70,7 @@ b18 = a18; // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js index dc1d0dd2dee..98477fa1523 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -47,8 +47,7 @@ b16 = x.a16; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js index 6044c40b3cc..617d136bbb2 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -48,8 +48,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js index b3c073ea0b7..0c5b0be038f 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -45,8 +45,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index 229525a91f0..20279fb1dc5 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -96,8 +96,7 @@ module WithBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var OnlyDerived; (function (OnlyDerived) { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index 629f7bf5113..6675fab6d69 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -93,8 +93,7 @@ module SourceHasOptional { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index 4ffec4aa7dd..b89106eba2b 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -95,8 +95,7 @@ module SourceHasOptional { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js index 99457453af4..3391ac5773a 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -58,8 +58,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 33054009d8e..127f85512ac 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -74,8 +74,7 @@ foo() = value; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // expected error for all the LHS of assignments var value; diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index 5986ef4a3f5..f4bbad50c60 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -27,8 +27,7 @@ class Point3D extends Point { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Point = (function () { function Point(x, y) { diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index 4e7db8e6a5b..49038f37b18 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -33,8 +33,7 @@ function f() { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C(x, y) { diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js index 85b76221e3c..8463ed58a53 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.js +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -28,8 +28,7 @@ var z: Derived = b.foo(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js index 754d90e21ea..4c5fe22ea08 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.js +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -40,8 +40,7 @@ class Class4 extends Class3 var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var someVariable; var Class1 = (function () { diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js index aaa93710339..1de1ebd4bfb 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js @@ -30,8 +30,7 @@ class Wrapper { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/bases.js b/tests/baselines/reference/bases.js index 5687e9e0fe1..0275c225dac 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -24,8 +24,7 @@ new C().y; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B = (function () { function B() { diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index e56e530ad64..abd2cc5e874 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -32,8 +32,7 @@ function foo5(t: T, u: U): Object { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a; var b; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js index fb3c15a8fba..e0e7bc3f324 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -30,8 +30,7 @@ function foo3(t: T, u: U) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index 5642df5570c..ed0b0ecb328 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -26,8 +26,7 @@ var e51 = t5[2]; // {} var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js index 685e33acb6b..e43c22fab75 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -74,8 +74,7 @@ interface I extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js index 135c0c056ae..6105ddf23fa 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -119,8 +119,7 @@ module Errors { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Errors; (function (Errors) { diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js index c578a49ee55..aee3af6f740 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -54,8 +54,7 @@ interface I extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js index 74987308ef7..c72a77e4020 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -54,8 +54,7 @@ interface I extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js index aa2e9787bd1..e22bb1189ed 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -57,8 +57,7 @@ interface I9 extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index d21b4879daa..50840abfbb7 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -54,8 +54,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function foo(x, y) { var z = []; diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index 27c80e2991d..611ad93f531 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -12,8 +12,7 @@ class B extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(p) { diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js index 8b1005d4487..0102d1310a3 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -36,8 +36,7 @@ t4[2] = 10; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js index 022668ba7cf..04c328031cd 100644 --- a/tests/baselines/reference/chainedAssignment3.js +++ b/tests/baselines/reference/chainedAssignment3.js @@ -26,8 +26,7 @@ a = b = new A(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index 494f0bc1b5d..e7e1a3a871b 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -23,8 +23,7 @@ class C extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Chain = (function () { function Chain(value) { diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index bcdde6b3be1..d8f40a3f1d9 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -35,8 +35,7 @@ class Baz extends Object { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo; (function (Foo) { diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js index 1a50a46221b..8b908a97ee6 100644 --- a/tests/baselines/reference/circularImportAlias.js +++ b/tests/baselines/reference/circularImportAlias.js @@ -24,8 +24,7 @@ var c = new B.a.C(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B; (function (B) { diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index 5d715556ec1..a5538b66ecc 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -30,8 +30,7 @@ class Derived extends C3 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1(x) { diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 1d273e119ec..581746a180b 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -30,8 +30,7 @@ class Derived extends C3 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1(x) { diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index 43823bbb4d9..d98b094ccdb 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -17,8 +17,7 @@ d.p; // public, OK var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(p) { diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index 7299b04720f..a8d6fcd88e0 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -15,8 +15,7 @@ module M { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js index 52474582315..8515e1d98eb 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -16,8 +16,7 @@ class StringTreeCollection extends StringTreeCollectionBase { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x; if (typeof x !== "string") { diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index b8e079e8ecb..6168cb3418d 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -35,8 +35,7 @@ var r8 = D2.other(1); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index b099ce763e8..cafa4eebcd1 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -19,8 +19,7 @@ class C8 extends E { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index 3dcff0b44b9..4661ab961c9 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -9,8 +9,7 @@ class C5a extends null { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C4a = (function () { function C4a() { diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js index 0289797d1e3..44a4fbe2bd6 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.js +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -11,8 +11,7 @@ module M { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/classExtendingQualifiedName2.js b/tests/baselines/reference/classExtendingQualifiedName2.js index 76065ccc577..afd432180d4 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.js +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -11,8 +11,7 @@ module M { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index 726f918f4e8..fe8dc79b864 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -17,8 +17,7 @@ module Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js index 8dc3410a179..94c50679151 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -10,8 +10,7 @@ module Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index afbb4dab714..92414c7e6c3 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -20,8 +20,7 @@ class C6 extends []{ } // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index c41943072dd..2735032f3c4 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -7,8 +7,7 @@ class C6 extends []{ } // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C2 = (function (_super) { __extends(C2, _super); diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js index a3e596299fa..9b78cde35e9 100644 --- a/tests/baselines/reference/classExtendsInterface.js +++ b/tests/baselines/reference/classExtendsInterface.js @@ -12,8 +12,7 @@ class B2 implements Comparable2 {} var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function (_super) { __extends(A, _super); diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js index 79a4226731f..c370e797a57 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -9,8 +9,7 @@ class E extends E { } // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js index eee52b877e3..65cd72ce3c8 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -15,8 +15,7 @@ class E2 extends D2 { baz: T; } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index 02201425cba..c0b46e6cbb6 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -26,8 +26,7 @@ module O { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js index bff6dd92bc9..9241403a7ce 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -22,8 +22,7 @@ class E2 extends D2 { baz: T; } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); @@ -36,8 +35,7 @@ var C = (function (_super) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var D = (function (_super) { __extends(D, _super); @@ -50,8 +48,7 @@ var D = (function (_super) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var E = (function (_super) { __extends(E, _super); @@ -64,8 +61,7 @@ var E = (function (_super) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C2 = (function (_super) { __extends(C2, _super); @@ -78,8 +74,7 @@ var C2 = (function (_super) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var D2 = (function (_super) { __extends(D2, _super); @@ -92,8 +87,7 @@ var D2 = (function (_super) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var E2 = (function (_super) { __extends(E2, _super); diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.js b/tests/baselines/reference/classExtendsMultipleBaseClasses.js index 7027e85450d..d1ffee30415 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.js +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.js @@ -7,8 +7,7 @@ class C extends A,B { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js index 48f2e791139..164ffdc8493 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -12,8 +12,7 @@ module M { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index 411bd3c2fba..448db68db9f 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -9,8 +9,7 @@ class C extends foo { } // error, cannot extend it though var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function foo() { } var x = new foo(); // can be used as a constructor function diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.js b/tests/baselines/reference/classHeritageWithTrailingSeparator.js index 6d33f79a4d5..2d5b12d5201 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.js +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.js @@ -7,8 +7,7 @@ class D extends C, { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index 49b73bfdb18..490d2706b48 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -17,8 +17,7 @@ c2 = c; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js index f8773b435bd..00cb49e2da3 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -18,8 +18,7 @@ c2 = c; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index cf442b0ad24..0d7508b723b 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -20,8 +20,7 @@ c2 = c; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index a648f6bd63f..caacb7b3044 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -21,8 +21,7 @@ c2 = c; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index af6f0844d28..2e8d765be89 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -25,8 +25,7 @@ c2.bar(); // should error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js index 9f630b96306..e962c7295f2 100644 --- a/tests/baselines/reference/classIndexer3.js +++ b/tests/baselines/reference/classIndexer3.js @@ -14,8 +14,7 @@ class D123 extends C123 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C123 = (function () { function C123() { diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js index 374248c3a2c..1e463dd195d 100644 --- a/tests/baselines/reference/classInheritence.js +++ b/tests/baselines/reference/classInheritence.js @@ -6,8 +6,7 @@ class A extends A { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B = (function (_super) { __extends(B, _super); diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js index a33bf5499be..a92cfb430bf 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.js +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -19,8 +19,7 @@ class Derived2 extends Base<{ bar: string; }> { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index 8eed39bddeb..fd3fee2e037 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -23,8 +23,7 @@ a.foo(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function (_super) { __extends(A, _super); diff --git a/tests/baselines/reference/classOrderBug.js b/tests/baselines/reference/classOrderBug.js index ae50152d608..bc3f0e739c4 100644 --- a/tests/baselines/reference/classOrderBug.js +++ b/tests/baselines/reference/classOrderBug.js @@ -19,8 +19,7 @@ class foo extends baz {} var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var bar = (function () { function bar() { diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index 66cbc0c25c7..6d217149b83 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -19,8 +19,7 @@ C2.bar(); // valid var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index e09301fe85f..fb6f0d8cbb9 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -24,8 +24,7 @@ class TextBase implements IText { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var SubText = (function (_super) { __extends(SubText, _super); diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index a69b6ff0345..0891a7c9e74 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -22,8 +22,7 @@ var r3: typeof A = C; // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(x) { diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 90149d88d9d..95db2680a1c 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -117,8 +117,7 @@ class R { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // // test codegen for instance properties diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index f1a10b317a1..44e5d39c376 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -44,8 +44,7 @@ var d6 = new D(1); // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(x) { diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index 467738e0966..a36db6ee745 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -53,8 +53,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var NonGeneric; (function (NonGeneric) { diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index 7d86e1c7229..ec8a203d200 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -32,8 +32,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/classWithStaticMembers.js b/tests/baselines/reference/classWithStaticMembers.js index edad6c22c70..34928c37abd 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -23,8 +23,7 @@ var r3 = r.foo; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C(a, b) { diff --git a/tests/baselines/reference/classdecl.js b/tests/baselines/reference/classdecl.js index 127e0e9f32b..2af85da5b57 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -97,8 +97,7 @@ class e { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a(ns) { diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index c37b9f0e96a..652b3f7bac6 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -26,8 +26,7 @@ module Path.Utils { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Shape = (function () { function Shape() { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js index a58f4aa9f94..731f3d4f064 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js @@ -43,8 +43,7 @@ class c extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function _super() { } diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index b89a8753acd..06acaa0e02a 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -28,8 +28,7 @@ class c extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function _super() { } diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js index efa9c1d9f03..6702ba8ac3d 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -32,8 +32,7 @@ class c extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function _super() { } diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index 228b7243d4f..8d13eed617b 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -22,8 +22,7 @@ class b extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function _super() { } diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js index d2392f4df38..12685727795 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js @@ -36,8 +36,7 @@ class c extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var _super = 10; // No Error var Foo = (function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index dc3210c1f8e..6f543492898 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -24,8 +24,7 @@ class c extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var _super = 10; // No Error var Foo = (function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index 7a6ee0c45c5..373ee270014 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -22,8 +22,7 @@ class c extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var _super = 10; // No Error var Foo = (function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index f678c7cf6ca..7ba9b407858 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -21,8 +21,7 @@ class b extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var _super = 10; // No Error var Foo = (function () { diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index 540a2b659d9..5cddcc01845 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -15,8 +15,7 @@ class Foo extends base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var console; var _super = 10; // No error diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index ac8947e00d3..965887d6d1b 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -66,8 +66,7 @@ class Foo4 extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/collisionSuperAndParameter1.js b/tests/baselines/reference/collisionSuperAndParameter1.js index b072667396d..f6d1f23947d 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.js +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -13,8 +13,7 @@ class Foo2 extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index e96ae7d8928..f54bbef28a8 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -34,8 +34,7 @@ class b4 extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index dbf36111dfb..eb2ddd825fb 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -22,8 +22,7 @@ class b2 extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index 4fe5a30cb8b..33726436189 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -155,8 +155,7 @@ i2_i = i3_i; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var c1 = (function () { function c1() { diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js index aebb486a1b5..d59ec764680 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -198,8 +198,7 @@ var r8b7 = b6 !== a6; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A1 = (function () { function A1() { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js index 3d7e96be633..4bbc7675a31 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -172,8 +172,7 @@ var r8b7 = b7 !== a7; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js index 097246f183b..397c7e9d8e4 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -172,8 +172,7 @@ var r8b7 = b7 !== a7; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js index 6bb3cddc8a7..9f3c037538d 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -115,8 +115,7 @@ var r8b4 = b4 !== a4; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js index dee8fb5ed5a..68ebcb9d596 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -153,8 +153,7 @@ var r8b6 = b6 !== a6; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js index bc7db12ebf2..60177f0ea22 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -153,8 +153,7 @@ var r8b6 = b6 !== a6; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js index a35ece1b617..27d1b68c85d 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -263,8 +263,7 @@ var r8b11 = b11 !== a11; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js index 8ade79daa20..5a98e12b001 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -225,8 +225,7 @@ var r8b9 = b9 !== a9; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js index 080c7990c04..24069615e0a 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -111,8 +111,7 @@ var r8b1 = b4 !== a4; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js index f01b18496d5..f0dac057ca3 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -168,8 +168,7 @@ var r8b6 = b6 !== a6; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js index bd4525e5c7b..eaf1aca728d 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -168,8 +168,7 @@ var r8b6 = b6 !== a6; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js index cbd31f56b30..822d4b7520a 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -82,8 +82,7 @@ var rh4 = b2 !== a2; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js index 2d750b77f71..ca2b31a805c 100644 --- a/tests/baselines/reference/complexClassRelationships.js +++ b/tests/baselines/reference/complexClassRelationships.js @@ -51,8 +51,7 @@ class FooBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // There should be no errors in this file var Derived = (function (_super) { diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js index 920172b206d..71c1cee164f 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -9,8 +9,7 @@ class S18 extends S18 var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var S18 = (function (_super) { __extends(S18, _super); diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index 4c5c050dc83..833c1e1ea7c 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -126,8 +126,7 @@ foo() += value; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // expected error for all the LHS of compound assignments (arithmetic and addition) var value; diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.js b/tests/baselines/reference/computedPropertyNames24_ES5.js index e433383eb5c..5a4b79cf44a 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.js +++ b/tests/baselines/reference/computedPropertyNames24_ES5.js @@ -12,8 +12,7 @@ class C extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index eca2485ab7d..832fad174d8 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -17,8 +17,7 @@ class C extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.js b/tests/baselines/reference/computedPropertyNames26_ES5.js index 0e3b6c126bc..09a95419480 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -14,8 +14,7 @@ class C extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/computedPropertyNames27_ES5.js b/tests/baselines/reference/computedPropertyNames27_ES5.js index 12f02fbefa9..53e2c2988c8 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.js +++ b/tests/baselines/reference/computedPropertyNames27_ES5.js @@ -9,8 +9,7 @@ class C extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index b2be5f120a5..be79f22c2da 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -14,8 +14,7 @@ class C extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index 6bbca3da056..de60b5daf53 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -19,8 +19,7 @@ class C extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index fb7d651364b..f8e34603305 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -19,8 +19,7 @@ class C extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.js b/tests/baselines/reference/computedPropertyNames43_ES5.js index e51df61a8c1..c3b7f6a71d0 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -16,8 +16,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.js b/tests/baselines/reference/computedPropertyNames44_ES5.js index 5efc5a11496..1186f0caef7 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.js +++ b/tests/baselines/reference/computedPropertyNames44_ES5.js @@ -15,8 +15,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.js b/tests/baselines/reference/computedPropertyNames45_ES5.js index d7fb6f35407..ce948e58208 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.js +++ b/tests/baselines/reference/computedPropertyNames45_ES5.js @@ -16,8 +16,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js index 18c09a500a6..a493a5cfab0 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -51,8 +51,7 @@ var result11: any = true ? 1 : 'string'; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; //Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type var X = (function () { diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 62b887d7e60..3d75eb0507a 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -27,8 +27,7 @@ var result61: (t: X) => number| string = true ? (m) => m.propertyX1 : (n) => n.p var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; //Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type var X = (function () { diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index aa89c619e7e..45c0fe9ff0a 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -17,8 +17,7 @@ function foo(tagName: any): Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js index 529f888bfc9..946f8196372 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -18,8 +18,7 @@ function foo(tagName: any): Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js index 22b77ba6816..9cf9d71f7a2 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -23,8 +23,7 @@ class Container { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // No errors var Constraint = (function () { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js index c1c10ead1e3..38b7b7fc194 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -74,8 +74,7 @@ interface I extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js index 12907c6d032..7d07c1a1712 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -117,8 +117,7 @@ module Errors { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Errors; (function (Errors) { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js index ef03802a17e..ba341eec61f 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -64,8 +64,7 @@ interface I extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js index 9964a3464a1..304b5cafd66 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -54,8 +54,7 @@ interface I extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js index 4cf9b7d71f5..99c885f9716 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -57,8 +57,7 @@ interface I9 extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index 93a47178d52..6fc3511b70e 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -19,8 +19,7 @@ class Sub extends Super { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Super = (function () { function Super(value) { diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js index 9c92f31ce97..305b3e54ead 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -23,8 +23,7 @@ class Derived2 extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index 61cf399f613..b2bf377f0cc 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -37,8 +37,7 @@ class Derived2 extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(x) { diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js index 47020120f9f..a1bdee8e7d4 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -35,8 +35,7 @@ module Generic { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var NonGeneric; (function (NonGeneric) { diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index 16da3f0fa0a..d95477d84f6 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -29,8 +29,7 @@ f1.bar1(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var FooBase = (function () { function FooBase(x) { diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js index f4299466aa1..c7e4e411319 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -26,8 +26,7 @@ f1.bar1(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function (_super) { __extends(Foo, _super); diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 01a1880ffd5..5a61d4d5d7e 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -283,8 +283,7 @@ TypeScriptAllInOne.Program.Main(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var fs = module; ("fs"); diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js index e24ae90176c..59da607079b 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -18,8 +18,7 @@ var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }]; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index 72c15455e8e..a0f8ea0a4cf 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -18,8 +18,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x = true ? function (a) { return a.toExponential(); } : function (b) { return b.toFixed(); }; var A = (function () { diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index 4e6b95a6857..2833ed37d4b 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -16,8 +16,7 @@ var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js index 17c9ac649d8..332f4897fc7 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js @@ -14,8 +14,7 @@ var a: D = foo("hi", []); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js index 134bacd6053..0f13824fc45 100644 --- a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js @@ -13,8 +13,7 @@ interface I extends X<() => number> { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var X = (function () { function X() { diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js index 23630ba5218..caaba28859a 100644 --- a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js @@ -16,8 +16,7 @@ class Baz implements IBar { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index dfbe147a78d..b67bacebb1a 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -43,8 +43,7 @@ export var j = C.F6; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C; (function (C) { diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 03649af4ba6..416e0f6737c 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -46,8 +46,7 @@ module templa.dom.mvc.composite { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // Module var templa; diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 8881122839e..e21c28138a2 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -24,8 +24,7 @@ module X.Y.base.Z { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var X; (function (X) { diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js index c06461e89fc..587b8ff1e27 100644 --- a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -22,8 +22,7 @@ module A.B.C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A; (function (A) { diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.js b/tests/baselines/reference/declarationEmit_nameConflicts3.js index ee21d9a408d..07299132bd4 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.js @@ -30,8 +30,7 @@ module M.P { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.js b/tests/baselines/reference/declarationEmit_protectedMembers.js index faa1dc298e1..536f4f4aff7 100644 --- a/tests/baselines/reference/declarationEmit_protectedMembers.js +++ b/tests/baselines/reference/declarationEmit_protectedMembers.js @@ -54,8 +54,7 @@ class C4 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // Class with protected members var C1 = (function () { diff --git a/tests/baselines/reference/declareDottedExtend.js b/tests/baselines/reference/declareDottedExtend.js index 2579a5557fc..030e5048ef7 100644 --- a/tests/baselines/reference/declareDottedExtend.js +++ b/tests/baselines/reference/declareDottedExtend.js @@ -15,8 +15,7 @@ class E extends A.B.C{ } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ab = A.B; var D = (function (_super) { diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js index aa938eaaaf4..05c4f285291 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.js +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -13,8 +13,7 @@ module M { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index 37dc2db870b..b9090176add 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -37,8 +37,7 @@ class Derived4 extends Base2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js index eaf7dfd5698..64da47e68e0 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js @@ -18,8 +18,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js index b83255ccf93..0538ba9b54a 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js @@ -44,8 +44,7 @@ var r8 = d2[1]; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(x) { diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js index 1fe59d78044..a575c9bb183 100644 --- a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js @@ -21,8 +21,7 @@ class Derived2 extends Base2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index b9cd6df0338..7e11209b8fe 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -19,8 +19,7 @@ new DerivedClass(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var BaseClass = (function () { function BaseClass() { diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.js b/tests/baselines/reference/derivedClassOverridesPrivates.js index 2cc8360a803..6662b5013d8 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.js +++ b/tests/baselines/reference/derivedClassOverridesPrivates.js @@ -19,8 +19,7 @@ class Derived2 extends Base2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index 48ee6eded6c..21f2ce87880 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -40,8 +40,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x; var y; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js index fca27b0de04..b5fe3e93af5 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -67,8 +67,7 @@ var r8 = d2[1]; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x; var y; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index 2a102d55eac..c4dc1d0e9d5 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -75,8 +75,7 @@ class Derived10 extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x; var y; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js index 5145f3919a8..f25c3b792de 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js @@ -18,8 +18,7 @@ class Derived2 extends Derived1 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x; var y; diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index 0529189e4c1..5125be4eeeb 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -66,8 +66,7 @@ var r8 = d2[1]; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x; var y; diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js index 5cb746bfdd3..9762c88035a 100644 --- a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js @@ -27,8 +27,7 @@ class Derived2 extends Base2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index dd5b206ecdd..55c0a312b71 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -99,8 +99,7 @@ class Derived10 extends Base2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js index d2914cd6949..0c214d42fec 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js @@ -36,8 +36,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index 7c7e9b40cec..a81a092fa54 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -32,8 +32,7 @@ class Derived4 extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(a) { diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index ad4f3e481a7..de7669a71b5 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -25,8 +25,7 @@ var r2 = e.foo(''); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/derivedClassTransitivity2.js b/tests/baselines/reference/derivedClassTransitivity2.js index efeb25195ff..22e930ab7f9 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -25,8 +25,7 @@ var r2 = e.foo(1, ''); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/derivedClassTransitivity3.js b/tests/baselines/reference/derivedClassTransitivity3.js index 8befbf18731..a1aa3a978eb 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -25,8 +25,7 @@ var r2 = e.foo('', 1); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/derivedClassTransitivity4.js b/tests/baselines/reference/derivedClassTransitivity4.js index 546c7e4a849..a4d319707c7 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.js +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -25,8 +25,7 @@ var r2 = e.foo(''); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/derivedClassWithAny.js b/tests/baselines/reference/derivedClassWithAny.js index 6f9ef484627..123853f3afd 100644 --- a/tests/baselines/reference/derivedClassWithAny.js +++ b/tests/baselines/reference/derivedClassWithAny.js @@ -63,8 +63,7 @@ var r = c.foo(); // e.foo would return string var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js index bf8b1b51cd1..3454c60f881 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -26,8 +26,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js index 131c529f3bf..7de92c9cb2f 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js @@ -36,8 +36,7 @@ Derived.a = 2; // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js index d661eeadc06..36d2b7d2dc3 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -25,8 +25,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js index c3fc34b21c1..36080385b3b 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js @@ -37,8 +37,7 @@ Derived.a = 2; // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index 16b9b110a5f..27a634ab2d9 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -29,8 +29,7 @@ var d2 = new D(new Date()); // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(x) { diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index 6e413752f1d..82c5eec1d7d 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -37,8 +37,7 @@ var d4 = new D(new Date(), new Date(), new Date()); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(x) { diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index b72fdb1503d..4bfa7c81577 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -51,8 +51,7 @@ var d3 = new D2(new Date(), new Date()); // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(x) { diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js index 7221031cb8b..214c65bde6c 100644 --- a/tests/baselines/reference/derivedClasses.js +++ b/tests/baselines/reference/derivedClasses.js @@ -34,8 +34,7 @@ b.hue(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Red = (function (_super) { __extends(Red, _super); diff --git a/tests/baselines/reference/derivedGenericClassWithAny.js b/tests/baselines/reference/derivedGenericClassWithAny.js index b5bfbd5e5db..15835e78bd5 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.js +++ b/tests/baselines/reference/derivedGenericClassWithAny.js @@ -46,8 +46,7 @@ var r = c.foo(); // e.foo would return string var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js index 564a51f2b13..0839b93971b 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -21,8 +21,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js index f981a5e6e54..f00c32114cf 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -24,8 +24,7 @@ var r: Base[] = [d1, d2]; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js index 7540302599c..38366ca67ba 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -55,8 +55,7 @@ d3({ y: "world" }); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Class = (function () { function Class() { diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.js b/tests/baselines/reference/emitThisInSuperMethodCall.js index 9224e156de9..f5cff5a8fa5 100644 --- a/tests/baselines/reference/emitThisInSuperMethodCall.js +++ b/tests/baselines/reference/emitThisInSuperMethodCall.js @@ -31,8 +31,7 @@ class RegisteredUser extends User { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var User = (function () { function User() { diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js index f1a0d741a5c..0b30745fa15 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js @@ -15,8 +15,7 @@ class derived extends base { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function f() { var d1 = new derived(); diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index bd692f35fa3..d2d4911c76a 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -78,8 +78,7 @@ class OtherDerived extends OtherBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; //super call in class constructor with no base type var NoBase = (function () { diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index abf077d2b82..57a574d8a06 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -132,8 +132,7 @@ var obj = { n: super.wat, p: super.foo() }; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; //super property access in constructor of class with no base type //super property access in instance member function of class with no base type diff --git a/tests/baselines/reference/errorsInGenericTypeReference.js b/tests/baselines/reference/errorsInGenericTypeReference.js index 0ba69b601ae..42c7456be60 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.js +++ b/tests/baselines/reference/errorsInGenericTypeReference.js @@ -76,8 +76,7 @@ interface testInterface2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.js b/tests/baselines/reference/es6ClassSuperCodegenBug.js index a374778ef45..62c96f6260d 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.js +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -17,8 +17,7 @@ class B extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(str1, str2) { diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index bf65840e31c..9247dfde1c3 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -88,8 +88,7 @@ declare module AmbientMod { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Bar = (function () { function Bar(n) { diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index 40f1c15c8f1..20200a692ff 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -162,8 +162,7 @@ var ccwc = new ChildClassWithoutConstructor(1, "s"); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var BasicMonster = (function () { function BasicMonster(name, health) { diff --git a/tests/baselines/reference/es6ClassTest7.js b/tests/baselines/reference/es6ClassTest7.js index c4f7e83b9a2..970e9c4fd9e 100644 --- a/tests/baselines/reference/es6ClassTest7.js +++ b/tests/baselines/reference/es6ClassTest7.js @@ -12,8 +12,7 @@ class Bar extends M.Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Bar = (function (_super) { __extends(Bar, _super); diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.js b/tests/baselines/reference/exportAssignmentOfGenericType1.js index 983c328cd98..59fa01f2ca0 100644 --- a/tests/baselines/reference/exportAssignmentOfGenericType1.js +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.js @@ -26,8 +26,7 @@ define(["require", "exports"], function (require, exports) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; define(["require", "exports", "exportAssignmentOfGenericType1_0"], function (require, exports, q) { var M = (function (_super) { diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js index 9894f1fb194..4a1ee9b739f 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.js +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -22,8 +22,7 @@ var a: Bbb.SomeType; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Bbb = (function () { function Bbb() { diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js index 9e7421b906c..07923eccc88 100644 --- a/tests/baselines/reference/extBaseClass1.js +++ b/tests/baselines/reference/extBaseClass1.js @@ -23,8 +23,7 @@ module N { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/extBaseClass2.js b/tests/baselines/reference/extBaseClass2.js index e5a717bca80..6e9972c3f29 100644 --- a/tests/baselines/reference/extBaseClass2.js +++ b/tests/baselines/reference/extBaseClass2.js @@ -14,8 +14,7 @@ module M { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var N; (function (N) { diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js index c69315dbd61..6a631ceebf8 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -17,8 +17,7 @@ d.foo; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js index 06ea74880c2..42cf785c0b0 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -20,8 +20,7 @@ var r4: number = d.bar(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js index 7598d771bac..d8c54b58d7e 100644 --- a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js @@ -7,8 +7,7 @@ class base { constructor (public n: number) { } } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var derived = (function (_super) { __extends(derived, _super); diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index 59da2d7ca2b..29408686068 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -7,8 +7,7 @@ class C extends x { } // error, could not find symbol xs var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/extendNonClassSymbol2.js b/tests/baselines/reference/extendNonClassSymbol2.js index 830994e3d26..a65eeca612a 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.js +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -9,8 +9,7 @@ class C extends Foo {} // error, could not find symbol Foo var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function Foo() { this.x = 1; diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js index 0bf86390b74..297a7527ec0 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js @@ -43,8 +43,7 @@ exports.Model = Model; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { @@ -59,8 +58,7 @@ exports.VisualizationModel = VisualizationModel; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.js b/tests/baselines/reference/extendsClauseAlreadySeen.js index 3e7151b8e0d..ed6602c116a 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen.js @@ -10,8 +10,7 @@ class D extends C extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.js b/tests/baselines/reference/extendsClauseAlreadySeen2.js index 9ee428c36ed..2c77f4e673f 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.js @@ -10,8 +10,7 @@ class D extends C extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/for-inStatements.js b/tests/baselines/reference/for-inStatements.js index 749c7b47b34..d735a37ba97 100644 --- a/tests/baselines/reference/for-inStatements.js +++ b/tests/baselines/reference/for-inStatements.js @@ -84,8 +84,7 @@ for (var x in Color.Blue) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var aString; for (aString in {}) { } diff --git a/tests/baselines/reference/for-inStatementsInvalid.js b/tests/baselines/reference/for-inStatementsInvalid.js index e1806272790..93b9fb9b97f 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.js +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -67,8 +67,7 @@ for (var x in i[42]) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var aNumber; for (aNumber in {}) { } diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js index b00e8acef14..1dde9981880 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -57,8 +57,7 @@ for( var m = M.A;;){} var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 6c1daffdaf1..42be5f21458 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -77,8 +77,7 @@ var f13 = () => { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index 0370c4c0027..3fc040650e4 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -160,8 +160,7 @@ var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherC var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // FunctionExpression with no return type annotation and no return statement returns void var v = function () { }(); diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.js b/tests/baselines/reference/functionSubtypingOfVarArgs.js index b0168975677..ddcb0570908 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.js @@ -18,8 +18,7 @@ class StringEvent extends EventBase { // should work var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var EventBase = (function () { function EventBase() { diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.js b/tests/baselines/reference/functionSubtypingOfVarArgs2.js index 7efd35cc2d2..d04a5b97dae 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs2.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.js @@ -18,8 +18,7 @@ class StringEvent extends EventBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var EventBase = (function () { function EventBase() { diff --git a/tests/baselines/reference/generatedContextualTyping.js b/tests/baselines/reference/generatedContextualTyping.js index 3c2c704ddb0..1f7d2b8035f 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -358,8 +358,7 @@ var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.js b/tests/baselines/reference/genericBaseClassLiteralProperty.js index 5e365531461..f8a5f78e753 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.js @@ -16,8 +16,7 @@ class SubClass extends BaseClass { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var BaseClass = (function () { function BaseClass() { diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.js b/tests/baselines/reference/genericBaseClassLiteralProperty2.js index 8a19d857bb6..d5c480955d8 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.js @@ -19,8 +19,7 @@ class DataView2 extends BaseCollection2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var CollectionItem2 = (function () { function CollectionItem2() { diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js index f00468dcbc5..9df55756ee2 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -112,8 +112,7 @@ var r11 = i.foo8(); // Base var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index 910e3860b49..bded01ead69 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -36,8 +36,7 @@ var r4 = f2(i); // Base => Derived var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index 9cb2425f9d0..96c2f9300db 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -44,8 +44,7 @@ var r7 = f3(null, x => x); // any var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index 3c5a4c24b53..daaa2f5c0eb 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -42,8 +42,7 @@ var r6 = f3(x => x, null); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js index 16abb2683e7..093757d513d 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -27,8 +27,7 @@ module M { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js index 22bb975e7d7..f77f60a2fb9 100644 --- a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js @@ -9,8 +9,7 @@ class C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function (_super) { __extends(A, _super); diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index 43d1e53a615..69261747244 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -79,8 +79,7 @@ class ViewModel implements Contract { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Portal; (function (Portal) { diff --git a/tests/baselines/reference/genericClassStaticMethod.js b/tests/baselines/reference/genericClassStaticMethod.js index 23e1874c0ed..aed721aa7d5 100644 --- a/tests/baselines/reference/genericClassStaticMethod.js +++ b/tests/baselines/reference/genericClassStaticMethod.js @@ -14,8 +14,7 @@ class Bar extends Foo { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js index 373052d78e3..14ffab2f6f6 100644 --- a/tests/baselines/reference/genericClasses3.js +++ b/tests/baselines/reference/genericClasses3.js @@ -21,8 +21,7 @@ var z = v2.b; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B = (function () { function B() { diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index 561c24cd50e..b4e56933775 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -30,8 +30,7 @@ module EndGate.Tweening { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var EndGate; (function (EndGate) { diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index 2420e082e3d..54a807a8e87 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -29,8 +29,7 @@ module EndGate.Tweening { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var EndGate; (function (EndGate) { diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js index 69ae509bf54..eb27365ebc5 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js @@ -16,8 +16,7 @@ x = y; // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js index 1c4f27b5ebe..be94a778858 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js @@ -16,8 +16,7 @@ x = y; // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/genericPrototypeProperty2.js b/tests/baselines/reference/genericPrototypeProperty2.js index b91b345481e..cbe33431ca4 100644 --- a/tests/baselines/reference/genericPrototypeProperty2.js +++ b/tests/baselines/reference/genericPrototypeProperty2.js @@ -19,8 +19,7 @@ class MyEventWrapper extends BaseEventWrapper { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var BaseEvent = (function () { function BaseEvent() { diff --git a/tests/baselines/reference/genericPrototypeProperty3.js b/tests/baselines/reference/genericPrototypeProperty3.js index de093886ea4..6447a4e0ac2 100644 --- a/tests/baselines/reference/genericPrototypeProperty3.js +++ b/tests/baselines/reference/genericPrototypeProperty3.js @@ -18,8 +18,7 @@ class MyEventWrapper extends BaseEventWrapper { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var BaseEvent = (function () { function BaseEvent() { diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js index b73239626d0..a1f7566f1c0 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js @@ -30,8 +30,7 @@ module TypeScript2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var TypeScript2; (function (TypeScript2) { diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index 0d4a3315acd..a0229e19925 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -34,8 +34,7 @@ module TypeScript { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var TypeScript; (function (TypeScript) { diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index a3b88f599b9..22ff708592e 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -17,8 +17,7 @@ var r5: A = >[]; // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/genericTypeAssertions4.js b/tests/baselines/reference/genericTypeAssertions4.js index 95ca5482b2e..d6d8672283c 100644 --- a/tests/baselines/reference/genericTypeAssertions4.js +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -29,8 +29,7 @@ function foo2(x: T) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/genericTypeAssertions6.js b/tests/baselines/reference/genericTypeAssertions6.js index d19da506680..30a5d5ff5e5 100644 --- a/tests/baselines/reference/genericTypeAssertions6.js +++ b/tests/baselines/reference/genericTypeAssertions6.js @@ -28,8 +28,7 @@ var c: A = >b; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(x) { diff --git a/tests/baselines/reference/genericTypeConstraints.js b/tests/baselines/reference/genericTypeConstraints.js index 6f0f235ccb8..eb8bed1fb92 100644 --- a/tests/baselines/reference/genericTypeConstraints.js +++ b/tests/baselines/reference/genericTypeConstraints.js @@ -17,8 +17,7 @@ class BarExtended extends Bar { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index 5ec0a25af3d..0cbf3581706 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -43,8 +43,7 @@ var k = null; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js index 2f36a74de76..355030caa1b 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -43,8 +43,7 @@ var k = null; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var c; var a; diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js index 8142cd86407..2457d4a534e 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -18,8 +18,7 @@ export class ListItem extends CollectionItem { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; define(["require", "exports"], function (require, exports) { var Collection = (function () { diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index 26d1b09a6fc..45ea6429979 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -136,8 +136,7 @@ function foo4(t: T, u: U) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = [1, '']; // {}[] var b = [1, null]; // number[] diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index d389f705707..020d3f053d1 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -166,8 +166,7 @@ do { }while(fn) var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index 57a382fe625..c3a52473744 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -24,8 +24,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/implementClausePrecedingExtends.js b/tests/baselines/reference/implementClausePrecedingExtends.js index 7501c231dc8..a929c2fb966 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.js +++ b/tests/baselines/reference/implementClausePrecedingExtends.js @@ -6,8 +6,7 @@ class D implements C extends C { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js index 3d80d344850..cfa5ccf4150 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -89,8 +89,7 @@ module M2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js index 1fa40bf7aa2..39f30424321 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js @@ -45,8 +45,7 @@ class Bar8 extends Foo implements I { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js index 24f7e0477d6..bcd8a5ce16c 100644 --- a/tests/baselines/reference/importAsBaseClass.js +++ b/tests/baselines/reference/importAsBaseClass.js @@ -22,8 +22,7 @@ exports.Greeter = Greeter; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Hello = (function (_super) { __extends(Hello, _super); diff --git a/tests/baselines/reference/importShadowsGlobalName.js b/tests/baselines/reference/importShadowsGlobalName.js index 6db46eb41b1..fe37e938a5a 100644 --- a/tests/baselines/reference/importShadowsGlobalName.js +++ b/tests/baselines/reference/importShadowsGlobalName.js @@ -23,8 +23,7 @@ define(["require", "exports"], function (require, exports) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; define(["require", "exports", 'Foo'], function (require, exports, Error) { var Bar = (function (_super) { diff --git a/tests/baselines/reference/importUsedInExtendsList1.js b/tests/baselines/reference/importUsedInExtendsList1.js index 3e07ee084f3..e86b1a41456 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.js +++ b/tests/baselines/reference/importUsedInExtendsList1.js @@ -22,8 +22,7 @@ exports.Super = Super; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /// var foo = require('importUsedInExtendsList1_require'); diff --git a/tests/baselines/reference/indexerConstraints2.js b/tests/baselines/reference/indexerConstraints2.js index 7d3966688db..7e662bc66cc 100644 --- a/tests/baselines/reference/indexerConstraints2.js +++ b/tests/baselines/reference/indexerConstraints2.js @@ -32,8 +32,7 @@ class K extends J { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/indirectSelfReference.js b/tests/baselines/reference/indirectSelfReference.js index 3652d2962d0..bd838ed8810 100644 --- a/tests/baselines/reference/indirectSelfReference.js +++ b/tests/baselines/reference/indirectSelfReference.js @@ -6,8 +6,7 @@ class b extends a{ } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function (_super) { __extends(a, _super); diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.js b/tests/baselines/reference/indirectSelfReferenceGeneric.js index 079a37dc201..c9b4478ec13 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.js +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.js @@ -6,8 +6,7 @@ class b extends a { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function (_super) { __extends(a, _super); diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js index 71390b03c83..f057b649cb6 100644 --- a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js @@ -28,8 +28,7 @@ o(A); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Functionality = (function () { function Functionality() { diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.js b/tests/baselines/reference/inheritFromGenericTypeParameter.js index ccf445a26bf..ec6be00785f 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.js +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.js @@ -6,8 +6,7 @@ interface I extends T { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js index 850741c3666..93494c7256e 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js @@ -14,8 +14,7 @@ interface A extends C, C2 { // ok var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B = (function () { function B() { diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js index f2b5be9335e..b581ae894ae 100644 --- a/tests/baselines/reference/inheritance.js +++ b/tests/baselines/reference/inheritance.js @@ -38,8 +38,7 @@ class Baad extends Good { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B1 = (function () { function B1() { diff --git a/tests/baselines/reference/inheritance1.js b/tests/baselines/reference/inheritance1.js index e0d4fa974c5..aa7775b9904 100644 --- a/tests/baselines/reference/inheritance1.js +++ b/tests/baselines/reference/inheritance1.js @@ -65,8 +65,7 @@ l1 = c; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Control = (function () { function Control() { diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js index 0f016233ef3..927ae969049 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -14,8 +14,7 @@ class C extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js index 596982a4794..05d8dc2a541 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -14,8 +14,7 @@ class C extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js index ec8ae03b3e3..ddd87251f9f 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -14,8 +14,7 @@ class C extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js index 2da2bcbe6fe..eaf34df921b 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js @@ -21,8 +21,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js index 8b58a7f2b35..cd79d8c6964 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js @@ -18,8 +18,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js index 1864e62b237..18c1ab33952 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js @@ -16,8 +16,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js index 0b24db92a35..5c254251718 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js @@ -18,8 +18,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js index bf1186a5cde..e2d3d9551c2 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js @@ -15,8 +15,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js index 2ecf7edb0e8..b1d64aeb2c8 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js @@ -13,8 +13,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js index 512ca023dee..bfa5d3fb801 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js @@ -17,8 +17,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js index 975727031e3..d84f4879632 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js @@ -13,8 +13,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js index b924932e0b4..8677d502273 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js @@ -11,8 +11,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js index d62c62410b7..73d3b4aa6cb 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -11,8 +11,7 @@ var b3 = new B(); // error, could not select overload for 'new' expression var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js index c54f8b4d317..e7e6228392c 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -18,8 +18,7 @@ var n3 = new N.D2(); // no error, D2 var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js index 120efc11e27..32f1d20eda1 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js @@ -21,8 +21,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js index 7200f37f94b..7a1a86ced18 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js @@ -18,8 +18,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js index 2fd5e18dab9..8a142d41c57 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js @@ -16,8 +16,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js index 812ac57bfe4..7c08ec7649e 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js @@ -18,8 +18,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js index 224c0326a87..acde620c100 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js @@ -15,8 +15,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js index 375f07fd905..abd4d7c1498 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js @@ -15,8 +15,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js index c4d3f7ca420..c2d095e5527 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js @@ -13,8 +13,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js index f9513f68585..979f0c36359 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js @@ -13,8 +13,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js index f64615e8a7c..5c6c0e06a6f 100644 --- a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js @@ -13,8 +13,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.js b/tests/baselines/reference/inheritanceStaticMembersCompatible.js index f1e288c57f5..014d3276189 100644 --- a/tests/baselines/reference/inheritanceStaticMembersCompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.js @@ -11,8 +11,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js index 66ad8612538..a1728dc6dcb 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js @@ -11,8 +11,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js index 310f2127e7e..b81b6cd1d78 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js @@ -15,8 +15,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js index 3e8a444d772..9afa969af65 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js @@ -13,8 +13,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js index 088cfa9b1f9..fcecca62774 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js @@ -11,8 +11,7 @@ class b extends a { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = (function () { function a() { diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.js b/tests/baselines/reference/inheritedConstructorWithRestParams.js index 45f4fe72535..a0bb2ed8dc1 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.js @@ -18,8 +18,7 @@ new Derived(3); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.js b/tests/baselines/reference/inheritedConstructorWithRestParams2.js index eeb0413d1ec..9b87465233c 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.js @@ -38,8 +38,7 @@ new Derived("", 3, "", ""); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var IBaseBase = (function () { function IBaseBase(x) { diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js index 75a2f13fed7..50f41af2c09 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.js +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -25,8 +25,7 @@ class E extends D { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js index 9e8e6d26b31..548cb77b878 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js @@ -46,8 +46,7 @@ module Generic { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var NonGeneric; (function (NonGeneric) { diff --git a/tests/baselines/reference/instanceSubtypeCheck2.js b/tests/baselines/reference/instanceSubtypeCheck2.js index e02a2b2afad..59043b29b4e 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.js +++ b/tests/baselines/reference/instanceSubtypeCheck2.js @@ -11,8 +11,7 @@ class C2 extends C1 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.js b/tests/baselines/reference/instantiatedReturnTypeContravariance.js index 678f324797f..2484816fe33 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.js +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.js @@ -34,8 +34,7 @@ return null; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var c = (function () { function c() { diff --git a/tests/baselines/reference/interfaceExtendsClass1.js b/tests/baselines/reference/interfaceExtendsClass1.js index 5e72b36ef30..2fbe01bdf67 100644 --- a/tests/baselines/reference/interfaceExtendsClass1.js +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -22,8 +22,7 @@ class Location { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Control = (function () { function Control() { diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js index dac502b9ca3..9a6e92c3e2b 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -31,8 +31,7 @@ d = c; // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index c6a11c1d3ab..44738036f96 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -27,8 +27,7 @@ class D2 extends C implements I { // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/interfaceImplementation8.js b/tests/baselines/reference/interfaceImplementation8.js index 64b4c453829..cb6eaa12450 100644 --- a/tests/baselines/reference/interfaceImplementation8.js +++ b/tests/baselines/reference/interfaceImplementation8.js @@ -44,8 +44,7 @@ class C8 extends C7 implements i2{ var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js index 4b3ab1b6d88..0b662b56f06 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js @@ -83,8 +83,7 @@ module YYY4 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Y; (function (Y) { diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js index 31d0e44c918..b239a3dc1dd 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.js +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -57,8 +57,7 @@ var m = M.A; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/invalidReturnStatements.js b/tests/baselines/reference/invalidReturnStatements.js index 50977334f4c..5fbe8c4dc37 100644 --- a/tests/baselines/reference/invalidReturnStatements.js +++ b/tests/baselines/reference/invalidReturnStatements.js @@ -24,8 +24,7 @@ function fn11(): D { return new C(); } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // all the following should be error function fn1() { } diff --git a/tests/baselines/reference/isolatedModulesImportExportElision.js b/tests/baselines/reference/isolatedModulesImportExportElision.js index ca3eee0ac2b..8cb65747e6f 100644 --- a/tests/baselines/reference/isolatedModulesImportExportElision.js +++ b/tests/baselines/reference/isolatedModulesImportExportElision.js @@ -17,8 +17,7 @@ export var z = x; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var module_1 = require("module"); var module_2 = require("module"); diff --git a/tests/baselines/reference/lambdaArgCrash.js b/tests/baselines/reference/lambdaArgCrash.js index 0f71ae803d6..5616b5d525f 100644 --- a/tests/baselines/reference/lambdaArgCrash.js +++ b/tests/baselines/reference/lambdaArgCrash.js @@ -38,8 +38,7 @@ class ItemSetEvent extends Event { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Event = (function () { function Event() { diff --git a/tests/baselines/reference/lift.js b/tests/baselines/reference/lift.js index eaaf94e7024..a832b34641d 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -21,8 +21,7 @@ class C extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B = (function () { function B(y) { diff --git a/tests/baselines/reference/localTypes1.js b/tests/baselines/reference/localTypes1.js index 09fa9c04f3c..00c65db2c96 100644 --- a/tests/baselines/reference/localTypes1.js +++ b/tests/baselines/reference/localTypes1.js @@ -145,8 +145,7 @@ function f6() { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function f1() { var E; diff --git a/tests/baselines/reference/m7Bugs.js b/tests/baselines/reference/m7Bugs.js index 72829316fb8..86b5aa96c77 100644 --- a/tests/baselines/reference/m7Bugs.js +++ b/tests/baselines/reference/m7Bugs.js @@ -30,8 +30,7 @@ var y3: C1 = {}; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var s = ({}); var x = {}; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js index 389bbfa63dd..26cd3c8bf7c 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -35,8 +35,7 @@ var r2 = a.w; // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js index d088aab3d3c..530595d54f6 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js @@ -42,8 +42,7 @@ module M { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/moduleAsBaseType.js b/tests/baselines/reference/moduleAsBaseType.js index c2246be8795..7e2af06480d 100644 --- a/tests/baselines/reference/moduleAsBaseType.js +++ b/tests/baselines/reference/moduleAsBaseType.js @@ -8,8 +8,7 @@ class C2 implements M { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js index e8e08eed26c..9b7449b95ca 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js @@ -18,8 +18,7 @@ define(["require", "exports"], function (require, exports) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; define(["require", "exports"], function (require, exports) { var C1 = (function () { diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js index 6c0f625f986..aeffc8d6e5b 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -62,8 +62,7 @@ module Y { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A; (function (A_1) { diff --git a/tests/baselines/reference/multipleInheritance.js b/tests/baselines/reference/multipleInheritance.js index ea4a7156df9..901838b584b 100644 --- a/tests/baselines/reference/multipleInheritance.js +++ b/tests/baselines/reference/multipleInheritance.js @@ -42,8 +42,7 @@ class Baad extends Good { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B1 = (function () { function B1() { diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js index 9b3d6f31291..09f4be0c4e9 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -14,8 +14,7 @@ var test = new foo(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var foo = (function () { function foo() { diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js index b687162c154..7cdb702d6ff 100644 --- a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -9,8 +9,7 @@ class Bar extends Foo { } // Valid var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js index fe1e4768672..ade000d50ba 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -50,8 +50,7 @@ var b: { [x: number]: A } = { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/numericIndexerConstraint3.js b/tests/baselines/reference/numericIndexerConstraint3.js index 724db29f557..dc3b6024eee 100644 --- a/tests/baselines/reference/numericIndexerConstraint3.js +++ b/tests/baselines/reference/numericIndexerConstraint3.js @@ -16,8 +16,7 @@ class C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js index 404a9394bf7..7509c64eac8 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.js +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -15,8 +15,7 @@ var x: { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js index c5e91e9dfc0..2e3ba2ce74c 100644 --- a/tests/baselines/reference/numericIndexerTyping2.js +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -16,8 +16,7 @@ var r2: string = i2[1]; // error: numeric indexer returns the type of the string var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var I = (function () { function I() { diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index 45d56a1d716..05457a559e9 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -59,8 +59,7 @@ var foods2: MonsterFood[] = new PetFood[new IceCream('Mint chocolate chip') , Co var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Food = (function () { function Food(name) { diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index 339f6b23f6a..5d30e0faecf 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -58,8 +58,7 @@ var r4: void = b.valueOf(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js index 8f6d1706e40..e0f626ae083 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -127,8 +127,7 @@ function foo16(x: any) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js index 8f5b6449a88..f0417a7ca23 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -130,8 +130,7 @@ function foo16(x: any) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js index 2fc8c0c946d..e1473790553 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -127,8 +127,7 @@ function foo16(x: any) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js index a68eba8c6a2..bf4f80da15a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -125,8 +125,7 @@ function foo16(x: any) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js index 92aac37ecdb..c8cd12cff30 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -43,8 +43,7 @@ function foo6(x: any): any { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js index c202f684895..a812a1fc4bd 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js @@ -29,8 +29,7 @@ var c3: C3; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js index 98693b4e6ee..9cf9e99cb4b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -127,8 +127,7 @@ function foo16(x: any) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js index 7e9abbad7e6..84f3d04e7bf 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -130,8 +130,7 @@ function foo16(x: any) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index 2ac23c39be5..e8b65ea5119 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -14,8 +14,7 @@ d2.foo(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(opt) { diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 7538397566a..414f474598d 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -129,8 +129,7 @@ fnOpt2(1, [2, 3], [1], true); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // test basic configurations var C1 = (function () { diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js index aa76f41644c..4a72953bdad 100644 --- a/tests/baselines/reference/optionalParamInOverride.js +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -11,8 +11,7 @@ class Y extends Z { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Z = (function () { function Z() { diff --git a/tests/baselines/reference/overload1.js b/tests/baselines/reference/overload1.js index b308c0e8d83..af3aebde4ee 100644 --- a/tests/baselines/reference/overload1.js +++ b/tests/baselines/reference/overload1.js @@ -43,8 +43,7 @@ var v=x.g; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var O; (function (O) { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js index 4588bef017b..67aa365ee39 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -26,8 +26,7 @@ class D implements MyDoc { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.js b/tests/baselines/reference/overloadOnConstConstraintChecks2.js index 709f7808ac1..353680bb92e 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -15,8 +15,7 @@ function foo(name: any): A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.js b/tests/baselines/reference/overloadOnConstConstraintChecks3.js index 7104c441938..2debaa589f5 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -16,8 +16,7 @@ function foo(name: any): A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index 4483b42a941..17ec3779620 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -17,8 +17,7 @@ function foo(name: any): Z { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Z = (function () { function Z() { diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js index efcad011ab5..a8dfcde9ada 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -15,8 +15,7 @@ foo("HI"); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/overloadResolution.js b/tests/baselines/reference/overloadResolution.js index d234ea4a69a..287c5ccdb8e 100644 --- a/tests/baselines/reference/overloadResolution.js +++ b/tests/baselines/reference/overloadResolution.js @@ -98,8 +98,7 @@ var s = fn5((n) => n.substr(0)); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var SomeBase = (function () { function SomeBase() { diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js index fc7dbd9cebe..14306b7873b 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.js +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -105,8 +105,7 @@ new fn5((n) => n.blah); // Error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var SomeBase = (function () { function SomeBase() { diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js index b3c2b2ef764..788e6362f86 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.js +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -106,8 +106,7 @@ var s = new fn5((n) => n.substr(0)); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var SomeBase = (function () { function SomeBase() { diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js index 4274841d60f..bd08f70498d 100644 --- a/tests/baselines/reference/overloadingOnConstants1.js +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -29,8 +29,7 @@ var htmlSpanElement2: Derived1 = d2.createElement("span"); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/overloadingOnConstants2.js b/tests/baselines/reference/overloadingOnConstants2.js index 2414ec4eab2..eaec0054f66 100644 --- a/tests/baselines/reference/overloadingOnConstants2.js +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -31,8 +31,7 @@ var f: C = bar("um", []); // C var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.js b/tests/baselines/reference/overridingPrivateStaticMembers.js index 56ecfec66c0..a155bb1b830 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.js +++ b/tests/baselines/reference/overridingPrivateStaticMembers.js @@ -11,8 +11,7 @@ class Derived2 extends Base2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base2 = (function () { function Base2() { diff --git a/tests/baselines/reference/parseErrorInHeritageClause1.js b/tests/baselines/reference/parseErrorInHeritageClause1.js index 66facdeadf0..b6640b64257 100644 --- a/tests/baselines/reference/parseErrorInHeritageClause1.js +++ b/tests/baselines/reference/parseErrorInHeritageClause1.js @@ -6,8 +6,7 @@ class C extends A # { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parser509630.js b/tests/baselines/reference/parser509630.js index 20e00ea01ed..6862eef4a93 100644 --- a/tests/baselines/reference/parser509630.js +++ b/tests/baselines/reference/parser509630.js @@ -10,8 +10,7 @@ class Any extends Type { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Type = (function () { function Type() { diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index ec88d11b0c9..5de3cb8f9f1 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -223,8 +223,7 @@ class c6 extends c5 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var c1 = (function () { function c1() { diff --git a/tests/baselines/reference/parserClassDeclaration1.js b/tests/baselines/reference/parserClassDeclaration1.js index 9ef865adb75..f430b8e644a 100644 --- a/tests/baselines/reference/parserClassDeclaration1.js +++ b/tests/baselines/reference/parserClassDeclaration1.js @@ -6,8 +6,7 @@ class C extends A extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserClassDeclaration3.js b/tests/baselines/reference/parserClassDeclaration3.js index 644c4fcb54a..8ea681a668f 100644 --- a/tests/baselines/reference/parserClassDeclaration3.js +++ b/tests/baselines/reference/parserClassDeclaration3.js @@ -6,8 +6,7 @@ class C implements A extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserClassDeclaration4.js b/tests/baselines/reference/parserClassDeclaration4.js index d7cd9ca6cac..2bbbd134ed4 100644 --- a/tests/baselines/reference/parserClassDeclaration4.js +++ b/tests/baselines/reference/parserClassDeclaration4.js @@ -6,8 +6,7 @@ class C extends A implements B extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserClassDeclaration5.js b/tests/baselines/reference/parserClassDeclaration5.js index 4f75eb96668..146cbda9563 100644 --- a/tests/baselines/reference/parserClassDeclaration5.js +++ b/tests/baselines/reference/parserClassDeclaration5.js @@ -6,8 +6,7 @@ class C extends A implements B implements C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserClassDeclaration6.js b/tests/baselines/reference/parserClassDeclaration6.js index a653a7e4042..0f65ad53f07 100644 --- a/tests/baselines/reference/parserClassDeclaration6.js +++ b/tests/baselines/reference/parserClassDeclaration6.js @@ -6,8 +6,7 @@ class C extends A, B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js index 43ebfa2bb0e..3c2f96f54fd 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js @@ -6,8 +6,7 @@ class C extends A, { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js index 732508b8d85..594c4575eab 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js @@ -6,8 +6,7 @@ class C extends A implements { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js index 58f4f4631dc..3d2447e0b8c 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js @@ -6,8 +6,7 @@ class C extends A, implements B, { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.js b/tests/baselines/reference/parserGenericsInTypeContexts1.js index 5c2369e61c7..9cea884bcfb 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.js @@ -21,8 +21,7 @@ function f2(): F { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.js b/tests/baselines/reference/parserGenericsInTypeContexts2.js index 487038e1959..b5e5e010d56 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.js @@ -21,8 +21,7 @@ function f2(): F, Y>> { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 4c241abba0e..f184db9173c 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -461,8 +461,7 @@ module TypeScript { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /// var TypeScript; diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index c6a08062820..4091eb290d1 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2370,8 +2370,7 @@ module TypeScript { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /// var TypeScript; diff --git a/tests/baselines/reference/parserharness.js b/tests/baselines/reference/parserharness.js index 4e22c804ab6..296aae05fad 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2099,8 +2099,7 @@ module Harness { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /// /// diff --git a/tests/baselines/reference/primitiveMembers.js b/tests/baselines/reference/primitiveMembers.js index a49d6f7ee1c..60ae4b79dec 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -35,8 +35,7 @@ class foo extends baz { public bar(){ return undefined}; } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x = 5; var r = /yo/; diff --git a/tests/baselines/reference/privacyClass.js b/tests/baselines/reference/privacyClass.js index 4d6d0a72e4a..f632ea8b26f 100644 --- a/tests/baselines/reference/privacyClass.js +++ b/tests/baselines/reference/privacyClass.js @@ -131,8 +131,7 @@ export class glo_C12_public extends glo_c_private implements glo_i_private, glo var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var m1; (function (m1) { diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js index 044c30f3797..a3ddd387883 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js @@ -101,8 +101,7 @@ class publicClassExtendingPublicClassInGlobal extends publicClassInGlobal { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var publicModule; (function (publicModule) { @@ -288,8 +287,7 @@ exports.publicClassExtendingFromPrivateModuleClass = publicClassExtendingFromPri var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var publicModuleInGlobal; (function (publicModuleInGlobal) { diff --git a/tests/baselines/reference/privacyGloClass.js b/tests/baselines/reference/privacyGloClass.js index 58877eae167..01eff312739 100644 --- a/tests/baselines/reference/privacyGloClass.js +++ b/tests/baselines/reference/privacyGloClass.js @@ -64,8 +64,7 @@ class glo_C11_public extends glo_c_public implements glo_i_public { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var m1; (function (m1) { diff --git a/tests/baselines/reference/privateAccessInSubclass1.js b/tests/baselines/reference/privateAccessInSubclass1.js index 7004a535952..b22af20af37 100644 --- a/tests/baselines/reference/privateAccessInSubclass1.js +++ b/tests/baselines/reference/privateAccessInSubclass1.js @@ -13,8 +13,7 @@ class D extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index 4158ef6a8f7..ac2f44ee5d9 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -17,8 +17,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index 013c606f829..0b9be3b69ff 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -12,8 +12,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index 3db3a636c7d..b67ca77dc26 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -19,8 +19,7 @@ module D { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js index 1ce3452dbed..bab996e07a4 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js @@ -1,8 +1,7 @@ var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var m2; (function (m2) { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js index 1ce3452dbed..bab996e07a4 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js @@ -1,8 +1,7 @@ var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var m2; (function (m2) { diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index e621c38f984..fb0ca5dfac0 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -4,8 +4,7 @@ var _this = this; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // class inheritance to ensure __extends is emitted var m; diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js index e621c38f984..fb0ca5dfac0 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -4,8 +4,7 @@ var _this = this; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // class inheritance to ensure __extends is emitted var m; diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts deleted file mode 100644 index d7b4c67d491..00000000000 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -declare class ClassC extends test.ClassA { -} diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js index b1f4dd64ef2..bdf2edefcb0 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js @@ -2,8 +2,7 @@ var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ClassC = (function (_super) { __extends(ClassC, _super); diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts deleted file mode 100644 index d7b4c67d491..00000000000 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -declare class ClassC extends test.ClassA { -} diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js index b1f4dd64ef2..bdf2edefcb0 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js @@ -2,8 +2,7 @@ var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ClassC = (function (_super) { __extends(ClassC, _super); diff --git a/tests/baselines/reference/propertiesAndIndexers.js b/tests/baselines/reference/propertiesAndIndexers.js index f67a9d89249..b7a39ae2330 100644 --- a/tests/baselines/reference/propertiesAndIndexers.js +++ b/tests/baselines/reference/propertiesAndIndexers.js @@ -55,8 +55,7 @@ var c: { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var P = (function () { function P() { diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index 1e6ef5c1d6d..ed004b332cb 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -154,8 +154,7 @@ var x3: A; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index dc4c30d9165..35c279ba0ed 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -86,8 +86,7 @@ var r4 = b.foo(aB, aB); // no inferences for T so constraint isn't satisfied, er var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js index 7e935609e36..24c3fc50501 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -61,8 +61,7 @@ var r4 = b.foo(new B()); // valid call to an invalid function var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js index f871ce553b7..37b8240b9ac 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -48,8 +48,7 @@ var r4 = b.foo(new B()); // error after constraints above made illegal, doesn't var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js index 45f001c65fb..ce7bc5d0b40 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js @@ -24,8 +24,7 @@ class C extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B = (function () { function B() { diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js index 10276f8ac85..e47e7e5a7d5 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js @@ -98,8 +98,7 @@ d4.x; // Error, neither within their declaring class nor class var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js index 1a5b7489910..0140e61406c 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js @@ -17,8 +17,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/protectedInstanceMemberAccessibility.js b/tests/baselines/reference/protectedInstanceMemberAccessibility.js index 7560c5c89ca..ff4ae952249 100644 --- a/tests/baselines/reference/protectedInstanceMemberAccessibility.js +++ b/tests/baselines/reference/protectedInstanceMemberAccessibility.js @@ -48,8 +48,7 @@ class C extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/protectedMembers.js b/tests/baselines/reference/protectedMembers.js index 33b6e2ebde2..f86818b6e65 100644 --- a/tests/baselines/reference/protectedMembers.js +++ b/tests/baselines/reference/protectedMembers.js @@ -120,8 +120,7 @@ class B3 extends A3 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // Class with protected members var C1 = (function () { diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js index 1bd102694d4..9edd43ad52e 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js @@ -47,8 +47,7 @@ Derived3.x; // Error, neither within their declaring class nor classes deriv var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js index c82c67b7003..5a8b07df371 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js @@ -25,8 +25,7 @@ class Derived2 extends Derived1 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js index 8b071cb6b52..b0079c2f45b 100644 --- a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js +++ b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js @@ -10,8 +10,7 @@ class Beta extends Alpha.x { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Alpha; (function (Alpha) { diff --git a/tests/baselines/reference/recursiveBaseCheck3.js b/tests/baselines/reference/recursiveBaseCheck3.js index 6c1cd918779..aeb0d70240f 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.js +++ b/tests/baselines/reference/recursiveBaseCheck3.js @@ -8,8 +8,7 @@ class C extends A { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function (_super) { __extends(A, _super); diff --git a/tests/baselines/reference/recursiveBaseCheck4.js b/tests/baselines/reference/recursiveBaseCheck4.js index 1abb6731263..2e4a745a703 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.js +++ b/tests/baselines/reference/recursiveBaseCheck4.js @@ -6,8 +6,7 @@ class M extends M { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M = (function (_super) { __extends(M, _super); diff --git a/tests/baselines/reference/recursiveBaseCheck6.js b/tests/baselines/reference/recursiveBaseCheck6.js index 7fb9b444650..13b4944e96f 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.js +++ b/tests/baselines/reference/recursiveBaseCheck6.js @@ -6,8 +6,7 @@ class S18 extends S18<{ S19: A; }>{ } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var S18 = (function (_super) { __extends(S18, _super); diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index d0fc83b30f2..d14a78ed908 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -10,8 +10,7 @@ var x = new C2(); // Valid var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js index 214c543b836..224c13e7765 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js @@ -13,8 +13,7 @@ export class MemberNameArray extends MemberName { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var a = new TypeScript2.MemberNameArray(); var TypeScript2; diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index e9339fec4df..0e884b94e8e 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -108,8 +108,7 @@ module Sample.Thing.Languages.PlainText { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Sample; (function (Sample) { diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index 5573bdd8de8..734906688fd 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js.map +++ b/tests/baselines/reference/recursiveClassReferenceTest.js.map @@ -1,2 +1,2 @@ //// [recursiveClassReferenceTest.js.map] -{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,OAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC;oBAAAC;oBAQAC,CAACA;oBANOD,+BAAKA,GAAZA,cAAiBE,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,kBAQ3BA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,YAAIA,KAAJA,YAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC;gBAKCC,oBAAoBA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,AADAA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA,IAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBAAAA,CAACA,CAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,aAkBtBA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAAe;IAAuFC,CAACA;IAA3CD,sCAAeA,GAAtBA,cAAmCE,MAAMA,CAACA,IAAIA,CAACA,CAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACU,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC;oBACOC,eAAoBA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA,cAA0BI,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,QAWjBA,CAAAA;gBAEDA;oBAA0BM,wBAAYA;oBAAtCA;wBAA0BC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,OAQhBA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBV,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file +{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,OAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC;oBAAAC;oBAQAC,CAACA;oBANOD,+BAAKA,GAAZA,cAAiBE,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,kBAQ3BA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,YAAIA,KAAJA,YAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC;gBAKCC,oBAAoBA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,AADAA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA,IAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBAAAA,CAACA,CAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,aAkBtBA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAAe;IAAuFC,CAACA;IAA3CD,sCAAeA,GAAtBA,cAAmCE,MAAMA,CAACA,IAAIA,CAACA,CAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACU,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC;oBACOC,eAAoBA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA,cAA0BI,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,QAWjBA,CAAAA;gBAEDA;oBAA0BM,wBAAYA;oBAAtCA;wBAA0BC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,OAQhBA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBV,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt index 67031d420ea..8f45e0ea715 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -29,8 +29,7 @@ sourceFile:recursiveClassReferenceTest.ts >>>var __extends = (this && this.__extends) || function (d, b) { >>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; >>> function __() { this.constructor = d; } ->>> __.prototype = b.prototype; ->>> d.prototype = new __(); +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); >>>}; >>>var Sample; 1 > @@ -82,10 +81,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(9, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(32, 8) + SourceIndex(0) -3 >Emitted(9, 11) Source(32, 14) + SourceIndex(0) -4 >Emitted(9, 12) Source(42, 2) + SourceIndex(0) +1 >Emitted(8, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(32, 8) + SourceIndex(0) +3 >Emitted(8, 11) Source(32, 14) + SourceIndex(0) +4 >Emitted(8, 12) Source(42, 2) + SourceIndex(0) --- >>>(function (Sample) { 1-> @@ -94,9 +93,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 >module 3 > Sample -1->Emitted(10, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(10, 12) Source(32, 8) + SourceIndex(0) -3 >Emitted(10, 18) Source(32, 14) + SourceIndex(0) +1->Emitted(9, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(9, 12) Source(32, 8) + SourceIndex(0) +3 >Emitted(9, 18) Source(32, 14) + SourceIndex(0) --- >>> var Actions; 1 >^^^^ @@ -118,10 +117,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(11, 5) Source(32, 15) + SourceIndex(0) name (Sample) -2 >Emitted(11, 9) Source(32, 15) + SourceIndex(0) name (Sample) -3 >Emitted(11, 16) Source(32, 22) + SourceIndex(0) name (Sample) -4 >Emitted(11, 17) Source(42, 2) + SourceIndex(0) name (Sample) +1 >Emitted(10, 5) Source(32, 15) + SourceIndex(0) name (Sample) +2 >Emitted(10, 9) Source(32, 15) + SourceIndex(0) name (Sample) +3 >Emitted(10, 16) Source(32, 22) + SourceIndex(0) name (Sample) +4 >Emitted(10, 17) Source(42, 2) + SourceIndex(0) name (Sample) --- >>> (function (Actions) { 1->^^^^ @@ -130,9 +129,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Actions -1->Emitted(12, 5) Source(32, 15) + SourceIndex(0) name (Sample) -2 >Emitted(12, 16) Source(32, 15) + SourceIndex(0) name (Sample) -3 >Emitted(12, 23) Source(32, 22) + SourceIndex(0) name (Sample) +1->Emitted(11, 5) Source(32, 15) + SourceIndex(0) name (Sample) +2 >Emitted(11, 16) Source(32, 15) + SourceIndex(0) name (Sample) +3 >Emitted(11, 23) Source(32, 22) + SourceIndex(0) name (Sample) --- >>> var Thing; 1 >^^^^^^^^ @@ -154,10 +153,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(13, 9) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -2 >Emitted(13, 13) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -3 >Emitted(13, 18) Source(32, 28) + SourceIndex(0) name (Sample.Actions) -4 >Emitted(13, 19) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +1 >Emitted(12, 9) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +2 >Emitted(12, 13) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +3 >Emitted(12, 18) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +4 >Emitted(12, 19) Source(42, 2) + SourceIndex(0) name (Sample.Actions) --- >>> (function (Thing_1) { 1->^^^^^^^^ @@ -166,9 +165,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(14, 9) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -2 >Emitted(14, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -3 >Emitted(14, 27) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +1->Emitted(13, 9) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +2 >Emitted(13, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +3 >Emitted(13, 27) Source(32, 28) + SourceIndex(0) name (Sample.Actions) --- >>> var Find; 1 >^^^^^^^^^^^^ @@ -190,10 +189,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(15, 13) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -2 >Emitted(15, 17) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -3 >Emitted(15, 21) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) -4 >Emitted(15, 22) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +1 >Emitted(14, 13) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +2 >Emitted(14, 17) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +3 >Emitted(14, 21) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +4 >Emitted(14, 22) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) --- >>> (function (Find) { 1->^^^^^^^^^^^^ @@ -207,24 +206,24 @@ sourceFile:recursiveClassReferenceTest.ts 3 > Find 4 > 5 > { -1->Emitted(16, 13) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -2 >Emitted(16, 24) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -3 >Emitted(16, 28) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) -4 >Emitted(16, 30) Source(32, 34) + SourceIndex(0) name (Sample.Actions.Thing) -5 >Emitted(16, 31) Source(32, 35) + SourceIndex(0) name (Sample.Actions.Thing) +1->Emitted(15, 13) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +2 >Emitted(15, 24) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +3 >Emitted(15, 28) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +4 >Emitted(15, 30) Source(32, 34) + SourceIndex(0) name (Sample.Actions.Thing) +5 >Emitted(15, 31) Source(32, 35) + SourceIndex(0) name (Sample.Actions.Thing) --- >>> var StartFindAction = (function () { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(17, 17) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) +1->Emitted(16, 17) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) --- >>> function StartFindAction() { 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(18, 21) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +1->Emitted(17, 21) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) --- >>> } 1->^^^^^^^^^^^^^^^^^^^^ @@ -240,8 +239,8 @@ sourceFile:recursiveClassReferenceTest.ts > } > 2 > } -1->Emitted(19, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.constructor) -2 >Emitted(19, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.constructor) +1->Emitted(18, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.constructor) +2 >Emitted(18, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.constructor) --- >>> StartFindAction.prototype.getId = function () { return "yo"; }; 1->^^^^^^^^^^^^^^^^^^^^ @@ -264,16 +263,16 @@ sourceFile:recursiveClassReferenceTest.ts 8 > ; 9 > 10> } -1->Emitted(20, 21) Source(35, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -2 >Emitted(20, 52) Source(35, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -3 >Emitted(20, 55) Source(35, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -4 >Emitted(20, 69) Source(35, 20) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -5 >Emitted(20, 75) Source(35, 26) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -6 >Emitted(20, 76) Source(35, 27) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -7 >Emitted(20, 80) Source(35, 31) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -8 >Emitted(20, 81) Source(35, 32) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -9 >Emitted(20, 82) Source(35, 33) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) -10>Emitted(20, 83) Source(35, 34) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +1->Emitted(19, 21) Source(35, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(19, 52) Source(35, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(19, 55) Source(35, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +4 >Emitted(19, 69) Source(35, 20) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +5 >Emitted(19, 75) Source(35, 26) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +6 >Emitted(19, 76) Source(35, 27) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +7 >Emitted(19, 80) Source(35, 31) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +8 >Emitted(19, 81) Source(35, 32) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +9 >Emitted(19, 82) Source(35, 33) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +10>Emitted(19, 83) Source(35, 34) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) --- >>> StartFindAction.prototype.run = function (Thing) { 1 >^^^^^^^^^^^^^^^^^^^^ @@ -288,11 +287,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > public run( 5 > Thing:Sample.Thing.ICodeThing -1 >Emitted(21, 21) Source(37, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -2 >Emitted(21, 50) Source(37, 13) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -3 >Emitted(21, 53) Source(37, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -4 >Emitted(21, 63) Source(37, 14) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -5 >Emitted(21, 68) Source(37, 43) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +1 >Emitted(20, 21) Source(37, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(20, 50) Source(37, 13) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(20, 53) Source(37, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +4 >Emitted(20, 63) Source(37, 14) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +5 >Emitted(20, 68) Source(37, 43) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) --- >>> return true; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -307,11 +306,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > true 5 > ; -1 >Emitted(22, 25) Source(39, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -2 >Emitted(22, 31) Source(39, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -3 >Emitted(22, 32) Source(39, 11) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -4 >Emitted(22, 36) Source(39, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -5 >Emitted(22, 37) Source(39, 16) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +1 >Emitted(21, 25) Source(39, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +2 >Emitted(21, 31) Source(39, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +3 >Emitted(21, 32) Source(39, 11) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +4 >Emitted(21, 36) Source(39, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +5 >Emitted(21, 37) Source(39, 16) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -320,8 +319,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(23, 21) Source(40, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) -2 >Emitted(23, 22) Source(40, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +1 >Emitted(22, 21) Source(40, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +2 >Emitted(22, 22) Source(40, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) --- >>> return StartFindAction; 1->^^^^^^^^^^^^^^^^^^^^ @@ -329,8 +328,8 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > 2 > } -1->Emitted(24, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -2 >Emitted(24, 43) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +1->Emitted(23, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(23, 43) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) --- >>> })(); 1 >^^^^^^^^^^^^^^^^ @@ -350,10 +349,10 @@ sourceFile:recursiveClassReferenceTest.ts > return true; > } > } -1 >Emitted(25, 17) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -2 >Emitted(25, 18) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) -3 >Emitted(25, 18) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) -4 >Emitted(25, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +1 >Emitted(24, 17) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(24, 18) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(24, 18) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) +4 >Emitted(24, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) --- >>> Find.StartFindAction = StartFindAction; 1->^^^^^^^^^^^^^^^^ @@ -373,10 +372,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } 4 > -1->Emitted(26, 17) Source(33, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find) -2 >Emitted(26, 37) Source(33, 30) + SourceIndex(0) name (Sample.Actions.Thing.Find) -3 >Emitted(26, 55) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) -4 >Emitted(26, 56) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +1->Emitted(25, 17) Source(33, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find) +2 >Emitted(25, 37) Source(33, 30) + SourceIndex(0) name (Sample.Actions.Thing.Find) +3 >Emitted(25, 55) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +4 >Emitted(25, 56) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) --- >>> })(Find = Thing_1.Find || (Thing_1.Find = {})); 1->^^^^^^^^^^^^ @@ -408,15 +407,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1->Emitted(27, 13) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing.Find) -2 >Emitted(27, 14) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) -3 >Emitted(27, 16) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -4 >Emitted(27, 20) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) -5 >Emitted(27, 23) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -6 >Emitted(27, 35) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) -7 >Emitted(27, 40) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) -8 >Emitted(27, 52) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) -9 >Emitted(27, 60) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +1->Emitted(26, 13) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing.Find) +2 >Emitted(26, 14) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) +3 >Emitted(26, 16) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +4 >Emitted(26, 20) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +5 >Emitted(26, 23) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +6 >Emitted(26, 35) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +7 >Emitted(26, 40) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +8 >Emitted(26, 52) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +9 >Emitted(26, 60) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) --- >>> })(Thing = Actions.Thing || (Actions.Thing = {})); 1 >^^^^^^^^ @@ -448,15 +447,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(28, 9) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing) -2 >Emitted(28, 10) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) -3 >Emitted(28, 12) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -4 >Emitted(28, 17) Source(32, 28) + SourceIndex(0) name (Sample.Actions) -5 >Emitted(28, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -6 >Emitted(28, 33) Source(32, 28) + SourceIndex(0) name (Sample.Actions) -7 >Emitted(28, 38) Source(32, 23) + SourceIndex(0) name (Sample.Actions) -8 >Emitted(28, 51) Source(32, 28) + SourceIndex(0) name (Sample.Actions) -9 >Emitted(28, 59) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +1 >Emitted(27, 9) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing) +2 >Emitted(27, 10) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +3 >Emitted(27, 12) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +4 >Emitted(27, 17) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +5 >Emitted(27, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +6 >Emitted(27, 33) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +7 >Emitted(27, 38) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +8 >Emitted(27, 51) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +9 >Emitted(27, 59) Source(42, 2) + SourceIndex(0) name (Sample.Actions) --- >>> })(Actions = Sample.Actions || (Sample.Actions = {})); 1->^^^^ @@ -487,15 +486,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1->Emitted(29, 5) Source(42, 1) + SourceIndex(0) name (Sample.Actions) -2 >Emitted(29, 6) Source(42, 2) + SourceIndex(0) name (Sample.Actions) -3 >Emitted(29, 8) Source(32, 15) + SourceIndex(0) name (Sample) -4 >Emitted(29, 15) Source(32, 22) + SourceIndex(0) name (Sample) -5 >Emitted(29, 18) Source(32, 15) + SourceIndex(0) name (Sample) -6 >Emitted(29, 32) Source(32, 22) + SourceIndex(0) name (Sample) -7 >Emitted(29, 37) Source(32, 15) + SourceIndex(0) name (Sample) -8 >Emitted(29, 51) Source(32, 22) + SourceIndex(0) name (Sample) -9 >Emitted(29, 59) Source(42, 2) + SourceIndex(0) name (Sample) +1->Emitted(28, 5) Source(42, 1) + SourceIndex(0) name (Sample.Actions) +2 >Emitted(28, 6) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +3 >Emitted(28, 8) Source(32, 15) + SourceIndex(0) name (Sample) +4 >Emitted(28, 15) Source(32, 22) + SourceIndex(0) name (Sample) +5 >Emitted(28, 18) Source(32, 15) + SourceIndex(0) name (Sample) +6 >Emitted(28, 32) Source(32, 22) + SourceIndex(0) name (Sample) +7 >Emitted(28, 37) Source(32, 15) + SourceIndex(0) name (Sample) +8 >Emitted(28, 51) Source(32, 22) + SourceIndex(0) name (Sample) +9 >Emitted(28, 59) Source(42, 2) + SourceIndex(0) name (Sample) --- >>>})(Sample || (Sample = {})); 1 > @@ -522,13 +521,13 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(30, 1) Source(42, 1) + SourceIndex(0) name (Sample) -2 >Emitted(30, 2) Source(42, 2) + SourceIndex(0) name (Sample) -3 >Emitted(30, 4) Source(32, 8) + SourceIndex(0) -4 >Emitted(30, 10) Source(32, 14) + SourceIndex(0) -5 >Emitted(30, 15) Source(32, 8) + SourceIndex(0) -6 >Emitted(30, 21) Source(32, 14) + SourceIndex(0) -7 >Emitted(30, 29) Source(42, 2) + SourceIndex(0) +1 >Emitted(29, 1) Source(42, 1) + SourceIndex(0) name (Sample) +2 >Emitted(29, 2) Source(42, 2) + SourceIndex(0) name (Sample) +3 >Emitted(29, 4) Source(32, 8) + SourceIndex(0) +4 >Emitted(29, 10) Source(32, 14) + SourceIndex(0) +5 >Emitted(29, 15) Source(32, 8) + SourceIndex(0) +6 >Emitted(29, 21) Source(32, 14) + SourceIndex(0) +7 >Emitted(29, 29) Source(42, 2) + SourceIndex(0) --- >>>var Sample; 1 > @@ -562,10 +561,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(31, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(31, 5) Source(44, 8) + SourceIndex(0) -3 >Emitted(31, 11) Source(44, 14) + SourceIndex(0) -4 >Emitted(31, 12) Source(64, 2) + SourceIndex(0) +1 >Emitted(30, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(30, 5) Source(44, 8) + SourceIndex(0) +3 >Emitted(30, 11) Source(44, 14) + SourceIndex(0) +4 >Emitted(30, 12) Source(64, 2) + SourceIndex(0) --- >>>(function (Sample) { 1-> @@ -574,9 +573,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 >module 3 > Sample -1->Emitted(32, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(32, 12) Source(44, 8) + SourceIndex(0) -3 >Emitted(32, 18) Source(44, 14) + SourceIndex(0) +1->Emitted(31, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(31, 12) Source(44, 8) + SourceIndex(0) +3 >Emitted(31, 18) Source(44, 14) + SourceIndex(0) --- >>> var Thing; 1 >^^^^ @@ -608,10 +607,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(33, 5) Source(44, 15) + SourceIndex(0) name (Sample) -2 >Emitted(33, 9) Source(44, 15) + SourceIndex(0) name (Sample) -3 >Emitted(33, 14) Source(44, 20) + SourceIndex(0) name (Sample) -4 >Emitted(33, 15) Source(64, 2) + SourceIndex(0) name (Sample) +1 >Emitted(32, 5) Source(44, 15) + SourceIndex(0) name (Sample) +2 >Emitted(32, 9) Source(44, 15) + SourceIndex(0) name (Sample) +3 >Emitted(32, 14) Source(44, 20) + SourceIndex(0) name (Sample) +4 >Emitted(32, 15) Source(64, 2) + SourceIndex(0) name (Sample) --- >>> (function (Thing) { 1->^^^^ @@ -621,9 +620,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(34, 5) Source(44, 15) + SourceIndex(0) name (Sample) -2 >Emitted(34, 16) Source(44, 15) + SourceIndex(0) name (Sample) -3 >Emitted(34, 21) Source(44, 20) + SourceIndex(0) name (Sample) +1->Emitted(33, 5) Source(44, 15) + SourceIndex(0) name (Sample) +2 >Emitted(33, 16) Source(44, 15) + SourceIndex(0) name (Sample) +3 >Emitted(33, 21) Source(44, 20) + SourceIndex(0) name (Sample) --- >>> var Widgets; 1->^^^^^^^^ @@ -655,10 +654,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(35, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(35, 13) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(35, 20) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(35, 21) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +1->Emitted(34, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(34, 13) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(34, 20) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(34, 21) Source(64, 2) + SourceIndex(0) name (Sample.Thing) --- >>> (function (Widgets) { 1->^^^^^^^^ @@ -672,18 +671,18 @@ sourceFile:recursiveClassReferenceTest.ts 3 > Widgets 4 > 5 > { -1->Emitted(36, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(36, 20) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(36, 27) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(36, 29) Source(44, 29) + SourceIndex(0) name (Sample.Thing) -5 >Emitted(36, 30) Source(44, 30) + SourceIndex(0) name (Sample.Thing) +1->Emitted(35, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(35, 20) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(35, 27) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(35, 29) Source(44, 29) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(35, 30) Source(44, 30) + SourceIndex(0) name (Sample.Thing) --- >>> var FindWidget = (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -1->Emitted(37, 13) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +1->Emitted(36, 13) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) --- >>> function FindWidget(codeThing) { 1->^^^^^^^^^^^^^^^^ @@ -698,9 +697,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > constructor(private 3 > codeThing: Sample.Thing.ICodeThing -1->Emitted(38, 17) Source(50, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(38, 37) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(38, 46) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +1->Emitted(37, 17) Source(50, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(37, 37) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(37, 46) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) --- >>> this.codeThing = codeThing; 1->^^^^^^^^^^^^^^^^^^^^ @@ -713,11 +712,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > codeThing 5 > : Sample.Thing.ICodeThing -1->Emitted(39, 21) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(39, 35) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -3 >Emitted(39, 38) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -4 >Emitted(39, 47) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -5 >Emitted(39, 48) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1->Emitted(38, 21) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(38, 35) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(38, 38) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(38, 47) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(38, 48) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> this.domNode = null; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -730,11 +729,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > :any = 4 > null 5 > ; -1 >Emitted(40, 21) Source(49, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(40, 33) Source(49, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -3 >Emitted(40, 36) Source(49, 25) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -4 >Emitted(40, 40) Source(49, 29) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -5 >Emitted(40, 41) Source(49, 30) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1 >Emitted(39, 21) Source(49, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(39, 33) Source(49, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(39, 36) Source(49, 25) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(39, 40) Source(49, 29) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(39, 41) Source(49, 30) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> // scenario 1 1 >^^^^^^^^^^^^^^^^^^^^ @@ -747,9 +746,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > 3 > // scenario 1 -1 >Emitted(41, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(41, 21) Source(51, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -3 >Emitted(41, 34) Source(51, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1 >Emitted(40, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(40, 21) Source(51, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(40, 34) Source(51, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> codeThing.addWidget("addWidget", this); 1->^^^^^^^^^^^^^^^^^^^^ @@ -773,16 +772,16 @@ sourceFile:recursiveClassReferenceTest.ts 8 > this 9 > ) 10> ; -1->Emitted(42, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(42, 30) Source(52, 16) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -3 >Emitted(42, 31) Source(52, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -4 >Emitted(42, 40) Source(52, 26) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -5 >Emitted(42, 41) Source(52, 27) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -6 >Emitted(42, 52) Source(52, 38) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -7 >Emitted(42, 54) Source(52, 40) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -8 >Emitted(42, 58) Source(52, 44) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -9 >Emitted(42, 59) Source(52, 45) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -10>Emitted(42, 60) Source(52, 46) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1->Emitted(41, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(41, 30) Source(52, 16) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(41, 31) Source(52, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(41, 40) Source(52, 26) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(41, 41) Source(52, 27) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +6 >Emitted(41, 52) Source(52, 38) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +7 >Emitted(41, 54) Source(52, 40) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +8 >Emitted(41, 58) Source(52, 44) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +9 >Emitted(41, 59) Source(52, 45) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +10>Emitted(41, 60) Source(52, 46) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> } 1 >^^^^^^^^^^^^^^^^ @@ -791,8 +790,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(43, 17) Source(53, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(43, 18) Source(53, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +1 >Emitted(42, 17) Source(53, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(42, 18) Source(53, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> FindWidget.prototype.gar = function (runner) { if (true) { 1->^^^^^^^^^^^^^^^^ @@ -821,19 +820,19 @@ sourceFile:recursiveClassReferenceTest.ts 11> ) 12> 13> { -1->Emitted(44, 17) Source(47, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(44, 41) Source(47, 13) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(44, 44) Source(47, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -4 >Emitted(44, 54) Source(47, 14) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -5 >Emitted(44, 60) Source(47, 55) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -6 >Emitted(44, 64) Source(47, 59) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -7 >Emitted(44, 66) Source(47, 61) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -8 >Emitted(44, 67) Source(47, 62) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -9 >Emitted(44, 68) Source(47, 63) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -10>Emitted(44, 72) Source(47, 67) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -11>Emitted(44, 73) Source(47, 68) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -12>Emitted(44, 74) Source(47, 69) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -13>Emitted(44, 75) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +1->Emitted(43, 17) Source(47, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(43, 41) Source(47, 13) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(43, 44) Source(47, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +4 >Emitted(43, 54) Source(47, 14) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +5 >Emitted(43, 60) Source(47, 55) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +6 >Emitted(43, 64) Source(47, 59) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +7 >Emitted(43, 66) Source(47, 61) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +8 >Emitted(43, 67) Source(47, 62) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +9 >Emitted(43, 68) Source(47, 63) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +10>Emitted(43, 72) Source(47, 67) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +11>Emitted(43, 73) Source(47, 68) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +12>Emitted(43, 74) Source(47, 69) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +13>Emitted(43, 75) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) --- >>> return runner(this); 1 >^^^^^^^^^^^^^^^^^^^^ @@ -852,14 +851,14 @@ sourceFile:recursiveClassReferenceTest.ts 6 > this 7 > ) 8 > ; -1 >Emitted(45, 21) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -2 >Emitted(45, 27) Source(47, 76) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -3 >Emitted(45, 28) Source(47, 77) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -4 >Emitted(45, 34) Source(47, 83) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -5 >Emitted(45, 35) Source(47, 84) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -6 >Emitted(45, 39) Source(47, 88) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -7 >Emitted(45, 40) Source(47, 89) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -8 >Emitted(45, 41) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +1 >Emitted(44, 21) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 >Emitted(44, 27) Source(47, 76) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +3 >Emitted(44, 28) Source(47, 77) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +4 >Emitted(44, 34) Source(47, 83) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +5 >Emitted(44, 35) Source(47, 84) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +6 >Emitted(44, 39) Source(47, 88) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +7 >Emitted(44, 40) Source(47, 89) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +8 >Emitted(44, 41) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) --- >>> } }; 1 >^^^^^^^^^^^^^^^^ @@ -871,10 +870,10 @@ sourceFile:recursiveClassReferenceTest.ts 2 > } 3 > 4 > } -1 >Emitted(46, 17) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -2 >Emitted(46, 18) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -3 >Emitted(46, 19) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) -4 >Emitted(46, 20) Source(47, 92) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +1 >Emitted(45, 17) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 >Emitted(45, 18) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +3 >Emitted(45, 19) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +4 >Emitted(45, 20) Source(47, 92) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) --- >>> FindWidget.prototype.getDomNode = function () { 1->^^^^^^^^^^^^^^^^ @@ -891,9 +890,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getDomNode 3 > -1->Emitted(47, 17) Source(55, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(47, 48) Source(55, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(47, 51) Source(55, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +1->Emitted(46, 17) Source(55, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(46, 48) Source(55, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(46, 51) Source(55, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) --- >>> return domNode; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -907,11 +906,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > domNode 5 > ; -1 >Emitted(48, 21) Source(56, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -2 >Emitted(48, 27) Source(56, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -3 >Emitted(48, 28) Source(56, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -4 >Emitted(48, 35) Source(56, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -5 >Emitted(48, 36) Source(56, 19) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +1 >Emitted(47, 21) Source(56, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +2 >Emitted(47, 27) Source(56, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +3 >Emitted(47, 28) Source(56, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +4 >Emitted(47, 35) Source(56, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +5 >Emitted(47, 36) Source(56, 19) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -920,8 +919,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(49, 17) Source(57, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) -2 >Emitted(49, 18) Source(57, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +1 >Emitted(48, 17) Source(57, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +2 >Emitted(48, 18) Source(57, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) --- >>> FindWidget.prototype.destroy = function () { 1->^^^^^^^^^^^^^^^^ @@ -932,9 +931,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > destroy 3 > -1->Emitted(50, 17) Source(59, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(50, 45) Source(59, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(50, 48) Source(59, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +1->Emitted(49, 17) Source(59, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(49, 45) Source(59, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(49, 48) Source(59, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -944,8 +943,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(51, 17) Source(61, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) -2 >Emitted(51, 18) Source(61, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) +1 >Emitted(50, 17) Source(61, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) +2 >Emitted(50, 18) Source(61, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) --- >>> return FindWidget; 1->^^^^^^^^^^^^^^^^ @@ -954,8 +953,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(52, 17) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(52, 34) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +1->Emitted(51, 17) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(51, 34) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) --- >>> })(); 1 >^^^^^^^^^^^^ @@ -985,10 +984,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > > } -1 >Emitted(53, 13) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -2 >Emitted(53, 14) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) -3 >Emitted(53, 14) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) -4 >Emitted(53, 18) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +1 >Emitted(52, 13) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(52, 14) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(52, 14) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +4 >Emitted(52, 18) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) --- >>> Widgets.FindWidget = FindWidget; 1->^^^^^^^^^^^^ @@ -1018,10 +1017,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(54, 13) Source(45, 15) + SourceIndex(0) name (Sample.Thing.Widgets) -2 >Emitted(54, 31) Source(45, 25) + SourceIndex(0) name (Sample.Thing.Widgets) -3 >Emitted(54, 44) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) -4 >Emitted(54, 45) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +1->Emitted(53, 13) Source(45, 15) + SourceIndex(0) name (Sample.Thing.Widgets) +2 >Emitted(53, 31) Source(45, 25) + SourceIndex(0) name (Sample.Thing.Widgets) +3 >Emitted(53, 44) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +4 >Emitted(53, 45) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) --- >>> })(Widgets = Thing.Widgets || (Thing.Widgets = {})); 1->^^^^^^^^ @@ -1063,15 +1062,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(55, 9) Source(64, 1) + SourceIndex(0) name (Sample.Thing.Widgets) -2 >Emitted(55, 10) Source(64, 2) + SourceIndex(0) name (Sample.Thing.Widgets) -3 >Emitted(55, 12) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(55, 19) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -5 >Emitted(55, 22) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -6 >Emitted(55, 35) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -7 >Emitted(55, 40) Source(44, 21) + SourceIndex(0) name (Sample.Thing) -8 >Emitted(55, 53) Source(44, 28) + SourceIndex(0) name (Sample.Thing) -9 >Emitted(55, 61) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +1->Emitted(54, 9) Source(64, 1) + SourceIndex(0) name (Sample.Thing.Widgets) +2 >Emitted(54, 10) Source(64, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +3 >Emitted(54, 12) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(54, 19) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(54, 22) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +6 >Emitted(54, 35) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +7 >Emitted(54, 40) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +8 >Emitted(54, 53) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +9 >Emitted(54, 61) Source(64, 2) + SourceIndex(0) name (Sample.Thing) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -1112,15 +1111,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(56, 5) Source(64, 1) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(56, 6) Source(64, 2) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(56, 8) Source(44, 15) + SourceIndex(0) name (Sample) -4 >Emitted(56, 13) Source(44, 20) + SourceIndex(0) name (Sample) -5 >Emitted(56, 16) Source(44, 15) + SourceIndex(0) name (Sample) -6 >Emitted(56, 28) Source(44, 20) + SourceIndex(0) name (Sample) -7 >Emitted(56, 33) Source(44, 15) + SourceIndex(0) name (Sample) -8 >Emitted(56, 45) Source(44, 20) + SourceIndex(0) name (Sample) -9 >Emitted(56, 53) Source(64, 2) + SourceIndex(0) name (Sample) +1 >Emitted(55, 5) Source(64, 1) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(55, 6) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(55, 8) Source(44, 15) + SourceIndex(0) name (Sample) +4 >Emitted(55, 13) Source(44, 20) + SourceIndex(0) name (Sample) +5 >Emitted(55, 16) Source(44, 15) + SourceIndex(0) name (Sample) +6 >Emitted(55, 28) Source(44, 20) + SourceIndex(0) name (Sample) +7 >Emitted(55, 33) Source(44, 15) + SourceIndex(0) name (Sample) +8 >Emitted(55, 45) Source(44, 20) + SourceIndex(0) name (Sample) +9 >Emitted(55, 53) Source(64, 2) + SourceIndex(0) name (Sample) --- >>>})(Sample || (Sample = {})); 1 > @@ -1158,13 +1157,13 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(57, 1) Source(64, 1) + SourceIndex(0) name (Sample) -2 >Emitted(57, 2) Source(64, 2) + SourceIndex(0) name (Sample) -3 >Emitted(57, 4) Source(44, 8) + SourceIndex(0) -4 >Emitted(57, 10) Source(44, 14) + SourceIndex(0) -5 >Emitted(57, 15) Source(44, 8) + SourceIndex(0) -6 >Emitted(57, 21) Source(44, 14) + SourceIndex(0) -7 >Emitted(57, 29) Source(64, 2) + SourceIndex(0) +1 >Emitted(56, 1) Source(64, 1) + SourceIndex(0) name (Sample) +2 >Emitted(56, 2) Source(64, 2) + SourceIndex(0) name (Sample) +3 >Emitted(56, 4) Source(44, 8) + SourceIndex(0) +4 >Emitted(56, 10) Source(44, 14) + SourceIndex(0) +5 >Emitted(56, 15) Source(44, 8) + SourceIndex(0) +6 >Emitted(56, 21) Source(44, 14) + SourceIndex(0) +7 >Emitted(56, 29) Source(64, 2) + SourceIndex(0) --- >>>var AbstractMode = (function () { 1-> @@ -1173,13 +1172,13 @@ sourceFile:recursiveClassReferenceTest.ts > >interface IMode { getInitialState(): IState;} > -1->Emitted(58, 1) Source(67, 1) + SourceIndex(0) +1->Emitted(57, 1) Source(67, 1) + SourceIndex(0) --- >>> function AbstractMode() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(59, 5) Source(67, 1) + SourceIndex(0) name (AbstractMode) +1->Emitted(58, 5) Source(67, 1) + SourceIndex(0) name (AbstractMode) --- >>> } 1->^^^^ @@ -1187,8 +1186,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->class AbstractMode implements IMode { public getInitialState(): IState { return null;} 2 > } -1->Emitted(60, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode.constructor) -2 >Emitted(60, 6) Source(67, 89) + SourceIndex(0) name (AbstractMode.constructor) +1->Emitted(59, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode.constructor) +2 >Emitted(59, 6) Source(67, 89) + SourceIndex(0) name (AbstractMode.constructor) --- >>> AbstractMode.prototype.getInitialState = function () { return null; }; 1->^^^^ @@ -1211,24 +1210,24 @@ sourceFile:recursiveClassReferenceTest.ts 8 > ; 9 > 10> } -1->Emitted(61, 5) Source(67, 46) + SourceIndex(0) name (AbstractMode) -2 >Emitted(61, 43) Source(67, 61) + SourceIndex(0) name (AbstractMode) -3 >Emitted(61, 46) Source(67, 39) + SourceIndex(0) name (AbstractMode) -4 >Emitted(61, 60) Source(67, 74) + SourceIndex(0) name (AbstractMode.getInitialState) -5 >Emitted(61, 66) Source(67, 80) + SourceIndex(0) name (AbstractMode.getInitialState) -6 >Emitted(61, 67) Source(67, 81) + SourceIndex(0) name (AbstractMode.getInitialState) -7 >Emitted(61, 71) Source(67, 85) + SourceIndex(0) name (AbstractMode.getInitialState) -8 >Emitted(61, 72) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) -9 >Emitted(61, 73) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) -10>Emitted(61, 74) Source(67, 87) + SourceIndex(0) name (AbstractMode.getInitialState) +1->Emitted(60, 5) Source(67, 46) + SourceIndex(0) name (AbstractMode) +2 >Emitted(60, 43) Source(67, 61) + SourceIndex(0) name (AbstractMode) +3 >Emitted(60, 46) Source(67, 39) + SourceIndex(0) name (AbstractMode) +4 >Emitted(60, 60) Source(67, 74) + SourceIndex(0) name (AbstractMode.getInitialState) +5 >Emitted(60, 66) Source(67, 80) + SourceIndex(0) name (AbstractMode.getInitialState) +6 >Emitted(60, 67) Source(67, 81) + SourceIndex(0) name (AbstractMode.getInitialState) +7 >Emitted(60, 71) Source(67, 85) + SourceIndex(0) name (AbstractMode.getInitialState) +8 >Emitted(60, 72) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) +9 >Emitted(60, 73) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) +10>Emitted(60, 74) Source(67, 87) + SourceIndex(0) name (AbstractMode.getInitialState) --- >>> return AbstractMode; 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^ 1 > 2 > } -1 >Emitted(62, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode) -2 >Emitted(62, 24) Source(67, 89) + SourceIndex(0) name (AbstractMode) +1 >Emitted(61, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode) +2 >Emitted(61, 24) Source(67, 89) + SourceIndex(0) name (AbstractMode) --- >>>})(); 1 > @@ -1240,10 +1239,10 @@ sourceFile:recursiveClassReferenceTest.ts 2 >} 3 > 4 > class AbstractMode implements IMode { public getInitialState(): IState { return null;} } -1 >Emitted(63, 1) Source(67, 88) + SourceIndex(0) name (AbstractMode) -2 >Emitted(63, 2) Source(67, 89) + SourceIndex(0) name (AbstractMode) -3 >Emitted(63, 2) Source(67, 1) + SourceIndex(0) -4 >Emitted(63, 6) Source(67, 89) + SourceIndex(0) +1 >Emitted(62, 1) Source(67, 88) + SourceIndex(0) name (AbstractMode) +2 >Emitted(62, 2) Source(67, 89) + SourceIndex(0) name (AbstractMode) +3 >Emitted(62, 2) Source(67, 1) + SourceIndex(0) +4 >Emitted(62, 6) Source(67, 89) + SourceIndex(0) --- >>>var Sample; 1-> @@ -1288,10 +1287,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(64, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(64, 5) Source(76, 8) + SourceIndex(0) -3 >Emitted(64, 11) Source(76, 14) + SourceIndex(0) -4 >Emitted(64, 12) Source(100, 2) + SourceIndex(0) +1->Emitted(63, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(63, 5) Source(76, 8) + SourceIndex(0) +3 >Emitted(63, 11) Source(76, 14) + SourceIndex(0) +4 >Emitted(63, 12) Source(100, 2) + SourceIndex(0) --- >>>(function (Sample) { 1-> @@ -1300,9 +1299,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 >module 3 > Sample -1->Emitted(65, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(65, 12) Source(76, 8) + SourceIndex(0) -3 >Emitted(65, 18) Source(76, 14) + SourceIndex(0) +1->Emitted(64, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(64, 12) Source(76, 8) + SourceIndex(0) +3 >Emitted(64, 18) Source(76, 14) + SourceIndex(0) --- >>> var Thing; 1 >^^^^ @@ -1338,10 +1337,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(66, 5) Source(76, 15) + SourceIndex(0) name (Sample) -2 >Emitted(66, 9) Source(76, 15) + SourceIndex(0) name (Sample) -3 >Emitted(66, 14) Source(76, 20) + SourceIndex(0) name (Sample) -4 >Emitted(66, 15) Source(100, 2) + SourceIndex(0) name (Sample) +1 >Emitted(65, 5) Source(76, 15) + SourceIndex(0) name (Sample) +2 >Emitted(65, 9) Source(76, 15) + SourceIndex(0) name (Sample) +3 >Emitted(65, 14) Source(76, 20) + SourceIndex(0) name (Sample) +4 >Emitted(65, 15) Source(100, 2) + SourceIndex(0) name (Sample) --- >>> (function (Thing) { 1->^^^^ @@ -1351,9 +1350,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(67, 5) Source(76, 15) + SourceIndex(0) name (Sample) -2 >Emitted(67, 16) Source(76, 15) + SourceIndex(0) name (Sample) -3 >Emitted(67, 21) Source(76, 20) + SourceIndex(0) name (Sample) +1->Emitted(66, 5) Source(76, 15) + SourceIndex(0) name (Sample) +2 >Emitted(66, 16) Source(76, 15) + SourceIndex(0) name (Sample) +3 >Emitted(66, 21) Source(76, 20) + SourceIndex(0) name (Sample) --- >>> var Languages; 1->^^^^^^^^ @@ -1389,10 +1388,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(68, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(68, 13) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(68, 22) Source(76, 30) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(68, 23) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +1->Emitted(67, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(67, 13) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(67, 22) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(67, 23) Source(100, 2) + SourceIndex(0) name (Sample.Thing) --- >>> (function (Languages) { 1->^^^^^^^^ @@ -1401,9 +1400,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Languages -1->Emitted(69, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(69, 20) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(69, 29) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +1->Emitted(68, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(68, 20) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(68, 29) Source(76, 30) + SourceIndex(0) name (Sample.Thing) --- >>> var PlainText; 1 >^^^^^^^^^^^^ @@ -1439,10 +1438,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(70, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -2 >Emitted(70, 17) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -3 >Emitted(70, 26) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -4 >Emitted(70, 27) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +1 >Emitted(69, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(69, 17) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(69, 26) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(69, 27) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) --- >>> (function (PlainText) { 1->^^^^^^^^^^^^ @@ -1456,11 +1455,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > PlainText 4 > 5 > { -1->Emitted(71, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -2 >Emitted(71, 24) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -3 >Emitted(71, 33) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -4 >Emitted(71, 35) Source(76, 41) + SourceIndex(0) name (Sample.Thing.Languages) -5 >Emitted(71, 36) Source(76, 42) + SourceIndex(0) name (Sample.Thing.Languages) +1->Emitted(70, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(70, 24) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(70, 33) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(70, 35) Source(76, 41) + SourceIndex(0) name (Sample.Thing.Languages) +5 >Emitted(70, 36) Source(76, 42) + SourceIndex(0) name (Sample.Thing.Languages) --- >>> var State = (function () { 1->^^^^^^^^^^^^^^^^ @@ -1468,7 +1467,7 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > > -1->Emitted(72, 17) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(71, 17) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> function State(mode) { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1479,9 +1478,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > constructor(private 3 > mode: IMode -1->Emitted(73, 21) Source(79, 9) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(73, 36) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(73, 40) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +1->Emitted(72, 21) Source(79, 9) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(72, 36) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(72, 40) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) --- >>> this.mode = mode; 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1494,11 +1493,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > mode 5 > : IMode -1->Emitted(74, 25) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -2 >Emitted(74, 34) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -3 >Emitted(74, 37) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -4 >Emitted(74, 41) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -5 >Emitted(74, 42) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +1->Emitted(73, 25) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +2 >Emitted(73, 34) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +3 >Emitted(73, 37) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +4 >Emitted(73, 41) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +5 >Emitted(73, 42) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) --- >>> } 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1506,8 +1505,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >) { 2 > } -1 >Emitted(75, 21) Source(79, 44) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) -2 >Emitted(75, 22) Source(79, 45) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +1 >Emitted(74, 21) Source(79, 44) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +2 >Emitted(74, 22) Source(79, 45) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) --- >>> State.prototype.clone = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1517,9 +1516,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > clone 3 > -1->Emitted(76, 21) Source(80, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(76, 42) Source(80, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(76, 45) Source(80, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +1->Emitted(75, 21) Source(80, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(75, 42) Source(80, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(75, 45) Source(80, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) --- >>> return this; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1533,11 +1532,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > this 5 > ; -1 >Emitted(77, 25) Source(81, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -2 >Emitted(77, 31) Source(81, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -3 >Emitted(77, 32) Source(81, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -4 >Emitted(77, 36) Source(81, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -5 >Emitted(77, 37) Source(81, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +1 >Emitted(76, 25) Source(81, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +2 >Emitted(76, 31) Source(81, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +3 >Emitted(76, 32) Source(81, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +4 >Emitted(76, 36) Source(81, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +5 >Emitted(76, 37) Source(81, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1546,8 +1545,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(78, 21) Source(82, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) -2 >Emitted(78, 22) Source(82, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +1 >Emitted(77, 21) Source(82, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +2 >Emitted(77, 22) Source(82, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) --- >>> State.prototype.equals = function (other) { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1562,11 +1561,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > public equals( 5 > other:IState -1->Emitted(79, 21) Source(84, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(79, 43) Source(84, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(79, 46) Source(84, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -4 >Emitted(79, 56) Source(84, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -5 >Emitted(79, 61) Source(84, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +1->Emitted(78, 21) Source(84, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(78, 43) Source(84, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(78, 46) Source(84, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +4 >Emitted(78, 56) Source(84, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +5 >Emitted(78, 61) Source(84, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) --- >>> return this === other; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1584,13 +1583,13 @@ sourceFile:recursiveClassReferenceTest.ts 5 > === 6 > other 7 > ; -1 >Emitted(80, 25) Source(85, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -2 >Emitted(80, 31) Source(85, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -3 >Emitted(80, 32) Source(85, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -4 >Emitted(80, 36) Source(85, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -5 >Emitted(80, 41) Source(85, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -6 >Emitted(80, 46) Source(85, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -7 >Emitted(80, 47) Source(85, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +1 >Emitted(79, 25) Source(85, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +2 >Emitted(79, 31) Source(85, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +3 >Emitted(79, 32) Source(85, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +4 >Emitted(79, 36) Source(85, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +5 >Emitted(79, 41) Source(85, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +6 >Emitted(79, 46) Source(85, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +7 >Emitted(79, 47) Source(85, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1599,8 +1598,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(81, 21) Source(86, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) -2 >Emitted(81, 22) Source(86, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +1 >Emitted(80, 21) Source(86, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +2 >Emitted(80, 22) Source(86, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) --- >>> State.prototype.getMode = function () { return mode; }; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1625,16 +1624,16 @@ sourceFile:recursiveClassReferenceTest.ts 8 > ; 9 > 10> } -1->Emitted(82, 21) Source(88, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(82, 44) Source(88, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(82, 47) Source(88, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -4 >Emitted(82, 61) Source(88, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -5 >Emitted(82, 67) Source(88, 35) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -6 >Emitted(82, 68) Source(88, 36) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -7 >Emitted(82, 72) Source(88, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -8 >Emitted(82, 73) Source(88, 41) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -9 >Emitted(82, 74) Source(88, 42) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) -10>Emitted(82, 75) Source(88, 43) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +1->Emitted(81, 21) Source(88, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(81, 44) Source(88, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(81, 47) Source(88, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +4 >Emitted(81, 61) Source(88, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +5 >Emitted(81, 67) Source(88, 35) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +6 >Emitted(81, 68) Source(88, 36) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +7 >Emitted(81, 72) Source(88, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +8 >Emitted(81, 73) Source(88, 41) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +9 >Emitted(81, 74) Source(88, 42) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +10>Emitted(81, 75) Source(88, 43) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) --- >>> return State; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1642,8 +1641,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(83, 21) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(83, 33) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +1 >Emitted(82, 21) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(82, 33) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) --- >>> })(); 1 >^^^^^^^^^^^^^^^^ @@ -1666,10 +1665,10 @@ sourceFile:recursiveClassReferenceTest.ts > > public getMode(): IMode { return mode; } > } -1 >Emitted(84, 17) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -2 >Emitted(84, 18) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) -3 >Emitted(84, 18) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -4 >Emitted(84, 22) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1 >Emitted(83, 17) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(83, 18) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(83, 18) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(83, 22) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> PlainText.State = State; 1->^^^^^^^^^^^^^^^^ @@ -1692,10 +1691,10 @@ sourceFile:recursiveClassReferenceTest.ts > public getMode(): IMode { return mode; } > } 4 > -1->Emitted(85, 17) Source(78, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -2 >Emitted(85, 32) Source(78, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -3 >Emitted(85, 40) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -4 >Emitted(85, 41) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(84, 17) Source(78, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(84, 32) Source(78, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(84, 40) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(84, 41) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> var Mode = (function (_super) { 1->^^^^^^^^^^^^^^^^ @@ -1703,29 +1702,29 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > > -1->Emitted(86, 17) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(85, 17) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> __extends(Mode, _super); 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^ 1->export class Mode extends 2 > AbstractMode -1->Emitted(87, 21) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(87, 45) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1->Emitted(86, 21) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(86, 45) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> function Mode() { 1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(88, 21) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1 >Emitted(87, 21) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> _super.apply(this, arguments); 1->^^^^^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1->export class Mode extends 2 > AbstractMode -1->Emitted(89, 25) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) -2 >Emitted(89, 55) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +1->Emitted(88, 25) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +2 >Emitted(88, 55) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) --- >>> } 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1741,8 +1740,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(90, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) -2 >Emitted(90, 22) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +1 >Emitted(89, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +2 >Emitted(89, 22) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) --- >>> // scenario 2 1->^^^^^^^^^^^^^^^^^^^^ @@ -1750,8 +1749,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > // scenario 2 -1->Emitted(91, 21) Source(93, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(91, 34) Source(93, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1->Emitted(90, 21) Source(93, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(90, 34) Source(93, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> Mode.prototype.getInitialState = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1761,9 +1760,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getInitialState 3 > -1->Emitted(92, 21) Source(94, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(92, 51) Source(94, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -3 >Emitted(92, 54) Source(94, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1->Emitted(91, 21) Source(94, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(91, 51) Source(94, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +3 >Emitted(91, 54) Source(94, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> return new State(self); 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1785,15 +1784,15 @@ sourceFile:recursiveClassReferenceTest.ts 7 > self 8 > ) 9 > ; -1 >Emitted(93, 25) Source(95, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -2 >Emitted(93, 31) Source(95, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -3 >Emitted(93, 32) Source(95, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -4 >Emitted(93, 36) Source(95, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -5 >Emitted(93, 41) Source(95, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -6 >Emitted(93, 42) Source(95, 21) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -7 >Emitted(93, 46) Source(95, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -8 >Emitted(93, 47) Source(95, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -9 >Emitted(93, 48) Source(95, 27) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +1 >Emitted(92, 25) Source(95, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +2 >Emitted(92, 31) Source(95, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +3 >Emitted(92, 32) Source(95, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +4 >Emitted(92, 36) Source(95, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +5 >Emitted(92, 41) Source(95, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +6 >Emitted(92, 42) Source(95, 21) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +7 >Emitted(92, 46) Source(95, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +8 >Emitted(92, 47) Source(95, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +9 >Emitted(92, 48) Source(95, 27) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1802,8 +1801,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(94, 21) Source(96, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) -2 >Emitted(94, 22) Source(96, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +1 >Emitted(93, 21) Source(96, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +2 >Emitted(93, 22) Source(96, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) --- >>> return Mode; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1814,8 +1813,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(95, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(95, 32) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +1->Emitted(94, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(94, 32) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) --- >>> })(AbstractMode); 1->^^^^^^^^^^^^^^^^ @@ -1839,12 +1838,12 @@ sourceFile:recursiveClassReferenceTest.ts > > > } -1->Emitted(96, 17) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -2 >Emitted(96, 18) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) -3 >Emitted(96, 18) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -4 >Emitted(96, 20) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -5 >Emitted(96, 32) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -6 >Emitted(96, 34) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(95, 17) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(95, 18) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +3 >Emitted(95, 18) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(95, 20) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +5 >Emitted(95, 32) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +6 >Emitted(95, 34) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> PlainText.Mode = Mode; 1->^^^^^^^^^^^^^^^^ @@ -1864,10 +1863,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(97, 17) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -2 >Emitted(97, 31) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -3 >Emitted(97, 38) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -4 >Emitted(97, 39) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +1->Emitted(96, 17) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(96, 31) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(96, 38) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(96, 39) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) --- >>> })(PlainText = Languages.PlainText || (Languages.PlainText = {})); 1->^^^^^^^^^^^^ @@ -1913,15 +1912,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(98, 13) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -2 >Emitted(98, 14) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) -3 >Emitted(98, 16) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -4 >Emitted(98, 25) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -5 >Emitted(98, 28) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -6 >Emitted(98, 47) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -7 >Emitted(98, 52) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) -8 >Emitted(98, 71) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) -9 >Emitted(98, 79) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +1->Emitted(97, 13) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(97, 14) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(97, 16) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(97, 25) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +5 >Emitted(97, 28) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +6 >Emitted(97, 47) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +7 >Emitted(97, 52) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +8 >Emitted(97, 71) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +9 >Emitted(97, 79) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) --- >>> })(Languages = Thing.Languages || (Thing.Languages = {})); 1 >^^^^^^^^ @@ -1966,15 +1965,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(99, 9) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages) -2 >Emitted(99, 10) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) -3 >Emitted(99, 12) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -4 >Emitted(99, 21) Source(76, 30) + SourceIndex(0) name (Sample.Thing) -5 >Emitted(99, 24) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -6 >Emitted(99, 39) Source(76, 30) + SourceIndex(0) name (Sample.Thing) -7 >Emitted(99, 44) Source(76, 21) + SourceIndex(0) name (Sample.Thing) -8 >Emitted(99, 59) Source(76, 30) + SourceIndex(0) name (Sample.Thing) -9 >Emitted(99, 67) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +1 >Emitted(98, 9) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(98, 10) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(98, 12) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(98, 21) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(98, 24) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +6 >Emitted(98, 39) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +7 >Emitted(98, 44) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +8 >Emitted(98, 59) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +9 >Emitted(98, 67) Source(100, 2) + SourceIndex(0) name (Sample.Thing) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -2019,15 +2018,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(100, 5) Source(100, 1) + SourceIndex(0) name (Sample.Thing) -2 >Emitted(100, 6) Source(100, 2) + SourceIndex(0) name (Sample.Thing) -3 >Emitted(100, 8) Source(76, 15) + SourceIndex(0) name (Sample) -4 >Emitted(100, 13) Source(76, 20) + SourceIndex(0) name (Sample) -5 >Emitted(100, 16) Source(76, 15) + SourceIndex(0) name (Sample) -6 >Emitted(100, 28) Source(76, 20) + SourceIndex(0) name (Sample) -7 >Emitted(100, 33) Source(76, 15) + SourceIndex(0) name (Sample) -8 >Emitted(100, 45) Source(76, 20) + SourceIndex(0) name (Sample) -9 >Emitted(100, 53) Source(100, 2) + SourceIndex(0) name (Sample) +1 >Emitted(99, 5) Source(100, 1) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(99, 6) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(99, 8) Source(76, 15) + SourceIndex(0) name (Sample) +4 >Emitted(99, 13) Source(76, 20) + SourceIndex(0) name (Sample) +5 >Emitted(99, 16) Source(76, 15) + SourceIndex(0) name (Sample) +6 >Emitted(99, 28) Source(76, 20) + SourceIndex(0) name (Sample) +7 >Emitted(99, 33) Source(76, 15) + SourceIndex(0) name (Sample) +8 >Emitted(99, 45) Source(76, 20) + SourceIndex(0) name (Sample) +9 >Emitted(99, 53) Source(100, 2) + SourceIndex(0) name (Sample) --- >>>})(Sample || (Sample = {})); 1 > @@ -2069,12 +2068,12 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(101, 1) Source(100, 1) + SourceIndex(0) name (Sample) -2 >Emitted(101, 2) Source(100, 2) + SourceIndex(0) name (Sample) -3 >Emitted(101, 4) Source(76, 8) + SourceIndex(0) -4 >Emitted(101, 10) Source(76, 14) + SourceIndex(0) -5 >Emitted(101, 15) Source(76, 8) + SourceIndex(0) -6 >Emitted(101, 21) Source(76, 14) + SourceIndex(0) -7 >Emitted(101, 29) Source(100, 2) + SourceIndex(0) +1 >Emitted(100, 1) Source(100, 1) + SourceIndex(0) name (Sample) +2 >Emitted(100, 2) Source(100, 2) + SourceIndex(0) name (Sample) +3 >Emitted(100, 4) Source(76, 8) + SourceIndex(0) +4 >Emitted(100, 10) Source(76, 14) + SourceIndex(0) +5 >Emitted(100, 15) Source(76, 8) + SourceIndex(0) +6 >Emitted(100, 21) Source(76, 14) + SourceIndex(0) +7 >Emitted(100, 29) Source(100, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=recursiveClassReferenceTest.js.map \ No newline at end of file diff --git a/tests/baselines/reference/recursiveComplicatedClasses.js b/tests/baselines/reference/recursiveComplicatedClasses.js index 6e88dd8dc22..e35931008b2 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.js +++ b/tests/baselines/reference/recursiveComplicatedClasses.js @@ -28,8 +28,7 @@ class TypeSymbol extends InferenceSymbol { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Signature = (function () { function Signature() { diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js index 60022dc245a..48e8b1c4eba 100644 --- a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js @@ -33,8 +33,7 @@ declare module MsPortal.Controls.Base.ItemList { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var MsPortal; (function (MsPortal) { diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index 72cc702309c..3ba03a1e03c 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -1023,8 +1023,7 @@ module caurinus { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var rionegrensis; (function (rionegrensis) { diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index 87b1b6d672a..e8781f06d24 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -70,8 +70,7 @@ class I extends G { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js index 35c208b19ee..956efc5f077 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -28,8 +28,7 @@ function fn13(): C { return null; } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // all the following should be valid function fn1() { return 1; } diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js index f971f089741..1a5fc7d9b3e 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js @@ -12,8 +12,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js index a7f7f4fde99..2844897bdd9 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js @@ -12,8 +12,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index 99a933cf157..b104f63f74c 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -15,8 +15,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js index 4100dba13e3..e2ac679e7eb 100644 --- a/tests/baselines/reference/shadowPrivateMembers.js +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -7,8 +7,7 @@ class derived extends base { private n() {} } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var base = (function () { function base() { diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index cae6e991e24..f210e65d4d2 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -11,8 +11,7 @@ class Greeter extends AbstractGreeter { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var AbstractGreeter = (function () { function AbstractGreeter() { diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map index 60a26845043..fad366e8ebb 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map] -{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts"],"names":["AbstractGreeter","AbstractGreeter.constructor","Greeter","Greeter.constructor"],"mappings":";;;;;;AAAA;IAAAA;IACAC,CAACA;IAADD,sBAACA;AAADA,CAACA,AADD,IACC;AAED;IAAsBE,2BAAeA;IAArCA;QAAsBC,8BAAeA;QAC1BA,MAACA,GAAGA,EAAEA,CAACA;QACPA,UAAKA,GAAGA,KAAKA,CAACA;IACzBA,CAACA;IAADD,cAACA;AAADA,CAACA,AAHD,EAAsB,eAAe,EAGpC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts"],"names":["AbstractGreeter","AbstractGreeter.constructor","Greeter","Greeter.constructor"],"mappings":";;;;;AAAA;IAAAA;IACAC,CAACA;IAADD,sBAACA;AAADA,CAACA,AADD,IACC;AAED;IAAsBE,2BAAeA;IAArCA;QAAsBC,8BAAeA;QAC1BA,MAACA,GAAGA,EAAEA,CAACA;QACPA,UAAKA,GAAGA,KAAKA,CAACA;IACzBA,CAACA;IAADD,cAACA;AAADA,CAACA,AAHD,EAAsB,eAAe,EAGpC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt index d0934f3c9ed..aba9861a230 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -11,20 +11,19 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts >>>var __extends = (this && this.__extends) || function (d, b) { >>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; >>> function __() { this.constructor = d; } ->>> __.prototype = b.prototype; ->>> d.prototype = new __(); +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); >>>}; >>>var AbstractGreeter = (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(7, 1) Source(1, 1) + SourceIndex(0) +1 >Emitted(6, 1) Source(1, 1) + SourceIndex(0) --- >>> function AbstractGreeter() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(8, 5) Source(1, 1) + SourceIndex(0) name (AbstractGreeter) +1->Emitted(7, 5) Source(1, 1) + SourceIndex(0) name (AbstractGreeter) --- >>> } 1->^^^^ @@ -33,16 +32,16 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1->class AbstractGreeter { > 2 > } -1->Emitted(9, 5) Source(2, 1) + SourceIndex(0) name (AbstractGreeter.constructor) -2 >Emitted(9, 6) Source(2, 2) + SourceIndex(0) name (AbstractGreeter.constructor) +1->Emitted(8, 5) Source(2, 1) + SourceIndex(0) name (AbstractGreeter.constructor) +2 >Emitted(8, 6) Source(2, 2) + SourceIndex(0) name (AbstractGreeter.constructor) --- >>> return AbstractGreeter; 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^ 1-> 2 > } -1->Emitted(10, 5) Source(2, 1) + SourceIndex(0) name (AbstractGreeter) -2 >Emitted(10, 27) Source(2, 2) + SourceIndex(0) name (AbstractGreeter) +1->Emitted(9, 5) Source(2, 1) + SourceIndex(0) name (AbstractGreeter) +2 >Emitted(9, 27) Source(2, 2) + SourceIndex(0) name (AbstractGreeter) --- >>>})(); 1 > @@ -55,10 +54,10 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > 4 > class AbstractGreeter { > } -1 >Emitted(11, 1) Source(2, 1) + SourceIndex(0) name (AbstractGreeter) -2 >Emitted(11, 2) Source(2, 2) + SourceIndex(0) name (AbstractGreeter) -3 >Emitted(11, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(11, 6) Source(2, 2) + SourceIndex(0) +1 >Emitted(10, 1) Source(2, 1) + SourceIndex(0) name (AbstractGreeter) +2 >Emitted(10, 2) Source(2, 2) + SourceIndex(0) name (AbstractGreeter) +3 >Emitted(10, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(10, 6) Source(2, 2) + SourceIndex(0) --- >>>var Greeter = (function (_super) { 1-> @@ -66,29 +65,29 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1-> > > -1->Emitted(12, 1) Source(4, 1) + SourceIndex(0) +1->Emitted(11, 1) Source(4, 1) + SourceIndex(0) --- >>> __extends(Greeter, _super); 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1->class Greeter extends 2 > AbstractGreeter -1->Emitted(13, 5) Source(4, 23) + SourceIndex(0) name (Greeter) -2 >Emitted(13, 32) Source(4, 38) + SourceIndex(0) name (Greeter) +1->Emitted(12, 5) Source(4, 23) + SourceIndex(0) name (Greeter) +2 >Emitted(12, 32) Source(4, 38) + SourceIndex(0) name (Greeter) --- >>> function Greeter() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(14, 5) Source(4, 1) + SourceIndex(0) name (Greeter) +1 >Emitted(13, 5) Source(4, 1) + SourceIndex(0) name (Greeter) --- >>> _super.apply(this, arguments); 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1->class Greeter extends 2 > AbstractGreeter -1->Emitted(15, 9) Source(4, 23) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(15, 39) Source(4, 38) + SourceIndex(0) name (Greeter.constructor) +1->Emitted(14, 9) Source(4, 23) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(14, 39) Source(4, 38) + SourceIndex(0) name (Greeter.constructor) --- >>> this.a = 10; 1 >^^^^^^^^ @@ -103,11 +102,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > = 4 > 10 5 > ; -1 >Emitted(16, 9) Source(5, 12) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(16, 15) Source(5, 13) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(16, 18) Source(5, 16) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(16, 20) Source(5, 18) + SourceIndex(0) name (Greeter.constructor) -5 >Emitted(16, 21) Source(5, 19) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(15, 9) Source(5, 12) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(15, 15) Source(5, 13) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(15, 18) Source(5, 16) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(15, 20) Source(5, 18) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(15, 21) Source(5, 19) + SourceIndex(0) name (Greeter.constructor) --- >>> this.nameA = "Ten"; 1->^^^^^^^^ @@ -121,11 +120,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > = 4 > "Ten" 5 > ; -1->Emitted(17, 9) Source(6, 12) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(17, 19) Source(6, 17) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(17, 22) Source(6, 20) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(17, 27) Source(6, 25) + SourceIndex(0) name (Greeter.constructor) -5 >Emitted(17, 28) Source(6, 26) + SourceIndex(0) name (Greeter.constructor) +1->Emitted(16, 9) Source(6, 12) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(16, 19) Source(6, 17) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(16, 22) Source(6, 20) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(16, 27) Source(6, 25) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(16, 28) Source(6, 26) + SourceIndex(0) name (Greeter.constructor) --- >>> } 1 >^^^^ @@ -134,8 +133,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1 > > 2 > } -1 >Emitted(18, 5) Source(7, 1) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(18, 6) Source(7, 2) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(17, 5) Source(7, 1) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(17, 6) Source(7, 2) + SourceIndex(0) name (Greeter.constructor) --- >>> return Greeter; 1->^^^^ @@ -143,8 +142,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > ^^^-> 1-> 2 > } -1->Emitted(19, 5) Source(7, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(19, 19) Source(7, 2) + SourceIndex(0) name (Greeter) +1->Emitted(18, 5) Source(7, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(18, 19) Source(7, 2) + SourceIndex(0) name (Greeter) --- >>>})(AbstractGreeter); 1-> @@ -163,11 +162,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts > public a = 10; > public nameA = "Ten"; > } -1->Emitted(20, 1) Source(7, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(20, 2) Source(7, 2) + SourceIndex(0) name (Greeter) -3 >Emitted(20, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(20, 4) Source(4, 23) + SourceIndex(0) -5 >Emitted(20, 19) Source(4, 38) + SourceIndex(0) -6 >Emitted(20, 21) Source(7, 2) + SourceIndex(0) +1->Emitted(19, 1) Source(7, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(19, 2) Source(7, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(19, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(19, 4) Source(4, 23) + SourceIndex(0) +5 >Emitted(19, 19) Source(4, 38) + SourceIndex(0) +6 >Emitted(19, 21) Source(7, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map \ No newline at end of file diff --git a/tests/baselines/reference/specializedInheritedConstructors1.js b/tests/baselines/reference/specializedInheritedConstructors1.js index ec467ad9877..20ef13c3f09 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -21,8 +21,7 @@ var myView = new MyView(m); // was error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var View = (function () { function View(options) { diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js index 2a022cdf7da..31cb4a69594 100644 --- a/tests/baselines/reference/specializedOverloadWithRestParameters.js +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -16,8 +16,7 @@ function g(tagName: any): Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/staticFactory1.js b/tests/baselines/reference/staticFactory1.js index 96303af586f..03092a16de9 100644 --- a/tests/baselines/reference/staticFactory1.js +++ b/tests/baselines/reference/staticFactory1.js @@ -17,8 +17,7 @@ d.foo(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index 0aba29b3560..d3e14d482cc 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -15,8 +15,7 @@ doThing(B); //OK var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function doThing(x) { } var A = (function () { diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js index ab3c010d571..8f9849af057 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js @@ -13,8 +13,7 @@ class P extends SomeBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var SomeBase = (function () { function SomeBase() { diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index f0d50b3ecb6..3f75dc8e26b 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -39,8 +39,7 @@ class E extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index fef1ef46b1a..7fd74aa108f 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -64,8 +64,7 @@ class Ds extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js index 9ee817182c2..e4bef791374 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js @@ -32,8 +32,7 @@ class H extends package.A { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo(private, public, static) { diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js index b6bd2dbd437..97e3e9b0f5b 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -44,8 +44,7 @@ var b: { [x: string]: A } = { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index 5abdd633424..c7b14a4129c 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -110,8 +110,7 @@ function f2(x: T, y: U) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C3 = (function () { function C3() { diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js index afe9b998bd4..194c1835147 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js @@ -172,8 +172,7 @@ class D29 extends C3 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C3 = (function () { function C3() { diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js index 6f1756912a6..370bbf2b8ff 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js @@ -83,8 +83,7 @@ class D9 extends B1 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js index 3d2b6372302..c5d4e68b516 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js @@ -162,8 +162,7 @@ module M2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/subtypingTransitivity.js b/tests/baselines/reference/subtypingTransitivity.js index 9dcb4095aa2..9bc5cd93209 100644 --- a/tests/baselines/reference/subtypingTransitivity.js +++ b/tests/baselines/reference/subtypingTransitivity.js @@ -23,8 +23,7 @@ b.x = 1; // assigned number to string var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B = (function () { function B() { diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index db6f1d85954..f11b83c4da6 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -177,8 +177,7 @@ var r18 = foo18(r18arg1); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index d7ff8a79b6c..2b45b75b95f 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -124,8 +124,7 @@ module WithGenericSignaturesInBaseType { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Errors; (function (Errors) { diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.js b/tests/baselines/reference/subtypingWithCallSignatures4.js index 739e3cacd86..d1d30437cd6 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.js +++ b/tests/baselines/reference/subtypingWithCallSignatures4.js @@ -116,8 +116,7 @@ var r18 = foo18(r18arg); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index 4e93ddbbe55..df050ffd6e9 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -177,8 +177,7 @@ var r18 = foo18(r18arg1); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index 7022b4b395c..ccc6fb872c5 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -126,8 +126,7 @@ module WithGenericSignaturesInBaseType { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Errors; (function (Errors) { diff --git a/tests/baselines/reference/subtypingWithConstructSignatures4.js b/tests/baselines/reference/subtypingWithConstructSignatures4.js index a16ea8e2397..67b83aa94c9 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures4.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures4.js @@ -116,8 +116,7 @@ var r18 = foo18(r18arg); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithConstructSignatures5.js b/tests/baselines/reference/subtypingWithConstructSignatures5.js index fe3b86d1775..ec3bad2c1f3 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures5.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures5.js @@ -54,8 +54,7 @@ interface I extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithConstructSignatures6.js b/tests/baselines/reference/subtypingWithConstructSignatures6.js index 990b654bf45..1c7a2d883c3 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures6.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures6.js @@ -57,8 +57,7 @@ interface I9 extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.js b/tests/baselines/reference/subtypingWithNumericIndexer.js index a7790fba564..2ad6a2ebedc 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer.js @@ -44,8 +44,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.js b/tests/baselines/reference/subtypingWithNumericIndexer3.js index c3fff86274f..f4c2d1d9da9 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.js @@ -48,8 +48,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.js b/tests/baselines/reference/subtypingWithNumericIndexer4.js index e7ec08436a7..7956464d172 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.js @@ -32,8 +32,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/subtypingWithObjectMembers.js b/tests/baselines/reference/subtypingWithObjectMembers.js index 28af7239222..fc452ba8cf4 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.js +++ b/tests/baselines/reference/subtypingWithObjectMembers.js @@ -71,8 +71,7 @@ module TwoLevels { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithObjectMembers4.js b/tests/baselines/reference/subtypingWithObjectMembers4.js index b04c3056a3e..487a5969f71 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers4.js +++ b/tests/baselines/reference/subtypingWithObjectMembers4.js @@ -38,8 +38,7 @@ class B3 extends A3 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js index d3b62890855..f08f2367d2c 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js @@ -38,8 +38,7 @@ class B3 extends A3 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js index 4a0ff448b7b..c23405cd50c 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js @@ -66,8 +66,7 @@ module ImplicitPublic { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/subtypingWithStringIndexer.js b/tests/baselines/reference/subtypingWithStringIndexer.js index 4b398451de8..5f606520a65 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.js +++ b/tests/baselines/reference/subtypingWithStringIndexer.js @@ -45,8 +45,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.js b/tests/baselines/reference/subtypingWithStringIndexer3.js index cf1ec80a8d2..6ce66c4e723 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.js +++ b/tests/baselines/reference/subtypingWithStringIndexer3.js @@ -48,8 +48,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.js b/tests/baselines/reference/subtypingWithStringIndexer4.js index e6aa298fed8..19d36e475c2 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.js +++ b/tests/baselines/reference/subtypingWithStringIndexer4.js @@ -32,8 +32,7 @@ module Generics { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/super.js b/tests/baselines/reference/super.js index ed220ae1f18..a6b698413ec 100644 --- a/tests/baselines/reference/super.js +++ b/tests/baselines/reference/super.js @@ -41,8 +41,7 @@ s.foo() + ss.foo(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/super1.js b/tests/baselines/reference/super1.js index 1bf75783a60..6a52cfcd9e7 100644 --- a/tests/baselines/reference/super1.js +++ b/tests/baselines/reference/super1.js @@ -70,8 +70,7 @@ module Base4 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // Case 1 var Base1 = (function () { diff --git a/tests/baselines/reference/super2.js b/tests/baselines/reference/super2.js index 0f5531a8d57..9d865194a2a 100644 --- a/tests/baselines/reference/super2.js +++ b/tests/baselines/reference/super2.js @@ -54,8 +54,7 @@ results1.x() + results1.y() + results2.y(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // Case 5 var Base5 = (function () { diff --git a/tests/baselines/reference/superAccess.js b/tests/baselines/reference/superAccess.js index bf6a9ee3ad0..bb5a71a0b8f 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -17,8 +17,7 @@ class MyDerived extends MyBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var MyBase = (function () { function MyBase() { diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index afcba34aa5d..fd20f424ba3 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -28,8 +28,7 @@ class Q extends P { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var P = (function () { function P() { diff --git a/tests/baselines/reference/superAccessInFatArrow1.js b/tests/baselines/reference/superAccessInFatArrow1.js index 6222bf42fee..0dc69179c92 100644 --- a/tests/baselines/reference/superAccessInFatArrow1.js +++ b/tests/baselines/reference/superAccessInFatArrow1.js @@ -19,8 +19,7 @@ module test { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var test; (function (test) { diff --git a/tests/baselines/reference/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index 7c7948cc387..3369cf7e8df 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -29,8 +29,7 @@ class T6 extends T5{ var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var T5 = (function () { function T5(bar) { diff --git a/tests/baselines/reference/superCallAssignResult.js b/tests/baselines/reference/superCallAssignResult.js index a83e5b3de75..24a198e3420 100644 --- a/tests/baselines/reference/superCallAssignResult.js +++ b/tests/baselines/reference/superCallAssignResult.js @@ -14,8 +14,7 @@ class H extends E { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var E = (function () { function E(arg) { diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js index 15e26b5481f..d59f6f5a578 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -15,8 +15,7 @@ class D extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var D = (function (_super) { __extends(D, _super); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index 15d24015a04..a3d5d42c822 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -14,8 +14,7 @@ class D extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var D = (function (_super) { __extends(D, _super); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index 114505b85a2..155258861bf 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -14,8 +14,7 @@ class B extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(map) { diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js index 226665e3e67..37883b9921a 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -14,8 +14,7 @@ class B extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(map) { diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js index 7c07e78b0f9..dbd4528c39f 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -14,8 +14,7 @@ class B extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(map) { diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index c3038e23c4c..7de6a100451 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -54,8 +54,7 @@ class Other extends Doing { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Doing = (function () { function Doing() { diff --git a/tests/baselines/reference/superCallInStaticMethod.js b/tests/baselines/reference/superCallInStaticMethod.js index 7e57cd2d2e8..9978773739f 100644 --- a/tests/baselines/reference/superCallInStaticMethod.js +++ b/tests/baselines/reference/superCallInStaticMethod.js @@ -50,8 +50,7 @@ class Other extends Doing { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Doing = (function () { function Doing() { diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index 0a1822bc549..c2152e13db0 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -26,8 +26,7 @@ var d = new D(); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index 4888473319e..b7508e4cd7d 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -16,8 +16,7 @@ class B extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(map) { diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.js b/tests/baselines/reference/superCallParameterContextualTyping2.js index ab6093c42be..996e0374c7f 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -15,8 +15,7 @@ class C extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(map) { diff --git a/tests/baselines/reference/superCallParameterContextualTyping3.js b/tests/baselines/reference/superCallParameterContextualTyping3.js index 574d281ed09..6f1311e58ab 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -35,8 +35,7 @@ class C extends CBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var CBase = (function () { function CBase(param) { diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index d2e4f9ff7f1..bd54ba34b56 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -34,8 +34,7 @@ class OtherDerived extends OtherBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(n) { diff --git a/tests/baselines/reference/superCallsInConstructor.js b/tests/baselines/reference/superCallsInConstructor.js index 6bd313898d4..c238808b959 100644 --- a/tests/baselines/reference/superCallsInConstructor.js +++ b/tests/baselines/reference/superCallsInConstructor.js @@ -24,8 +24,7 @@ class Derived extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index 2e1cd346cd4..3a3de509120 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -55,8 +55,7 @@ class RegisteredUser extends User { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function foo() { // super in a non class context diff --git a/tests/baselines/reference/superInCatchBlock1.js b/tests/baselines/reference/superInCatchBlock1.js index 38131f5f08e..cf4c69c7b61 100644 --- a/tests/baselines/reference/superInCatchBlock1.js +++ b/tests/baselines/reference/superInCatchBlock1.js @@ -17,8 +17,7 @@ class B extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index aaf4162e992..7c0cc7bf40d 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -14,8 +14,7 @@ class C extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var B = (function () { function B() { diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index 5640425f6bc..89d5798f882 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -71,8 +71,7 @@ class RegisteredUser4 extends User { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var User = (function () { function User() { diff --git a/tests/baselines/reference/superNewCall1.js b/tests/baselines/reference/superNewCall1.js index 1b11b61ce2f..aa25e65e14d 100644 --- a/tests/baselines/reference/superNewCall1.js +++ b/tests/baselines/reference/superNewCall1.js @@ -16,8 +16,7 @@ class B extends A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A(map) { diff --git a/tests/baselines/reference/superPropertyAccess.js b/tests/baselines/reference/superPropertyAccess.js index 016fc09ff96..95dbb2f94e0 100644 --- a/tests/baselines/reference/superPropertyAccess.js +++ b/tests/baselines/reference/superPropertyAccess.js @@ -40,8 +40,7 @@ class MyDerived extends MyBase { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var MyBase = (function () { function MyBase() { diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index 1ee834f3495..748331af95f 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -31,8 +31,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index 0877cf23b9d..dccd4717ee0 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -31,8 +31,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index f8ee7f6d01b..44a6910a386 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -70,8 +70,7 @@ class SomeDerivedClass extends SomeBaseClass { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var SomeBaseClass = (function () { function SomeBaseClass() { diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index 5cd85f90735..3d1ea0f77a9 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -18,8 +18,7 @@ var r2: number = d.y; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index 8ba6f878dc2..482c7ba0694 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -15,8 +15,7 @@ class D extends B { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var D = (function (_super) { __extends(D, _super); diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index 2e5ea93a47a..6d5690cd689 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -13,8 +13,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/superWithTypeArgument2.js b/tests/baselines/reference/superWithTypeArgument2.js index c33497d58fd..588094cd864 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -13,8 +13,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index 1266d97f264..8f0ba6c0861 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -17,8 +17,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js index 97fa57528cf..d2f240b766d 100644 --- a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js +++ b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js @@ -31,8 +31,7 @@ class SuperObjectTest extends F { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ObjectLiteral; (function (ObjectLiteral) { diff --git a/tests/baselines/reference/switchStatements.js b/tests/baselines/reference/switchStatements.js index debd9a4d531..39a4b2c901d 100644 --- a/tests/baselines/reference/switchStatements.js +++ b/tests/baselines/reference/switchStatements.js @@ -59,8 +59,7 @@ switch (((x: T) => '')(1)) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index bde689ba2c9..41673a62efd 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -22,8 +22,7 @@ class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // err var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function foo(x) { } var Foo = (function () { diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index afce4ec0375..84b96404683 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -52,8 +52,7 @@ enum SomeEnum { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; //'this' in static member initializer var ErrClass1 = (function () { diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 8fcbe226437..7de94be9420 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -52,8 +52,7 @@ export = this; // Should be an error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; //'this' in static member initializer var ErrClass1 = (function () { diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index 3da6d9c8a68..f7d7ca4e4fd 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -26,8 +26,7 @@ class Foo3 extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(x) { diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index b0ff1bd4bab..4ae43784fe0 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -14,8 +14,7 @@ class Foo extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(a) { diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index fca671a2c73..a9bbeda9fe7 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -23,8 +23,7 @@ class Foo2 extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(a) { diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index fe2bdec77ed..ba27add2d97 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -16,8 +16,7 @@ class Foo extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(a) { diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index 51ca6a27f0e..3645e61f2ba 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -46,8 +46,7 @@ someOther = someOther; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // Function call whose argument is a 1 arg generic function call with explicit type arguments function fn1(t) { } diff --git a/tests/baselines/reference/typeGuardFunction.js b/tests/baselines/reference/typeGuardFunction.js index f6b752c8c04..bff304682af 100644 --- a/tests/baselines/reference/typeGuardFunction.js +++ b/tests/baselines/reference/typeGuardFunction.js @@ -87,8 +87,7 @@ let union3: boolean | B = isA(union2) || union2; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/typeGuardFunctionErrors.js b/tests/baselines/reference/typeGuardFunctionErrors.js index 179a3b80cf0..5b0979ac576 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.js +++ b/tests/baselines/reference/typeGuardFunctionErrors.js @@ -139,8 +139,7 @@ function b7({a, b, c: {p1}}, p2, p3): p1 is A { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/typeGuardFunctionGenerics.js b/tests/baselines/reference/typeGuardFunctionGenerics.js index 6704225a0d0..edf5cb97fe4 100644 --- a/tests/baselines/reference/typeGuardFunctionGenerics.js +++ b/tests/baselines/reference/typeGuardFunctionGenerics.js @@ -37,8 +37,7 @@ let test3: B = funE(isB, 1); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.js b/tests/baselines/reference/typeGuardOfFormInstanceOf.js index de7e9813a84..cab04365c19 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.js +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -39,8 +39,7 @@ var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/typeGuardOfFormIsType.js b/tests/baselines/reference/typeGuardOfFormIsType.js index 65d99319d1e..8400aef59ad 100644 --- a/tests/baselines/reference/typeGuardOfFormIsType.js +++ b/tests/baselines/reference/typeGuardOfFormIsType.js @@ -41,8 +41,7 @@ var r2: C2 | D1 = isC1(c2Ord1) && c2Ord1; // C2 | D1 var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/typeMatch2.js b/tests/baselines/reference/typeMatch2.js index 6f05bf684f1..c4550750ca2 100644 --- a/tests/baselines/reference/typeMatch2.js +++ b/tests/baselines/reference/typeMatch2.js @@ -48,8 +48,7 @@ function f4() { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function f1() { var a = { x: 1, y: 2 }; diff --git a/tests/baselines/reference/typeOfSuperCall.js b/tests/baselines/reference/typeOfSuperCall.js index 5df29d615e4..72cdd7d528e 100644 --- a/tests/baselines/reference/typeOfSuperCall.js +++ b/tests/baselines/reference/typeOfSuperCall.js @@ -12,8 +12,7 @@ class D extends C { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C() { diff --git a/tests/baselines/reference/typeParameterAsBaseClass.js b/tests/baselines/reference/typeParameterAsBaseClass.js index b00a00abac5..f17db28f657 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.js +++ b/tests/baselines/reference/typeParameterAsBaseClass.js @@ -6,8 +6,7 @@ class C2 implements T {} var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/typeParameterAsBaseType.js b/tests/baselines/reference/typeParameterAsBaseType.js index 2715c09fa23..de9a0ed2587 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.js +++ b/tests/baselines/reference/typeParameterAsBaseType.js @@ -16,8 +16,7 @@ interface I2 extends U { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function (_super) { __extends(C, _super); diff --git a/tests/baselines/reference/typeParameterExtendingUnion1.js b/tests/baselines/reference/typeParameterExtendingUnion1.js index c5e8fccf350..3027f119fb9 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion1.js +++ b/tests/baselines/reference/typeParameterExtendingUnion1.js @@ -16,8 +16,7 @@ function f(a: T) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Animal = (function () { function Animal() { diff --git a/tests/baselines/reference/typeParameterExtendingUnion2.js b/tests/baselines/reference/typeParameterExtendingUnion2.js index e53aeb42f22..55f6d3e07e2 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion2.js +++ b/tests/baselines/reference/typeParameterExtendingUnion2.js @@ -16,8 +16,7 @@ function f(a: T) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Animal = (function () { function Animal() { diff --git a/tests/baselines/reference/typeValueConflict1.js b/tests/baselines/reference/typeValueConflict1.js index d036d90262f..0a6e92d0d62 100644 --- a/tests/baselines/reference/typeValueConflict1.js +++ b/tests/baselines/reference/typeValueConflict1.js @@ -15,8 +15,7 @@ module M2 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M1; (function (M1) { diff --git a/tests/baselines/reference/typeValueConflict2.js b/tests/baselines/reference/typeValueConflict2.js index c927e70615a..6e925b535a3 100644 --- a/tests/baselines/reference/typeValueConflict2.js +++ b/tests/baselines/reference/typeValueConflict2.js @@ -22,8 +22,7 @@ module M3 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M1; (function (M1) { diff --git a/tests/baselines/reference/typeofClass2.js b/tests/baselines/reference/typeofClass2.js index f4401db1549..d16abbda6e5 100644 --- a/tests/baselines/reference/typeofClass2.js +++ b/tests/baselines/reference/typeofClass2.js @@ -25,8 +25,7 @@ var r2: typeof d; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C = (function () { function C(x) { diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.js b/tests/baselines/reference/typesWithSpecializedCallSignatures.js index 4baa9d71194..3de4134789e 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.js @@ -46,8 +46,7 @@ var r3: Base = c.foo('hm'); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js index 8f64b4be3bf..c66c471b3a1 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js @@ -44,8 +44,7 @@ var r3: Base = new a('hm'); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/undeclaredBase.js b/tests/baselines/reference/undeclaredBase.js index bb78d5995c3..b1efffc0e24 100644 --- a/tests/baselines/reference/undeclaredBase.js +++ b/tests/baselines/reference/undeclaredBase.js @@ -7,8 +7,7 @@ module M { export class C extends M.I { } } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var M; (function (M) { diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js index 49877eb62e0..c89c3f65381 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -126,8 +126,7 @@ class D17 extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base() { diff --git a/tests/baselines/reference/underscoreMapFirst.js b/tests/baselines/reference/underscoreMapFirst.js index c1839fadfdc..4ee69572f1d 100644 --- a/tests/baselines/reference/underscoreMapFirst.js +++ b/tests/baselines/reference/underscoreMapFirst.js @@ -52,8 +52,7 @@ class MyView extends View { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var MyView = (function (_super) { __extends(MyView, _super); diff --git a/tests/baselines/reference/unionTypeEquivalence.js b/tests/baselines/reference/unionTypeEquivalence.js index 04ee64b73e3..3f4ad647dd5 100644 --- a/tests/baselines/reference/unionTypeEquivalence.js +++ b/tests/baselines/reference/unionTypeEquivalence.js @@ -23,8 +23,7 @@ var z1: string | typeof BC; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // A | B is equivalent to A if B is a subtype of A var C = (function () { diff --git a/tests/baselines/reference/unionTypeFromArrayLiteral.js b/tests/baselines/reference/unionTypeFromArrayLiteral.js index ab43a6273b2..1bfadd68ca6 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.js +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.js @@ -31,8 +31,7 @@ var arr9 = [e, f]; // (E|F)[] var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var arr1 = [1, 2]; // number[] var arr2 = ["hello", true]; // (string | number)[] diff --git a/tests/baselines/reference/unionTypesAssignability.js b/tests/baselines/reference/unionTypesAssignability.js index 7778e1beded..80eafb4f506 100644 --- a/tests/baselines/reference/unionTypesAssignability.js +++ b/tests/baselines/reference/unionTypesAssignability.js @@ -76,8 +76,7 @@ function foo(t: T, u: U) { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var unionNumberString; var C = (function () { diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 0e081a66b83..cab42726c73 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -36,8 +36,7 @@ class C5 { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x = asdf; var y; diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index df64daff2bf..ed844f740ba 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -157,8 +157,7 @@ module ts { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ts; (function (ts) { diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js index 8304aae576f..2f2d4e87c46 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js @@ -47,8 +47,7 @@ c5(1); // error var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // none of these function calls should be allowed var x = function () { return; }; diff --git a/tests/baselines/reference/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index 6f2fc67d7e1..4378d89ad4b 100644 --- a/tests/baselines/reference/validUseOfThisInSuper.js +++ b/tests/baselines/reference/validUseOfThisInSuper.js @@ -13,8 +13,7 @@ class Super extends Base { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Base = (function () { function Base(b) { diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index 005ba55d761..c3daf0c1004 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -28,8 +28,7 @@ reg.register(B); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; define(["require", "exports"], function (require, exports) { var A = (function () { From c67eecde5da1b7196998a2a23e89a07d78b17655 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 16 Jun 2015 12:35:34 -0700 Subject: [PATCH 16/42] Accepting new baselines --- .../project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts | 3 +++ .../project/quotesInFileAndDirectoryNames/node/m'ain.d.ts | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts create mode 100644 tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts new file mode 100644 index 00000000000..d7b4c67d491 --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts @@ -0,0 +1,3 @@ +/// +declare class ClassC extends test.ClassA { +} diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts new file mode 100644 index 00000000000..d7b4c67d491 --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts @@ -0,0 +1,3 @@ +/// +declare class ClassC extends test.ClassA { +} From 6ee1890e9481fc3611ab5570e2787adc752db877 Mon Sep 17 00:00:00 2001 From: piloopin Date: Wed, 17 Jun 2015 00:57:23 +0430 Subject: [PATCH 17/42] Fix Intl.DateTimeFormat.format and Int.NumberFormatOptions signature --- src/lib/intl.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/intl.d.ts b/src/lib/intl.d.ts index 66e51ddbc5a..57df70672d4 100644 --- a/src/lib/intl.d.ts +++ b/src/lib/intl.d.ts @@ -41,6 +41,11 @@ declare module Intl { currency?: string; currencyDisplay?: string; useGrouping?: boolean; + minimumintegerDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; } interface ResolvedNumberFormatOptions { @@ -103,7 +108,7 @@ declare module Intl { } interface DateTimeFormat { - format(date: number): string; + format(date?: Date | number): string; resolvedOptions(): ResolvedDateTimeFormatOptions; } var DateTimeFormat: { From aed48ecb991ed141eced94b6498e44c969375442 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 16 Jun 2015 14:56:31 -0700 Subject: [PATCH 18/42] changed to '==' to '===', '!=' to '!==' --- src/compiler/checker.ts | 8 +++---- src/harness/projectsRunner.ts | 1 + src/harness/sourceMapRecorder.ts | 30 ++++++++++++------------ src/services/formatting/rulesMap.ts | 10 ++++---- src/services/formatting/rulesProvider.ts | 1 + src/services/formatting/tokenRange.ts | 2 +- src/services/patternMatcher.ts | 4 ++-- src/services/services.ts | 3 ++- src/services/shims.ts | 2 ++ 9 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e27e69bb993..20d8f84e584 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3523,7 +3523,7 @@ namespace ts { // -> typeParameter and symbol.declaration originate from the same type parameter list // -> illegal for all declarations in symbol // forEach === exists - links.isIllegalTypeReferenceInConstraint = forEach(symbol.declarations, d => d.parent == typeParameter.parent); + links.isIllegalTypeReferenceInConstraint = forEach(symbol.declarations, d => d.parent === typeParameter.parent); } } if (links.isIllegalTypeReferenceInConstraint) { @@ -8432,7 +8432,7 @@ namespace ts { // contextually typed function and arrow expressions in the initial phase. function checkExpression(node: Expression | QualifiedName, contextualMapper?: TypeMapper): Type { let type: Type; - if (node.kind == SyntaxKind.QualifiedName) { + if (node.kind === SyntaxKind.QualifiedName) { type = checkQualifiedName(node); } else { @@ -9871,7 +9871,7 @@ namespace ts { function checkForStatement(node: ForStatement) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == SyntaxKind.VariableDeclarationList) { + if (node.initializer && node.initializer.kind === SyntaxKind.VariableDeclarationList) { checkGrammarVariableDeclarationList(node.initializer); } } @@ -11751,7 +11751,7 @@ namespace ts { } function isTypeDeclarationName(name: Node): boolean { - return name.kind == SyntaxKind.Identifier && + return name.kind === SyntaxKind.Identifier && isTypeDeclaration(name.parent) && (name.parent).name === name; } diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 324524272e0..dd5474364d7 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -110,6 +110,7 @@ class ProjectRunner extends RunnerBase { else if (url.indexOf(diskProjectPath) === 0) { // Replace the disk specific path into the project root path url = url.substr(diskProjectPath.length); + // TODO: should be '!=='? if (url.charCodeAt(0) != ts.CharacterCodes.slash) { url = "/" + url; } diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index 528e6ddd52b..ed079774d94 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -46,7 +46,7 @@ module Harness.SourceMapRecoder { } function isSourceMappingSegmentEnd() { - if (decodingIndex == sourceMapMappings.length) { + if (decodingIndex === sourceMapMappings.length) { return true; } @@ -95,7 +95,7 @@ module Harness.SourceMapRecoder { var currentByte = base64FormatDecode(); // If msb is set, we still have more bits to continue - moreDigits = (currentByte & 32) != 0; + moreDigits = (currentByte & 32) !== 0; // least significant 5 bits are the next msbs in the final value. value = value | ((currentByte & 31) << shiftCount); @@ -103,7 +103,7 @@ module Harness.SourceMapRecoder { } // Least significant bit if 1 represents negative and rest of the msb is actual absolute value - if ((value & 1) == 0) { + if ((value & 1) === 0) { // + number value = value >> 1; } @@ -182,7 +182,7 @@ module Harness.SourceMapRecoder { } } // Dont support reading mappings that dont have information about original source and its line numbers - if (createErrorIfCondition(!isSourceMappingSegmentEnd(), "Unsupported Error Format: There are more entries after " + (decodeOfEncodedMapping.nameIndex == -1 ? "sourceColumn" : "nameIndex"))) { + if (createErrorIfCondition(!isSourceMappingSegmentEnd(), "Unsupported Error Format: There are more entries after " + (decodeOfEncodedMapping.nameIndex === -1 ? "sourceColumn" : "nameIndex"))) { return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; } @@ -249,7 +249,7 @@ module Harness.SourceMapRecoder { mapString += " name (" + sourceMapNames[mapEntry.nameIndex] + ")"; } else { - if (mapEntry.nameIndex != -1 || getAbsentNameIndex) { + if (mapEntry.nameIndex !== -1 || getAbsentNameIndex) { mapString += " nameIndex (" + mapEntry.nameIndex + ")"; } } @@ -262,12 +262,12 @@ module Harness.SourceMapRecoder { var decodeResult = SourceMapDecoder.decodeNextEncodedSourceMapSpan(); var decodedErrors: string[]; if (decodeResult.error - || decodeResult.sourceMapSpan.emittedLine != sourceMapSpan.emittedLine - || decodeResult.sourceMapSpan.emittedColumn != sourceMapSpan.emittedColumn - || decodeResult.sourceMapSpan.sourceLine != sourceMapSpan.sourceLine - || decodeResult.sourceMapSpan.sourceColumn != sourceMapSpan.sourceColumn - || decodeResult.sourceMapSpan.sourceIndex != sourceMapSpan.sourceIndex - || decodeResult.sourceMapSpan.nameIndex != sourceMapSpan.nameIndex) { + || decodeResult.sourceMapSpan.emittedLine !== sourceMapSpan.emittedLine + || decodeResult.sourceMapSpan.emittedColumn !== sourceMapSpan.emittedColumn + || decodeResult.sourceMapSpan.sourceLine !== sourceMapSpan.sourceLine + || decodeResult.sourceMapSpan.sourceColumn !== sourceMapSpan.sourceColumn + || decodeResult.sourceMapSpan.sourceIndex !== sourceMapSpan.sourceIndex + || decodeResult.sourceMapSpan.nameIndex !== sourceMapSpan.nameIndex) { if (decodeResult.error) { decodedErrors = ["!!^^ !!^^ There was decoding error in the sourcemap at this location: " + decodeResult.error]; } @@ -288,7 +288,7 @@ module Harness.SourceMapRecoder { } export function recordNewSourceFileSpan(sourceMapSpan: ts.SourceMapSpan, newSourceFileCode: string) { - assert.isTrue(spansOnSingleLine.length == 0 || spansOnSingleLine[0].sourceMapSpan.emittedLine !== sourceMapSpan.emittedLine, "new file source map span should be on new line. We currently handle only that scenario"); + assert.isTrue(spansOnSingleLine.length === 0 || spansOnSingleLine[0].sourceMapSpan.emittedLine !== sourceMapSpan.emittedLine, "new file source map span should be on new line. We currently handle only that scenario"); recordSourceMapSpan(sourceMapSpan); assert.isTrue(spansOnSingleLine.length === 1); @@ -395,9 +395,9 @@ module Harness.SourceMapRecoder { var tsCodeLineMap = ts.computeLineStarts(sourceText); for (var i = 0; i < tsCodeLineMap.length; i++) { - writeSourceMapIndent(prevEmittedCol, i == 0 ? markerIds[index] : " >"); + writeSourceMapIndent(prevEmittedCol, i === 0 ? markerIds[index] : " >"); sourceMapRecoder.Write(getTextOfLine(i, tsCodeLineMap, sourceText)); - if (i == tsCodeLineMap.length - 1) { + if (i === tsCodeLineMap.length - 1) { sourceMapRecoder.WriteLine(""); } } @@ -447,7 +447,7 @@ module Harness.SourceMapRecoder { for (var j = 0; j < sourceMapData.sourceMapDecodedMappings.length; j++) { var decodedSourceMapping = sourceMapData.sourceMapDecodedMappings[j]; var currentSourceFile = program.getSourceFile(sourceMapData.inputSourceFileNames[decodedSourceMapping.sourceIndex]); - if (currentSourceFile != prevSourceFile) { + if (currentSourceFile !== prevSourceFile) { SourceMapSpanWriter.recordNewSourceFileSpan(decodedSourceMapping, currentSourceFile.text); prevSourceFile = currentSourceFile; } diff --git a/src/services/formatting/rulesMap.ts b/src/services/formatting/rulesMap.ts index 4f231bd842e..bffbb75c02e 100644 --- a/src/services/formatting/rulesMap.ts +++ b/src/services/formatting/rulesMap.ts @@ -41,15 +41,15 @@ namespace ts.formatting { } private FillRule(rule: Rule, rulesBucketConstructionStateList: RulesBucketConstructionState[]): void { - let specificRule = rule.Descriptor.LeftTokenRange != Shared.TokenRange.Any && - rule.Descriptor.RightTokenRange != Shared.TokenRange.Any; + let specificRule = rule.Descriptor.LeftTokenRange !== Shared.TokenRange.Any && + rule.Descriptor.RightTokenRange !== Shared.TokenRange.Any; rule.Descriptor.LeftTokenRange.GetTokens().forEach((left) => { rule.Descriptor.RightTokenRange.GetTokens().forEach((right) => { let rulesBucketIndex = this.GetRuleBucketIndex(left, right); let rulesBucket = this.map[rulesBucketIndex]; - if (rulesBucket == undefined) { + if (rulesBucket === undefined) { rulesBucket = this.map[rulesBucketIndex] = new RulesBucket(); } @@ -124,7 +124,7 @@ namespace ts.formatting { public IncreaseInsertionIndex(maskPosition: RulesPosition): void { let value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; value++; - Debug.assert((value & Mask) == value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); + Debug.assert((value & Mask) === value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); let temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); temp |= value << maskPosition; @@ -147,7 +147,7 @@ namespace ts.formatting { public AddRule(rule: Rule, specificTokens: boolean, constructionState: RulesBucketConstructionState[], rulesBucketIndex: number): void { let position: RulesPosition; - if (rule.Operation.Action == RuleAction.Ignore) { + if (rule.Operation.Action === RuleAction.Ignore) { position = specificTokens ? RulesPosition.IgnoreRulesSpecific : RulesPosition.IgnoreRulesAny; diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index bd8f4fc3a5e..5317e9e50fe 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -25,6 +25,7 @@ namespace ts.formatting { } public ensureUpToDate(options: ts.FormatCodeOptions) { + // TODO: should this be '==='? if (this.options == null || !ts.compareDataObjects(this.options, options)) { let activeRules = this.createActiveRules(options); let rulesMap = RulesMap.create(activeRules); diff --git a/src/services/formatting/tokenRange.ts b/src/services/formatting/tokenRange.ts index 27a43280f2c..3391365f328 100644 --- a/src/services/formatting/tokenRange.ts +++ b/src/services/formatting/tokenRange.ts @@ -54,7 +54,7 @@ namespace ts.formatting { } public Contains(tokenValue: SyntaxKind): boolean { - return tokenValue == this.token; + return tokenValue === this.token; } } diff --git a/src/services/patternMatcher.ts b/src/services/patternMatcher.ts index d56c7fac975..ea433867c46 100644 --- a/src/services/patternMatcher.ts +++ b/src/services/patternMatcher.ts @@ -686,7 +686,7 @@ namespace ts { if (charIsPunctuation(identifier.charCodeAt(i - 1)) || charIsPunctuation(identifier.charCodeAt(i)) || - lastIsDigit != currentIsDigit || + lastIsDigit !== currentIsDigit || hasTransitionFromLowerToUpper || hasTransitionFromUpperToLower) { @@ -757,7 +757,7 @@ namespace ts { // 3) HTMLDocument -> HTML, Document // // etc. - if (index != wordStart && + if (index !== wordStart && index + 1 < identifier.length) { let currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); let nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); diff --git a/src/services/services.ts b/src/services/services.ts index 3939e62cfd2..d0ea89c7a16 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -6043,7 +6043,8 @@ namespace ts { */ function hasValueSideModule(symbol: Symbol): boolean { return forEach(symbol.declarations, declaration => { - return declaration.kind === SyntaxKind.ModuleDeclaration && getModuleInstanceState(declaration) == ModuleInstanceState.Instantiated; + return declaration.kind === SyntaxKind.ModuleDeclaration && + getModuleInstanceState(declaration) === ModuleInstanceState.Instantiated; }); } } diff --git a/src/services/shims.ts b/src/services/shims.ts index 9a586a1ec12..2e8b3eb774d 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -234,6 +234,7 @@ namespace ts { public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange { var oldSnapshotShim = oldSnapshot; var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); + // TODO: should this be '==='? if (encoded == null) { return null; } @@ -283,6 +284,7 @@ namespace ts { public getCompilationSettings(): CompilerOptions { var settingsJson = this.shimHost.getCompilationSettings(); + // TODO: should this be '==='? if (settingsJson == null || settingsJson == "") { throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); return null; From 1d5dcf0d0c2c5ba990d6dfa91cd2a45326b81a60 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 16 Jun 2015 15:39:34 -0700 Subject: [PATCH 19/42] changes that are non-breaking --- src/compiler/checker.ts | 2 +- src/compiler/core.ts | 2 +- src/compiler/emitter.ts | 10 ++--- src/compiler/scanner.ts | 2 +- src/compiler/utilities.ts | 2 +- src/harness/fourslash.ts | 9 ++-- src/harness/projectsRunner.ts | 2 +- src/server/client.ts | 6 +-- src/server/editorServices.ts | 44 +++++++++---------- src/server/node.d.ts | 4 +- src/server/protocol.d.ts | 4 +- src/server/server.ts | 4 +- src/server/session.ts | 14 +++--- src/services/breakpoints.ts | 2 +- src/services/formatting/formattingContext.ts | 4 +- .../formatting/ruleOperationContext.ts | 2 +- src/services/formatting/rules.ts | 2 +- src/services/formatting/rulesProvider.ts | 2 +- 18 files changed, 60 insertions(+), 57 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 20d8f84e584..a052949cd8e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11920,7 +11920,7 @@ namespace ts { // Intentional fall-through case SyntaxKind.NumericLiteral: // index access - if (node.parent.kind == SyntaxKind.ElementAccessExpression && (node.parent).argumentExpression === node) { + if (node.parent.kind === SyntaxKind.ElementAccessExpression && (node.parent).argumentExpression === node) { let objectType = checkExpression((node.parent).expression); if (objectType === unknownType) return undefined; let apparentType = getApparentType(objectType); diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 0c0414f3b12..ced477eeeec 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -572,7 +572,7 @@ namespace ts { export function getNormalizedPathComponents(path: string, currentDirectory: string) { path = normalizeSlashes(path); let rootLength = getRootLength(path); - if (rootLength == 0) { + if (rootLength === 0) { // If the path is not rooted it is relative to current directory path = combinePaths(normalizeSlashes(currentDirectory), path); rootLength = getRootLength(path); diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8081668f98c..ff46d06741a 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -320,7 +320,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { let prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; // Line/Comma delimiters - if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { + if (lastEncodedSourceMapSpan.emittedLine === lastRecordedSourceMapSpan.emittedLine) { // Emit comma to separate the entry if (sourceMapData.sourceMapMappings) { sourceMapData.sourceMapMappings += ","; @@ -403,8 +403,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { // If this location wasn't recorded or the location in source is going backwards, record the span if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine != emittedLine || - lastRecordedSourceMapSpan.emittedColumn != emittedColumn || + lastRecordedSourceMapSpan.emittedLine !== emittedLine || + lastRecordedSourceMapSpan.emittedColumn !== emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { @@ -654,7 +654,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { if (nodeIsSynthesized(node)) { return emitNodeWithoutSourceMap(node); } - if (node.kind != SyntaxKind.SourceFile) { + if (node.kind !== SyntaxKind.SourceFile) { recordEmitNodeStartSpan(node); emitNodeWithoutSourceMap(node); recordEmitNodeEndSpan(node); @@ -1962,7 +1962,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { // Make sure we consider all nested cast expressions, e.g.: // (-A).x; - while (operand.kind == SyntaxKind.TypeAssertionExpression) { + while (operand.kind === SyntaxKind.TypeAssertionExpression) { operand = (operand).expression; } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index fd8883045fe..39ea940433c 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -934,7 +934,7 @@ namespace ts { error(Diagnostics.Unexpected_end_of_text); isInvalidExtendedEscape = true; } - else if (text.charCodeAt(pos) == CharacterCodes.closeBrace) { + else if (text.charCodeAt(pos) === CharacterCodes.closeBrace) { // Only swallow the following character up if it's a '}'. pos++; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 7251867f070..40382b4e98d 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -42,7 +42,7 @@ namespace ts { // Pool writers to avoid needing to allocate them for every symbol we write. let stringWriters: StringSymbolWriter[] = []; export function getSingleLineStringWriter(): StringSymbolWriter { - if (stringWriters.length == 0) { + if (stringWriters.length === 0) { let str = ""; let writeText: (text: string) => void = text => str += text; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index bf6e120ec3c..5915698462c 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -831,6 +831,7 @@ module FourSlash { if (expectedText !== undefined) { assert.notEqual(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text")); } + // TODO: should be '==='? if (expectedDocumentation != undefined) { assert.notEqual(actualQuickInfoDocumentation, expectedDocumentation, this.messageAtLastKnownMarker("quick info doc comment")); } @@ -838,6 +839,7 @@ module FourSlash { if (expectedText !== undefined) { assert.equal(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text")); } + // TODO: should be '==='? if (expectedDocumentation != undefined) { assert.equal(actualQuickInfoDocumentation, expectedDocumentation, assertionMessage("quick info doc")); } @@ -1820,7 +1822,7 @@ module FourSlash { } private verifyProjectInfo(expected: string[]) { - if (this.testType == FourSlashTestType.Server) { + if (this.testType === FourSlashTestType.Server) { let actual = (this.languageService).getProjectInfo( this.activeFile.fileName, /* needFileNameList */ true @@ -1937,7 +1939,7 @@ module FourSlash { } } - if (expected != actual) { + if (expected !== actual) { this.raiseError('verifyNavigationItemsCount failed - found: ' + actual + ' navigation items, expected: ' + expected + '.'); } } @@ -1984,7 +1986,7 @@ module FourSlash { var items = this.languageService.getNavigationBarItems(this.activeFile.fileName); var actual = this.getNavigationBarItemsCount(items); - if (expected != actual) { + if (expected !== actual) { this.raiseError('verifyGetScriptLexicalStructureListCount failed - found: ' + actual + ' navigation items, expected: ' + expected + '.'); } } @@ -2402,6 +2404,7 @@ module FourSlash { globalOptions[match[1]] = match[2]; } } + // TODO: should be '==='? } else if (line == '' || lineLength === 0) { // Previously blank lines between fourslash content caused it to be considered as 2 files, // Remove this behavior since it just causes errors now diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index dd5474364d7..5eb0016ff8d 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -241,7 +241,7 @@ class ProjectRunner extends RunnerBase { if (Harness.Compiler.isJS(fileName)) { // Make sure if there is URl we have it cleaned up var indexOfSourceMapUrl = data.lastIndexOf("//# sourceMappingURL="); - if (indexOfSourceMapUrl != -1) { + if (indexOfSourceMapUrl !== -1) { data = data.substring(0, indexOfSourceMapUrl + 21) + cleanProjectUrl(data.substring(indexOfSourceMapUrl + 21)); } } diff --git a/src/server/client.ts b/src/server/client.ts index 3546f8339ee..e4a524dd210 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -219,7 +219,7 @@ namespace ts.server { var request = this.processRequest(CommandNames.CompletionDetails, args); var response = this.processResponse(request); - Debug.assert(response.body.length == 1, "Unexpected length of completion details response body."); + Debug.assert(response.body.length === 1, "Unexpected length of completion details response body."); return response.body[0]; } @@ -429,8 +429,8 @@ namespace ts.server { if (!this.lastRenameEntry || this.lastRenameEntry.fileName !== fileName || this.lastRenameEntry.position !== position || - this.lastRenameEntry.findInStrings != findInStrings || - this.lastRenameEntry.findInComments != findInComments) { + this.lastRenameEntry.findInStrings !== findInStrings || + this.lastRenameEntry.findInComments !== findInComments) { this.getRenameInfo(fileName, position, findInStrings, findInComments); } diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 9e235e2cc7d..0e5dc0d81e3 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -629,7 +629,7 @@ namespace ts.server { for (var i = 0, len = this.openFilesReferenced.length; i < len; i++) { var f = this.openFilesReferenced[i]; // if f was referenced by the removed project, remember it - if (f.defaultProject == removedProject) { + if (f.defaultProject === removedProject) { f.defaultProject = undefined; orphanFiles.push(f); } @@ -656,7 +656,7 @@ namespace ts.server { for (var i = 0, len = this.inferredProjects.length; i < len; i++) { var inferredProject = this.inferredProjects[i]; inferredProject.updateGraph(); - if (inferredProject != excludedProject) { + if (inferredProject !== excludedProject) { if (inferredProject.getSourceFile(info)) { info.defaultProject = inferredProject; referencingProjects.push(inferredProject); @@ -710,7 +710,7 @@ namespace ts.server { var rootFile = this.openFileRoots[i]; var rootedProject = rootFile.defaultProject; var referencingProjects = this.findReferencingProjects(rootFile, rootedProject); - if (referencingProjects.length == 0) { + if (referencingProjects.length === 0) { rootFile.defaultProject = rootedProject; openFileRoots.push(rootFile); } @@ -1082,7 +1082,7 @@ namespace ts.server { for (var k = this.endBranch.length - 1; k >= 0; k--) { (this.endBranch[k]).updateCounts(); - if (this.endBranch[k].charCount() == 0) { + if (this.endBranch[k].charCount() === 0) { lastZeroCount = this.endBranch[k]; if (k > 0) { branchParent = this.endBranch[k - 1]; @@ -1147,7 +1147,7 @@ namespace ts.server { post(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineCollection, nodeType: CharRangeSection): LineCollection { // have visited the path for start of range, now looking for end // if range is on single line, we will never make this state transition - if (lineCollection == this.lineCollectionAtBranch) { + if (lineCollection === this.lineCollectionAtBranch) { this.state = CharRangeSection.End; } // always pop stack because post only called when child has been visited @@ -1159,7 +1159,7 @@ namespace ts.server { // currentNode corresponds to parent, but in the new tree var currentNode = this.stack[this.stack.length - 1]; - if ((this.state == CharRangeSection.Entire) && (nodeType == CharRangeSection.Start)) { + if ((this.state === CharRangeSection.Entire) && (nodeType === CharRangeSection.Start)) { // if range is on single line, we will never make this state transition this.state = CharRangeSection.Start; this.branchNode = currentNode; @@ -1176,12 +1176,12 @@ namespace ts.server { switch (nodeType) { case CharRangeSection.PreStart: this.goSubtree = false; - if (this.state != CharRangeSection.End) { + if (this.state !== CharRangeSection.End) { currentNode.add(lineCollection); } break; case CharRangeSection.Start: - if (this.state == CharRangeSection.End) { + if (this.state === CharRangeSection.End) { this.goSubtree = false; } else { @@ -1191,7 +1191,7 @@ namespace ts.server { } break; case CharRangeSection.Entire: - if (this.state != CharRangeSection.End) { + if (this.state !== CharRangeSection.End) { child = fresh(lineCollection); currentNode.add(child); this.startPath[this.startPath.length] = child; @@ -1208,7 +1208,7 @@ namespace ts.server { this.goSubtree = false; break; case CharRangeSection.End: - if (this.state != CharRangeSection.End) { + if (this.state !== CharRangeSection.End) { this.goSubtree = false; } else { @@ -1221,7 +1221,7 @@ namespace ts.server { break; case CharRangeSection.PostEnd: this.goSubtree = false; - if (this.state != CharRangeSection.Start) { + if (this.state !== CharRangeSection.Start) { currentNode.add(lineCollection); } break; @@ -1233,10 +1233,10 @@ namespace ts.server { } // just gather text from the leaves leaf(relativeStart: number, relativeLength: number, ll: LineLeaf) { - if (this.state == CharRangeSection.Start) { + if (this.state === CharRangeSection.Start) { this.initialText = ll.text.substring(0, relativeStart); } - else if (this.state == CharRangeSection.Entire) { + else if (this.state === CharRangeSection.Entire) { this.initialText = ll.text.substring(0, relativeStart); this.trailingText = ll.text.substring(relativeStart + relativeLength); } @@ -1499,8 +1499,8 @@ namespace ts.server { function editFlat(source: string, s: number, dl: number, nt = "") { return source.substring(0, s) + nt + source.substring(s + dl, source.length); } - if (this.root.charCount() == 0) { - // TODO: assert deleteLength == 0 + if (this.root.charCount() === 0) { + // TODO: assert deleteLength === 0 if (newText) { this.load(LineIndex.linesFromText(newText).lines); return this; @@ -1528,7 +1528,7 @@ namespace ts.server { // check whether last characters deleted are line break var e = pos + deleteLength; var lineInfo = this.charOffsetToLineNumberAndPos(e); - if ((lineInfo && (lineInfo.offset == 0))) { + if ((lineInfo && (lineInfo.offset === 0))) { // move range end just past line that will merge with previous line deleteLength += lineInfo.text.length; // store text by appending to end of insertedText @@ -1574,7 +1574,7 @@ namespace ts.server { interiorNodes[i].totalChars = charCount; interiorNodes[i].totalLines = lineCount; } - if (interiorNodes.length == 1) { + if (interiorNodes.length === 1) { return interiorNodes[0]; } else { @@ -1585,7 +1585,7 @@ namespace ts.server { static linesFromText(text: string) { var lineStarts = ts.computeLineStarts(text); - if (lineStarts.length == 0) { + if (lineStarts.length === 0) { return { lines: [], lineMap: lineStarts }; } var lines = new Array(lineStarts.length); @@ -1821,7 +1821,7 @@ namespace ts.server { findChildIndex(child: LineCollection) { var childIndex = 0; var clen = this.children.length; - while ((this.children[childIndex] != child) && (childIndex < clen)) childIndex++; + while ((this.children[childIndex] !== child) && (childIndex < clen)) childIndex++; return childIndex; } @@ -1830,7 +1830,7 @@ namespace ts.server { var clen = this.children.length; var nodeCount = nodes.length; // if child is last and there is more room and only one node to place, place it - if ((clen < lineCollectionCapacity) && (childIndex == (clen - 1)) && (nodeCount == 1)) { + if ((clen < lineCollectionCapacity) && (childIndex === (clen - 1)) && (nodeCount === 1)) { this.add(nodes[0]); this.updateCounts(); return []; @@ -1854,13 +1854,13 @@ namespace ts.server { var splitNode = splitNodes[0]; while (nodeIndex < nodeCount) { splitNode.add(nodes[nodeIndex++]); - if (splitNode.children.length == lineCollectionCapacity) { + if (splitNode.children.length === lineCollectionCapacity) { splitNodeIndex++; splitNode = splitNodes[splitNodeIndex]; } } for (i = splitNodes.length - 1; i >= 0; i--) { - if (splitNodes[i].children.length == 0) { + if (splitNodes[i].children.length === 0) { splitNodes.length--; } } diff --git a/src/server/node.d.ts b/src/server/node.d.ts index 2002f973a37..8f7237382e5 100644 --- a/src/server/node.d.ts +++ b/src/server/node.d.ts @@ -584,9 +584,9 @@ declare module NodeJS { export interface Response extends Message { request_seq: number; success: boolean; - /** Contains error message if success == false. */ + /** Contains error message if success === false. */ message?: string; - /** Contains message body if success == true. */ + /** Contains message body if success === true. */ body?: any; } diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index 336bc11c9f3..017a8c1d81a 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -67,12 +67,12 @@ declare namespace ts.server.protocol { command: string; /** - * Contains error message if success == false. + * Contains error message if success === false. */ message?: string; /** - * Contains message body if success == true. + * Contains message body if success === true. */ body?: any; } diff --git a/src/server/server.ts b/src/server/server.ts index b4b35edd3f3..735a438ff98 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -123,7 +123,7 @@ namespace ts.server { if (err) { watchedFile.callback(watchedFile.fileName); } - else if (watchedFile.mtime.getTime() != stats.mtime.getTime()) { + else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) { watchedFile.mtime = WatchedFileSet.getModifiedTime(watchedFile.fileName); watchedFile.callback(watchedFile.fileName); } @@ -138,7 +138,7 @@ namespace ts.server { var count = 0; var nextToCheck = this.nextFileToCheck; var firstCheck = -1; - while ((count < this.chunkSize) && (nextToCheck != firstCheck)) { + while ((count < this.chunkSize) && (nextToCheck !== firstCheck)) { this.poll(nextToCheck); if (firstCheck < 0) { firstCheck = nextToCheck; diff --git a/src/server/session.ts b/src/server/session.ts index f9cfb4f9f7d..dc88a8528a2 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -31,7 +31,7 @@ namespace ts.server { if (a < b) { return -1; } - else if (a == b) { + else if (a === b) { return 0; } else return 1; @@ -43,7 +43,7 @@ namespace ts.server { } else if (a.file == b.file) { var n = compareNumber(a.start.line, b.start.line); - if (n == 0) { + if (n === 0) { return compareNumber(a.start.offset, b.start.offset); } else return n; @@ -129,7 +129,7 @@ namespace ts.server { if (eventName == "context") { this.projectService.log("got context event, updating diagnostics for" + fileName, "Info"); this.updateErrorCheck([{ fileName, project }], this.changeSeq, - (n) => n == this.changeSeq, 100); + (n) => n === this.changeSeq, 100); } } @@ -546,7 +546,7 @@ namespace ts.server { // getFormattingEditsAfterKeytroke either empty or pertaining // only to the previous line. If all this is true, then // add edits necessary to properly indent the current line. - if ((key == "\n") && ((!edits) || (edits.length == 0) || allEditsBeforePos(edits, position))) { + if ((key == "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) { var scriptInfo = compilerService.host.getScriptInfo(file); if (scriptInfo) { var lineInfo = scriptInfo.getLineInfo(line); @@ -622,7 +622,7 @@ namespace ts.server { } return completions.entries.reduce((result: protocol.CompletionEntry[], entry: ts.CompletionEntry) => { - if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) == 0)) { + if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) { result.push(entry); } return result; @@ -689,7 +689,7 @@ namespace ts.server { }, []); if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq,(n) => n == this.changeSeq, delay) + this.updateErrorCheck(checkList, this.changeSeq,(n) => n === this.changeSeq, delay) } } @@ -704,7 +704,7 @@ namespace ts.server { compilerService.host.editScript(file, start, end, insertString); this.changeSeq++; } - this.updateProjectStructure(this.changeSeq, (n) => n == this.changeSeq); + this.updateProjectStructure(this.changeSeq, (n) => n === this.changeSeq); } } diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 4d3d7d331a5..227ba6a7970 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -75,7 +75,7 @@ namespace ts.BreakpointResolver { return textSpan(node); } - if (node.parent.kind == SyntaxKind.ArrowFunction && (node.parent).body == node) { + if (node.parent.kind === SyntaxKind.ArrowFunction && (node.parent).body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); } diff --git a/src/services/formatting/formattingContext.ts b/src/services/formatting/formattingContext.ts index c9b9952a49e..ab182797a3c 100644 --- a/src/services/formatting/formattingContext.ts +++ b/src/services/formatting/formattingContext.ts @@ -59,7 +59,7 @@ namespace ts.formatting { if (this.tokensAreOnSameLine === undefined) { let startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line; let endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line; - this.tokensAreOnSameLine = (startLine == endLine); + this.tokensAreOnSameLine = (startLine === endLine); } return this.tokensAreOnSameLine; @@ -84,7 +84,7 @@ namespace ts.formatting { private NodeIsOnOneLine(node: Node): boolean { let startLine = this.sourceFile.getLineAndCharacterOfPosition(node.getStart(this.sourceFile)).line; let endLine = this.sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; - return startLine == endLine; + return startLine === endLine; } private BlockIsOnOneLine(node: Node): boolean { diff --git a/src/services/formatting/ruleOperationContext.ts b/src/services/formatting/ruleOperationContext.ts index 515250d7264..47330faa0dd 100644 --- a/src/services/formatting/ruleOperationContext.ts +++ b/src/services/formatting/ruleOperationContext.ts @@ -14,7 +14,7 @@ namespace ts.formatting { public IsAny(): boolean { - return this == RuleOperationContext.Any; + return this === RuleOperationContext.Any; } public InContext(context: FormattingContext): boolean { diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index c10e3ee69ea..abb08f5bf22 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -692,7 +692,7 @@ namespace ts.formatting { } static IsNotFormatOnEnter(context: FormattingContext): boolean { - return context.formattingRequestKind != FormattingRequestKind.FormatOnEnter; + return context.formattingRequestKind !== FormattingRequestKind.FormatOnEnter; } static IsModuleDeclContext(context: FormattingContext): boolean { diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index 5317e9e50fe..ac1494571d1 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -25,7 +25,7 @@ namespace ts.formatting { } public ensureUpToDate(options: ts.FormatCodeOptions) { - // TODO: should this be '==='? + // TODO: Should this be '==='? if (this.options == null || !ts.compareDataObjects(this.options, options)) { let activeRules = this.createActiveRules(options); let rulesMap = RulesMap.create(activeRules); From 3bb7be96fa1b048e7c2ef4409611046c046c4a25 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 16 Jun 2015 16:03:45 -0700 Subject: [PATCH 20/42] Scan less during classification. --- src/harness/runner.ts | 1 - src/services/services.ts | 28 +++++++++++-------- .../syntacticClassificationsDocComment3.ts | 1 - 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/harness/runner.ts b/src/harness/runner.ts index 42c2d5667c4..1e9c6470421 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -49,7 +49,6 @@ if (testConfigFile !== '') { if (!option) { continue; } - ts.sys.write("Option: " + option + "\r\n"); switch (option) { case 'compiler': runners.push(new CompilerBaselineRunner(CompilerTestType.Conformance)); diff --git a/src/services/services.ts b/src/services/services.ts index 3939e62cfd2..cebe79630d0 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -6132,13 +6132,7 @@ namespace ts { result.push(type); } - function classifyLeadingTrivia(token: Node): void { - let tokenStart = skipTrivia(sourceFile.text, token.pos, /*stopAfterLineBreak:*/ false); - if (tokenStart === token.pos) { - return; - } - - // token has trivia. Classify them appropriately. + function classifyLeadingTriviaAndGetTokenStart(token: Node): number { triviaScanner.setTextPos(token.pos); while (true) { let start = triviaScanner.getTextPos(); @@ -6148,13 +6142,23 @@ namespace ts { // The moment we get something that isn't trivia, then stop processing. if (!isTrivia(kind)) { - return; + return start; + } + + // Don't bother with newlines/whitespace. + if (kind === SyntaxKind.NewLineTrivia || kind === SyntaxKind.WhitespaceTrivia) { + continue; } // Only bother with the trivia if it at least intersects the span of interest. if (textSpanIntersectsWith(span, start, width)) { if (isComment(kind)) { classifyComment(token, kind, start, width); + + // Classifying a comment might cause us to reuse the trivia scanner + // (because of jsdoc comments). So after we classify the comment make + // sure we set the scanner position back to where it needs to be. + triviaScanner.setTextPos(end); continue; } @@ -6292,12 +6296,14 @@ namespace ts { } function classifyToken(token: Node): void { - classifyLeadingTrivia(token); + let tokenStart = classifyLeadingTriviaAndGetTokenStart(token); - if (token.getWidth() > 0) { + let tokenWidth = token.getEnd() - tokenStart; + Debug.assert(tokenWidth >= 0); + if (tokenWidth > 0) { let type = classifyTokenType(token.kind, token); if (type) { - pushClassification(token.getStart(), token.getWidth(), type); + pushClassification(tokenStart, tokenWidth, type); } } } diff --git a/tests/cases/fourslash/syntacticClassificationsDocComment3.ts b/tests/cases/fourslash/syntacticClassificationsDocComment3.ts index bdc7faa470e..6aca8cc415f 100644 --- a/tests/cases/fourslash/syntacticClassificationsDocComment3.ts +++ b/tests/cases/fourslash/syntacticClassificationsDocComment3.ts @@ -14,7 +14,6 @@ verify.syntacticClassificationsAre( c.punctuation("{"), c.keyword("number"), c.comment(" /* } */"), - c.comment("/* } */"), c.keyword("var"), c.text("v"), c.punctuation(";")); From 41e39735e88301c38ca89e98e0cdfaa42d8301e0 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 16 Jun 2015 17:06:00 -0700 Subject: [PATCH 21/42] Make resolveName ignore export specifiers without calling getSymbol --- src/compiler/checker.ts | 33 ++++++++++++++----- ...rtSpecifierAndExportedMemberDeclaration.js | 15 +++++++++ ...cifierAndExportedMemberDeclaration.symbols | 27 +++++++++++++++ ...pecifierAndExportedMemberDeclaration.types | 27 +++++++++++++++ ...cifierAndLocalMemberDeclaration.errors.txt | 18 ++++++++++ ...xportSpecifierAndLocalMemberDeclaration.js | 15 +++++++++ ...rtSpecifierReferencingOuterDeclaration1.js | 8 +++++ ...cifierReferencingOuterDeclaration1.symbols | 14 ++++++++ ...pecifierReferencingOuterDeclaration1.types | 14 ++++++++ ...rtSpecifierReferencingOuterDeclaration2.js | 11 +++++++ ...cifierReferencingOuterDeclaration2.symbols | 14 ++++++++ ...pecifierReferencingOuterDeclaration2.types | 14 ++++++++ ...ierReferencingOuterDeclaration3.errors.txt | 13 ++++++++ ...rtSpecifierReferencingOuterDeclaration3.js | 10 ++++++ ...ierReferencingOuterDeclaration4.errors.txt | 13 ++++++++ ...rtSpecifierReferencingOuterDeclaration4.js | 13 ++++++++ ...rtSpecifierAndExportedMemberDeclaration.ts | 12 +++++++ ...xportSpecifierAndLocalMemberDeclaration.ts | 12 +++++++ ...rtSpecifierReferencingOuterDeclaration1.ts | 5 +++ ...rtSpecifierReferencingOuterDeclaration2.ts | 7 ++++ ...rtSpecifierReferencingOuterDeclaration3.ts | 7 ++++ ...rtSpecifierReferencingOuterDeclaration4.ts | 9 +++++ 22 files changed, 303 insertions(+), 8 deletions(-) create mode 100644 tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.js create mode 100644 tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.symbols create mode 100644 tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.types create mode 100644 tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt create mode 100644 tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.js create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.js create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.js create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.js create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt create mode 100644 tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.js create mode 100644 tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts create mode 100644 tests/cases/compiler/exportSpecifierAndLocalMemberDeclaration.ts create mode 100644 tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts create mode 100644 tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2.ts create mode 100644 tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts create mode 100644 tests/cases/compiler/exportSpecifierReferencingOuterDeclaration4.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8ee39ab18f3..d296ea5fa22 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -344,21 +344,38 @@ module ts { case SyntaxKind.SourceFile: if (!isExternalModule(location)) break; case SyntaxKind.ModuleDeclaration: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.ModuleMember)) { - if (result.flags & meaning || !(result.flags & SymbolFlags.Alias && getDeclarationOfAliasSymbol(result).kind === SyntaxKind.ExportSpecifier)) { - break loop; - } - result = undefined; - } - else if (location.kind === SyntaxKind.SourceFile || + let moduleExports = getSymbolOfNode(location).exports; + if (location.kind === SyntaxKind.SourceFile || (location.kind === SyntaxKind.ModuleDeclaration && (location).name.kind === SyntaxKind.StringLiteral)) { - result = getSymbolOfNode(location).exports["default"]; + + // It's an external module. Because of module/namespace merging, a module's exports are in scope, + // yet we never want to treat an export specifier as putting a member in scope. Therefore, + // if the name we find is purely an export specifier, it is not actually considered in scope. + // Two things to note about this: + // 1. We have to check this without calling getSymbol. The problem with calling getSymbol + // on an export specifier is that it might find the export specifier itself, and try to + // resolve it as an alias. This will cause the checker to consider the export specifier + // a circular alias reference when it might not be. + // 2. We check === SymbolFlags.Alias in order to check that the symbol is *purely* + // an alias. If we used &, we'd be throwing out symbols that have non alias aspects, + // which is not the desired behavior. + if (hasProperty(moduleExports, name) && + moduleExports[name].flags === SymbolFlags.Alias && + getDeclarationOfKind(moduleExports[name], SyntaxKind.ExportSpecifier)) { + break; + } + + result = moduleExports["default"]; let localSymbol = getLocalSymbolForExportDefault(result); if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; } + + if (result = getSymbol(moduleExports, name, meaning & SymbolFlags.ModuleMember)) { + break loop; + } break; case SyntaxKind.EnumDeclaration: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.EnumMember)) { diff --git a/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.js b/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.js new file mode 100644 index 00000000000..3fc40121011 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.js @@ -0,0 +1,15 @@ +//// [exportSpecifierAndExportedMemberDeclaration.ts] +declare module "m2" { + export module X { + interface I { } + } + function Y(); + export { Y as X }; + function Z(): X.I; +} + +declare module "m2" { + function Z2(): X.I; +} + +//// [exportSpecifierAndExportedMemberDeclaration.js] diff --git a/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.symbols b/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.symbols new file mode 100644 index 00000000000..7e2de735c47 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts === +declare module "m2" { + export module X { +>X : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) + + interface I { } +>I : Symbol(I, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 1, 21)) + } + function Y(); +>Y : Symbol(Y, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 3, 5)) + + export { Y as X }; +>Y : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) +>X : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) + + function Z(): X.I; +>Z : Symbol(Z, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 22)) +>X : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) +>I : Symbol(X.I, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 1, 21)) +} + +declare module "m2" { + function Z2(): X.I; +>Z2 : Symbol(Z2, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 9, 21)) +>X : Symbol(X, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 0, 21), Decl(exportSpecifierAndExportedMemberDeclaration.ts, 5, 12)) +>I : Symbol(X.I, Decl(exportSpecifierAndExportedMemberDeclaration.ts, 1, 21)) +} diff --git a/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.types b/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.types new file mode 100644 index 00000000000..931552819c7 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.types @@ -0,0 +1,27 @@ +=== tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts === +declare module "m2" { + export module X { +>X : () => any + + interface I { } +>I : I + } + function Y(); +>Y : () => any + + export { Y as X }; +>Y : () => any +>X : () => any + + function Z(): X.I; +>Z : () => X.I +>X : any +>I : X.I +} + +declare module "m2" { + function Z2(): X.I; +>Z2 : () => X.I +>X : any +>I : X.I +} diff --git a/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt b/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt new file mode 100644 index 00000000000..eb444919f2c --- /dev/null +++ b/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/exportSpecifierAndLocalMemberDeclaration.ts(11,20): error TS2503: Cannot find namespace 'X'. + + +==== tests/cases/compiler/exportSpecifierAndLocalMemberDeclaration.ts (1 errors) ==== + declare module "m2" { + module X { + interface I { } + } + function Y(); + export { Y as X }; + function Z(): X.I; + } + + declare module "m2" { + function Z2(): X.I; + ~ +!!! error TS2503: Cannot find namespace 'X'. + } \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.js b/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.js new file mode 100644 index 00000000000..d99ff3627ed --- /dev/null +++ b/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.js @@ -0,0 +1,15 @@ +//// [exportSpecifierAndLocalMemberDeclaration.ts] +declare module "m2" { + module X { + interface I { } + } + function Y(); + export { Y as X }; + function Z(): X.I; +} + +declare module "m2" { + function Z2(): X.I; +} + +//// [exportSpecifierAndLocalMemberDeclaration.js] diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.js b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.js new file mode 100644 index 00000000000..003956e2822 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.js @@ -0,0 +1,8 @@ +//// [exportSpecifierReferencingOuterDeclaration1.ts] +declare module X { export interface bar { } } +declare module "m" { + export { X }; + export function foo(): X.bar; +} + +//// [exportSpecifierReferencingOuterDeclaration1.js] diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols new file mode 100644 index 00000000000..16abde86d32 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts === +declare module X { export interface bar { } } +>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 0)) +>bar : Symbol(bar, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 18)) + +declare module "m" { + export { X }; +>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 2, 12)) + + export function foo(): X.bar; +>foo : Symbol(foo, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 2, 17)) +>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 0)) +>bar : Symbol(X.bar, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 18)) +} diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types new file mode 100644 index 00000000000..be03554a1b0 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts === +declare module X { export interface bar { } } +>X : any +>bar : bar + +declare module "m" { + export { X }; +>X : any + + export function foo(): X.bar; +>foo : () => X.bar +>X : any +>bar : X.bar +} diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.js b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.js new file mode 100644 index 00000000000..e8e96784083 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.js @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2.ts] //// + +//// [exportSpecifierReferencingOuterDeclaration2_A.ts] +declare module X { export interface bar { } } + +//// [exportSpecifierReferencingOuterDeclaration2_B.ts] +export { X }; +export declare function foo(): X.bar; + +//// [exportSpecifierReferencingOuterDeclaration2_A.js] +//// [exportSpecifierReferencingOuterDeclaration2_B.js] diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols new file mode 100644 index 00000000000..9a57645b1cb --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts === +declare module X { export interface bar { } } +>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 0)) +>bar : Symbol(bar, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 18)) + +=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts === +export { X }; +>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_B.ts, 0, 8)) + +export declare function foo(): X.bar; +>foo : Symbol(foo, Decl(exportSpecifierReferencingOuterDeclaration2_B.ts, 0, 13)) +>X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 0)) +>bar : Symbol(X.bar, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 18)) + diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types new file mode 100644 index 00000000000..fa59948c116 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts === +declare module X { export interface bar { } } +>X : any +>bar : bar + +=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts === +export { X }; +>X : any + +export declare function foo(): X.bar; +>foo : () => X.bar +>X : any +>bar : X.bar + diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt new file mode 100644 index 00000000000..e144c48bea4 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts(6,30): error TS2305: Module 'X' has no exported member 'bar'. + + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts (1 errors) ==== + declare module X { export interface bar { } } + declare module "m" { + module X { export interface foo { } } + export { X }; + export function foo(): X.foo; + export function bar(): X.bar; // error + ~~~ +!!! error TS2305: Module 'X' has no exported member 'bar'. + } \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.js b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.js new file mode 100644 index 00000000000..0f6fff977da --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.js @@ -0,0 +1,10 @@ +//// [exportSpecifierReferencingOuterDeclaration3.ts] +declare module X { export interface bar { } } +declare module "m" { + module X { export interface foo { } } + export { X }; + export function foo(): X.foo; + export function bar(): X.bar; // error +} + +//// [exportSpecifierReferencingOuterDeclaration3.js] diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt new file mode 100644 index 00000000000..6ac67c70d17 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(4,34): error TS2305: Module 'X' has no exported member 'bar'. + + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts (0 errors) ==== + declare module X { export interface bar { } } + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts (1 errors) ==== + declare module X { export interface foo { } } + export { X }; + export declare function foo(): X.foo; + export declare function bar(): X.bar; // error + ~~~ +!!! error TS2305: Module 'X' has no exported member 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.js b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.js new file mode 100644 index 00000000000..4edb5f711a6 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.js @@ -0,0 +1,13 @@ +//// [tests/cases/compiler/exportSpecifierReferencingOuterDeclaration4.ts] //// + +//// [exportSpecifierReferencingOuterDeclaration2_A.ts] +declare module X { export interface bar { } } + +//// [exportSpecifierReferencingOuterDeclaration2_B.ts] +declare module X { export interface foo { } } +export { X }; +export declare function foo(): X.foo; +export declare function bar(): X.bar; // error + +//// [exportSpecifierReferencingOuterDeclaration2_A.js] +//// [exportSpecifierReferencingOuterDeclaration2_B.js] diff --git a/tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts b/tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts new file mode 100644 index 00000000000..1c20ffb0437 --- /dev/null +++ b/tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts @@ -0,0 +1,12 @@ +declare module "m2" { + export module X { + interface I { } + } + function Y(); + export { Y as X }; + function Z(): X.I; +} + +declare module "m2" { + function Z2(): X.I; +} \ No newline at end of file diff --git a/tests/cases/compiler/exportSpecifierAndLocalMemberDeclaration.ts b/tests/cases/compiler/exportSpecifierAndLocalMemberDeclaration.ts new file mode 100644 index 00000000000..5f942a75a74 --- /dev/null +++ b/tests/cases/compiler/exportSpecifierAndLocalMemberDeclaration.ts @@ -0,0 +1,12 @@ +declare module "m2" { + module X { + interface I { } + } + function Y(); + export { Y as X }; + function Z(): X.I; +} + +declare module "m2" { + function Z2(): X.I; +} \ No newline at end of file diff --git a/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts b/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts new file mode 100644 index 00000000000..e3d0a9000ab --- /dev/null +++ b/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts @@ -0,0 +1,5 @@ +declare module X { export interface bar { } } +declare module "m" { + export { X }; + export function foo(): X.bar; +} \ No newline at end of file diff --git a/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2.ts b/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2.ts new file mode 100644 index 00000000000..683358a0e3b --- /dev/null +++ b/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2.ts @@ -0,0 +1,7 @@ +// @module: commonjs +// @Filename: exportSpecifierReferencingOuterDeclaration2_A.ts +declare module X { export interface bar { } } + +// @Filename: exportSpecifierReferencingOuterDeclaration2_B.ts +export { X }; +export declare function foo(): X.bar; \ No newline at end of file diff --git a/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts b/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts new file mode 100644 index 00000000000..d4ddf3cc4a6 --- /dev/null +++ b/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts @@ -0,0 +1,7 @@ +declare module X { export interface bar { } } +declare module "m" { + module X { export interface foo { } } + export { X }; + export function foo(): X.foo; + export function bar(): X.bar; // error +} \ No newline at end of file diff --git a/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration4.ts b/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration4.ts new file mode 100644 index 00000000000..5beaf1de126 --- /dev/null +++ b/tests/cases/compiler/exportSpecifierReferencingOuterDeclaration4.ts @@ -0,0 +1,9 @@ +// @module: commonjs +// @Filename: exportSpecifierReferencingOuterDeclaration2_A.ts +declare module X { export interface bar { } } + +// @Filename: exportSpecifierReferencingOuterDeclaration2_B.ts +declare module X { export interface foo { } } +export { X }; +export declare function foo(): X.foo; +export declare function bar(): X.bar; // error \ No newline at end of file From d206f62adb02488ecf693097025d441c7112a673 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 16 Jun 2015 17:55:36 -0700 Subject: [PATCH 22/42] Squueze perf in syntactic classification. --- src/compiler/scanner.ts | 23 +++++++++++++++ src/compiler/utilities.ts | 6 ++++ src/services/services.ts | 60 +++++++++++++++++++++------------------ 3 files changed, 62 insertions(+), 27 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index fd8883045fe..fcba1da9dca 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -376,8 +376,31 @@ namespace ts { return ch >= CharacterCodes._0 && ch <= CharacterCodes._7; } + export function couldStartTrivia(text: string, pos: number): boolean { + // Keep in sync with skipTrivia + let ch = text.charCodeAt(pos); + switch (ch) { + case CharacterCodes.carriageReturn: + case CharacterCodes.lineFeed: + case CharacterCodes.tab: + case CharacterCodes.verticalTab: + case CharacterCodes.formFeed: + case CharacterCodes.space: + case CharacterCodes.slash: + // starts of normal trivia + case CharacterCodes.lessThan: + case CharacterCodes.equals: + case CharacterCodes.greaterThan: + // Starts of conflict marker trivia + return true; + default: + return ch > CharacterCodes.maxAsciiCharacter; + } + } + /* @internal */ export function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number { + // Keep in sync with couldStartTrivia while (true) { let ch = text.charCodeAt(pos); switch (ch) { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 7251867f070..6d95e7eac83 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2083,6 +2083,12 @@ namespace ts { return start <= textSpanEnd(span) && end >= span.start; } + export function textSpanIntersectsWith2(start1: number, length1: number, start2: number, length2: number) { + let end1 = start1 + length1; + let end2 = start2 + length2; + return start2 <= end1 && end2 >= start1; + } + export function textSpanIntersectsWithPosition(span: TextSpan, position: number) { return position <= textSpanEnd(span) && position >= span.start; } diff --git a/src/services/services.ts b/src/services/services.ts index cebe79630d0..2f529ddab7b 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -167,7 +167,7 @@ namespace ts { } public getFullWidth(): number { - return this.end - this.getFullStart(); + return this.end - this.pos; } public getLeadingTriviaWidth(sourceFile?: SourceFile): number { @@ -6116,6 +6116,8 @@ namespace ts { function getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications { // doesn't use compiler - no need to synchronize with host let sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + let spanStart = span.start; + let spanLength = span.length; // Make a scanner we can get trivia from. let triviaScanner = createScanner(ScriptTarget.Latest, /*skipTrivia:*/ false, sourceFile.text); @@ -6136,6 +6138,11 @@ namespace ts { triviaScanner.setTextPos(token.pos); while (true) { let start = triviaScanner.getTextPos(); + // only bother scanning if we have something that could be trivia. + if (!couldStartTrivia(sourceFile.text, start)) { + return start; + } + let kind = triviaScanner.scan(); let end = triviaScanner.getTextPos(); let width = end - start; @@ -6151,33 +6158,31 @@ namespace ts { } // Only bother with the trivia if it at least intersects the span of interest. - if (textSpanIntersectsWith(span, start, width)) { - if (isComment(kind)) { - classifyComment(token, kind, start, width); + if (isComment(kind)) { + classifyComment(token, kind, start, width); - // Classifying a comment might cause us to reuse the trivia scanner - // (because of jsdoc comments). So after we classify the comment make - // sure we set the scanner position back to where it needs to be. - triviaScanner.setTextPos(end); + // Classifying a comment might cause us to reuse the trivia scanner + // (because of jsdoc comments). So after we classify the comment make + // sure we set the scanner position back to where it needs to be. + triviaScanner.setTextPos(end); + continue; + } + + if (kind === SyntaxKind.ConflictMarkerTrivia) { + let text = sourceFile.text; + let ch = text.charCodeAt(start); + + // for the <<<<<<< and >>>>>>> markers, we just add them in as comments + // in the classification stream. + if (ch === CharacterCodes.lessThan || ch === CharacterCodes.greaterThan) { + pushClassification(start, width, ClassificationType.comment); continue; } - if (kind === SyntaxKind.ConflictMarkerTrivia) { - let text = sourceFile.text; - let ch = text.charCodeAt(start); - - // for the <<<<<<< and >>>>>>> markers, we just add them in as comments - // in the classification stream. - if (ch === CharacterCodes.lessThan || ch === CharacterCodes.greaterThan) { - pushClassification(start, width, ClassificationType.comment); - continue; - } - - // for the ======== add a comment for the first line, and then lex all - // subsequent lines up until the end of the conflict marker. - Debug.assert(ch === CharacterCodes.equals); - classifyDisabledMergeCode(text, start, end); - } + // for the ======== add a comment for the first line, and then lex all + // subsequent lines up until the end of the conflict marker. + Debug.assert(ch === CharacterCodes.equals); + classifyDisabledMergeCode(text, start, end); } } } @@ -6298,7 +6303,7 @@ namespace ts { function classifyToken(token: Node): void { let tokenStart = classifyLeadingTriviaAndGetTokenStart(token); - let tokenWidth = token.getEnd() - tokenStart; + let tokenWidth = token.end - tokenStart; Debug.assert(tokenWidth >= 0); if (tokenWidth > 0) { let type = classifyTokenType(token.kind, token); @@ -6408,9 +6413,10 @@ namespace ts { } // Ignore nodes that don't intersect the original span to classify. - if (textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { + if (textSpanIntersectsWith2(spanStart, spanLength, element.pos, element.getFullWidth())) { let children = element.getChildren(sourceFile); - for (let child of children) { + for (let i = 0, n = children.length; i < n; i++) { + let child = children[i]; if (isToken(child)) { classifyToken(child); } From 5f1fe3740beb977459220edb7df7aae2f6fa70ac Mon Sep 17 00:00:00 2001 From: Colby Russell Date: Wed, 17 Jun 2015 13:08:13 -0500 Subject: [PATCH 23/42] Fix line endings in program.ts --- src/compiler/program.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 562654c2ed0..800e2238a54 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -144,7 +144,7 @@ namespace ts { let program: Program; let files: SourceFile[] = []; let diagnostics = createDiagnosticCollection(); - + let commonSourceDirectory: string; let diagnosticsProducingTypeChecker: TypeChecker; let noDiagnosticsTypeChecker: TypeChecker; @@ -678,4 +678,4 @@ namespace ts { } } } -} \ No newline at end of file +} From 7390fe0eab8bd8a081bc7ec92629134d4795f990 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 17 Jun 2015 12:39:02 -0700 Subject: [PATCH 24/42] Feedback form pr #3513 --- Jakefile.js | 6 ++--- src/harness/harnessLanguageService.ts | 2 +- src/server/editorServices.ts | 2 +- src/server/nodeimpl.ts | 7 ------ src/server/server.ts | 6 ++--- src/server/session.ts | 32 +++++++++------------------ 6 files changed, 18 insertions(+), 37 deletions(-) delete mode 100644 src/server/nodeimpl.ts diff --git a/Jakefile.js b/Jakefile.js index 9a2f39ee130..ee0a84987ad 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -100,7 +100,6 @@ var serverSources = [ "editorServices.ts", "protocol.d.ts", "session.ts", - "nodeimpl.ts", "server.ts" ].map(function (f) { return path.join(serverDirectory, f); @@ -112,7 +111,7 @@ var languageServiceLibrarySources = [ "session.ts" ].map(function (f) { return path.join(serverDirectory, f); -}); +}).concat(servicesSources); var harnessSources = [ "harness.ts", @@ -146,7 +145,6 @@ var harnessSources = [ "protocol.d.ts", "session.ts", "client.ts", - "nodeimpl.ts", "editorServices.ts", ].map(function (f) { return path.join(serverDirectory, f); @@ -383,7 +381,7 @@ var lsslFile = path.join(builtLocalDirectory, "tslssl.js"); compileFile( lsslFile, languageServiceLibrarySources, - [builtLocalDirectory, copyright].concat(serverSources).concat(languageServiceLibrarySources), + [builtLocalDirectory, copyright].concat(languageServiceLibrarySources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, /*noOutFile*/ false, diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 3796c84863b..8eb77817533 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -583,7 +583,7 @@ module Harness.LanguageService { // This host is just a proxy for the clientHost, it uses the client // host to answer server queries about files on disk var serverHost = new SessionServerHost(clientHost); - var server = new ts.server.Session(serverHost, new ts.server.NodeEnvironment(), serverHost); + var server = new ts.server.Session(serverHost, Buffer.byteLength, process.hrtime, serverHost); // Fake the connection between the client and the server serverHost.writeMessage = client.onMessage.bind(client); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index d31ea53b5f9..53cab79f9af 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1262,7 +1262,7 @@ module ts.server { versions: LineIndexSnapshot[] = []; minVersion = 0; // no versions earlier than min version will maintain change history private currentVersion = 0; - private host: System; + private host: ServerHost; static changeNumberThreshold = 8; static changeLengthThreshold = 256; diff --git a/src/server/nodeimpl.ts b/src/server/nodeimpl.ts deleted file mode 100644 index 9694b49aa85..00000000000 --- a/src/server/nodeimpl.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -module ts.server { - export class NodeEnvironment implements Environment { - byteLength = Buffer.byteLength; - hrtime = process.hrtime; - } -} \ No newline at end of file diff --git a/src/server/server.ts b/src/server/server.ts index d9737a554d0..e2d195284f5 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -173,8 +173,8 @@ module ts.server { } class IOSession extends Session { - constructor(host: ServerHost, env: NodeEnvironment, logger: ts.server.Logger) { - super(host, env, logger); + constructor(host: ServerHost, logger: ts.server.Logger) { + super(host, Buffer.byteLength, process.hrtime, logger); } exit() { @@ -265,7 +265,7 @@ module ts.server { } }; - var ioSession = new IOSession(ts.sys, new NodeEnvironment(), logger); + var ioSession = new IOSession(ts.sys, logger); process.on('uncaughtException', function(err: Error) { ioSession.logError(err, "unknown"); }); diff --git a/src/server/session.ts b/src/server/session.ts index 60ae0b8ee21..09c6d70a070 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -107,21 +107,6 @@ module ts.server { export interface ServerHost extends ts.System { } - - export interface Environment { - byteLength: (buf: string, encoding?: string) => number; - hrtime: (start?: number[]) => number[]; //array of seconds, nanoseconds - } - - export interface Message { - type: string, - seq: number - } - - export interface Event extends Message { - event: string; - body?: any; - } export class Session { projectService: ProjectService; @@ -132,7 +117,12 @@ module ts.server { immediateId: any; changeSeq = 0; - constructor(private host: ServerHost, private environment: Environment, private logger: Logger) { + constructor( + private host: ServerHost, + private byteLength: (buf: string, encoding?: string) => number, + private hrtime: (start?: number[]) => number[], + private logger: Logger + ) { this.projectService = new ProjectService(host, logger, (eventName,project,fileName) => { this.handleEvent(eventName, project, fileName); @@ -163,17 +153,17 @@ module ts.server { this.host.write(line + this.host.newLine); } - send(msg: Message) { + send(msg: protocol.Message) { var json = JSON.stringify(msg); if (this.logger.isVerbose()) { this.logger.info(msg.type + ": " + json); } - this.sendLineToClient('Content-Length: ' + (1 + this.environment.byteLength(json, 'utf8')) + + this.sendLineToClient('Content-Length: ' + (1 + this.byteLength(json, 'utf8')) + '\r\n\r\n' + json); } event(info: any, eventName: string) { - var ev: Event = { + var ev: protocol.Event = { seq: 0, type: "event", event: eventName, @@ -852,7 +842,7 @@ module ts.server { onMessage(message: string) { if (this.logger.isVerbose()) { this.logger.info("request: " + message); - var start = this.environment.hrtime(); + var start = this.hrtime(); } try { var request = JSON.parse(message); @@ -994,7 +984,7 @@ module ts.server { } if (this.logger.isVerbose()) { - var elapsed = this.environment.hrtime(start); + var elapsed = this.hrtime(start); var seconds = elapsed[0] var nanoseconds = elapsed[1]; var elapsedMs = ((1e9 * seconds) + nanoseconds)/1000000.0; From d71af8a3fb485880866e097cbb6963d5aab62678 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 17 Jun 2015 13:28:39 -0700 Subject: [PATCH 25/42] Addressing CR feedback --- src/compiler/checker.ts | 41 +++++++++++-------- .../diagnosticInformationMap.generated.ts | 4 +- src/compiler/diagnosticMessages.json | 4 +- src/compiler/utilities.ts | 8 ++-- src/harness/typeWriter.ts | 2 +- src/services/services.ts | 2 +- 6 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 935f5ae3340..bf42e584f09 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2639,7 +2639,8 @@ namespace ts { } let baseConstructorType = checkExpression(baseTypeNode.expression); if (baseConstructorType.flags & TypeFlags.ObjectType) { - // Force resolution of members such that we catch circularities + // Resolving the members of a class requires us to resolve the base class of that class. + // We force resolution here such that we catch circularities now. resolveObjectOrUnionTypeMembers(baseConstructorType); } if (!popTypeResolution()) { @@ -2647,7 +2648,7 @@ namespace ts { return type.resolvedBaseConstructorType = unknownType; } if (baseConstructorType !== unknownType && baseConstructorType !== nullType && !isConstructorType(baseConstructorType)) { - error(baseTypeNode.expression, Diagnostics.Base_expression_is_not_of_a_constructor_function_type); + error(baseTypeNode.expression, Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); return type.resolvedBaseConstructorType = unknownType; } type.resolvedBaseConstructorType = baseConstructorType; @@ -2699,7 +2700,7 @@ namespace ts { return; } if (!(getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface))) { - error(baseTypeNode.expression, Diagnostics.Base_constructor_does_not_return_a_class_or_interface_type); + error(baseTypeNode.expression, Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); return; } if (type === baseType || hasBaseType(baseType, type)) { @@ -5962,7 +5963,9 @@ namespace ts { let baseClassType = classType && getBaseTypes(classType)[0]; if (!baseClassType) { - error(node, Diagnostics.super_can_only_be_referenced_in_a_derived_class); + if (!classDeclaration || !getClassExtendsHeritageClauseElement(classDeclaration)) { + error(node, Diagnostics.super_can_only_be_referenced_in_a_derived_class); + } return unknownType; } @@ -8970,13 +8973,14 @@ namespace ts { checkDecorators(node); } - function checkTypeArgumentsAndConstraints(typeParameters: TypeParameter[], typeArguments: TypeNode[]) { - for (let i = 0; i < typeArguments.length; i++) { - let typeArgument = typeArguments[i]; - checkSourceElement(typeArgument); - let constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (produceDiagnostics && constraint) { - checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + function checkTypeArgumentConstraints(typeParameters: TypeParameter[], typeArguments: TypeNode[]) { + if (produceDiagnostics) { + for (let i = 0; i < typeParameters.length; i++) { + let constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + let typeArgument = typeArguments[i]; + checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } } } } @@ -8986,9 +8990,10 @@ namespace ts { let type = getTypeFromTypeReference(node); if (type !== unknownType && node.typeArguments) { // Do type argument local checks only if referenced type is successfully resolved + forEach(node.typeArguments, checkSourceElement); let symbol = getNodeLinks(node).resolvedSymbol; let typeParameters = symbol.flags & SymbolFlags.TypeAlias ? getSymbolLinks(symbol).typeParameters : (type).target.localTypeParameters; - checkTypeArgumentsAndConstraints(typeParameters, node.typeArguments); + checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } @@ -10588,15 +10593,19 @@ namespace ts { let baseType = baseTypes[0]; let staticBaseType = getBaseConstructorTypeOfClass(type); if (baseTypeNode.typeArguments) { - let constructors = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); - checkTypeArgumentsAndConstraints(constructors[0].typeParameters, baseTypeNode.typeArguments); + forEach(baseTypeNode.typeArguments, checkSourceElement); + for (let constructor of getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments)) { + checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments); + } } checkTypeAssignableTo(type, baseType, node.name || node, Diagnostics.Class_0_incorrectly_extends_base_class_1); checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (!(staticBaseType.symbol && staticBaseType.symbol.flags & SymbolFlags.Class)) { // When the static base type is a "class-like" constructor function (but not actually a class), we verify - // that all instantiated base constructor signatures return the same type. + // that all instantiated base constructor signatures return the same type. We can simply compare the type + // references (as opposed to checking the structure of the types) because elsewhere we have already checked + // that the base type is a class or interface type (and not, for example, an anonymous object type). let constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments); if (forEach(constructors, sig => getReturnTypeOfSignature(sig) !== baseType)) { error(baseTypeNode.expression, Diagnostics.Base_constructors_must_all_have_the_same_return_type); @@ -11997,7 +12006,7 @@ namespace ts { return getTypeOfExpression(node); } - if (isClassExtendsExpressionWithTypeArguments(node)) { + if (isExpressionWithTypeArgumentsInClassExtendsClause(node)) { // A SyntaxKind.ExpressionWithTypeArguments is considered a type node, except when it occurs in the // extends clause of a class. We handle that case here. return getBaseTypes(getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0]; diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 2eada488a68..09b009711fe 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -385,9 +385,9 @@ namespace ts { No_best_common_type_exists_among_yield_expressions: { code: 2504, category: DiagnosticCategory.Error, key: "No best common type exists among yield expressions." }, A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: DiagnosticCategory.Error, key: "A generator cannot have a 'void' type annotation." }, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: { code: 2506, category: DiagnosticCategory.Error, key: "'{0}' is referenced directly or indirectly in its own base expression." }, - Base_expression_is_not_of_a_constructor_function_type: { code: 2507, category: DiagnosticCategory.Error, key: "Base expression is not of a constructor function type." }, + Type_0_is_not_a_constructor_function_type: { code: 2507, category: DiagnosticCategory.Error, key: "Type '{0}' is not a constructor function type." }, No_base_constructor_has_the_specified_number_of_type_arguments: { code: 2508, category: DiagnosticCategory.Error, key: "No base constructor has the specified number of type arguments." }, - Base_constructor_does_not_return_a_class_or_interface_type: { code: 2509, category: DiagnosticCategory.Error, key: "Base constructor does not return a class or interface type." }, + Base_constructor_return_type_0_is_not_a_class_or_interface_type: { code: 2509, category: DiagnosticCategory.Error, key: "Base constructor return type '{0}' is not a class or interface type." }, Base_constructors_must_all_have_the_same_return_type: { code: 2510, category: DiagnosticCategory.Error, key: "Base constructors must all have the same return type." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index dae42d20e27..fee46a84c1e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1529,7 +1529,7 @@ "category": "Error", "code": 2506 }, - "Base expression is not of a constructor function type.": { + "Type '{0}' is not a constructor function type.": { "category": "Error", "code": 2507 }, @@ -1537,7 +1537,7 @@ "category": "Error", "code": 2508 }, - "Base constructor does not return a class or interface type.": { + "Base constructor return type '{0}' is not a class or interface type.": { "category": "Error", "code": 2509 }, diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index dc55b9fac5f..45b34f8b43c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -426,7 +426,7 @@ namespace ts { // Specialized signatures can have string literals as their parameters' type names return node.parent.kind === SyntaxKind.Parameter; case SyntaxKind.ExpressionWithTypeArguments: - return !isClassExtendsExpressionWithTypeArguments(node); + return !isExpressionWithTypeArgumentsInClassExtendsClause(node); // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container @@ -460,7 +460,7 @@ namespace ts { } switch (parent.kind) { case SyntaxKind.ExpressionWithTypeArguments: - return !isClassExtendsExpressionWithTypeArguments(parent); + return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); case SyntaxKind.TypeParameter: return node === (parent).constraint; case SyntaxKind.PropertyDeclaration: @@ -920,7 +920,7 @@ namespace ts { case SyntaxKind.Decorator: return true; case SyntaxKind.ExpressionWithTypeArguments: - return isClassExtendsExpressionWithTypeArguments(parent); + return (parent).expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: if (isExpression(parent)) { return true; @@ -1914,7 +1914,7 @@ namespace ts { return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; } - export function isClassExtendsExpressionWithTypeArguments(node: Node): boolean { + export function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean { return node.kind === SyntaxKind.ExpressionWithTypeArguments && (node.parent).token === SyntaxKind.ExtendsKeyword && node.parent.parent.kind === SyntaxKind.ClassDeclaration; diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index ac695fc23a4..b68e606c79d 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -43,7 +43,7 @@ class TypeWriterWalker { // Workaround to ensure we output 'C' instead of 'typeof C' for base class expressions // var type = this.checker.getTypeAtLocation(node); - var type = node.parent && ts.isClassExtendsExpressionWithTypeArguments(node.parent) && this.checker.getTypeAtLocation(node.parent) || this.checker.getTypeAtLocation(node); + var type = node.parent && ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) && this.checker.getTypeAtLocation(node.parent) || this.checker.getTypeAtLocation(node); ts.Debug.assert(type !== undefined, "type doesn't exist"); var symbol = this.checker.getSymbolAtLocation(node); diff --git a/src/services/services.ts b/src/services/services.ts index 9d57ff75679..280386513d3 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -5812,7 +5812,7 @@ namespace ts { } return node.parent.kind === SyntaxKind.TypeReference || - (node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isClassExtendsExpressionWithTypeArguments(node.parent)); + (node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)); } function isNamespaceReference(node: Node): boolean { From 471f6e05360d87aac2ad88d9ad506c954a51e7ab Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 17 Jun 2015 13:29:08 -0700 Subject: [PATCH 26/42] Accepting new baselines --- .../classExtendingNonConstructor.errors.txt | 28 +++++++++---------- .../classExtendingPrimitive.errors.txt | 8 +++--- ...ithModuleNotReferingConstructor.errors.txt | 4 +-- ...useClassNotReferringConstructor.errors.txt | 4 +-- .../classExtendsEveryObjectType.errors.txt | 20 ++++++------- .../classExtendsEveryObjectType2.errors.txt | 8 +++--- ...endsShadowedConstructorFunction.errors.txt | 4 +-- ...ExtendsValidConstructorFunction.errors.txt | 4 +-- .../extendNonClassSymbol2.errors.txt | 4 +-- .../reference/generatorTypeCheck40.errors.txt | 4 +-- .../reference/generatorTypeCheck60.errors.txt | 4 +-- .../reference/importAsBaseClass.errors.txt | 4 +-- ...-does-not-affect-class-heritage.errors.txt | 4 +-- ...IncorrectNumberOfTypeArguments1.errors.txt | 5 +--- ...ericTypeButWithNoTypeArguments1.errors.txt | 5 +--- ...enericTypeButWithTypeArguments1.errors.txt | 5 +--- .../thisInInvalidContexts.errors.txt | 4 +-- ...InInvalidContextsExternalModule.errors.txt | 4 +-- 18 files changed, 57 insertions(+), 66 deletions(-) diff --git a/tests/baselines/reference/classExtendingNonConstructor.errors.txt b/tests/baselines/reference/classExtendingNonConstructor.errors.txt index b1e3994cf1c..17b3610d252 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.errors.txt +++ b/tests/baselines/reference/classExtendingNonConstructor.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(7,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(8,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(9,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(10,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(11,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(12,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(13,18): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(7,18): error TS2507: Type 'undefined' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(8,18): error TS2507: Type 'boolean' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(9,18): error TS2507: Type 'boolean' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(10,18): error TS2507: Type 'number' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(11,18): error TS2507: Type 'string' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(12,18): error TS2507: Type '{}' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(13,18): error TS2507: Type '() => void' is not a constructor function type. ==== tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts (7 errors) ==== @@ -16,23 +16,23 @@ tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.t class C1 extends undefined { } ~~~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'undefined' is not a constructor function type. class C2 extends true { } ~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'boolean' is not a constructor function type. class C3 extends false { } ~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'boolean' is not a constructor function type. class C4 extends 42 { } ~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'number' is not a constructor function type. class C5 extends "hello" { } ~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'string' is not a constructor function type. class C6 extends x { } ~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type '{}' is not a constructor function type. class C7 extends foo { } ~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type '() => void' is not a constructor function type. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingPrimitive.errors.txt b/tests/baselines/reference/classExtendingPrimitive.errors.txt index 68525a1eabd..554e0fbecbc 100644 --- a/tests/baselines/reference/classExtendingPrimitive.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive.errors.txt @@ -4,9 +4,9 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1109: Expression expected. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2507: Type 'undefined' is not a constructor function type. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2304: Cannot find name 'Undefined'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2507: Type 'typeof E' is not a constructor function type. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (9 errors) ==== @@ -33,7 +33,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class C5a extends null { } class C6 extends undefined { } ~~~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'undefined' is not a constructor function type. class C7 extends Undefined { } ~~~~~~~~~ !!! error TS2304: Cannot find name 'Undefined'. @@ -41,4 +41,4 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla enum E { A } class C8 extends E { } ~ -!!! error TS2507: Base expression is not of a constructor function type. \ No newline at end of file +!!! error TS2507: Type 'typeof E' is not a constructor function type. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt index b1c5d253b56..dfac4f68885 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(10,21): error TS2507: Base expression is not of a constructor function type. +tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(10,21): error TS2507: Type 'number' is not a constructor function type. ==== tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstruct var A = 1; class B extends A { ~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'number' is not a constructor function type. b: string; } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt index 448167d739d..ff355ec653c 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts(4,21): error TS2507: Base expression is not of a constructor function type. +tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts(4,21): error TS2507: Type 'number' is not a constructor function type. ==== tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts(4,21): er var A = 1; class B extends A { b: string; } ~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'number' is not a constructor function type. } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index e1f1c785bbc..0339dfad13a 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2304: Cannot find name 'I'. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS2507: Type '{ foo: any; }' is not a constructor function type. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,25): error TS2304: Cannot find name 'string'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2507: Base expression is not of a constructor function type. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2507: Type '{ foo: string; }' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2507: Type 'typeof M' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2507: Type '() => void' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS2507: Type 'undefined[]' is not a constructor function type. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (8 errors) ==== @@ -18,7 +18,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class C2 extends { foo: string; } { } // error ~~~~~~~~~~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type '{ foo: any; }' is not a constructor function type. ~~~~~~ !!! error TS2304: Cannot find name 'string'. ~ @@ -26,18 +26,18 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla var x: { foo: string; } class C3 extends x { } // error ~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type '{ foo: string; }' is not a constructor function type. module M { export var x = 1; } class C4 extends M { } // error ~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'typeof M' is not a constructor function type. function foo() { } class C5 extends foo { } // error ~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type '() => void' is not a constructor function type. class C6 extends []{ } // error ~~ -!!! error TS2507: Base expression is not of a constructor function type. \ No newline at end of file +!!! error TS2507: Type 'undefined[]' is not a constructor function type. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt index 650c4e4886e..af52a248b54 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS2507: Type '{ foo: any; }' is not a constructor function type. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,25): error TS2304: Cannot find name 'string'. tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,31): error TS1005: ',' expected. -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS2507: Type 'undefined[]' is not a constructor function type. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (4 errors) ==== class C2 extends { foo: string; } { } // error ~~~~~~~~~~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type '{ foo: any; }' is not a constructor function type. ~~~~~~ !!! error TS2304: Cannot find name 'string'. ~ @@ -15,4 +15,4 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class C6 extends []{ } // error ~~ -!!! error TS2507: Base expression is not of a constructor function type. \ No newline at end of file +!!! error TS2507: Type 'undefined[]' is not a constructor function type. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt index 475a980e4e6..3d8c7454255 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts(5,21): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts(5,21): error TS2507: Type 'number' is not a constructor function type. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla var C = 1; class D extends C { // error, C must evaluate to constructor function ~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'number' is not a constructor function type. bar: string; } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt b/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt index 6ebd818e547..fdfd9110ce6 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts(5,17): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts(5,17): error TS2507: Type '() => void' is not a constructor function type. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts (1 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class C extends foo { } // error, cannot extend it though ~~~ -!!! error TS2507: Base expression is not of a constructor function type. \ No newline at end of file +!!! error TS2507: Type '() => void' is not a constructor function type. \ No newline at end of file diff --git a/tests/baselines/reference/extendNonClassSymbol2.errors.txt b/tests/baselines/reference/extendNonClassSymbol2.errors.txt index 882a8b447f8..5554ff60a26 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.errors.txt +++ b/tests/baselines/reference/extendNonClassSymbol2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/extendNonClassSymbol2.ts(5,17): error TS2507: Base expression is not of a constructor function type. +tests/cases/compiler/extendNonClassSymbol2.ts(5,17): error TS2507: Type '() => void' is not a constructor function type. ==== tests/cases/compiler/extendNonClassSymbol2.ts (1 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/extendNonClassSymbol2.ts(5,17): error TS2507: Base expressi var x = new Foo(); // legal, considered a constructor function class C extends Foo {} // error, could not find symbol Foo ~~~ -!!! error TS2507: Base expression is not of a constructor function type. \ No newline at end of file +!!! error TS2507: Type '() => void' is not a constructor function type. \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck40.errors.txt b/tests/baselines/reference/generatorTypeCheck40.errors.txt index 6341ec9ae0a..ba93862c8d5 100644 --- a/tests/baselines/reference/generatorTypeCheck40.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts(2,21): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts(2,21): error TS2507: Type 'any' is not a constructor function type. tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts(2,22): error TS1163: A 'yield' expression is only allowed in a generator body. @@ -6,7 +6,7 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts(2,22): erro function* g() { class C extends (yield 0) { } ~~~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'any' is not a constructor function type. ~~~~~ !!! error TS1163: A 'yield' expression is only allowed in a generator body. } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck60.errors.txt b/tests/baselines/reference/generatorTypeCheck60.errors.txt index 4d230a81b5b..5330cd186b7 100644 --- a/tests/baselines/reference/generatorTypeCheck60.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck60.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts(2,21): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts(2,21): error TS2507: Type 'any' is not a constructor function type. tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts(2,22): error TS1163: A 'yield' expression is only allowed in a generator body. @@ -6,7 +6,7 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts(2,22): erro function* g() { class C extends (yield) {}; ~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'any' is not a constructor function type. ~~~~~ !!! error TS1163: A 'yield' expression is only allowed in a generator body. } \ No newline at end of file diff --git a/tests/baselines/reference/importAsBaseClass.errors.txt b/tests/baselines/reference/importAsBaseClass.errors.txt index 4b923ea2323..835fd143f70 100644 --- a/tests/baselines/reference/importAsBaseClass.errors.txt +++ b/tests/baselines/reference/importAsBaseClass.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/importAsBaseClass_1.ts(2,21): error TS2507: Base expression is not of a constructor function type. +tests/cases/compiler/importAsBaseClass_1.ts(2,21): error TS2507: Type 'typeof "tests/cases/compiler/importAsBaseClass_0"' is not a constructor function type. ==== tests/cases/compiler/importAsBaseClass_1.ts (1 errors) ==== import Greeter = require("importAsBaseClass_0"); class Hello extends Greeter { } ~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'typeof "tests/cases/compiler/importAsBaseClass_0"' is not a constructor function type. ==== tests/cases/compiler/importAsBaseClass_0.ts (0 errors) ==== export class Greeter { diff --git a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt index 3c67ff44fd3..e6929df9bae 100644 --- a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt +++ b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts(5,20): error TS2507: Base expression is not of a constructor function type. +tests/cases/compiler/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts(5,20): error TS2507: Type 'number' is not a constructor function type. ==== tests/cases/compiler/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts (1 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/qualifiedName_entity-name-resolution-does-not-affect-class- class Beta extends Alpha.x { ~~~~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'number' is not a constructor function type. } \ No newline at end of file diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.errors.txt b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.errors.txt index 14905b224ad..f491cac9f0c 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.errors.txt +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts(8,17): error TS2314: Generic type 'A' requires 2 type argument(s). -tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts(9,21): error TS2335: 'super' can only be referenced in a derived class. -==== tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts (2 errors) ==== +==== tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts (1 errors) ==== class A { constructor(private map: (value: T1) => T2) { @@ -14,6 +13,4 @@ tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrec ~~~~~~~~~ !!! error TS2314: Generic type 'A' requires 2 type argument(s). constructor() { super(value => String(value)); } - ~~~~~ -!!! error TS2335: 'super' can only be referenced in a derived class. } \ No newline at end of file diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.errors.txt b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.errors.txt index d402272df1b..32047f3b417 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.errors.txt +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts(8,17): error TS2314: Generic type 'A' requires 2 type argument(s). -tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts(9,21): error TS2335: 'super' can only be referenced in a derived class. -==== tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts (2 errors) ==== +==== tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts (1 errors) ==== class A { constructor(private map: (value: T1) => T2) { @@ -14,6 +13,4 @@ tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeAr ~ !!! error TS2314: Generic type 'A' requires 2 type argument(s). constructor() { super(value => String(value)); } - ~~~~~ -!!! error TS2335: 'super' can only be referenced in a derived class. } \ No newline at end of file diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.errors.txt b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.errors.txt index 8bbf8b87cd3..4aa9e5a134b 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.errors.txt +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.ts(8,17): error TS2315: Type 'A' is not generic. -tests/cases/compiler/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.ts(9,21): error TS2335: 'super' can only be referenced in a derived class. -==== tests/cases/compiler/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.ts (2 errors) ==== +==== tests/cases/compiler/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.ts (1 errors) ==== class A { constructor(private map: (value: number) => string) { @@ -14,6 +13,4 @@ tests/cases/compiler/superCallFromClassThatDerivesNonGenericTypeButWithTypeArgum ~~~~~~~~~~~~~~~~~ !!! error TS2315: Type 'A' is not generic. constructor() { super(value => String(value)); } - ~~~~~ -!!! error TS2335: 'super' can only be referenced in a derived class. } \ No newline at end of file diff --git a/tests/baselines/reference/thisInInvalidContexts.errors.txt b/tests/baselines/reference/thisInInvalidContexts.errors.txt index 9cb554ab5df..d6f24cbcfdc 100644 --- a/tests/baselines/reference/thisInInvalidContexts.errors.txt +++ b/tests/baselines/reference/thisInInvalidContexts.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(22,15): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(28,13): error TS2331: 'this' cannot be referenced in a module or namespace body. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS2507: Type 'any' is not a constructor function type. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(44,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): error TS2332: 'this' cannot be referenced in current location. @@ -52,7 +52,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): class ErrClass3 extends this { ~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'any' is not a constructor function type. } diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt index 96fab807f5e..df47901d771 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(22,15): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(28,13): error TS2331: 'this' cannot be referenced in a module or namespace body. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS2507: Base expression is not of a constructor function type. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS2507: Type 'any' is not a constructor function type. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(44,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(45,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. @@ -53,7 +53,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod class ErrClass3 extends this { ~~~~ -!!! error TS2507: Base expression is not of a constructor function type. +!!! error TS2507: Type 'any' is not a constructor function type. } From efcccaa4f8db014d1a5348b7d6f0340e9dd6e67f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 17 Jun 2015 14:04:05 -0700 Subject: [PATCH 27/42] Addressing more CR feedback --- src/compiler/checker.ts | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bf42e584f09..0c1db9df22f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8973,16 +8973,16 @@ namespace ts { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters: TypeParameter[], typeArguments: TypeNode[]) { - if (produceDiagnostics) { - for (let i = 0; i < typeParameters.length; i++) { - let constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint) { - let typeArgument = typeArguments[i]; - checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } + function checkTypeArgumentConstraints(typeParameters: TypeParameter[], typeArguments: TypeNode[]): boolean { + let result = true; + for (let i = 0; i < typeParameters.length; i++) { + let constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + let typeArgument = typeArguments[i]; + result = result && checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } + return result; } function checkTypeReferenceNode(node: TypeReferenceNode | ExpressionWithTypeArguments) { @@ -8991,9 +8991,11 @@ namespace ts { if (type !== unknownType && node.typeArguments) { // Do type argument local checks only if referenced type is successfully resolved forEach(node.typeArguments, checkSourceElement); - let symbol = getNodeLinks(node).resolvedSymbol; - let typeParameters = symbol.flags & SymbolFlags.TypeAlias ? getSymbolLinks(symbol).typeParameters : (type).target.localTypeParameters; - checkTypeArgumentConstraints(typeParameters, node.typeArguments); + if (produceDiagnostics) { + let symbol = getNodeLinks(node).resolvedSymbol; + let typeParameters = symbol.flags & SymbolFlags.TypeAlias ? getSymbolLinks(symbol).typeParameters : (type).target.localTypeParameters; + checkTypeArgumentConstraints(typeParameters, node.typeArguments); + } } } @@ -10595,7 +10597,9 @@ namespace ts { if (baseTypeNode.typeArguments) { forEach(baseTypeNode.typeArguments, checkSourceElement); for (let constructor of getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments)) { - checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments); + if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { + break; + } } } checkTypeAssignableTo(type, baseType, node.name || node, Diagnostics.Class_0_incorrectly_extends_base_class_1); From 5b9a1b5e20696be8c6e27480cd43034f74fbac34 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 17 Jun 2015 14:17:52 -0700 Subject: [PATCH 28/42] Accepting new baselines after master merge --- tests/baselines/reference/classExtendingBuiltinType.js | 3 +-- tests/baselines/reference/classExtendingClassLikeType.js | 3 +-- tests/baselines/reference/classExtendingNonConstructor.js | 3 +-- tests/baselines/reference/classExtendingNull.js | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/baselines/reference/classExtendingBuiltinType.js b/tests/baselines/reference/classExtendingBuiltinType.js index 666ada39505..8a4b0dd3849 100644 --- a/tests/baselines/reference/classExtendingBuiltinType.js +++ b/tests/baselines/reference/classExtendingBuiltinType.js @@ -15,8 +15,7 @@ class C10 extends Array { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function (_super) { __extends(C1, _super); diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index 88a5dc8dcd3..4634b22e493 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -62,8 +62,7 @@ class D5 extends getBadBase() { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; // Error, no Base constructor function var D0 = (function (_super) { diff --git a/tests/baselines/reference/classExtendingNonConstructor.js b/tests/baselines/reference/classExtendingNonConstructor.js index f796b30ddd6..dff2fdf9ca9 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.js +++ b/tests/baselines/reference/classExtendingNonConstructor.js @@ -18,8 +18,7 @@ class C7 extends foo { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var x; function foo() { diff --git a/tests/baselines/reference/classExtendingNull.js b/tests/baselines/reference/classExtendingNull.js index f0c3ea69626..ac8009b9cd9 100644 --- a/tests/baselines/reference/classExtendingNull.js +++ b/tests/baselines/reference/classExtendingNull.js @@ -7,8 +7,7 @@ class C2 extends (null) { } var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var C1 = (function (_super) { __extends(C1, _super); From 3d224bde486718efb965f05dafcaa674de53e59b Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 17 Jun 2015 17:50:03 -0700 Subject: [PATCH 29/42] Emit declarations of namespaces correctelly --- Jakefile.js | 2 +- src/compiler/declarationEmitter.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index 1f88ee39082..cf7f9b3af22 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -361,7 +361,7 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca // Create the node definition file by replacing 'ts' module with '"typescript"' as a module. jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true}); var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString(); - definitionFileContents = definitionFileContents.replace(/declare module ts/g, 'declare module "typescript"'); + definitionFileContents = definitionFileContents.replace(/declare namespace ts/g, 'declare module "typescript"'); fs.writeFileSync(nodeDefinitionsFile, definitionFileContents); }); diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index a2edc632de3..2ba88f1ac29 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -709,7 +709,12 @@ namespace ts { function writeModuleDeclaration(node: ModuleDeclaration) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); - write("module "); + if (node.flags & NodeFlags.Namespace) { + write("namespace "); + } + else { + write("module "); + } writeTextOfNode(currentSourceFile, node.name); while (node.body.kind !== SyntaxKind.ModuleBlock) { node = node.body; From 9cc97f1fc5777d461e780ac37b30ca366c02f6eb Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 17 Jun 2015 21:17:09 -0700 Subject: [PATCH 30/42] feedback from pr #3542 --- src/server/editorServices.ts | 2 +- src/server/tsconfig.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 53cab79f9af..3cfccaec423 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1360,7 +1360,7 @@ module ts.server { } } - static fromString(host: System, script: string) { + static fromString(host: ServerHost, script: string) { var svc = new ScriptVersionCache(); var snap = new LineIndexSnapshot(0, svc); svc.versions[svc.currentVersion] = snap; diff --git a/src/server/tsconfig.json b/src/server/tsconfig.json index bdc0a36cb86..2c8538c61e3 100644 --- a/src/server/tsconfig.json +++ b/src/server/tsconfig.json @@ -12,7 +12,6 @@ "editorServices.ts", "protocol.d.ts", "server.ts", - "nodeimpl.ts", "session.ts" ] } From 54ed3c475e4e1b21c8058028af23784d4dc1d05a Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 17 Jun 2015 21:20:20 -0700 Subject: [PATCH 31/42] Add a unit test --- .../reference/namespacesDeclaration.js | 22 +++++++++++++++++++ .../reference/namespacesDeclaration.symbols | 16 ++++++++++++++ .../reference/namespacesDeclaration.types | 16 ++++++++++++++ tests/cases/compiler/namespacesDeclaration.ts | 9 ++++++++ 4 files changed, 63 insertions(+) create mode 100644 tests/baselines/reference/namespacesDeclaration.js create mode 100644 tests/baselines/reference/namespacesDeclaration.symbols create mode 100644 tests/baselines/reference/namespacesDeclaration.types create mode 100644 tests/cases/compiler/namespacesDeclaration.ts diff --git a/tests/baselines/reference/namespacesDeclaration.js b/tests/baselines/reference/namespacesDeclaration.js new file mode 100644 index 00000000000..7c7cfa84af0 --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration.js @@ -0,0 +1,22 @@ +//// [namespacesDeclaration.ts] + +module M { + export namespace N { + export module M2 { + export interface I {} + } + } +} + +//// [namespacesDeclaration.js] + + +//// [namespacesDeclaration.d.ts] +declare module M { + namespace N { + module M2 { + interface I { + } + } + } +} diff --git a/tests/baselines/reference/namespacesDeclaration.symbols b/tests/baselines/reference/namespacesDeclaration.symbols new file mode 100644 index 00000000000..1706f212f34 --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/namespacesDeclaration.ts === + +module M { +>M : Symbol(M, Decl(namespacesDeclaration.ts, 0, 0)) + + export namespace N { +>N : Symbol(N, Decl(namespacesDeclaration.ts, 1, 10)) + + export module M2 { +>M2 : Symbol(M2, Decl(namespacesDeclaration.ts, 2, 23)) + + export interface I {} +>I : Symbol(I, Decl(namespacesDeclaration.ts, 3, 24)) + } + } +} diff --git a/tests/baselines/reference/namespacesDeclaration.types b/tests/baselines/reference/namespacesDeclaration.types new file mode 100644 index 00000000000..944098097fc --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/namespacesDeclaration.ts === + +module M { +>M : any + + export namespace N { +>N : any + + export module M2 { +>M2 : any + + export interface I {} +>I : I + } + } +} diff --git a/tests/cases/compiler/namespacesDeclaration.ts b/tests/cases/compiler/namespacesDeclaration.ts new file mode 100644 index 00000000000..a231cf2d9d1 --- /dev/null +++ b/tests/cases/compiler/namespacesDeclaration.ts @@ -0,0 +1,9 @@ +// @declaration: true + +module M { + export namespace N { + export module M2 { + export interface I {} + } + } +} \ No newline at end of file From 53579f089e920c811b6b7de848f0f52dbf702790 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 17 Jun 2015 23:44:12 -0700 Subject: [PATCH 32/42] support modules as well as namespaces in external module conversion --- Jakefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jakefile.js b/Jakefile.js index cf7f9b3af22..07d48bbc133 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -361,7 +361,7 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca // Create the node definition file by replacing 'ts' module with '"typescript"' as a module. jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true}); var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString(); - definitionFileContents = definitionFileContents.replace(/declare namespace ts/g, 'declare module "typescript"'); + definitionFileContents = definitionFileContents.replace(/declare (namespace|module) ts/g, 'declare module "typescript"'); fs.writeFileSync(nodeDefinitionsFile, definitionFileContents); }); From 752e0ba00384a8664d7f6cafec588e88c5f30226 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Thu, 18 Jun 2015 23:04:05 +0800 Subject: [PATCH 33/42] Fixes type predicate crash bug --- src/compiler/checker.ts | 1 + .../expressions/typeGuards/typeGuardFunctionErrors.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index efc3e32166e..0861cd96a01 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5761,6 +5761,7 @@ namespace ts { let signature = getResolvedSignature(expr); if (signature.typePredicate && + expr.arguments[signature.typePredicate.parameterIndex] && getSymbolAtLocation(expr.arguments[signature.typePredicate.parameterIndex]) === symbol) { if (!assumeTrue) { diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts index e157b2afe36..688099280c5 100644 --- a/tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts @@ -23,6 +23,10 @@ function hasMissingIsKeyword(): x { return true; } +function hasMissingParameter(): x is A { + return true; +} + function hasMissingTypeInTypeGuardType(x): x is { return true; } @@ -132,4 +136,10 @@ function b6([a, b, p1], p2, p3): p1 is A { function b7({a, b, c: {p1}}, p2, p3): p1 is A { return true; +} + +// Should not crash the compiler +var x: A; +if (hasMissingParameter()) { + x.propA; } \ No newline at end of file From 84bb38415f2e0f47c8197ac6491abace54c58742 Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Thu, 18 Jun 2015 23:23:47 +0800 Subject: [PATCH 34/42] Accepts baselines --- .../typeGuardFunctionErrors.errors.txt | 69 +++++++++++-------- .../reference/typeGuardFunctionErrors.js | 18 +++++ 2 files changed, 59 insertions(+), 28 deletions(-) diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index 1542bbe0fee..499a51035f2 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -1,42 +1,43 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(15,12): error TS2322: Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(22,33): error TS2304: Cannot find name 'x'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(26,10): error TS2391: Function implementation is missing or not immediately following the declaration. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(27,5): error TS1131: Property or signature expected. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(28,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(30,38): error TS1225: Cannot find parameter 'x'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(34,51): error TS2322: Type 'B' is not assignable to type 'A'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(26,33): error TS1225: Cannot find parameter 'x'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(30,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(31,5): error TS1131: Property or signature expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(32,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(34,38): error TS1225: Cannot find parameter 'x'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(38,51): error TS2322: Type 'B' is not assignable to type 'A'. Property 'propA' is missing in type 'B'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(38,56): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(42,56): error TS2322: Type 'T[]' is not assignable to type 'string'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(56,7): error TS2339: Property 'propB' does not exist on type 'A'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(61,7): error TS2339: Property 'propB' does not exist on type 'A'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(66,7): error TS2339: Property 'propB' does not exist on type 'A'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(71,46): error TS2345: Argument of type '(p1: any) => boolean' is not assignable to parameter of type '(p1: any) => boolean'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(42,56): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(46,56): error TS2322: Type 'T[]' is not assignable to type 'string'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(60,7): error TS2339: Property 'propB' does not exist on type 'A'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(65,7): error TS2339: Property 'propB' does not exist on type 'A'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(70,7): error TS2339: Property 'propB' does not exist on type 'A'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(75,46): error TS2345: Argument of type '(p1: any) => boolean' is not assignable to parameter of type '(p1: any) => boolean'. Type predicate 'p1 is C' is not assignable to 'p1 is B'. Type 'C' is not assignable to type 'B'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(75,1): error TS2322: Type '(p1: any, p2: any) => boolean' is not assignable to type '(p1: any, p2: any) => boolean'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(79,1): error TS2322: Type '(p1: any, p2: any) => boolean' is not assignable to type '(p1: any, p2: any) => boolean'. Signature '(p1: any, p2: any): boolean' must have a type predicate. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(81,1): error TS2322: Type '(p1: any, p2: any) => boolean' is not assignable to type '(p1: any, p2: any) => boolean'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(85,1): error TS2322: Type '(p1: any, p2: any) => boolean' is not assignable to type '(p1: any, p2: any) => boolean'. Type predicate 'p2 is A' is not assignable to 'p1 is A'. Parameter 'p2' is not in the same position as parameter 'p1'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(87,1): error TS2322: Type '(p1: any, p2: any, p3: any) => boolean' is not assignable to type '(p1: any, p2: any) => boolean'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(92,9): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(93,16): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(94,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(100,25): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(101,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(103,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(106,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(107,16): error TS2408: Setters cannot return a value. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(112,18): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(116,22): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,20): error TS1229: A type predicate cannot reference a rest parameter. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(125,34): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(91,1): error TS2322: Type '(p1: any, p2: any, p3: any) => boolean' is not assignable to type '(p1: any, p2: any) => boolean'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,9): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,16): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(104,25): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(107,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(110,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(111,16): error TS2408: Setters cannot return a value. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(116,18): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,22): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(124,20): error TS1229: A type predicate cannot reference a rest parameter. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(129,34): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(133,39): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(133,34): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. -==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (30 errors) ==== +==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (31 errors) ==== class A { propA: number; @@ -66,6 +67,12 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(133,39 return true; } + function hasMissingParameter(): x is A { + ~ +!!! error TS1225: Cannot find parameter 'x'. + return true; + } + function hasMissingTypeInTypeGuardType(x): x is { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2391: Function implementation is missing or not immediately following the declaration. @@ -237,4 +244,10 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(133,39 ~~ !!! error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. return true; + } + + // Should not crash the compiler + var x: A; + if (hasMissingParameter()) { + x.propA; } \ No newline at end of file diff --git a/tests/baselines/reference/typeGuardFunctionErrors.js b/tests/baselines/reference/typeGuardFunctionErrors.js index 5b0979ac576..4923f544345 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.js +++ b/tests/baselines/reference/typeGuardFunctionErrors.js @@ -24,6 +24,10 @@ function hasMissingIsKeyword(): x { return true; } +function hasMissingParameter(): x is A { + return true; +} + function hasMissingTypeInTypeGuardType(x): x is { return true; } @@ -133,6 +137,12 @@ function b6([a, b, p1], p2, p3): p1 is A { function b7({a, b, c: {p1}}, p2, p3): p1 is A { return true; +} + +// Should not crash the compiler +var x: A; +if (hasMissingParameter()) { + x.propA; } //// [typeGuardFunctionErrors.js] @@ -167,6 +177,9 @@ function hasTypeGuardTypeInsideTypeGuardType(x) { function hasMissingIsKeyword() { return true; } +function hasMissingParameter() { + return true; +} return true; function hasNonMatchingParameter(y) { return true; @@ -260,3 +273,8 @@ function b7(_a, p2, p3) { var a = _a.a, b = _a.b, p1 = _a.c.p1; return true; } +// Should not crash the compiler +var x; +if (hasMissingParameter()) { + x.propA; +} From 151306f42374369f1e9bc94d63de2af63b5f1381 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 18 Jun 2015 08:30:26 -0700 Subject: [PATCH 35/42] PR feedback. --- src/compiler/utilities.ts | 2 +- src/services/services.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 6d95e7eac83..85216444626 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2083,7 +2083,7 @@ namespace ts { return start <= textSpanEnd(span) && end >= span.start; } - export function textSpanIntersectsWith2(start1: number, length1: number, start2: number, length2: number) { + export function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number) { let end1 = start1 + length1; let end2 = start2 + length2; return start2 <= end1 && end2 >= start1; diff --git a/src/services/services.ts b/src/services/services.ts index 2f529ddab7b..99b08254c1a 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -6413,7 +6413,7 @@ namespace ts { } // Ignore nodes that don't intersect the original span to classify. - if (textSpanIntersectsWith2(spanStart, spanLength, element.pos, element.getFullWidth())) { + if (decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { let children = element.getChildren(sourceFile); for (let i = 0, n = children.length; i < n; i++) { let child = children[i]; From ede80c1de22b40ca13f09cd8e6019f9bcb6cbc43 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 18 Jun 2015 09:06:47 -0700 Subject: [PATCH 36/42] Don't use spread operator when pushing arrays onto other arrays. Spreading emits as ".push.apply(reciver, values)". This pushes every elements in values onto the stack before calling the function. This can easily stack overflow if the amount of values is high (i hit this with ~10k values on my own system). --- src/services/services.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index bab5b7707ef..bed1f9b6bb9 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1789,11 +1789,6 @@ namespace ts { sourceFile.moduleName = moduleName; } - // Store syntactic diagnostics - if (diagnostics && sourceFile.parseDiagnostics) { - diagnostics.push(...sourceFile.parseDiagnostics); - } - let newLine = getNewLineCharacter(options); // Output @@ -1815,9 +1810,8 @@ namespace ts { var program = createProgram([inputFileName], options, compilerHost); - if (diagnostics) { - diagnostics.push(...program.getCompilerOptionsDiagnostics()); - } + addRange(/*to*/ diagnostics, /*from*/ sourceFile.parseDiagnostics); + addRange(/*to*/ diagnostics, /*from*/ program.getCompilerOptionsDiagnostics()); // Emit program.emit(); @@ -4188,7 +4182,7 @@ namespace ts { var result: DefinitionInfo[] = []; forEach((type).types, t => { if (t.symbol) { - result.push(...getDefinitionFromSymbol(t.symbol, node)); + addRange(/*to*/ result, /*from*/ getDefinitionFromSymbol(t.symbol, node)); } }); return result; From ef7d1136b80970f0be11ad37f66fe15fb583d672 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 18 Jun 2015 09:32:52 -0700 Subject: [PATCH 37/42] Make it so all our diagnostics APIs return an independent set of diagnostics. In order to get all diagnostics, you must call all the APIs. And no APIs return diagnostics produced by other APIs. This is how things were before hte addition of the getCompletionOptionsDiagnostics API, and i'm returning things to that state. --- src/compiler/checker.ts | 16 ++++++++-------- src/compiler/program.ts | 12 ++++-------- src/compiler/types.ts | 4 ++-- src/services/services.ts | 7 +++++-- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index efc3e32166e..68a0916f743 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -159,6 +159,14 @@ namespace ts { } }; + let subtypeRelation: Map = {}; + let assignableRelation: Map = {}; + let identityRelation: Map = {}; + + initializeTypeChecker(); + + return checker; + function getEmitResolver(sourceFile?: SourceFile) { // Ensure we have all the type information in place for this file so that all the // emitter questions of this resolver will return the right information. @@ -4221,10 +4229,6 @@ namespace ts { // TYPE CHECKING - let subtypeRelation: Map = {}; - let assignableRelation: Map = {}; - let identityRelation: Map = {}; - function isTypeIdenticalTo(source: Type, target: Type): boolean { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined); } @@ -13614,9 +13618,5 @@ namespace ts { return true; } } - - initializeTypeChecker(); - - return checker; } } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 800e2238a54..87b7ab26c48 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -105,7 +105,7 @@ namespace ts { } export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile): Diagnostic[] { - let diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); + let diagnostics = program.getOptionsDiagnostics().concat(program.getSyntacticDiagnostics(sourceFile)).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); if (program.getCompilerOptions().declaration) { diagnostics.concat(program.getDeclarationDiagnostics(sourceFile)); @@ -177,10 +177,10 @@ namespace ts { getSourceFiles: () => files, getCompilerOptions: () => options, getSyntacticDiagnostics, + getOptionsDiagnostics, getGlobalDiagnostics, getSemanticDiagnostics, getDeclarationDiagnostics, - getCompilerOptionsDiagnostics, getTypeChecker, getClassifiableNames, getDiagnosticsProducingTypeChecker, @@ -311,19 +311,15 @@ namespace ts { } } - function getCompilerOptionsDiagnostics(): Diagnostic[] { + function getOptionsDiagnostics(): Diagnostic[] { let allDiagnostics: Diagnostic[] = []; addRange(allDiagnostics, diagnostics.getGlobalDiagnostics()); return sortAndDeduplicateDiagnostics(allDiagnostics); } function getGlobalDiagnostics(): Diagnostic[] { - let typeChecker = getDiagnosticsProducingTypeChecker(); - let allDiagnostics: Diagnostic[] = []; - addRange(allDiagnostics, typeChecker.getGlobalDiagnostics()); - addRange(allDiagnostics, diagnostics.getGlobalDiagnostics()); - + addRange(allDiagnostics, getDiagnosticsProducingTypeChecker().getGlobalDiagnostics()); return sortAndDeduplicateDiagnostics(allDiagnostics); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c39426a2e22..f9a2fa3b7b4 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1212,11 +1212,11 @@ namespace ts { */ emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + getOptionsDiagnostics(): Diagnostic[]; getGlobalDiagnostics(): Diagnostic[]; + getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - /* @internal */ getCompilerOptionsDiagnostics(): Diagnostic[]; /** * Gets a type checker that can be used to semantically analyze source fils in the program. diff --git a/src/services/services.ts b/src/services/services.ts index bab5b7707ef..f3d7a80302d 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -973,6 +973,9 @@ namespace ts { getSyntacticDiagnostics(fileName: string): Diagnostic[]; getSemanticDiagnostics(fileName: string): Diagnostic[]; + + // TODO: Rename this to getProgramDiagnostics to better indicate that these are any + // diagnostics present for the program level, and not just 'options' diagnostics. getCompilerOptionsDiagnostics(): Diagnostic[]; /** @@ -1816,7 +1819,7 @@ namespace ts { var program = createProgram([inputFileName], options, compilerHost); if (diagnostics) { - diagnostics.push(...program.getCompilerOptionsDiagnostics()); + diagnostics.push(...program.getOptionsDiagnostics()); } // Emit @@ -2796,7 +2799,7 @@ namespace ts { function getCompilerOptionsDiagnostics() { synchronizeHostData(); - return program.getGlobalDiagnostics(); + return program.getOptionsDiagnostics().concat(program.getGlobalDiagnostics()); } /// Completion From 3f40e47fcce66ad427126feeb7c82eb1c944b476 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 18 Jun 2015 09:45:32 -0700 Subject: [PATCH 38/42] Don't access diagnostics directly. Use the supported Program API for them. --- src/services/services.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/services.ts b/src/services/services.ts index b97e2ebb9f8..7b94384a068 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1813,7 +1813,7 @@ namespace ts { var program = createProgram([inputFileName], options, compilerHost); - addRange(/*to*/ diagnostics, /*from*/ sourceFile.parseDiagnostics); + addRange(/*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile)); addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics()); // Emit From 22f704c0a35bf3df1ba14bfb49b0e9e63ddd5bbb Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 18 Jun 2015 10:14:13 -0700 Subject: [PATCH 39/42] Fix capitalization --- tests/perftsc.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/perftsc.ts b/tests/perftsc.ts index e0189896a15..89bff1cc006 100644 --- a/tests/perftsc.ts +++ b/tests/perftsc.ts @@ -10,7 +10,7 @@ if (perftest.hasLogIOFlag()) { var content = perftest.readFile(s); return content !== undefined ? ts.createSourceFile(s, content, v) : undefined; }, - getDefaultLibFilename: () => ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(perftest.getExecutingFilePath())), "lib.d.ts"), + getDefaultLibFileName: () => ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(perftest.getExecutingFilePath())), "lib.d.ts"), writeFile: (f: string, content: string) => { throw new Error("Unexpected operation: writeFile"); }, getCurrentDirectory: () => perftest.getCurrentDirectory(), getCanonicalFileName: (f: string) => ts.sys.useCaseSensitiveFileNames ? f : f.toLowerCase(), @@ -19,8 +19,8 @@ if (perftest.hasLogIOFlag()) { }; var commandLine = ts.parseCommandLine(perftest.getArgsWithoutLogIOFlag()); - var program = ts.createProgram(commandLine.filenames, commandLine.options, compilerHost); - var fileNames = program.getSourceFiles().map(f => f.filename); + var program = ts.createProgram(commandLine.fileNames, commandLine.options, compilerHost); + var fileNames = program.getSourceFiles().map(f => f.fileName); perftest.writeIOLog(fileNames); } else { From c4f65f8bbf0b9d54311af782d989144c47cc2417 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 18 Jun 2015 11:00:50 -0700 Subject: [PATCH 40/42] PR feedback. --- src/compiler/program.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 87b7ab26c48..2af9ad9987d 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -105,7 +105,10 @@ namespace ts { } export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile): Diagnostic[] { - let diagnostics = program.getOptionsDiagnostics().concat(program.getSyntacticDiagnostics(sourceFile)).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); + let diagnostics = program.getOptionsDiagnostics().concat( + program.getSyntacticDiagnostics(sourceFile), + program.getGlobalDiagnostics(), + program.getSemanticDiagnostics(sourceFile)); if (program.getCompilerOptions().declaration) { diagnostics.concat(program.getDeclarationDiagnostics(sourceFile)); From 38a54bc0b90f7145abd45e186e74e4dc78ad705c Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 18 Jun 2015 14:16:00 -0700 Subject: [PATCH 41/42] Fix incremental parsing issue. We were moving a method-declaration called "constructor" into a class. This is incorrect as that same code should be parsed as a constructor-declaration now that it is in the class context. --- src/compiler/parser.ts | 10 +++++++++- tests/cases/unittests/incrementalParser.ts | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index a507125d4bb..a94341dd9c4 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1491,12 +1491,20 @@ namespace ts { switch (node.kind) { case SyntaxKind.Constructor: case SyntaxKind.IndexSignature: - case SyntaxKind.MethodDeclaration: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.PropertyDeclaration: case SyntaxKind.SemicolonClassElement: return true; + case SyntaxKind.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. + let methodDeclaration = node; + let nameIsConstructor = methodDeclaration.name.kind === SyntaxKind.Identifier && + (methodDeclaration.name).originalKeywordKind === SyntaxKind.ConstructorKeyword; + + return !nameIsConstructor; } } diff --git a/tests/cases/unittests/incrementalParser.ts b/tests/cases/unittests/incrementalParser.ts index a0b361a87f4..1ef10eaa712 100644 --- a/tests/cases/unittests/incrementalParser.ts +++ b/tests/cases/unittests/incrementalParser.ts @@ -713,6 +713,24 @@ module m3 { }\ compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 4); }); + it('Do not move constructors from class to object-literal.', () => { + var source = "class C { public constructor() { } public constructor() { } public constructor() { } }" + + var oldText = ScriptSnapshot.fromString(source); + var newTextAndChange = withChange(oldText, 0, "class C".length, "var v ="); + + compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 0); + }); + + it('Do not move methods called "constructor" from object literal to class', () => { + var source = "var v = { public constructor() { } public constructor() { } public constructor() { } }" + + var oldText = ScriptSnapshot.fromString(source); + var newTextAndChange = withChange(oldText, 0, "var v =".length, "class C"); + + compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 0); + }); + it('Moving index signatures from class to interface',() => { var source = "class C { public [a: number]: string; public [a: number]: string; public [a: number]: string }" From 3db5bbf93ffc06afe707a0a9a5cb016b061404a7 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Fri, 5 Jun 2015 12:00:53 -0700 Subject: [PATCH 42/42] wrap host.getCanonicalFileName in arrow function --- src/compiler/program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 5c40230484a..1cfe4d77b6f 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -152,7 +152,7 @@ module ts { let start = new Date().getTime(); host = host || createCompilerHost(options); - let filesByName = createFileMap(host.getCanonicalFileName); + let filesByName = createFileMap(fileName => host.getCanonicalFileName(fileName)); forEach(rootNames, name => processRootFile(name, false)); if (!seenNoDefaultLib) {