diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c764b50b2ceba..28b664a33e4af 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9421,8 +9421,8 @@ namespace ts { let container = getSuperContainer(node, /*stopOnFunctions*/ true); let needToCaptureLexicalThis = false; + // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - // adjust the container reference in case if super is used inside arrow functions with arbitrary deep nesting while (container && container.kind === SyntaxKind.ArrowFunction) { container = getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < ScriptTarget.ES6; @@ -14439,6 +14439,7 @@ namespace ts { // constructors of derived classes must contain at least one super call somewhere in their function body. const containingClassDecl = node.parent; if (getClassExtendsHeritageClauseElement(containingClassDecl)) { + captureLexicalThis(node.parent, containingClassDecl); const classExtendsNull = classDeclarationExtendsNull(containingClassDecl); const superCall = getSuperCallInConstructor(node); if (superCall) { diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 4a6cbd0943443..4f2720c15071d 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -139,6 +139,30 @@ namespace ts { loopOutParameters?: LoopOutParameter[]; } + const enum SuperCaptureResult { + /** + * A capture may have been added for calls to 'super', but + * the caller should emit subsequent statements normally. + */ + NoReplacement, + /** + * A call to 'super()' got replaced with a capturing statement like: + * + * var _this = _super.call(...) || this; + * + * Callers should skip the current statement. + */ + ReplaceSuperCapture, + /** + * A call to 'super()' got replaced with a capturing statement like: + * + * return _super.call(...) || this; + * + * Callers should skip the current statement and avoid any returns of '_this'. + */ + ReplaceWithReturn, + } + export function transformES6(context: TransformationContext) { const { startLexicalEnvironment, @@ -197,7 +221,7 @@ namespace ts { : visitorWorker(node); } - function saveStateAndInvoke(node: Node, f: (node: Node) => T): T { + function saveStateAndInvoke(node: T, f: (node: T) => U): U { const savedEnclosingFunction = enclosingFunction; const savedEnclosingNonArrowFunction = enclosingNonArrowFunction; const savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody; @@ -756,7 +780,8 @@ namespace ts { function addConstructor(statements: Statement[], node: ClassExpression | ClassDeclaration, extendsClauseElement: ExpressionWithTypeArguments): void { const constructor = getFirstConstructorWithBody(node); const hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); - statements.push( + + const constructorFunction = createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -767,8 +792,12 @@ namespace ts { /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), /*location*/ constructor || node - ) - ); + ); + + if (extendsClauseElement) { + setEmitFlags(constructorFunction, EmitFlags.CapturesThis); + } + statements.push(constructorFunction); } /** @@ -800,22 +829,53 @@ namespace ts { * @param hasSynthesizedSuper A value indicating whether the constructor starts with a * synthesized `super` call. */ - function transformConstructorBody(constructor: ConstructorDeclaration, node: ClassDeclaration | ClassExpression, extendsClauseElement: ExpressionWithTypeArguments, hasSynthesizedSuper: boolean) { + function transformConstructorBody(constructor: ConstructorDeclaration | undefined, node: ClassDeclaration | ClassExpression, extendsClauseElement: ExpressionWithTypeArguments, hasSynthesizedSuper: boolean) { const statements: Statement[] = []; startLexicalEnvironment(); + + let statementOffset = -1; + if (hasSynthesizedSuper) { + // If a super call has already been synthesized, + // we're going to assume that we should just transform everything after that. + // The assumption is that no prior step in the pipeline has added any prologue directives. + statementOffset = 1; + } + else if (constructor) { + // Otherwise, try to emit all potential prologue directives first. + statementOffset = addPrologueDirectives(statements, constructor.body.statements, /*ensureUseStrict*/ false, visitor); + } + if (constructor) { - addCaptureThisForNodeIfNeeded(statements, constructor); addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); + Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); + } - addDefaultSuperCallIfNeeded(statements, constructor, extendsClauseElement, hasSynthesizedSuper); + const superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, hasSynthesizedSuper, statementOffset); + + // The last statement expression was replaced. Skip it. + if (superCaptureStatus === SuperCaptureResult.ReplaceSuperCapture || superCaptureStatus === SuperCaptureResult.ReplaceWithReturn) { + statementOffset++; + } if (constructor) { - const body = saveStateAndInvoke(constructor, hasSynthesizedSuper ? transformConstructorBodyWithSynthesizedSuper : transformConstructorBodyWithoutSynthesizedSuper); + const body = saveStateAndInvoke(constructor, constructor => visitNodes(constructor.body.statements, visitor, isStatement, /*start*/ statementOffset)); addRange(statements, body); } + // Return `_this` unless we're sure enough that it would be pointless to add a return statement. + // If there's a constructor that we can tell returns in enough places, then we *do not* want to add a return. + if (extendsClauseElement + && superCaptureStatus !== SuperCaptureResult.ReplaceWithReturn + && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { + statements.push( + createReturn( + createIdentifier("_this") + ) + ); + } + addRange(statements, endLexicalEnvironment()); const block = createBlock( createNodeArray( @@ -833,41 +893,130 @@ namespace ts { return block; } - function transformConstructorBodyWithSynthesizedSuper(node: ConstructorDeclaration) { - return visitNodes(node.body.statements, visitor, isStatement, 1); - } + /** + * We want to try to avoid emitting a return statement in certain cases if a user already returned something. + * It would generate obviously dead code, so we'll try to make things a little bit prettier + * by doing a minimal check on whether some common patterns always explicitly return. + */ + function isSufficientlyCoveredByReturnStatements(statement: Statement): boolean { + // A return statement is considered covered. + if (statement.kind === SyntaxKind.ReturnStatement) { + return true; + } + // An if-statement with two covered branches is covered. + else if (statement.kind === SyntaxKind.IfStatement) { + const ifStatement = statement as IfStatement; + if (ifStatement.elseStatement) { + return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && + isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); + } + } + // A block is covered if it has a last statement which is covered. + else if (statement.kind === SyntaxKind.Block) { + const lastStatement = lastOrUndefined((statement as Block).statements); + if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { + return true; + } + } - function transformConstructorBodyWithoutSynthesizedSuper(node: ConstructorDeclaration) { - return visitNodes(node.body.statements, visitor, isStatement, 0); + return false; } /** - * Adds a synthesized call to `_super` if it is needed. + * Declares a `_this` variable for derived classes and for when arrow functions capture `this`. * - * @param statements The statements for the new constructor body. - * @param constructor The constructor for the class. - * @param extendsClauseElement The expression for the class `extends` clause. - * @param hasSynthesizedSuper A value indicating whether the constructor starts with a - * synthesized `super` call. + * @returns The new statement offset into the `statements` array. */ - function addDefaultSuperCallIfNeeded(statements: Statement[], constructor: ConstructorDeclaration, extendsClauseElement: ExpressionWithTypeArguments, hasSynthesizedSuper: boolean) { - // If the TypeScript transformer needed to synthesize a constructor for property - // initializers, it would have also added a synthetic `...args` parameter and - // `super` call. - // If this is the case, or if the class has an `extends` clause but no - // constructor, we emit a synthesized call to `_super`. - if (constructor ? hasSynthesizedSuper : extendsClauseElement) { - statements.push( - createStatement( - createFunctionApply( - createIdentifier("_super"), - createThis(), - createIdentifier("arguments") - ), - /*location*/ extendsClauseElement - ) - ); + function declareOrCaptureOrReturnThisForConstructorIfNeeded( + statements: Statement[], + ctor: ConstructorDeclaration | undefined, + hasExtendsClause: boolean, + hasSynthesizedSuper: boolean, + statementOffset: number) { + // If this isn't a derived class, just capture 'this' for arrow functions if necessary. + if (!hasExtendsClause) { + if (ctor) { + addCaptureThisForNodeIfNeeded(statements, ctor); + } + return SuperCaptureResult.NoReplacement; + } + + // We must be here because the user didn't write a constructor + // but we needed to call 'super(...args)' anyway as per 14.5.14 of the ES2016 spec. + // If that's the case we can just immediately return the result of a 'super()' call. + if (!ctor) { + statements.push(createReturn(createDefaultSuperCallOrThis())); + return SuperCaptureResult.ReplaceWithReturn; + } + + // The constructor exists, but it and the 'super()' call it contains were generated + // for something like property initializers. + // Create a captured '_this' variable and assume it will subsequently be used. + if (hasSynthesizedSuper) { + captureThisForNode(statements, ctor, createDefaultSuperCallOrThis()); + enableSubstitutionsForCapturedThis(); + return SuperCaptureResult.ReplaceSuperCapture; + } + + // Most of the time, a 'super' call will be the first real statement in a constructor body. + // In these cases, we'd like to transform these into a *single* statement instead of a declaration + // followed by an assignment statement for '_this'. For instance, if we emitted without an initializer, + // we'd get: + // + // var _this; + // _this = _super.call(...) || this; + // + // instead of + // + // var _this = _super.call(...) || this; + // + // Additionally, if the 'super()' call is the last statement, we should just avoid capturing + // entirely and immediately return the result like so: + // + // return _super.call(...) || this; + // + let firstStatement: Statement; + let superCallExpression: Expression; + + const ctorStatements = ctor.body.statements; + if (statementOffset < ctorStatements.length) { + firstStatement = ctorStatements[statementOffset]; + + if (firstStatement.kind === SyntaxKind.ExpressionStatement && isSuperCallExpression((firstStatement as ExpressionStatement).expression)) { + const superCall = (firstStatement as ExpressionStatement).expression as CallExpression; + superCallExpression = setOriginalNode( + saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), + superCall + ); + } } + + // Return the result if we have an immediate super() call on the last statement. + if (superCallExpression && statementOffset === ctorStatements.length - 1) { + statements.push(createReturn(superCallExpression)); + return SuperCaptureResult.ReplaceWithReturn; + } + + // Perform the capture. + captureThisForNode(statements, ctor, superCallExpression, firstStatement); + + // If we're actually replacing the original statement, we need to signal this to the caller. + if (superCallExpression) { + return SuperCaptureResult.ReplaceSuperCapture; + } + + return SuperCaptureResult.NoReplacement; + } + + function createDefaultSuperCallOrThis() { + const actualThis = createThis(); + setEmitFlags(actualThis, EmitFlags.NoSubstitution); + const superCall = createFunctionApply( + createIdentifier("_super"), + actualThis, + createIdentifier("arguments"), + ); + return createLogicalOr(superCall, actualThis); } /** @@ -1121,24 +1270,29 @@ namespace ts { */ function addCaptureThisForNodeIfNeeded(statements: Statement[], node: Node): void { if (node.transformFlags & TransformFlags.ContainsCapturedLexicalThis && node.kind !== SyntaxKind.ArrowFunction) { - enableSubstitutionsForCapturedThis(); - const captureThisStatement = createVariableStatement( - /*modifiers*/ undefined, - createVariableDeclarationList([ - createVariableDeclaration( - "_this", - /*type*/ undefined, - createThis() - ) - ]) - ); - - setEmitFlags(captureThisStatement, EmitFlags.NoComments | EmitFlags.CustomPrologue); - setSourceMapRange(captureThisStatement, node); - statements.push(captureThisStatement); + captureThisForNode(statements, node, createThis()); } } + function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined, originalStatement?: Statement): void { + enableSubstitutionsForCapturedThis(); + const captureThisStatement = createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList([ + createVariableDeclaration( + "_this", + /*type*/ undefined, + initializer + ) + ]), + originalStatement + ); + + setEmitFlags(captureThisStatement, EmitFlags.NoComments | EmitFlags.CustomPrologue); + setSourceMapRange(captureThisStatement, node); + statements.push(captureThisStatement); + } + /** * Adds statements to the class body function for a class to define the members of the * class. @@ -2523,11 +2677,23 @@ namespace ts { * * @param node a CallExpression. */ - function visitCallExpression(node: CallExpression): LeftHandSideExpression { + function visitCallExpression(node: CallExpression) { + return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); + } + + function visitImmediateSuperCallInBody(node: CallExpression) { + return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ false); + } + + function visitCallExpressionWithPotentialCapturedThisAssignment(node: CallExpression, assignToCapturedThis: boolean): CallExpression | BinaryExpression { // We are here either because SuperKeyword was used somewhere in the expression, or // because we contain a SpreadElementExpression. const { target, thisArg } = createCallBinding(node.expression, hoistVariableDeclaration); + if (node.expression.kind === SyntaxKind.SuperKeyword) { + setEmitFlags(thisArg, EmitFlags.NoSubstitution); + } + let resultingCall: CallExpression | BinaryExpression; if (node.transformFlags & TransformFlags.ContainsSpreadElementExpression) { // [source] // f(...a, b) @@ -2543,7 +2709,7 @@ namespace ts { // _super.m.apply(this, a.concat([b])) // _super.prototype.m.apply(this, a.concat([b])) - return createFunctionApply( + resultingCall = createFunctionApply( visitNode(target, visitor, isExpression), visitNode(thisArg, visitor, isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false) @@ -2560,13 +2726,27 @@ namespace ts { // _super.m.call(this, a) // _super.prototype.m.call(this, a) - return createFunctionCall( + resultingCall = createFunctionCall( visitNode(target, visitor, isExpression), visitNode(thisArg, visitor, isExpression), visitNodes(node.arguments, visitor, isExpression), /*location*/ node ); } + + if (node.expression.kind === SyntaxKind.SuperKeyword) { + const actualThis = createThis(); + setEmitFlags(actualThis, EmitFlags.NoSubstitution); + const initializer = + createLogicalOr( + resultingCall, + actualThis + ); + return assignToCapturedThis + ? createAssignment(createIdentifier("_this"), initializer) + : initializer; + } + return resultingCall; } /** diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 130fe690c5263..1a4d95feca54f 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -982,11 +982,11 @@ namespace ts { } /** - * Given an super call\property node returns a closest node where either - * - super call\property is legal in the node and not legal in the parent node the node. + * Given an super call/property node, returns the closest node where + * - a super call/property access is legal in the node and not legal in the parent node the node. * i.e. super call is legal in constructor but not legal in the class body. - * - node is arrow function (so caller might need to call getSuperContainer in case it needs to climb higher) - * - super call\property is definitely illegal in the node (but might be legal in some subnode) + * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher) + * - a super call/property is definitely illegal in the container (but might be legal in some subnode) * i.e. super property access is illegal in function declaration but can be legal in the statement list */ export function getSuperContainer(node: Node, stopOnFunctions: boolean): Node { diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index 7dcbfef1d727d..ec0ed5494a4f1 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -38,7 +38,7 @@ var A; var Point3d = (function (_super) { __extends(Point3d, _super); function Point3d() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Point3d; }(Point)); diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index 8f175621af44a..bae9593fb98b1 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -41,7 +41,7 @@ var A; var Point3d = (function (_super) { __extends(Point3d, _super); function Point3d() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Point3d; }(Point)); diff --git a/tests/baselines/reference/abstractClassInLocalScope.js b/tests/baselines/reference/abstractClassInLocalScope.js index a49da04c8a175..db5144be39981 100644 --- a/tests/baselines/reference/abstractClassInLocalScope.js +++ b/tests/baselines/reference/abstractClassInLocalScope.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js index 1f6c1dfdd7a00..1b3e11cfa32d9 100644 --- a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js +++ b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js @@ -22,7 +22,7 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/abstractProperty.js b/tests/baselines/reference/abstractProperty.js index 87b5475111bbd..fb7deaa09ddbc 100644 --- a/tests/baselines/reference/abstractProperty.js +++ b/tests/baselines/reference/abstractProperty.js @@ -35,9 +35,10 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); - this.raw = "edge"; - this.ro = "readonly please"; + var _this = _super.apply(this, arguments) || this; + _this.raw = "edge"; + _this.ro = "readonly please"; + return _this; } Object.defineProperty(C.prototype, "prop", { get: function () { return "foo"; }, diff --git a/tests/baselines/reference/abstractPropertyNegative.js b/tests/baselines/reference/abstractPropertyNegative.js index 5fc340c58d04f..bebf9026a0e56 100644 --- a/tests/baselines/reference/abstractPropertyNegative.js +++ b/tests/baselines/reference/abstractPropertyNegative.js @@ -57,8 +57,9 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); - this.ro = "readonly please"; + var _this = _super.apply(this, arguments) || this; + _this.ro = "readonly please"; + return _this; } Object.defineProperty(C.prototype, "concreteWithNoBody", { get: function () { }, @@ -77,8 +78,9 @@ var WrongTypeProperty = (function () { var WrongTypePropertyImpl = (function (_super) { __extends(WrongTypePropertyImpl, _super); function WrongTypePropertyImpl() { - _super.apply(this, arguments); - this.num = "nope, wrong"; + var _this = _super.apply(this, arguments) || this; + _this.num = "nope, wrong"; + return _this; } return WrongTypePropertyImpl; }(WrongTypeProperty)); @@ -90,7 +92,7 @@ var WrongTypeAccessor = (function () { var WrongTypeAccessorImpl = (function (_super) { __extends(WrongTypeAccessorImpl, _super); function WrongTypeAccessorImpl() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(WrongTypeAccessorImpl.prototype, "num", { get: function () { return "nope, wrong"; }, @@ -102,8 +104,9 @@ var WrongTypeAccessorImpl = (function (_super) { var WrongTypeAccessorImpl2 = (function (_super) { __extends(WrongTypeAccessorImpl2, _super); function WrongTypeAccessorImpl2() { - _super.apply(this, arguments); - this.num = "nope, wrong"; + var _this = _super.apply(this, arguments) || this; + _this.num = "nope, wrong"; + return _this; } return WrongTypeAccessorImpl2; }(WrongTypeAccessor)); diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index c04532078e994..02d092dfd393f 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -34,8 +34,9 @@ var Point = (function () { var ColoredPoint = (function (_super) { __extends(ColoredPoint, _super); function ColoredPoint(x, y, color) { - _super.call(this, x, y); - this.color = color; + var _this = _super.call(this, x, y) || this; + _this.color = color; + return _this; } ColoredPoint.prototype.toString = function () { return _super.prototype.toString.call(this) + " color=" + this.color; 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 7294aa1aff74a..dbaeec1f688ef 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.js @@ -38,7 +38,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js index 905ed9bce0e58..8b60ed8e76ddd 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js @@ -46,7 +46,7 @@ var Backbone = require("./aliasUsage1_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInArray.js b/tests/baselines/reference/aliasUsageInArray.js index 2d9f7cfed6ec4..bf573aa9abb20 100644 --- a/tests/baselines/reference/aliasUsageInArray.js +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -40,7 +40,7 @@ var Backbone = require("./aliasUsageInArray_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.js b/tests/baselines/reference/aliasUsageInFunctionExpression.js index 21565dc99fc67..49bdd493aacee 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.js +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -39,7 +39,7 @@ var Backbone = require("./aliasUsageInFunctionExpression_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.js b/tests/baselines/reference/aliasUsageInGenericFunction.js index af24b61cf3330..dc3a8a88bab8d 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.js +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -43,7 +43,7 @@ var Backbone = require("./aliasUsageInGenericFunction_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js index 3b21f15777c90..cb7ad3027cad4 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -45,7 +45,7 @@ var Backbone = require("./aliasUsageInIndexerOfClass_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.js b/tests/baselines/reference/aliasUsageInObjectLiteral.js index b380104b461c1..81e3e621e850b 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.js +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -40,7 +40,7 @@ var Backbone = require("./aliasUsageInObjectLiteral_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInOrExpression.js b/tests/baselines/reference/aliasUsageInOrExpression.js index 1e9a54203453f..4faa41dd034f8 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.js +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -43,7 +43,7 @@ var Backbone = require("./aliasUsageInOrExpression_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 76b90c01bf0e3..2cf4aefab6c32 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -43,7 +43,7 @@ var Backbone = require("./aliasUsageInTypeArgumentOfExtendsClause_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); @@ -64,8 +64,9 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); - this.x = moduleA; + var _this = _super.apply(this, arguments) || this; + _this.x = moduleA; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.js b/tests/baselines/reference/aliasUsageInVarAssignment.js index 7c73fac2d67d5..80bb2dca20eea 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.js +++ b/tests/baselines/reference/aliasUsageInVarAssignment.js @@ -39,7 +39,7 @@ var Backbone = require("./aliasUsageInVarAssignment_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js index 275bbf676024e..01002792921c2 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -22,7 +22,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js index 2d04b059a9a9a..6ca9d343a721f 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.js +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -38,7 +38,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -51,7 +51,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js index de1b1ba11bd72..c6d3378872e60 100644 --- a/tests/baselines/reference/apparentTypeSupertype.js +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -28,7 +28,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index e2ca36cbd1de8..a887203cd5e05 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -101,7 +101,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C2.prototype.C2M1 = function () { return null; }; return C2; diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index a15df1b14b7e6..d82dedff29d60 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -75,7 +75,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C2.prototype.C2M1 = function () { return null; }; return C2; diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index f45f67a876545..b7ddaa5d6dae4 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -128,7 +128,7 @@ var EmptyTypes; var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return derived; }(base)); @@ -187,7 +187,7 @@ var NonEmptyTypes; var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return derived; }(base)); diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index f54dec83c9c2e..919d3a5e9227c 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -65,14 +65,14 @@ var Action = (function () { var ActionA = (function (_super) { __extends(ActionA, _super); function ActionA() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ActionA; }(Action)); var ActionB = (function (_super) { __extends(ActionB, _super); function ActionB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ActionB; }(Action)); diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index 4dbf88f868851..530cdedec73f3 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -70,7 +70,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); @@ -78,7 +78,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index c15782a8e2044..c0f320ac1e53a 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -39,7 +39,7 @@ var List = (function () { var DerivedList = (function (_super) { __extends(DerivedList, _super); function DerivedList() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return DerivedList; }(List)); diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js index 255b52e16c989..d1d75e8041c2a 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js @@ -33,14 +33,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(Array)); diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index 73e3be15e1189..64727398f7259 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -116,8 +116,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = this; - _super.call(this, function () { return _this; }); + return _super.call(this, function () { return _this; }) || this; } return Derived; }(Base)); @@ -158,8 +157,7 @@ var M2; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = this; - _super.call(this, function () { return _this; }); + return _super.call(this, function () { return _this; }) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js index 24f95ec61eaee..c5a1f41543760 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -114,21 +114,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js index 43608565039b2..58faf663ea893 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -115,21 +115,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js index b3318dd53e814..87506cad08fd3 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -80,21 +80,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js index becbfea57a037..2c05d5960b291 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -57,21 +57,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index d062a563a4dd3..76ad53e4e05e0 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -114,21 +114,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js index 5744424f8786c..f516df153c6b3 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -115,21 +115,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js index de42671c9f1f6..ef7de7f011bfb 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -80,21 +80,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js index 206ae7768baf6..3d58ae707a514 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -57,21 +57,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js index 56b206786f1e2..3716050668362 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -72,7 +72,7 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js index 53f92dd3b592b..2e6ecd72741db 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -59,7 +59,7 @@ b = a; // ok var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index 092de2ca7073b..2cc2510c8da7b 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -108,14 +108,14 @@ var OnlyDerived; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); @@ -167,14 +167,14 @@ var WithBase; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index 791ae494ab21d..3b12701b3d996 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -103,14 +103,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index d93ddf8b3a4b5..f965d18e2cee2 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -105,14 +105,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js index ef6befe268eb7..8d081c907940e 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -82,7 +82,7 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -93,7 +93,7 @@ var Generics; var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 8a3b4b35d0b87..ab3f80eff2104 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -118,8 +118,9 @@ value; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this); + var _this = _super.call(this) || this; _super.prototype. = value; + return _this; } Derived.prototype.foo = function () { _super.prototype. = value; }; Derived.sfoo = function () { _super. = value; }; diff --git a/tests/baselines/reference/asyncImportedPromise_es5.js b/tests/baselines/reference/asyncImportedPromise_es5.js index 0e6e8d515014d..76ffbc833aa6f 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5.js +++ b/tests/baselines/reference/asyncImportedPromise_es5.js @@ -19,7 +19,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Task = (function (_super) { __extends(Task, _super); function Task() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Task; }(Promise)); diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5.js b/tests/baselines/reference/asyncMethodWithSuper_es5.js index 21683eed63783..9ceff6bab4e4a 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5.js +++ b/tests/baselines/reference/asyncMethodWithSuper_es5.js @@ -61,7 +61,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } // async method with only call/get on 'super' does not require a binding B.prototype.simple = function () { diff --git a/tests/baselines/reference/asyncQualifiedReturnType_es5.js b/tests/baselines/reference/asyncQualifiedReturnType_es5.js index 19de38325e2cc..dd54f6ee8336d 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es5.js +++ b/tests/baselines/reference/asyncQualifiedReturnType_es5.js @@ -13,7 +13,7 @@ var X; var MyPromise = (function (_super) { __extends(MyPromise, _super); function MyPromise() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyPromise; }(Promise)); diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index e6790021f63f1..1c29bfeeff7f3 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -43,8 +43,9 @@ Point.origin = new Point(0, 0); var Point3D = (function (_super) { __extends(Point3D, _super); function Point3D(x, y, z, m) { - _super.call(this, x, y); - this.z = z; + var _this = _super.call(this, x, y) || this; + _this.z = z; + return _this; } Point3D.prototype.getDist = function () { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.m); diff --git a/tests/baselines/reference/awaitClassExpression_es5.js b/tests/baselines/reference/awaitClassExpression_es5.js index 9123f5f2ea86a..b207ba08f8d6a 100644 --- a/tests/baselines/reference/awaitClassExpression_es5.js +++ b/tests/baselines/reference/awaitClassExpression_es5.js @@ -17,7 +17,7 @@ function func() { _a = function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }; diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index c4210f3f6a531..870f811c09fa6 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -43,14 +43,14 @@ var C = (function () { var ELoc = (function (_super) { __extends(ELoc, _super); function ELoc(x) { - _super.call(this, 0, x); + return _super.call(this, 0, x) || this; } return ELoc; }(C)); var ELocVar = (function (_super) { __extends(ELocVar, _super); function ELocVar(x) { - _super.call(this, 0, loc); + return _super.call(this, 0, loc) || this; } ELocVar.prototype.m = function () { var loc = 10; @@ -60,24 +60,27 @@ var ELocVar = (function (_super) { var D = (function (_super) { __extends(D, _super); function D(z) { - _super.call(this, this.z); - this.z = z; + var _this = _super.call(this, _this.z) || this; + _this.z = z; + return _this; } return D; }(C)); // too few params var E = (function (_super) { __extends(E, _super); function E(z) { - _super.call(this, 0, this.z); - this.z = z; + var _this = _super.call(this, 0, _this.z) || this; + _this.z = z; + return _this; } return E; }(C)); var F = (function (_super) { __extends(F, _super); function F(z) { - _super.call(this, "hello", this.z); - this.z = z; + var _this = _super.call(this, "hello", _this.z) || this; + _this.z = z; + return _this; } return F; }(C)); // first param type diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js index 3f3fa3cc0b9ca..7e922cf83b239 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.js +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -38,7 +38,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js index 66d2135f01d7d..ec96b80a9999f 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.js +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -51,7 +51,7 @@ var Class1 = (function () { var Class2 = (function (_super) { __extends(Class2, _super); function Class2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Class2; }(Class1)); @@ -63,7 +63,7 @@ var Class3 = (function () { var Class4 = (function (_super) { __extends(Class4, _super); function Class4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Class4; }(Class3)); diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js index dc52eeeaee600..5f8dcbd0e10fd 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js @@ -41,7 +41,7 @@ var CBaseBase = (function () { var CBase = (function (_super) { __extends(CBase, _super); function CBase() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return CBase; }(CBaseBase)); @@ -59,7 +59,7 @@ var Wrapper = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.works = function () { new CBaseBase(this); diff --git a/tests/baselines/reference/bases.js b/tests/baselines/reference/bases.js index f67f754d06372..6b73eb9556b2c 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -36,8 +36,10 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - this.x; + var _this; + _this.x; any; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index 1c2fc896a6ad4..6d0f19dd37def 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -44,14 +44,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js index 21a69f517fc4c..2e2d0bcb1e2a4 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -40,14 +40,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index e38ce2854bd7d..928909f4c3852 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -46,7 +46,7 @@ var E = (function () { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return F; }(C)); @@ -59,8 +59,9 @@ var C1 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); - this.i = "bar"; + var _this = _super.apply(this, arguments) || this; + _this.i = "bar"; + return _this; } return D1; }(C1)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js index 6b3bf8e125ef5..0ae7648c7f903 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -84,21 +84,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js index a823047fc0d4e..7a7791280ad87 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -131,21 +131,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js index b60cf2014f1e8..19d66ce8d461d 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -64,21 +64,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js index 434af36123e8f..1c53de5d26e7e 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -64,21 +64,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js index 9776d14612eb8..c42e36389ca59 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -67,21 +67,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index e89e9d9345bc8..161eb36dbcf73 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -99,8 +99,9 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this, 1, 2); - _super.apply(this, [1, 2].concat(a)); + var _this = _super.call(this, 1, 2) || this; + _this = _super.apply(this, [1, 2].concat(a)) || this; + return _this; } D.prototype.foo = function () { _super.prototype.foo.call(this, 1, 2); diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index 791b6f4c97956..2c4df5db96151 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -22,8 +22,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = this; - _super.call(this, { test: function () { return _this.someMethod(); } }); + return _super.call(this, { test: function () { return _this.someMethod(); } }) || this; } B.prototype.someMethod = function () { }; return B; diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js index bcff0938157c0..f0178dcbbf0b2 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -59,7 +59,7 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(A)); @@ -67,7 +67,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return F; }(A)); diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js index b4b6330a7cf76..3857867043c90 100644 --- a/tests/baselines/reference/chainedAssignment3.js +++ b/tests/baselines/reference/chainedAssignment3.js @@ -36,7 +36,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index c53910e00acad..26d341e1f6a7e 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -42,14 +42,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index cdc19a5688de4..ade99e9319b39 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -49,14 +49,14 @@ var Foo; var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.call(this); + return _super.call(this) || this; } return Bar; }(Foo.Object)); var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - _super.call(this); + return _super.call(this) || this; } return Baz; }(Object)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js index cfb5726dac1f1..8ced6fce50092 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js @@ -24,10 +24,11 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this); - this; - this.x = 10; - var that = this; + var _this = _super.call(this) || this; + _this; + _this.x = 10; + var that = _this; + return _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js index afbc15cf912a9..95b34f27b68c7 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js @@ -24,10 +24,12 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - this.x = 100; - _super.call(this); - this.x = 10; - var that = this; + var _this; + _this.x = 100; + _this = _super.call(this) || this; + _this.x = 10; + var that = _this; + return _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js index 7e9c23c1f8337..0e882f71fdb1d 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js @@ -29,15 +29,17 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { + var _this; var innver = (function () { function innver() { this.y = true; } return innver; }()); - _super.call(this); - this.x = 10; - var that = this; + _this = _super.call(this) || this; + _this.x = 10; + var that = _this; + return _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js index 1257b446ccbaa..00f2ed22fbf7b 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js @@ -33,7 +33,7 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = this; + var _this; (function () { _this; // No error }); @@ -43,10 +43,11 @@ var Derived = (function (_super) { (function () { _this; // No error })(); - _super.call(this); - _super.call(this); - this.x = 10; - var that = this; + _this = _super.call(this) || this; + _this = _super.call(this) || this; + _this.x = 10; + var that = _this; + return _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js index 1889ee998ca91..8c7f18b77f617 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -25,7 +25,7 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this, this.x); + return _super.call(this, this.x) || this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js index 39db4dec17467..cc8912230ab51 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js @@ -28,9 +28,10 @@ var Base = (function () { var Super = (function (_super) { __extends(Super, _super); function Super() { - var _this = this; + var _this; (function () { return _this; }); // No Error - _super.call(this); + _this = _super.call(this) || this; + return _this; } return Super; }(Base)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js index d071c05db5d4e..ca12c16e047ad 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js @@ -23,8 +23,7 @@ var Base = (function () { var Super = (function (_super) { __extends(Super, _super); function Super() { - var _this = this; - _super.call(this, (function () { return _this; })); // No error + return _super.call(this, (function () { return _this; })) || this; } return Super; }(Base)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js index f334cc7f42b86..25a480b9b57e8 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js @@ -28,8 +28,10 @@ var Base = (function () { var Super = (function (_super) { __extends(Super, _super); function Super() { - var that = this; - _super.call(this); + var _this; + var that = _this; + _this = _super.call(this) || this; + return _this; } return Super; }(Base)); diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js index 19c156176bfbd..6fe5e604e57d3 100644 --- a/tests/baselines/reference/circularImportAlias.js +++ b/tests/baselines/reference/circularImportAlias.js @@ -32,7 +32,7 @@ var B; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(B.a.C)); diff --git a/tests/baselines/reference/circularTypeofWithFunctionModule.js b/tests/baselines/reference/circularTypeofWithFunctionModule.js index 6ce1dd62fc5d7..78e9d3f34e7f4 100644 --- a/tests/baselines/reference/circularTypeofWithFunctionModule.js +++ b/tests/baselines/reference/circularTypeofWithFunctionModule.js @@ -32,7 +32,7 @@ var maker; var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); diff --git a/tests/baselines/reference/classAbstractConstructorAssignability.js b/tests/baselines/reference/classAbstractConstructorAssignability.js index 5695e6c79d3cb..35d9e75884fe0 100644 --- a/tests/baselines/reference/classAbstractConstructorAssignability.js +++ b/tests/baselines/reference/classAbstractConstructorAssignability.js @@ -28,14 +28,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/classAbstractCrashedOnce.js b/tests/baselines/reference/classAbstractCrashedOnce.js index 46f0a8938c417..fe23e60c94faa 100644 --- a/tests/baselines/reference/classAbstractCrashedOnce.js +++ b/tests/baselines/reference/classAbstractCrashedOnce.js @@ -24,7 +24,7 @@ var foo = (function () { var bar = (function (_super) { __extends(bar, _super); function bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } bar.prototype.test = function () { this. diff --git a/tests/baselines/reference/classAbstractExtends.js b/tests/baselines/reference/classAbstractExtends.js index 8d7128cc03d30..e899cb82d6d73 100644 --- a/tests/baselines/reference/classAbstractExtends.js +++ b/tests/baselines/reference/classAbstractExtends.js @@ -31,28 +31,28 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(B)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.bar = function () { }; return E; diff --git a/tests/baselines/reference/classAbstractFactoryFunction.js b/tests/baselines/reference/classAbstractFactoryFunction.js index d5b0417f99596..50e232a9fcac7 100644 --- a/tests/baselines/reference/classAbstractFactoryFunction.js +++ b/tests/baselines/reference/classAbstractFactoryFunction.js @@ -31,7 +31,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classAbstractGeneric.js b/tests/baselines/reference/classAbstractGeneric.js index c9409e9746687..96df8f5f19edd 100644 --- a/tests/baselines/reference/classAbstractGeneric.js +++ b/tests/baselines/reference/classAbstractGeneric.js @@ -39,28 +39,28 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); // error -- inherits abstract methods var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(A)); // error -- inherits abstract methods var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.foo = function () { return this.t; }; return E; @@ -68,7 +68,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } F.prototype.bar = function (t) { }; return F; @@ -76,7 +76,7 @@ var F = (function (_super) { var G = (function (_super) { __extends(G, _super); function G() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } G.prototype.foo = function () { return this.t; }; G.prototype.bar = function (t) { }; diff --git a/tests/baselines/reference/classAbstractInAModule.js b/tests/baselines/reference/classAbstractInAModule.js index 17fbf568601b9..c6a9e206bcc72 100644 --- a/tests/baselines/reference/classAbstractInAModule.js +++ b/tests/baselines/reference/classAbstractInAModule.js @@ -24,7 +24,7 @@ var M; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classAbstractInheritance.js b/tests/baselines/reference/classAbstractInheritance.js index 4d5c804e55784..297a80dd99c3d 100644 --- a/tests/baselines/reference/classAbstractInheritance.js +++ b/tests/baselines/reference/classAbstractInheritance.js @@ -35,14 +35,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); @@ -54,42 +54,42 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return BB; }(AA)); var CC = (function (_super) { __extends(CC, _super); function CC() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return CC; }(AA)); var DD = (function (_super) { __extends(DD, _super); function DD() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return DD; }(BB)); var EE = (function (_super) { __extends(EE, _super); function EE() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return EE; }(BB)); var FF = (function (_super) { __extends(FF, _super); function FF() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return FF; }(CC)); var GG = (function (_super) { __extends(GG, _super); function GG() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return GG; }(CC)); diff --git a/tests/baselines/reference/classAbstractInstantiations1.js b/tests/baselines/reference/classAbstractInstantiations1.js index 0263e9e97b36c..5abbb9c1baa6f 100644 --- a/tests/baselines/reference/classAbstractInstantiations1.js +++ b/tests/baselines/reference/classAbstractInstantiations1.js @@ -41,14 +41,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/classAbstractInstantiations2.js b/tests/baselines/reference/classAbstractInstantiations2.js index 379e0b18cccde..dea4c744ae0a4 100644 --- a/tests/baselines/reference/classAbstractInstantiations2.js +++ b/tests/baselines/reference/classAbstractInstantiations2.js @@ -82,21 +82,21 @@ new x; // okay -- undefined behavior at runtime var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); // error -- not declared abstract var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(B)); // okay var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.bar = function () { return 1; }; return E; @@ -104,7 +104,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } F.prototype.bar = function () { return 2; }; return F; diff --git a/tests/baselines/reference/classAbstractOverrideWithAbstract.js b/tests/baselines/reference/classAbstractOverrideWithAbstract.js index d613dd1fe31f5..4ecebdf7b32f0 100644 --- a/tests/baselines/reference/classAbstractOverrideWithAbstract.js +++ b/tests/baselines/reference/classAbstractOverrideWithAbstract.js @@ -38,7 +38,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -51,7 +51,7 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } BB.prototype.bar = function () { }; return BB; @@ -59,14 +59,14 @@ var BB = (function (_super) { var CC = (function (_super) { __extends(CC, _super); function CC() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return CC; }(BB)); // error var DD = (function (_super) { __extends(DD, _super); function DD() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } DD.prototype.foo = function () { }; return DD; diff --git a/tests/baselines/reference/classAbstractSuperCalls.js b/tests/baselines/reference/classAbstractSuperCalls.js index 7ada903974cb8..0197f48a429d2 100644 --- a/tests/baselines/reference/classAbstractSuperCalls.js +++ b/tests/baselines/reference/classAbstractSuperCalls.js @@ -42,7 +42,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { _super.prototype.foo.call(this); }; B.prototype.baz = function () { return this.foo; }; @@ -51,7 +51,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.foo = function () { return 2; }; C.prototype.qux = function () { return _super.prototype.foo.call(this) || _super.prototype.foo; }; // 2 errors, foo is abstract @@ -68,7 +68,7 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return BB; }(AA)); diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js index 457195f5449aa..74b5d62aaf532 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js @@ -31,7 +31,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.foo = function () { return 1; }; return B; @@ -39,7 +39,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js index dc025b11ddec1..25cf1a307c7a3 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js @@ -41,21 +41,21 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.foo = function () { }; return D; @@ -63,7 +63,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.foo = function () { }; return E; @@ -76,21 +76,21 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return BB; }(AA)); var CC = (function (_super) { __extends(CC, _super); function CC() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return CC; }(AA)); var DD = (function (_super) { __extends(DD, _super); function DD() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } DD.prototype.foo = function () { }; return DD; diff --git a/tests/baselines/reference/classConstructorAccessibility2.js b/tests/baselines/reference/classConstructorAccessibility2.js index 03b7af3e716c1..ef637611e8de8 100644 --- a/tests/baselines/reference/classConstructorAccessibility2.js +++ b/tests/baselines/reference/classConstructorAccessibility2.js @@ -77,8 +77,9 @@ var BaseC = (function () { var DerivedA = (function (_super) { __extends(DerivedA, _super); function DerivedA(x) { - _super.call(this, x); - this.x = x; + var _this = _super.call(this, x) || this; + _this.x = x; + return _this; } DerivedA.prototype.createInstance = function () { new DerivedA(5); }; DerivedA.prototype.createBaseInstance = function () { new BaseA(6); }; @@ -88,8 +89,9 @@ var DerivedA = (function (_super) { var DerivedB = (function (_super) { __extends(DerivedB, _super); function DerivedB(x) { - _super.call(this, x); - this.x = x; + var _this = _super.call(this, x) || this; + _this.x = x; + return _this; } DerivedB.prototype.createInstance = function () { new DerivedB(7); }; DerivedB.prototype.createBaseInstance = function () { new BaseB(8); }; // ok @@ -99,8 +101,9 @@ var DerivedB = (function (_super) { var DerivedC = (function (_super) { __extends(DerivedC, _super); function DerivedC(x) { - _super.call(this, x); - this.x = x; + var _this = _super.call(this, x) || this; + _this.x = x; + return _this; } DerivedC.prototype.createInstance = function () { new DerivedC(9); }; DerivedC.prototype.createBaseInstance = function () { new BaseC(10); }; // error diff --git a/tests/baselines/reference/classConstructorAccessibility4.js b/tests/baselines/reference/classConstructorAccessibility4.js index 6342facae21fa..4772ac68d119f 100644 --- a/tests/baselines/reference/classConstructorAccessibility4.js +++ b/tests/baselines/reference/classConstructorAccessibility4.js @@ -51,7 +51,7 @@ var A = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); @@ -73,7 +73,7 @@ var D = (function () { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return F; }(D)); diff --git a/tests/baselines/reference/classConstructorAccessibility5.js b/tests/baselines/reference/classConstructorAccessibility5.js index ec9e9f83a8e41..d658349c2a59c 100644 --- a/tests/baselines/reference/classConstructorAccessibility5.js +++ b/tests/baselines/reference/classConstructorAccessibility5.js @@ -25,7 +25,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.make = function () { new Base(); }; // ok return Derived; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index c31fd8bf9dd15..e0e75bcfeeb53 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -59,8 +59,9 @@ c3.p; // protected, error var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - _super.call(this, p); - this.p; // OK + var _this = _super.call(this, p) || this; + _this.p; // OK + return _this; } return Derived; }(C3)); diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 7f52a6a581fc2..84da66c3e3c9c 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -59,8 +59,9 @@ c3.p; // protected, error var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - _super.call(this, p); - this.p; // OK + var _this = _super.call(this, p) || this; + _this.p; // OK + return _this; } return Derived; }(C3)); diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index 0da9449a3a71f..db9f94cf0fbf7 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -28,9 +28,10 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - _super.call(this, p); - this.p = p; - this.p; // OK + var _this = _super.call(this, p) || this; + _this.p = p; + _this.p; // OK + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index 7ab6cb2cecaf4..c1ecad3a7925d 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -35,7 +35,7 @@ var M; var O = (function (_super) { __extends(O, _super); function O() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return O; }(M.N)); diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js index 5a455edc082a7..076412e164dba 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -31,7 +31,7 @@ var StringTreeCollectionBase = (function () { var StringTreeCollection = (function (_super) { __extends(StringTreeCollection, _super); function StringTreeCollection() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return StringTreeCollection; }(StringTreeCollectionBase)); diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js index ed9497c8729c0..59b62c60cfe29 100644 --- a/tests/baselines/reference/classExpression2.js +++ b/tests/baselines/reference/classExpression2.js @@ -16,7 +16,7 @@ var D = (function () { var v = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(D)); diff --git a/tests/baselines/reference/classExpression3.js b/tests/baselines/reference/classExpression3.js index 508dc039387e9..c0376c54c27af 100644 --- a/tests/baselines/reference/classExpression3.js +++ b/tests/baselines/reference/classExpression3.js @@ -15,15 +15,17 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(class_1, _super); function class_1() { - _super.apply(this, arguments); - this.c = 3; + var _this = _super.apply(this, arguments) || this; + _this.c = 3; + return _this; } return class_1; }((function (_super) { __extends(class_2, _super); function class_2() { - _super.apply(this, arguments); - this.b = 2; + var _this = _super.apply(this, arguments) || this; + _this.b = 2; + return _this; } return class_2; }((function () { diff --git a/tests/baselines/reference/classExpressionExtendingAbstractClass.js b/tests/baselines/reference/classExpressionExtendingAbstractClass.js index c4da02cb3219d..7312ab6567dcb 100644 --- a/tests/baselines/reference/classExpressionExtendingAbstractClass.js +++ b/tests/baselines/reference/classExpressionExtendingAbstractClass.js @@ -22,7 +22,7 @@ var A = (function () { var C = (function (_super) { __extends(class_1, _super); function class_1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class_1; }(A)); diff --git a/tests/baselines/reference/classExtendingBuiltinType.js b/tests/baselines/reference/classExtendingBuiltinType.js index ace4cf19feef9..4c95e3008eaf9 100644 --- a/tests/baselines/reference/classExtendingBuiltinType.js +++ b/tests/baselines/reference/classExtendingBuiltinType.js @@ -20,70 +20,70 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C1; }(Object)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(Function)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C3; }(String)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C4; }(Boolean)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C5; }(Number)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C6; }(Date)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C7; }(RegExp)); var C8 = (function (_super) { __extends(C8, _super); function C8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C8; }(Error)); var C9 = (function (_super) { __extends(C9, _super); function C9() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C9; }(Array)); var C10 = (function (_super) { __extends(C10, _super); function C10() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C10; }(Array)); diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index 8073271b5eac1..91e3752980cd9 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -47,7 +47,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -66,7 +66,7 @@ var C2 = (function () { var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(C2)); diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index a41bb14451aad..bfc10c2356394 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -68,35 +68,38 @@ var __extends = (this && this.__extends) || function (d, b) { var D0 = (function (_super) { __extends(D0, _super); function D0() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D0; }(Base)); var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.call(this, "abc", "def"); - this.x = "x"; - this.y = "y"; + var _this = _super.call(this, "abc", "def") || this; + _this.x = "x"; + _this.y = "y"; + return _this; } return D1; }(getBase())); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.call(this, 10); - _super.call(this, 10, 20); - this.x = 1; - this.y = 2; + var _this = _super.call(this, 10) || this; + _this = _super.call(this, 10, 20) || this; + _this.x = 1; + _this.y = 2; + return _this; } return D2; }(getBase())); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.call(this, "abc", 42); - this.x = "x"; - this.y = 2; + var _this = _super.call(this, "abc", 42) || this; + _this.x = "x"; + _this.y = 2; + return _this; } return D3; }(getBase())); @@ -104,7 +107,7 @@ var D3 = (function (_super) { var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D4; }(getBase())); @@ -112,7 +115,7 @@ var D4 = (function (_super) { var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D5; }(getBadBase())); diff --git a/tests/baselines/reference/classExtendingNonConstructor.js b/tests/baselines/reference/classExtendingNonConstructor.js index c46e3c5ddbe85..574d50044860e 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.js +++ b/tests/baselines/reference/classExtendingNonConstructor.js @@ -27,49 +27,49 @@ function foo() { var C1 = (function (_super) { __extends(C1, _super); function C1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C1; }(undefined)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(true)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C3; }(false)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C4; }(42)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C5; }("hello")); var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C6; }(x)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C7; }(foo)); diff --git a/tests/baselines/reference/classExtendingNull.js b/tests/baselines/reference/classExtendingNull.js index fa6f0357b0dc1..8d5d73329aa3e 100644 --- a/tests/baselines/reference/classExtendingNull.js +++ b/tests/baselines/reference/classExtendingNull.js @@ -12,14 +12,14 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C1; }(null)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }((null))); diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index 8ecad9c24a57c..53cb45c208187 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -24,28 +24,28 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(number)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(string)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C3; }(boolean)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C4; }(Void)); @@ -58,28 +58,28 @@ void {}; var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C5; }(Null)); var C5a = (function (_super) { __extends(C5a, _super); function C5a() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C5a; }(null)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C6; }(undefined)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C7; }(Undefined)); @@ -90,7 +90,7 @@ var E; var C8 = (function (_super) { __extends(C8, _super); function C8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C8; }(E)); diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index af76697796741..b32dc31a5b400 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -20,7 +20,7 @@ void {}; var C5a = (function (_super) { __extends(C5a, _super); function C5a() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C5a; }(null)); diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js index 17d888834ec10..fced8c2a37322 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.js +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -23,7 +23,7 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(M.C)); diff --git a/tests/baselines/reference/classExtendingQualifiedName2.js b/tests/baselines/reference/classExtendingQualifiedName2.js index 4f1d872e75339..c133ceb87dc54 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.js +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -24,7 +24,7 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(M.C)); diff --git a/tests/baselines/reference/classExtendsAcrossFiles.js b/tests/baselines/reference/classExtendsAcrossFiles.js index 0805389f2684e..5be0ab8f9c0a3 100644 --- a/tests/baselines/reference/classExtendsAcrossFiles.js +++ b/tests/baselines/reference/classExtendsAcrossFiles.js @@ -37,7 +37,7 @@ exports.b = { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -62,7 +62,7 @@ exports.a = { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index 80b4b7c175d56..cc4870e837b43 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -33,7 +33,7 @@ var Foo; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js index 4c593761f0099..6c3dc7894452d 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -23,7 +23,7 @@ var Foo; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index 8b4663ad2cb31..a19f5d5cdd682 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -25,14 +25,14 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(I)); // error var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }({ foo: string })); // error @@ -40,7 +40,7 @@ var x; var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C3; }(x)); // error @@ -51,7 +51,7 @@ var M; var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C4; }(M)); // error @@ -59,14 +59,14 @@ function foo() { } var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C5; }(foo)); // error var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C6; }([])); // error diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index 6aceb0ffebf2a..fbc364ca5dad2 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -12,14 +12,14 @@ var __extends = (this && this.__extends) || function (d, b) { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }({ foo: string })); // error var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C6; }([])); // error diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js index b324f7382d820..b59462243172c 100644 --- a/tests/baselines/reference/classExtendsInterface.js +++ b/tests/baselines/reference/classExtendsInterface.js @@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A; }(Comparable)); @@ -29,7 +29,7 @@ var B = (function () { var A2 = (function (_super) { __extends(A2, _super); function A2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A2; }(Comparable2)); diff --git a/tests/baselines/reference/classExtendsInterfaceInExpression.js b/tests/baselines/reference/classExtendsInterfaceInExpression.js index 69e63f925707c..9dcd8dd727988 100644 --- a/tests/baselines/reference/classExtendsInterfaceInExpression.js +++ b/tests/baselines/reference/classExtendsInterfaceInExpression.js @@ -20,7 +20,7 @@ function factory(a) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(factory(A))); diff --git a/tests/baselines/reference/classExtendsInterfaceInModule.js b/tests/baselines/reference/classExtendsInterfaceInModule.js index 454154887003f..9da8831a1389f 100644 --- a/tests/baselines/reference/classExtendsInterfaceInModule.js +++ b/tests/baselines/reference/classExtendsInterfaceInModule.js @@ -24,21 +24,21 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C1; }(M.I1)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(M.I2)); var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(Mod.Nested.I)); diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js index 279d0ad6899da..36f2263d671ee 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -14,21 +14,21 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(C)); // error var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(D)); // error var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(E)); // error diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js index f8ea40ee69ccc..0f3f48d2f2c18 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -20,42 +20,42 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(E)); // error var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(D)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(E2)); // error var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(C2)); var E2 = (function (_super) { __extends(E2, _super); function E2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E2; }(D2)); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index 269edb851e9fd..e215a07c3571e 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(N.E)); // error @@ -40,7 +40,7 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -51,7 +51,7 @@ var N; var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(M.D)); @@ -62,7 +62,7 @@ var O; var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(Q.E2)); // error @@ -71,7 +71,7 @@ var O; var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(C2)); @@ -82,7 +82,7 @@ var O; var E2 = (function (_super) { __extends(E2, _super); function E2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E2; }(P.D2)); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js index 2d2cf938156fb..f8366d77e1349 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -27,7 +27,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(E)); // error @@ -40,7 +40,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -53,7 +53,7 @@ var __extends = (this && this.__extends) || function (d, b) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(D)); @@ -66,7 +66,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(E2)); // error @@ -79,7 +79,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(C2)); @@ -92,7 +92,7 @@ var __extends = (this && this.__extends) || function (d, b) { var E2 = (function (_super) { __extends(E2, _super); function E2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E2; }(D2)); diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.js b/tests/baselines/reference/classExtendsMultipleBaseClasses.js index 61db0a41a5ca2..cd9c28ad28319 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.js +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.js @@ -22,7 +22,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/classExtendsNull.js b/tests/baselines/reference/classExtendsNull.js index afb2be21c686f..1eeb5172caddb 100644 --- a/tests/baselines/reference/classExtendsNull.js +++ b/tests/baselines/reference/classExtendsNull.js @@ -21,7 +21,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.call(this); + var _this = _super.call(this) || this; return Object.create(null); } return C; @@ -29,6 +29,7 @@ var C = (function (_super) { var D = (function (_super) { __extends(D, _super); function D() { + var _this; return Object.create(null); } return D; diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js index ae2f73cadc182..ddaadc2dc628a 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -25,7 +25,7 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index 00cd35693f132..31bff6e430c4d 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -16,7 +16,7 @@ var x = new foo(); // can be used as a constructor function var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(foo)); // error, cannot extend it though diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.js b/tests/baselines/reference/classHeritageWithTrailingSeparator.js index 7f85e4e25d731..12265f569bd56 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.js +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.js @@ -17,7 +17,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index 09cdd5c779bb2..5e3eae465438c 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -33,7 +33,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C2.prototype.foo = function () { return 1; diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js index b47514b1286be..5fd003e93b908 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -37,7 +37,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index 32ae1ef3e8824..477288972df22 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -40,7 +40,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index 923ac9c98299d..0ec258ab77bf3 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -42,7 +42,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index a807590749ef5..0771c56415cc9 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -47,7 +47,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js index 39fb844613e93..2e55c89464526 100644 --- a/tests/baselines/reference/classIndexer3.js +++ b/tests/baselines/reference/classIndexer3.js @@ -24,7 +24,7 @@ var C123 = (function () { var D123 = (function (_super) { __extends(D123, _super); function D123() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D123; }(C123)); diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js index e6e7a1eaf427b..f68d76fad47f1 100644 --- a/tests/baselines/reference/classInheritence.js +++ b/tests/baselines/reference/classInheritence.js @@ -11,14 +11,14 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A; }(A)); diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js index b51488dbe1e2d..52300987d8ebd 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.js +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -29,14 +29,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index ec49320b4be5c..63490fa29b174 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -28,7 +28,7 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } A.prototype.foo = function () { this.bar(); }; return A; diff --git a/tests/baselines/reference/classOrderBug.js b/tests/baselines/reference/classOrderBug.js index d937197fad534..e21a5ed64cff7 100644 --- a/tests/baselines/reference/classOrderBug.js +++ b/tests/baselines/reference/classOrderBug.js @@ -35,7 +35,7 @@ var baz = (function () { var foo = (function (_super) { __extends(foo, _super); function foo() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return foo; }(baz)); diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index 0e3897a4f466c..9443509032cb1 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -33,7 +33,7 @@ var A = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index 72fd4af1eedac..67ee666749b75 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -29,7 +29,7 @@ var __extends = (this && this.__extends) || function (d, b) { var SubText = (function (_super) { __extends(SubText, _super); function SubText(text, span) { - _super.call(this); + return _super.call(this) || this; } return SubText; }(TextBase)); diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index b708489c518fb..589dd81c5c693 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -33,15 +33,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x, data) { - _super.call(this, x); - this.data = data; + var _this = _super.call(this, x) || this; + _this.data = data; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C(x) { - _super.call(this, x); + return _super.call(this, x) || this; } return C; }(A)); diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 581575d0d468b..53ef71d0e4be7 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -157,69 +157,79 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); - this.p1 = 0; + var _this = _super.apply(this, arguments) || this; + _this.p1 = 0; + return _this; } return E; }(D)); var F = (function (_super) { __extends(F, _super); function F() { + var _this; + return _this; } // ERROR - super call required return F; }(E)); var G = (function (_super) { __extends(G, _super); function G() { - _super.call(this); - this.p1 = 0; + var _this = _super.call(this) || this; + _this.p1 = 0; + return _this; } // NO ERROR return G; }(D)); var H = (function () { function H() { - _super.call(this); + _this = _super.call(this) || this; } // ERROR - no super call allowed return H; }()); var I = (function (_super) { __extends(I, _super); function I() { - _super.call(this); + return _super.call(this) || this; } // ERROR - no super call allowed return I; }(Object)); var J = (function (_super) { __extends(J, _super); function J(p1) { - _super.call(this); // NO ERROR - this.p1 = p1; + var _this = _super.call(this) || this; + _this.p1 = p1; + return _this; } return J; }(G)); var K = (function (_super) { __extends(K, _super); function K(p1) { - this.p1 = p1; + var _this; + _this.p1 = p1; var i = 0; - _super.call(this); + _this = _super.call(this) || this; + return _this; } return K; }(G)); var L = (function (_super) { __extends(L, _super); function L(p1) { - _super.call(this); // NO ERROR - this.p1 = p1; + var _this = _super.call(this) || this; + _this.p1 = p1; + return _this; } return L; }(G)); var M = (function (_super) { __extends(M, _super); function M(p1) { - this.p1 = p1; + var _this; + _this.p1 = p1; var i = 0; - _super.call(this); + _this = _super.call(this) || this; + return _this; } return M; }(G)); diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index e94a47005068c..c25687d3c74cd 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -54,7 +54,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(Base)); @@ -69,7 +69,7 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(Base2)); @@ -80,7 +80,7 @@ var d2 = new D(1); // ok var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(Base2)); @@ -90,7 +90,7 @@ var d4 = new D(1); // ok var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D3; }(Base2)); diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index 04dcfa2325c20..f445d22d18f88 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -75,7 +75,7 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C2)); @@ -103,7 +103,7 @@ var Generics; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C2)); diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index 2b2e01e59df10..2cb8a4e0a50ad 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -48,7 +48,7 @@ C.g = function () { return ''; }; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.method = function () { // No errors diff --git a/tests/baselines/reference/classWithStaticMembers.js b/tests/baselines/reference/classWithStaticMembers.js index 327adead6b89e..9e79780d5cc6a 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -45,7 +45,7 @@ var r3 = r.foo; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/classdecl.js b/tests/baselines/reference/classdecl.js index a8a440fa17d2a..a3059757d2fba 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -136,7 +136,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); @@ -161,7 +161,7 @@ var m2; var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return c; }(b)); @@ -177,7 +177,7 @@ var m2; var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return c; }(m1.b)); diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index 7e6f26ad59103..f65295627f13f 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -44,7 +44,7 @@ var Shape; var Path = (function (_super) { __extends(Path, _super); function Path() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Path; }(Shape)); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js index fc64a8012eeb9..85c0e398fbd0f 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js @@ -68,7 +68,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(b.prototype, "prop2", { get: function () { @@ -88,7 +88,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(c.prototype, "prop2", { get: function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index b6e7cb121d67e..d4a22b731f2cf 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -42,20 +42,22 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.call(this); + var _this = _super.call(this) || this; function _super() { } + return _this; } return b; }(Foo)); var c = (function (_super) { __extends(c, _super); function c() { - _super.call(this); + var _this = _super.call(this) || this; var x = function () { function _super() { } }; + return _this; } return c; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js index 14b8bf4669706..81c069da169d9 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -50,7 +50,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.prototype.foo = function () { function _super() { @@ -63,7 +63,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } c.prototype.foo = function () { var x = function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index 2af7a6a870e8c..67b7f0e399197 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -40,13 +40,14 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); - this.prop2 = { + var _this = _super.apply(this, arguments) || this; + _this.prop2 = { doStuff: function () { function _super() { } } }; + return _this; } return b; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js index 6887a22ae204d..26f782c0d17aa 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js @@ -58,7 +58,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(b.prototype, "prop2", { get: function () { @@ -76,7 +76,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(c.prototype, "prop2", { get: function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index d3b5e7a20306f..e3069352c0865 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -36,18 +36,20 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.call(this); + var _this = _super.call(this) || this; var _super = 10; // Should be error + return _this; } return b; }(Foo)); var c = (function (_super) { __extends(c, _super); function c() { - _super.call(this); + var _this = _super.call(this) || this; var x = function () { var _super = 10; // Should be error }; + return _this; } return c; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index 4553608756df1..0524d993ba1b0 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -36,7 +36,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.prototype.foo = function () { var _super = 10; // Should be error @@ -46,7 +46,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } c.prototype.foo = function () { var x = function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index df5d812cf54d9..d793e022c6b74 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -38,13 +38,14 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); - this.prop2 = { + var _this = _super.apply(this, arguments) || this; + _this.prop2 = { doStuff: function () { var _super = 10; // Should be error } }; - this._super = 10; // No error + _this._super = 10; // No error + return _this; } return b; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index 2db90d8b02663..cb5636ec904b2 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -27,7 +27,7 @@ var base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Foo.prototype.x = function () { console.log(_super); // Error as this doesnt not resolve to user defined _super diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index 29b5ad3b496ee..f5765043c5502 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -94,11 +94,12 @@ var Foo = (function () { var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2(_super) { - _super.call(this); - this.prop4 = { + var _this = _super.call(this) || this; + _this.prop4 = { doStuff: function (_super) { } }; + return _this; } Foo2.prototype.x = function () { var _this = this; @@ -123,7 +124,7 @@ var Foo2 = (function (_super) { var Foo4 = (function (_super) { __extends(Foo4, _super); function Foo4(_super) { - _super.call(this); + return _super.call(this) || this; } Foo4.prototype.y = function (_super) { var _this = this; diff --git a/tests/baselines/reference/collisionSuperAndParameter1.js b/tests/baselines/reference/collisionSuperAndParameter1.js index 517c126ab449f..ed19500f9d4d8 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.js +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -23,7 +23,7 @@ var Foo = (function () { var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Foo2.prototype.x = function () { var lambda = function (_super) { diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index f94a9fde5f252..5fa7fe290914e 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -44,30 +44,32 @@ var a = (function () { var b1 = (function (_super) { __extends(b1, _super); function b1(_super) { - _super.call(this); + return _super.call(this) || this; } return b1; }(a)); var b2 = (function (_super) { __extends(b2, _super); function b2(_super) { - _super.call(this); - this._super = _super; + var _this = _super.call(this) || this; + _this._super = _super; + return _this; } return b2; }(a)); var b3 = (function (_super) { __extends(b3, _super); function b3(_super) { - _super.call(this); + return _super.call(this) || this; } return b3; }(a)); var b4 = (function (_super) { __extends(b4, _super); function b4(_super) { - _super.call(this); - this._super = _super; + var _this = _super.call(this) || this; + _this._super = _super; + return _this; } return b4; }(a)); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index c71b0dcf1ddff..9e8132c68838f 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -34,7 +34,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.prototype.foo = function () { var _this = this; @@ -46,7 +46,7 @@ var b = (function (_super) { var b2 = (function (_super) { __extends(b2, _super); function b2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b2.prototype.foo = function () { var _this = this; diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index 42df3cca3893b..3527f5d23bb6f 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -227,7 +227,7 @@ var c2 = (function () { var c3 = (function (_super) { __extends(c3, _super); function c3() { - _super.call(this, 10); + return _super.call(this, 10) || this; } /** c3 f1*/ c3.prototype.f1 = function () { @@ -258,7 +258,7 @@ c2_i = c3_i; var c4 = (function (_super) { __extends(c4, _super); function c4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return c4; }(c2)); diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js index 0de25c1501337..a263a30e38285 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -227,14 +227,14 @@ var Base = (function () { var A2 = (function (_super) { __extends(A2, _super); function A2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A2; }(Base)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js index 4185af60dbc9f..b8584522b7baf 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -182,7 +182,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js index 90c67439773a7..93e1e876a7fd4 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -182,7 +182,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js index 736b57e08bacc..a8973bf2c1098 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -125,7 +125,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js index ca7eea70ad651..4539538782d77 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -163,7 +163,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js index c64e33827c58e..5e8412bc3610a 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -163,7 +163,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js index dc7a12eecdc94..d30c3586b12c3 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -273,7 +273,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js index d4be6df98dd05..4235c1352d480 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -235,7 +235,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js index ee5ad2fbd076c..9a6fecd668d21 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -121,7 +121,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js index 79e4bfd0bbfcb..5721a4524864c 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -178,7 +178,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js index 31c0dd3c7c557..b6bf8a16e614e 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -178,7 +178,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js index 5decd7a21fb09..690214fc00fa6 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -92,7 +92,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -114,7 +114,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A2)); diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js index 46974055171c9..4f48e5fc2c5d2 100644 --- a/tests/baselines/reference/complexClassRelationships.js +++ b/tests/baselines/reference/complexClassRelationships.js @@ -57,7 +57,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.createEmpty = function () { var item = new Derived(); diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js index 3d885d3eef12c..326c0830c4fe8 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || function (d, b) { var S18 = (function (_super) { __extends(S18, _super); function S18() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return S18; }(S18)); diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index a55c068d4a422..bfea11911bf88 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -197,9 +197,10 @@ value; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this); + var _this = _super.call(this) || this; _super.prototype. *= value; _super.prototype. += value; + return _this; } Derived.prototype.foo = function () { _super.prototype. *= value; diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js index 16500b823b8f6..c8fb8c6a22221 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -139,9 +139,10 @@ _a = Math.pow(['', ''], value), '' = _a[0], '' = _a[1]; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this); + var _this = _super.call(this) || this; (_a = _super.prototype). = Math.pow(_a., value); var _a; + return _this; } Derived.prototype.foo = function () { (_a = _super.prototype). = Math.pow(_a., value); diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.js b/tests/baselines/reference/computedPropertyNames24_ES5.js index 24cfe77d93cdf..ff9112755bd53 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.js +++ b/tests/baselines/reference/computedPropertyNames24_ES5.js @@ -25,7 +25,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype[_super.bar.call(this)] = function () { }; return C; diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index b03dd285ced24..dad9c5c291aeb 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -30,7 +30,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.foo = function () { var obj = (_a = {}, diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.js b/tests/baselines/reference/computedPropertyNames26_ES5.js index 41a20ac6477f3..5db7768270a6f 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -27,7 +27,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype[(_a = {}, _a[_super.bar.call(this)] = 1, _a)[0]] = function () { }; return C; diff --git a/tests/baselines/reference/computedPropertyNames27_ES5.js b/tests/baselines/reference/computedPropertyNames27_ES5.js index bdef47165b19f..381805659e271 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.js +++ b/tests/baselines/reference/computedPropertyNames27_ES5.js @@ -19,8 +19,8 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } - C.prototype[(_super.call(this), "prop")] = function () { }; + C.prototype[(_this = _super.call(this) || this, "prop")] = function () { }; return C; }(Base)); diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index ed15bbf0145cf..ab765c56dd75f 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -24,10 +24,11 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.call(this); + var _this = _super.call(this) || this; var obj = (_a = {}, - _a[(_super.call(this), "prop")] = function () { }, + _a[(_this = _super.call(this) || this, "prop")] = function () { }, _a); + return _this; var _a; } return C; diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index a900fd44c677e..c2c7cddd97170 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -29,16 +29,17 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.call(this); + var _this = _super.call(this) || this; (function () { var obj = (_a = {}, // Ideally, we would capture this. But the reference is // illegal, and not capturing this is consistent with //treatment of other similar violations. - _a[(_super.call(this), "prop")] = function () { }, + _a[(_this = _super.call(this) || this, "prop")] = function () { }, _a); var _a; }); + return _this; } return C; }(Base)); diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index 2e38e2a131f14..00cc765f4cc61 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -32,7 +32,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.foo = function () { var _this = this; diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.js b/tests/baselines/reference/computedPropertyNames43_ES5.js index c79a4d8d6d10a..b1bb0fec72c22 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -36,7 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(D.prototype, "get1", { // Computed properties diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.js b/tests/baselines/reference/computedPropertyNames44_ES5.js index 78e20a7d6a3d4..bf940f15014a4 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.js +++ b/tests/baselines/reference/computedPropertyNames44_ES5.js @@ -40,7 +40,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(D.prototype, "set1", { set: function (p) { }, diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.js b/tests/baselines/reference/computedPropertyNames45_ES5.js index 9c7482a471393..5b5d64f9bf024 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.js +++ b/tests/baselines/reference/computedPropertyNames45_ES5.js @@ -41,7 +41,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(D.prototype, "set1", { set: function (p) { }, diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js index 3514965f1cebc..408571af42aab 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -63,7 +63,7 @@ var X = (function () { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A; }(X)); @@ -71,7 +71,7 @@ var A = (function (_super) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(X)); diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 8780c92fc1e80..0ac935a582ad0 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -39,7 +39,7 @@ var X = (function () { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A; }(X)); @@ -47,7 +47,7 @@ var A = (function (_super) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(X)); diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index 09ff39f582e0b..160191c5ca03d 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -28,7 +28,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -36,7 +36,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -44,7 +44,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js index 37c1b1737cd99..509f9ba70e6c5 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -29,7 +29,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -37,7 +37,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -45,7 +45,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js index 4fd63cf60d0d8..7908d36a56a44 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -40,7 +40,7 @@ var GenericBase = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(GenericBase)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js index 88f35f53b175d..6b308d88896b5 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -84,21 +84,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js index 96318a0d61604..09abd6e0868e9 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -129,21 +129,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js index 171c4bc6210fe..4e9a8c59bf994 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -74,21 +74,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js index 26757c43defce..91ec3b313bb0c 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -64,21 +64,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js index ae1d0d904454b..edafb00991681 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -67,21 +67,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index 1d533506e1531..6bbea0fddf714 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -29,8 +29,9 @@ var Super = (function () { var Sub = (function (_super) { __extends(Sub, _super); function Sub(options) { - _super.call(this, options.value); - this.options = options; + var _this = _super.call(this, options.value) || this; + _this.options = options; + return _this; } return Sub; }(Super)); diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js index d06faa80f2004..45ed976e191c4 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -33,14 +33,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index 1c3d6bf16d0f4..c5e27748f5236 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -47,7 +47,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(x) { - _super.call(this, x); + return _super.call(this, x) || this; } return Derived; }(Base)); @@ -55,7 +55,7 @@ var Derived2 = (function (_super) { __extends(Derived2, _super); // ok, not enforcing assignability relation on this function Derived2(x) { - _super.call(this, x); + var _this = _super.call(this, x) || this; return 1; } return Derived2; diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js index 960b76f52c446..a16694cdbf54d 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -47,7 +47,7 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -66,7 +66,7 @@ var Generic; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index 76481ec1bc691..2d26194f2e764 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -40,7 +40,7 @@ var FooBase = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y) { - _super.call(this, x); + return _super.call(this, x) || this; } Foo.prototype.bar1 = function () { }; return Foo; diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js index 61f0d50db03af..c0ae9b452f98c 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -31,6 +31,8 @@ var __extends = (this && this.__extends) || function (d, b) { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y) { + var _this; + return _this; } Foo.prototype.bar1 = function () { }; return Foo; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 905c12e07e34b..2e3190c15c825 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -525,7 +525,7 @@ method2(); var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.method2 = function () { return this.method1(2); diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js index 5775e0f064dbf..caf7ed445e566 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -28,14 +28,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index 29bb48e797069..a6ce98f61e291 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -29,14 +29,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index 1d84d74e5902e..e3bd1643cfb8e 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -26,14 +26,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js index c385eff83d5e7..89979da4812a4 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js @@ -25,7 +25,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/declFileClassExtendsNull.js b/tests/baselines/reference/declFileClassExtendsNull.js index e9081acab55ed..30ddc3f08bf39 100644 --- a/tests/baselines/reference/declFileClassExtendsNull.js +++ b/tests/baselines/reference/declFileClassExtendsNull.js @@ -12,7 +12,7 @@ var __extends = (this && this.__extends) || function (d, b) { var ExtendsNull = (function (_super) { __extends(ExtendsNull, _super); function ExtendsNull() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ExtendsNull; }(null)); diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js index 4b9535cd2c340..442007d9b9a50 100644 --- a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js @@ -23,7 +23,7 @@ var X = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(X)); diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js index 117bb6a7bd5d9..47593dc9d6868 100644 --- a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js @@ -26,7 +26,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index 0974f9d7b3692..b2e99a73ad762 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -91,7 +91,7 @@ exports.g = C.F5(); var h = (function (_super) { __extends(h, _super); function h() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return h; }(C.A)); diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index a4636d829939e..a51254122ed06 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -58,7 +58,7 @@ var templa; var AbstractElementController = (function (_super) { __extends(AbstractElementController, _super); function AbstractElementController() { - _super.call(this); + return _super.call(this) || this; } return AbstractElementController; }(templa.mvc.AbstractController)); @@ -78,8 +78,9 @@ var templa; var AbstractCompositeElementController = (function (_super) { __extends(AbstractCompositeElementController, _super); function AbstractCompositeElementController() { - _super.call(this); - this._controllers = []; + var _this = _super.call(this) || this; + _this._controllers = []; + return _this; } return AbstractCompositeElementController; }(templa.dom.mvc.AbstractElementController)); diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 4ac08f97a527c..cd10a9e94560d 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -35,7 +35,7 @@ var X; var W = (function (_super) { __extends(W, _super); function W() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return W; }(A.B.Base.W)); @@ -54,7 +54,7 @@ var X; var W = (function (_super) { __extends(W, _super); function W() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return W; }(X.Y.base.W)); diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js index 6dfce6e8e6334..f3b93efc9eb84 100644 --- a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -45,7 +45,7 @@ var A; var ContextMenu = (function (_super) { __extends(ContextMenu, _super); function ContextMenu() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ContextMenu; }(B.EventManager)); diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends.js b/tests/baselines/reference/declarationEmitExpressionInExtends.js index a7b2a6c7873d8..726c7b22446c5 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends.js @@ -29,7 +29,7 @@ var Q = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(x)); diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends2.js b/tests/baselines/reference/declarationEmitExpressionInExtends2.js index 09298fbd92d21..4081de6d3ed56 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends2.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends2.js @@ -29,7 +29,7 @@ function getClass(c) { var MyClass = (function (_super) { __extends(MyClass, _super); function MyClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyClass; }(getClass(2))); diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends3.js b/tests/baselines/reference/declarationEmitExpressionInExtends3.js index c21074fc3b7f1..f36a7e250a29e 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends3.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends3.js @@ -70,7 +70,7 @@ function getExportedClass(c) { var MyClass = (function (_super) { __extends(MyClass, _super); function MyClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyClass; }(getLocalClass(undefined))); @@ -78,7 +78,7 @@ exports.MyClass = MyClass; var MyClass2 = (function (_super) { __extends(MyClass2, _super); function MyClass2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyClass2; }(getExportedClass(undefined))); @@ -86,7 +86,7 @@ exports.MyClass2 = MyClass2; var MyClass3 = (function (_super) { __extends(MyClass3, _super); function MyClass3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyClass3; }(getExportedClass(undefined))); @@ -94,7 +94,7 @@ exports.MyClass3 = MyClass3; var MyClass4 = (function (_super) { __extends(MyClass4, _super); function MyClass4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyClass4; }(getExportedClass(undefined))); diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends4.js b/tests/baselines/reference/declarationEmitExpressionInExtends4.js index e5e822a784db9..b90c1275197bd 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends4.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends4.js @@ -33,21 +33,21 @@ function getSomething() { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(getSomething())); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(SomeUndefinedFunction())); var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C3; }(SomeUndefinedFunction)); diff --git a/tests/baselines/reference/declarationEmitNameConflicts3.js b/tests/baselines/reference/declarationEmitNameConflicts3.js index e9d5ea3b98e77..09dcea089a849 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts3.js +++ b/tests/baselines/reference/declarationEmitNameConflicts3.js @@ -64,7 +64,7 @@ var M; var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(C)); diff --git a/tests/baselines/reference/declarationEmitProtectedMembers.js b/tests/baselines/reference/declarationEmitProtectedMembers.js index f391e143d727e..9ae8e8a2437d3 100644 --- a/tests/baselines/reference/declarationEmitProtectedMembers.js +++ b/tests/baselines/reference/declarationEmitProtectedMembers.js @@ -88,7 +88,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C2.prototype.f = function () { return _super.prototype.f.call(this) + this.x; @@ -102,7 +102,7 @@ var C2 = (function (_super) { var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C3.prototype.f = function () { return _super.prototype.f.call(this); diff --git a/tests/baselines/reference/declarationEmitThisPredicates01.js b/tests/baselines/reference/declarationEmitThisPredicates01.js index d05b5c46dad09..ad9b7a7037330 100644 --- a/tests/baselines/reference/declarationEmitThisPredicates01.js +++ b/tests/baselines/reference/declarationEmitThisPredicates01.js @@ -28,7 +28,7 @@ exports.C = C; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js b/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js index e34dcc9810fc4..fe7995462ef2c 100644 --- a/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js +++ b/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js @@ -28,7 +28,7 @@ exports.C = C; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/declareDottedExtend.js b/tests/baselines/reference/declareDottedExtend.js index f1e9ea0b4deb0..3c7588d2b6cc9 100644 --- a/tests/baselines/reference/declareDottedExtend.js +++ b/tests/baselines/reference/declareDottedExtend.js @@ -21,14 +21,14 @@ var ab = A.B; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(ab.C)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(A.B.C)); diff --git a/tests/baselines/reference/decoratorOnClassConstructor2.js b/tests/baselines/reference/decoratorOnClassConstructor2.js index 5fc5501c32986..ce323e8ed1e71 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor2.js +++ b/tests/baselines/reference/decoratorOnClassConstructor2.js @@ -45,7 +45,7 @@ var _0_ts_2 = require("./0.ts"); var C = (function (_super) { __extends(C, _super); function C(prop) { - _super.call(this); + return _super.call(this) || this; } return C; }(_0_ts_1.base)); diff --git a/tests/baselines/reference/decoratorOnClassConstructor3.js b/tests/baselines/reference/decoratorOnClassConstructor3.js index 66946fab8bd6a..f06bf80b21ddd 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor3.js +++ b/tests/baselines/reference/decoratorOnClassConstructor3.js @@ -48,7 +48,7 @@ var _0_2 = require("./0"); var C = (function (_super) { __extends(C, _super); function C(prop) { - _super.call(this); + return _super.call(this) || this; } return C; }(_0_1.base)); diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js index 6e9b9763a3ab9..7dd5f69818259 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.js +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -32,7 +32,7 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.method = function () { }; return C; diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js new file mode 100644 index 0000000000000..4ab447d8e3231 --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js @@ -0,0 +1,75 @@ +//// [derivedClassConstructorWithExplicitReturns01.ts] + +class C { + cProp = 10; + + foo() { return "this never gets used."; } + + constructor(value: number) { + return { + cProp: value, + foo() { + return "well this looks kinda C-ish."; + } + } + } +} + +class D extends C { + dProp = () => this; + + constructor(a = 100) { + super(a); + + if (Math.random() < 0.5) { + "You win!" + return { + cProp: 1, + dProp: () => this, + foo() { return "You win!!!!!" } + }; + } + else + return null; + } +} + +//// [derivedClassConstructorWithExplicitReturns01.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var C = (function () { + function C(value) { + this.cProp = 10; + return { + cProp: value, + foo: function () { + return "well this looks kinda C-ish."; + } + }; + } + C.prototype.foo = function () { return "this never gets used."; }; + return C; +}()); +var D = (function (_super) { + __extends(D, _super); + function D(a) { + if (a === void 0) { a = 100; } + var _this = _super.call(this, a) || this; + _this.dProp = function () { return _this; }; + if (Math.random() < 0.5) { + "You win!"; + return { + cProp: 1, + dProp: function () { return _this; }, + foo: function () { return "You win!!!!!"; } + }; + } + else + return null; + } + return D; +}(C)); +//# sourceMappingURL=derivedClassConstructorWithExplicitReturns01.js.map \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map new file mode 100644 index 0000000000000..8b9037e40c95f --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map @@ -0,0 +1,2 @@ +//// [derivedClassConstructorWithExplicitReturns01.js.map] +{"version":3,"file":"derivedClassConstructorWithExplicitReturns01.js","sourceRoot":"","sources":["derivedClassConstructorWithExplicitReturns01.ts"],"names":[],"mappings":";;;;;AACA;IAKI,WAAY,KAAa;QAJzB,UAAK,GAAG,EAAE,CAAC;QAKP,MAAM,CAAC;YACH,KAAK,EAAE,KAAK;YACZ,GAAG;gBACC,MAAM,CAAC,8BAA8B,CAAC;YAC1C,CAAC;SACJ,CAAA;IACL,CAAC;IATD,eAAG,GAAH,cAAQ,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAU7C,QAAC;AAAD,CAAC,AAbD,IAaC;AAED;IAAgB,qBAAC;IAGb,WAAY,CAAO;QAAP,kBAAA,EAAA,OAAO;QAAnB,YACI,kBAAM,CAAC,CAAC,SAYX;QAfD,WAAK,GAAG,cAAM,OAAA,KAAI,EAAJ,CAAI,CAAC;QAKf,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;YACtB,UAAU,CAAA;YACV,MAAM,CAAC;gBACH,KAAK,EAAE,CAAC;gBACR,KAAK,EAAE,cAAM,OAAA,KAAI,EAAJ,CAAI;gBACjB,GAAG,gBAAK,MAAM,CAAC,cAAc,CAAA,CAAC,CAAC;aAClC,CAAC;QACN,CAAC;QACD,IAAI;YACA,MAAM,CAAC,IAAI,CAAC;IACpB,CAAC;IACL,QAAC;AAAD,CAAC,AAjBD,CAAgB,CAAC,GAiBhB"} \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt new file mode 100644 index 0000000000000..d452115ceb70e --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt @@ -0,0 +1,582 @@ +=================================================================== +JsFile: derivedClassConstructorWithExplicitReturns01.js +mapUrl: derivedClassConstructorWithExplicitReturns01.js.map +sourceRoot: +sources: derivedClassConstructorWithExplicitReturns01.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.js +sourceFile:derivedClassConstructorWithExplicitReturns01.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; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>>}; +>>>var C = (function () { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(6, 1) Source(2, 1) + SourceIndex(0) +--- +>>> function C(value) { +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^-> +1->class C { + > cProp = 10; + > + > foo() { return "this never gets used."; } + > + > +2 > constructor( +3 > value: number +1->Emitted(7, 5) Source(7, 5) + SourceIndex(0) +2 >Emitted(7, 16) Source(7, 17) + SourceIndex(0) +3 >Emitted(7, 21) Source(7, 30) + SourceIndex(0) +--- +>>> this.cProp = 10; +1->^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +1-> +2 > cProp +3 > = +4 > 10 +5 > ; +1->Emitted(8, 9) Source(3, 5) + SourceIndex(0) +2 >Emitted(8, 19) Source(3, 10) + SourceIndex(0) +3 >Emitted(8, 22) Source(3, 13) + SourceIndex(0) +4 >Emitted(8, 24) Source(3, 15) + SourceIndex(0) +5 >Emitted(8, 25) Source(3, 16) + SourceIndex(0) +--- +>>> return { +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^-> +1 > + > + > foo() { return "this never gets used."; } + > + > constructor(value: number) { + > +2 > return +3 > +1 >Emitted(9, 9) Source(8, 9) + SourceIndex(0) +2 >Emitted(9, 15) Source(8, 15) + SourceIndex(0) +3 >Emitted(9, 16) Source(8, 16) + SourceIndex(0) +--- +>>> cProp: value, +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^^ +4 > ^^^^^ +5 > ^^^^^^^-> +1->{ + > +2 > cProp +3 > : +4 > value +1->Emitted(10, 13) Source(9, 13) + SourceIndex(0) +2 >Emitted(10, 18) Source(9, 18) + SourceIndex(0) +3 >Emitted(10, 20) Source(9, 20) + SourceIndex(0) +4 >Emitted(10, 25) Source(9, 25) + SourceIndex(0) +--- +>>> foo: function () { +1->^^^^^^^^^^^^ +2 > ^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > foo +1->Emitted(11, 13) Source(10, 13) + SourceIndex(0) +2 >Emitted(11, 16) Source(10, 16) + SourceIndex(0) +--- +>>> return "well this looks kinda C-ish."; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > "well this looks kinda C-ish." +5 > ; +1->Emitted(12, 17) Source(11, 17) + SourceIndex(0) +2 >Emitted(12, 23) Source(11, 23) + SourceIndex(0) +3 >Emitted(12, 24) Source(11, 24) + SourceIndex(0) +4 >Emitted(12, 54) Source(11, 54) + SourceIndex(0) +5 >Emitted(12, 55) Source(11, 55) + SourceIndex(0) +--- +>>> } +1 >^^^^^^^^^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(13, 13) Source(12, 13) + SourceIndex(0) +2 >Emitted(13, 14) Source(12, 14) + SourceIndex(0) +--- +>>> }; +1 >^^^^^^^^^ +2 > ^ +1 > + > } +2 > +1 >Emitted(14, 10) Source(13, 10) + SourceIndex(0) +2 >Emitted(14, 11) Source(13, 10) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(15, 5) Source(14, 5) + SourceIndex(0) +2 >Emitted(15, 6) Source(14, 6) + SourceIndex(0) +--- +>>> C.prototype.foo = function () { return "this never gets used."; }; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^ +9 > ^ +10> ^ +1-> +2 > foo +3 > +4 > foo() { +5 > return +6 > +7 > "this never gets used." +8 > ; +9 > +10> } +1->Emitted(16, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(16, 20) Source(5, 8) + SourceIndex(0) +3 >Emitted(16, 23) Source(5, 5) + SourceIndex(0) +4 >Emitted(16, 37) Source(5, 13) + SourceIndex(0) +5 >Emitted(16, 43) Source(5, 19) + SourceIndex(0) +6 >Emitted(16, 44) Source(5, 20) + SourceIndex(0) +7 >Emitted(16, 67) Source(5, 43) + SourceIndex(0) +8 >Emitted(16, 68) Source(5, 44) + SourceIndex(0) +9 >Emitted(16, 69) Source(5, 45) + SourceIndex(0) +10>Emitted(16, 70) Source(5, 46) + SourceIndex(0) +--- +>>> return C; +1 >^^^^ +2 > ^^^^^^^^ +1 > + > + > constructor(value: number) { + > return { + > cProp: value, + > foo() { + > return "well this looks kinda C-ish."; + > } + > } + > } + > +2 > } +1 >Emitted(17, 5) Source(15, 1) + SourceIndex(0) +2 >Emitted(17, 13) Source(15, 2) + SourceIndex(0) +--- +>>>}()); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class C { + > cProp = 10; + > + > foo() { return "this never gets used."; } + > + > constructor(value: number) { + > return { + > cProp: value, + > foo() { + > return "well this looks kinda C-ish."; + > } + > } + > } + > } +1 >Emitted(18, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(18, 2) Source(15, 2) + SourceIndex(0) +3 >Emitted(18, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(18, 6) Source(15, 2) + SourceIndex(0) +--- +>>>var D = (function (_super) { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(19, 1) Source(17, 1) + SourceIndex(0) +--- +>>> __extends(D, _super); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +1->class D extends +2 > C +1->Emitted(20, 5) Source(17, 17) + SourceIndex(0) +2 >Emitted(20, 26) Source(17, 18) + SourceIndex(0) +--- +>>> function D(a) { +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > { + > dProp = () => this; + > + > +2 > constructor( +3 > a = 100 +1 >Emitted(21, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(21, 16) Source(20, 17) + SourceIndex(0) +3 >Emitted(21, 17) Source(20, 24) + SourceIndex(0) +--- +>>> if (a === void 0) { a = 100; } +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^ +5 > ^^^^^^^^^^^^^^^-> +1-> +2 > +3 > +4 > a = 100 +1->Emitted(22, 9) Source(20, 17) + SourceIndex(0) +2 >Emitted(22, 27) Source(20, 17) + SourceIndex(0) +3 >Emitted(22, 29) Source(20, 17) + SourceIndex(0) +4 >Emitted(22, 36) Source(20, 24) + SourceIndex(0) +--- +>>> var _this = _super.call(this, a) || this; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^^^-> +1-> +2 > constructor(a = 100) { + > +3 > super( +4 > a +5 > ) +6 > ; + > + > if (Math.random() < 0.5) { + > "You win!" + > return { + > cProp: 1, + > dProp: () => this, + > foo() { return "You win!!!!!" } + > }; + > } + > else + > return null; + > } +1->Emitted(23, 9) Source(20, 5) + SourceIndex(0) +2 >Emitted(23, 21) Source(21, 9) + SourceIndex(0) +3 >Emitted(23, 39) Source(21, 15) + SourceIndex(0) +4 >Emitted(23, 40) Source(21, 16) + SourceIndex(0) +5 >Emitted(23, 41) Source(21, 17) + SourceIndex(0) +6 >Emitted(23, 50) Source(33, 6) + SourceIndex(0) +--- +>>> _this.dProp = function () { return _this; }; +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +9 > ^ +1-> +2 > dProp +3 > = +4 > () => +5 > +6 > this +7 > +8 > this +9 > ; +1->Emitted(24, 9) Source(18, 5) + SourceIndex(0) +2 >Emitted(24, 20) Source(18, 10) + SourceIndex(0) +3 >Emitted(24, 23) Source(18, 13) + SourceIndex(0) +4 >Emitted(24, 37) Source(18, 19) + SourceIndex(0) +5 >Emitted(24, 44) Source(18, 19) + SourceIndex(0) +6 >Emitted(24, 49) Source(18, 23) + SourceIndex(0) +7 >Emitted(24, 51) Source(18, 19) + SourceIndex(0) +8 >Emitted(24, 52) Source(18, 23) + SourceIndex(0) +9 >Emitted(24, 53) Source(18, 24) + SourceIndex(0) +--- +>>> if (Math.random() < 0.5) { +1 >^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^ +10> ^^^ +11> ^ +12> ^ +13> ^ +1 > + > + > constructor(a = 100) { + > super(a); + > + > +2 > if +3 > +4 > ( +5 > Math +6 > . +7 > random +8 > () +9 > < +10> 0.5 +11> ) +12> +13> { +1 >Emitted(25, 9) Source(23, 9) + SourceIndex(0) +2 >Emitted(25, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(25, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(25, 13) Source(23, 13) + SourceIndex(0) +5 >Emitted(25, 17) Source(23, 17) + SourceIndex(0) +6 >Emitted(25, 18) Source(23, 18) + SourceIndex(0) +7 >Emitted(25, 24) Source(23, 24) + SourceIndex(0) +8 >Emitted(25, 26) Source(23, 26) + SourceIndex(0) +9 >Emitted(25, 29) Source(23, 29) + SourceIndex(0) +10>Emitted(25, 32) Source(23, 32) + SourceIndex(0) +11>Emitted(25, 33) Source(23, 33) + SourceIndex(0) +12>Emitted(25, 34) Source(23, 34) + SourceIndex(0) +13>Emitted(25, 35) Source(23, 35) + SourceIndex(0) +--- +>>> "You win!"; +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^ +1 > + > +2 > "You win!" +3 > +1 >Emitted(26, 13) Source(24, 13) + SourceIndex(0) +2 >Emitted(26, 23) Source(24, 23) + SourceIndex(0) +3 >Emitted(26, 24) Source(24, 23) + SourceIndex(0) +--- +>>> return { +1 >^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^-> +1 > + > +2 > return +3 > +1 >Emitted(27, 13) Source(25, 13) + SourceIndex(0) +2 >Emitted(27, 19) Source(25, 19) + SourceIndex(0) +3 >Emitted(27, 20) Source(25, 20) + SourceIndex(0) +--- +>>> cProp: 1, +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->{ + > +2 > cProp +3 > : +4 > 1 +1->Emitted(28, 17) Source(26, 17) + SourceIndex(0) +2 >Emitted(28, 22) Source(26, 22) + SourceIndex(0) +3 >Emitted(28, 24) Source(26, 24) + SourceIndex(0) +4 >Emitted(28, 25) Source(26, 25) + SourceIndex(0) +--- +>>> dProp: function () { return _this; }, +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^-> +1->, + > +2 > dProp +3 > : +4 > () => +5 > +6 > this +7 > +8 > this +1->Emitted(29, 17) Source(27, 17) + SourceIndex(0) +2 >Emitted(29, 22) Source(27, 22) + SourceIndex(0) +3 >Emitted(29, 24) Source(27, 24) + SourceIndex(0) +4 >Emitted(29, 38) Source(27, 30) + SourceIndex(0) +5 >Emitted(29, 45) Source(27, 30) + SourceIndex(0) +6 >Emitted(29, 50) Source(27, 34) + SourceIndex(0) +7 >Emitted(29, 52) Source(27, 30) + SourceIndex(0) +8 >Emitted(29, 53) Source(27, 34) + SourceIndex(0) +--- +>>> foo: function () { return "You win!!!!!"; } +1->^^^^^^^^^^^^^^^^ +2 > ^^^ +3 > ^^^^^^^^^^^^^^^^ +4 > ^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +9 > ^ +1->, + > +2 > foo +3 > () { +4 > return +5 > +6 > "You win!!!!!" +7 > +8 > +9 > } +1->Emitted(30, 17) Source(28, 17) + SourceIndex(0) +2 >Emitted(30, 20) Source(28, 20) + SourceIndex(0) +3 >Emitted(30, 36) Source(28, 25) + SourceIndex(0) +4 >Emitted(30, 42) Source(28, 31) + SourceIndex(0) +5 >Emitted(30, 43) Source(28, 32) + SourceIndex(0) +6 >Emitted(30, 57) Source(28, 46) + SourceIndex(0) +7 >Emitted(30, 58) Source(28, 46) + SourceIndex(0) +8 >Emitted(30, 59) Source(28, 47) + SourceIndex(0) +9 >Emitted(30, 60) Source(28, 48) + SourceIndex(0) +--- +>>> }; +1 >^^^^^^^^^^^^^ +2 > ^ +1 > + > } +2 > ; +1 >Emitted(31, 14) Source(29, 14) + SourceIndex(0) +2 >Emitted(31, 15) Source(29, 15) + SourceIndex(0) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^-> +1 > + > +2 > } +1 >Emitted(32, 9) Source(30, 9) + SourceIndex(0) +2 >Emitted(32, 10) Source(30, 10) + SourceIndex(0) +--- +>>> else +1->^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^^^^^^^-> +1-> + > +2 > else +1->Emitted(33, 9) Source(31, 9) + SourceIndex(0) +2 >Emitted(33, 13) Source(31, 13) + SourceIndex(0) +--- +>>> return null; +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +1-> + > +2 > return +3 > +4 > null +5 > ; +1->Emitted(34, 13) Source(32, 13) + SourceIndex(0) +2 >Emitted(34, 19) Source(32, 19) + SourceIndex(0) +3 >Emitted(34, 20) Source(32, 20) + SourceIndex(0) +4 >Emitted(34, 24) Source(32, 24) + SourceIndex(0) +5 >Emitted(34, 25) Source(32, 25) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(35, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(35, 6) Source(33, 6) + SourceIndex(0) +--- +>>> return D; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(36, 5) Source(34, 1) + SourceIndex(0) +2 >Emitted(36, 13) Source(34, 2) + SourceIndex(0) +--- +>>>}(C)); +1 > +2 >^ +3 > +4 > ^ +5 > ^ +6 > ^^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class D extends +5 > C +6 > { + > dProp = () => this; + > + > constructor(a = 100) { + > super(a); + > + > if (Math.random() < 0.5) { + > "You win!" + > return { + > cProp: 1, + > dProp: () => this, + > foo() { return "You win!!!!!" } + > }; + > } + > else + > return null; + > } + > } +1 >Emitted(37, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(37, 2) Source(34, 2) + SourceIndex(0) +3 >Emitted(37, 2) Source(17, 1) + SourceIndex(0) +4 >Emitted(37, 3) Source(17, 17) + SourceIndex(0) +5 >Emitted(37, 4) Source(17, 18) + SourceIndex(0) +6 >Emitted(37, 7) Source(34, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=derivedClassConstructorWithExplicitReturns01.js.map \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.symbols b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.symbols new file mode 100644 index 0000000000000..ee043fcfe712d --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.symbols @@ -0,0 +1,66 @@ +=== tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts === + +class C { +>C : Symbol(C, Decl(derivedClassConstructorWithExplicitReturns01.ts, 0, 0)) + + cProp = 10; +>cProp : Symbol(C.cProp, Decl(derivedClassConstructorWithExplicitReturns01.ts, 1, 9)) + + foo() { return "this never gets used."; } +>foo : Symbol(C.foo, Decl(derivedClassConstructorWithExplicitReturns01.ts, 2, 15)) + + constructor(value: number) { +>value : Symbol(value, Decl(derivedClassConstructorWithExplicitReturns01.ts, 6, 16)) + + return { + cProp: value, +>cProp : Symbol(cProp, Decl(derivedClassConstructorWithExplicitReturns01.ts, 7, 16)) +>value : Symbol(value, Decl(derivedClassConstructorWithExplicitReturns01.ts, 6, 16)) + + foo() { +>foo : Symbol(foo, Decl(derivedClassConstructorWithExplicitReturns01.ts, 8, 25)) + + return "well this looks kinda C-ish."; + } + } + } +} + +class D extends C { +>D : Symbol(D, Decl(derivedClassConstructorWithExplicitReturns01.ts, 14, 1)) +>C : Symbol(C, Decl(derivedClassConstructorWithExplicitReturns01.ts, 0, 0)) + + dProp = () => this; +>dProp : Symbol(D.dProp, Decl(derivedClassConstructorWithExplicitReturns01.ts, 16, 19)) +>this : Symbol(D, Decl(derivedClassConstructorWithExplicitReturns01.ts, 14, 1)) + + constructor(a = 100) { +>a : Symbol(a, Decl(derivedClassConstructorWithExplicitReturns01.ts, 19, 16)) + + super(a); +>super : Symbol(C, Decl(derivedClassConstructorWithExplicitReturns01.ts, 0, 0)) +>a : Symbol(a, Decl(derivedClassConstructorWithExplicitReturns01.ts, 19, 16)) + + if (Math.random() < 0.5) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.d.ts, --, --)) + + "You win!" + return { + cProp: 1, +>cProp : Symbol(cProp, Decl(derivedClassConstructorWithExplicitReturns01.ts, 24, 20)) + + dProp: () => this, +>dProp : Symbol(dProp, Decl(derivedClassConstructorWithExplicitReturns01.ts, 25, 25)) +>this : Symbol(D, Decl(derivedClassConstructorWithExplicitReturns01.ts, 14, 1)) + + foo() { return "You win!!!!!" } +>foo : Symbol(foo, Decl(derivedClassConstructorWithExplicitReturns01.ts, 26, 34)) + + }; + } + else + return null; + } +} diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types new file mode 100644 index 0000000000000..d361e783ef0fc --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types @@ -0,0 +1,85 @@ +=== tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts === + +class C { +>C : C + + cProp = 10; +>cProp : number +>10 : 10 + + foo() { return "this never gets used."; } +>foo : () => string +>"this never gets used." : "this never gets used." + + constructor(value: number) { +>value : number + + return { +>{ cProp: value, foo() { return "well this looks kinda C-ish."; } } : { cProp: number; foo(): string; } + + cProp: value, +>cProp : number +>value : number + + foo() { +>foo : () => string + + return "well this looks kinda C-ish."; +>"well this looks kinda C-ish." : "well this looks kinda C-ish." + } + } + } +} + +class D extends C { +>D : D +>C : C + + dProp = () => this; +>dProp : () => this +>() => this : () => this +>this : this + + constructor(a = 100) { +>a : number +>100 : 100 + + super(a); +>super(a) : void +>super : typeof C +>a : number + + if (Math.random() < 0.5) { +>Math.random() < 0.5 : boolean +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>0.5 : 0.5 + + "You win!" +>"You win!" : "You win!" + + return { +>{ cProp: 1, dProp: () => this, foo() { return "You win!!!!!" } } : { cProp: number; dProp: () => this; foo(): string; } + + cProp: 1, +>cProp : number +>1 : 1 + + dProp: () => this, +>dProp : () => this +>() => this : () => this +>this : this + + foo() { return "You win!!!!!" } +>foo : () => string +>"You win!!!!!" : "You win!!!!!" + + }; + } + else + return null; +>null : null + } +} diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index 2e6ac2c793482..e76f3445c8eb2 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -47,6 +47,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { + var _this; + return _this; } return Derived; }(Base)); @@ -58,21 +60,27 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var r2 = function () { return _super.call(this); }; // error for misplaced super call (nested function) + var _this; + var r2 = function () { return _this = _super.call(this) || this; }; // error for misplaced super call (nested function) + return _this; } return Derived2; }(Base2)); var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var r = function () { _super.call(this); }; // error + var _this; + var r = function () { _this = _super.call(this) || this; }; // error + return _this; } return Derived3; }(Base2)); var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4() { - var r = _super.call(this); // ok + var _this; + var r = _this = _super.call(this) || this; // ok + return _this; } return Derived4; }(Base2)); diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js index 7dbb901362f97..7f6b83593ca75 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js @@ -38,7 +38,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.prototype.x = function () { return 1; diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js index 0c7a21232e61c..8224473cb548c 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js @@ -68,7 +68,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -89,7 +89,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js index a44d4340b8f35..4753e39539073 100644 --- a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js @@ -32,7 +32,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -45,7 +45,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index c81c6f048f51f..981c072d47c68 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -32,7 +32,7 @@ var BaseClass = (function () { var DerivedClass = (function (_super) { __extends(DerivedClass, _super); function DerivedClass() { - _super.call(this); + return _super.call(this) || this; } DerivedClass.prototype._init = function () { }; diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.js b/tests/baselines/reference/derivedClassOverridesPrivates.js index cd486152c1c78..1a58c038feac6 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.js +++ b/tests/baselines/reference/derivedClassOverridesPrivates.js @@ -29,7 +29,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -41,7 +41,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index 5b8af9e85bfe1..b8997769eb74c 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -66,7 +66,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - _super.call(this, x); + return _super.call(this, x) || this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js index 5c7d73d5dfd1a..6797eef0e7726 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -94,7 +94,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - _super.call(this, a); + return _super.call(this, a) || this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { @@ -131,7 +131,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index ebb675a26db2e..d0d9d8fa0f58a 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -103,14 +103,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1(a) { - _super.call(this, a); + return _super.call(this, a) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(a) { - _super.call(this, a); + return _super.call(this, a) || this; } Derived2.prototype.b = function (a) { }; return Derived2; @@ -118,7 +118,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(a) { - _super.call(this, a); + return _super.call(this, a) || this; } Object.defineProperty(Derived3.prototype, "c", { get: function () { return x; }, @@ -130,7 +130,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(a) { - _super.call(this, a); + return _super.call(this, a) || this; } Object.defineProperty(Derived4.prototype, "c", { set: function (v) { }, @@ -142,21 +142,21 @@ var Derived4 = (function (_super) { var Derived5 = (function (_super) { __extends(Derived5, _super); function Derived5(a) { - _super.call(this, a); + return _super.call(this, a) || this; } return Derived5; }(Base)); var Derived6 = (function (_super) { __extends(Derived6, _super); function Derived6(a) { - _super.call(this, a); + return _super.call(this, a) || this; } return Derived6; }(Base)); var Derived7 = (function (_super) { __extends(Derived7, _super); function Derived7(a) { - _super.call(this, a); + return _super.call(this, a) || this; } Derived7.s = function (a) { }; return Derived7; @@ -164,7 +164,7 @@ var Derived7 = (function (_super) { var Derived8 = (function (_super) { __extends(Derived8, _super); function Derived8(a) { - _super.call(this, a); + return _super.call(this, a) || this; } Object.defineProperty(Derived8, "t", { get: function () { return x; }, @@ -176,7 +176,7 @@ var Derived8 = (function (_super) { var Derived9 = (function (_super) { __extends(Derived9, _super); function Derived9(a) { - _super.call(this, a); + return _super.call(this, a) || this; } Object.defineProperty(Derived9, "t", { set: function (v) { }, @@ -188,7 +188,7 @@ var Derived9 = (function (_super) { var Derived10 = (function (_super) { __extends(Derived10, _super); function Derived10(a) { - _super.call(this, a); + return _super.call(this, a) || this; } return Derived10; }(Base)); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js index b8a15ee8b6c8f..06f809976008b 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js @@ -30,14 +30,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived1)); diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index b62f0d8f7d372..7943d904deafb 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -92,7 +92,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - _super.call(this, x); + return _super.call(this, x) || this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { @@ -129,7 +129,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js index 147e6edbbb4e6..e42ff9c9e1d07 100644 --- a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js @@ -37,7 +37,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -49,7 +49,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index 8e5fa82cf0f24..27dcc4b7d5dba 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -109,73 +109,86 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(y) { + var _this; var a = 1; - _super.call(this); // ok + _this = _super.call(this) || this; // ok + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(y) { - this.y = y; + var _this; + _this.y = y; var a = 1; - _super.call(this); // error + _this = _super.call(this) || this; // error + return _this; } return Derived2; }(Base)); var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(y) { - _super.call(this); // ok - this.y = y; + var _this = _super.call(this) || this; + _this.y = y; var a = 1; + return _this; } return Derived3; }(Base)); var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(y) { - this.a = 1; + var _this; + _this.a = 1; var b = 2; - _super.call(this); // error + _this = _super.call(this) || this; // error + return _this; } return Derived4; }(Base)); var Derived5 = (function (_super) { __extends(Derived5, _super); function Derived5(y) { - _super.call(this); // ok - this.a = 1; + var _this = _super.call(this) || this; + _this.a = 1; var b = 2; + return _this; } return Derived5; }(Base)); var Derived6 = (function (_super) { __extends(Derived6, _super); function Derived6(y) { - this.a = 1; + var _this; + _this.a = 1; var b = 2; - _super.call(this); // error: "super" has to be called before "this" accessing + _this = _super.call(this) || this; // error: "super" has to be called before "this" accessing + return _this; } return Derived6; }(Base)); var Derived7 = (function (_super) { __extends(Derived7, _super); function Derived7(y) { - this.a = 1; - this.a = 3; - this.b = 3; - _super.call(this); // error + var _this; + _this.a = 1; + _this.a = 3; + _this.b = 3; + _this = _super.call(this) || this; // error + return _this; } return Derived7; }(Base)); var Derived8 = (function (_super) { __extends(Derived8, _super); function Derived8(y) { - _super.call(this); // ok - this.a = 1; - this.a = 3; - this.b = 3; + var _this = _super.call(this) || this; + _this.a = 1; + _this.a = 3; + _this.b = 3; + return _this; } return Derived8; }(Base)); @@ -188,20 +201,23 @@ var Base2 = (function () { var Derived9 = (function (_super) { __extends(Derived9, _super); function Derived9(y) { - this.a = 1; - this.a = 3; - this.b = 3; - _super.call(this); // error + var _this; + _this.a = 1; + _this.a = 3; + _this.b = 3; + _this = _super.call(this) || this; // error + return _this; } return Derived9; }(Base2)); var Derived10 = (function (_super) { __extends(Derived10, _super); function Derived10(y) { - _super.call(this); // ok - this.a = 1; - this.a = 3; - this.b = 3; + var _this = _super.call(this) || this; + _this.a = 1; + _this.a = 3; + _this.b = 3; + return _this; } return Derived10; }(Base2)); diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js index 50408d3bee764..b778d7bbca281 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js @@ -46,37 +46,38 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); - this.a = _super.call(this); + var _this = _super.apply(this, arguments) || this; + _this.a = _this = _super.call(this) || this; + return _this; } Derived.prototype.b = function () { - _super.call(this); + _this = _super.call(this) || this; }; Object.defineProperty(Derived.prototype, "C", { get: function () { - _super.call(this); + _this = _super.call(this) || this; return 1; }, set: function (v) { - _super.call(this); + _this = _super.call(this) || this; }, enumerable: true, configurable: true }); Derived.b = function () { - _super.call(this); + _this = _super.call(this) || this; }; Object.defineProperty(Derived, "C", { get: function () { - _super.call(this); + _this = _super.call(this) || this; return 1; }, set: function (v) { - _super.call(this); + _this = _super.call(this) || this; }, enumerable: true, configurable: true }); return Derived; }(Base)); -Derived.a = _super.call(this); +Derived.a = _this = _super.call(this) || this; diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index 1c88306bf3add..504d414a6088c 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -42,32 +42,34 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this, this); // ok + return _super.call(this, _this) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(a) { - _super.call(this, this); // error - this.a = a; + var _this = _super.call(this, _this) || this; + _this.a = a; + return _this; } return Derived2; }(Base)); var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(a) { - var _this = this; - _super.call(this, function () { return _this; }); // error - this.a = a; + var _this = _super.call(this, function () { return _this; }) || this; + _this.a = a; + return _this; } return Derived3; }(Base)); var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(a) { - _super.call(this, function () { return this; }); // ok - this.a = a; + var _this = _super.call(this, function () { return this; }) || this; + _this.a = a; + return _this; } return Derived4; }(Base)); diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index 38c465492e68b..a76ac8101a098 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -36,7 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.foo = function () { }; // ok to drop parameters return D; @@ -44,7 +44,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.foo = function (x) { }; // ok to add optional parameters return E; diff --git a/tests/baselines/reference/derivedClassTransitivity2.js b/tests/baselines/reference/derivedClassTransitivity2.js index 5d08905a60545..a3894863696b4 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -36,7 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.foo = function (x) { }; // ok to drop parameters return D; @@ -44,7 +44,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.foo = function (x, y) { }; // ok to add optional parameters return E; diff --git a/tests/baselines/reference/derivedClassTransitivity3.js b/tests/baselines/reference/derivedClassTransitivity3.js index be7e97a8fc599..71dfecb346f01 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -36,7 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.foo = function (x) { }; // ok to drop parameters return D; @@ -44,7 +44,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.foo = function (x, y) { }; // ok to add optional parameters return E; diff --git a/tests/baselines/reference/derivedClassTransitivity4.js b/tests/baselines/reference/derivedClassTransitivity4.js index 0c70f03218ec5..0030ce702d82a 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.js +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -36,7 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.foo = function () { }; // ok to drop parameters return D; @@ -44,7 +44,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.foo = function (x) { }; // ok to add optional parameters return E; diff --git a/tests/baselines/reference/derivedClassWithAny.js b/tests/baselines/reference/derivedClassWithAny.js index 34af167011d0c..2a199e5586152 100644 --- a/tests/baselines/reference/derivedClassWithAny.js +++ b/tests/baselines/reference/derivedClassWithAny.js @@ -91,7 +91,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(D.prototype, "X", { get: function () { @@ -119,7 +119,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(E.prototype, "X", { get: function () { return ''; }, diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js index 2c0775efc1930..0542815c4e4b7 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -46,7 +46,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.prototype.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js index 540be97d165f8..41869cad416fd 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js @@ -56,7 +56,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.prototype.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js index 93d5b49fcd03d..10ae3cb35c855 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -45,7 +45,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js index b58acc01082d8..3f2c2a3b811a4 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js @@ -58,7 +58,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index 479beebbbfeef..7a6a7ecbb638b 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -41,9 +41,10 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); - this.x = 1; - this.y = 'hello'; + var _this = _super.apply(this, arguments) || this; + _this.x = 1; + _this.y = 'hello'; + return _this; } return Derived; }(Base)); @@ -58,9 +59,10 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); - this.x = 2; - this.y = null; + var _this = _super.apply(this, arguments) || this; + _this.x = 2; + _this.y = null; + return _this; } return D; }(Base2)); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index 4dc35c5e006e1..62beb4bf28f65 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -49,9 +49,10 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); - this.x = 1; - this.y = 'hello'; + var _this = _super.apply(this, arguments) || this; + _this.x = 1; + _this.y = 'hello'; + return _this; } return Derived; }(Base)); @@ -68,9 +69,10 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); - this.x = 2; - this.y = null; + var _this = _super.apply(this, arguments) || this; + _this.x = 2; + _this.y = null; + return _this; } return D; }(Base2)); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index 3b0a673d37805..c96d0c96723da 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -63,18 +63,20 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(y, z) { - _super.call(this, 2); - this.b = ''; - this.b = y; + var _this = _super.call(this, 2) || this; + _this.b = ''; + _this.b = y; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); - this.x = 1; - this.y = 'hello'; + var _this = _super.apply(this, arguments) || this; + _this.x = 1; + _this.y = 'hello'; + return _this; } return Derived2; }(Derived)); @@ -90,18 +92,20 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D(y, z) { - _super.call(this, 2); - this.b = null; - this.b = y; + var _this = _super.call(this, 2) || this; + _this.b = null; + _this.b = y; + return _this; } return D; }(Base)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); - this.x = 2; - this.y = null; + var _this = _super.apply(this, arguments) || this; + _this.x = 2; + _this.y = null; + return _this; } return D2; }(D)); diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js index b6103940b33b3..3e097a9b139c3 100644 --- a/tests/baselines/reference/derivedClasses.js +++ b/tests/baselines/reference/derivedClasses.js @@ -39,7 +39,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Red = (function (_super) { __extends(Red, _super); function Red() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Red.prototype.shade = function () { var _this = this; @@ -58,7 +58,7 @@ var Color = (function () { var Blue = (function (_super) { __extends(Blue, _super); function Blue() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Blue.prototype.shade = function () { var _this = this; diff --git a/tests/baselines/reference/derivedGenericClassWithAny.js b/tests/baselines/reference/derivedGenericClassWithAny.js index 56daf4b7310d4..1822f3fcc47dd 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.js +++ b/tests/baselines/reference/derivedGenericClassWithAny.js @@ -64,7 +64,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(D.prototype, "X", { get: function () { @@ -92,7 +92,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(E.prototype, "X", { get: function () { return ''; } // error diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js index 2e0a561e846e8..c17922e05eee0 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -34,7 +34,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.prototype.foo = function (x) { return null; diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js index cfbe44166c94e..6fe690fd692db 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -39,7 +39,7 @@ var Derived = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js index 2df6ce46b2c6b..7ba178823df6f 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -65,7 +65,7 @@ var Class = (function () { var SubClass = (function (_super) { __extends(SubClass, _super); function SubClass() { - _super.call(this); + return _super.call(this) || this; } return SubClass; }(Class)); @@ -77,7 +77,7 @@ var D = (function () { var SubD = (function (_super) { __extends(SubD, _super); function SubD() { - _super.call(this); + return _super.call(this) || this; } return SubD; }(D)); diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index 88ce3f1418b29..05b061116d3b4 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -30,8 +30,9 @@ var B = (function (_super) { function B(x) { "use strict"; 'someStringForEgngInject'; - _super.call(this); - this.x = x; + var _this = _super.call(this) || this; + _this.x = x; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js index 920ad1f7bdacb..2cf2cb02073d6 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js @@ -32,8 +32,9 @@ var B = (function (_super) { function B() { "use strict"; 'someStringForEgngInject'; - _super.call(this); - this.blub = 12; + var _this = _super.call(this) || this; + _this.blub = 12; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js index 3fa18140034df..eaa52e392853b 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -30,9 +30,10 @@ var B = (function (_super) { function B(x) { "use strict"; 'someStringForEgngInject'; - _super.call(this); - this.x = x; - this.blah = 2; + var _this = _super.call(this) || this; + _this.x = x; + _this.blah = 2; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.js b/tests/baselines/reference/emitThisInSuperMethodCall.js index 1350ed9d4c86e..1f7ed8bfa9443 100644 --- a/tests/baselines/reference/emitThisInSuperMethodCall.js +++ b/tests/baselines/reference/emitThisInSuperMethodCall.js @@ -43,7 +43,7 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } RegisteredUser.prototype.f = function () { (function () { diff --git a/tests/baselines/reference/emptyModuleName.js b/tests/baselines/reference/emptyModuleName.js index 5c85d39e1ec20..3ed21cf217a64 100644 --- a/tests/baselines/reference/emptyModuleName.js +++ b/tests/baselines/reference/emptyModuleName.js @@ -14,7 +14,7 @@ var A = require(""); var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js index 96f6c65b85c7b..ed2e1aa7f06e7 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js @@ -30,7 +30,7 @@ var base = (function () { var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return derived; }(base)); diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index 3e778535bb71b..720894e50c041 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -83,38 +83,38 @@ var __extends = (this && this.__extends) || function (d, b) { //super call in class constructor with no base type var NoBase = (function () { function NoBase() { - _super.call(this); + _this = _super.call(this) || this; //super call in class member initializer with no base type - this.p = _super.call(this); + this.p = _this = _super.call(this) || this; } //super call in class member function with no base type NoBase.prototype.fn = function () { - _super.call(this); + _this = _super.call(this) || this; }; Object.defineProperty(NoBase.prototype, "foo", { //super call in class accessor (get and set) with no base type get: function () { - _super.call(this); + _this = _super.call(this) || this; return null; }, set: function (v) { - _super.call(this); + _this = _super.call(this) || this; }, enumerable: true, configurable: true }); //super call in static class member function with no base type NoBase.fn = function () { - _super.call(this); + _this = _super.call(this) || this; }; Object.defineProperty(NoBase, "q", { //super call in static class accessor (get and set) with no base type get: function () { - _super.call(this); + _this = _super.call(this) || this; return null; }, set: function (n) { - _super.call(this); + _this = _super.call(this) || this; }, enumerable: true, configurable: true @@ -122,7 +122,7 @@ var NoBase = (function () { return NoBase; }()); //super call in static class member initializer with no base type -NoBase.k = _super.call(this); +NoBase.k = _this = _super.call(this) || this; var Base = (function () { function Base() { } @@ -132,8 +132,10 @@ var Derived = (function (_super) { __extends(Derived, _super); //super call with type arguments function Derived() { - _super.prototype..call(this); - _super.call(this); + var _this; + _super.prototype..call(_this); + _this = _super.call(this) || this; + return _this; } return Derived; }(Base)); @@ -145,22 +147,23 @@ var OtherBase = (function () { var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; //super call in class member initializer of derived type - this.t = _super.call(this); + _this.t = _this = _super.call(this) || this; + return _this; } OtherDerived.prototype.fn = function () { //super call in class member function of derived type - _super.call(this); + _this = _super.call(this) || this; }; Object.defineProperty(OtherDerived.prototype, "foo", { //super call in class accessor (get and set) of derived type get: function () { - _super.call(this); + _this = _super.call(this) || this; return null; }, set: function (n) { - _super.call(this); + _this = _super.call(this) || this; }, enumerable: true, configurable: true diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index dbfbdb4694023..e12a758b0537c 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -186,8 +186,9 @@ SomeBase.publicStaticMember = 0; var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - _super.call(this); + var _this = _super.call(this) || this; _super.prototype.publicMember = 1; + return _this; } SomeDerived1.prototype.fn = function () { var x = _super.prototype.publicMember; @@ -219,8 +220,9 @@ var SomeDerived1 = (function (_super) { var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - _super.call(this); + var _this = _super.call(this) || this; _super.prototype.privateMember = 1; + return _this; } SomeDerived2.prototype.fn = function () { var x = _super.prototype.privateMember; @@ -245,7 +247,7 @@ var SomeDerived2 = (function (_super) { var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SomeDerived3.fn = function () { _super.publicStaticMember = 3; diff --git a/tests/baselines/reference/errorsInGenericTypeReference.js b/tests/baselines/reference/errorsInGenericTypeReference.js index a7898810e1075..6dd9f62edcbc0 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.js +++ b/tests/baselines/reference/errorsInGenericTypeReference.js @@ -135,7 +135,7 @@ var testClass6 = (function () { var testClass7 = (function (_super) { __extends(testClass7, _super); function testClass7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return testClass7; }(Foo)); // error: could not find symbol V diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.js b/tests/baselines/reference/es6ClassSuperCodegenBug.js index c32865478e32b..2eec250211e98 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.js +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -28,12 +28,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; if (true) { - _super.call(this, 'a1', 'b1'); + _this = _super.call(this, 'a1', 'b1') || this; } else { - _super.call(this, 'a2', 'b2'); + _this = _super.call(this, 'a2', 'b2') || this; } + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index a722cce167033..067e57c258186 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -103,13 +103,14 @@ var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y, z) { if (z === void 0) { z = 0; } - _super.call(this, x); - this.y = y; - this.z = z; - this.gar = 0; - this.zoo = "zoo"; - this.x = x; - this.gar = 5; + var _this = _super.call(this, x) || this; + _this.y = y; + _this.z = z; + _this.gar = 0; + _this.zoo = "zoo"; + _this.x = x; + _this.gar = 5; + return _this; } Foo.prototype.bar = function () { return 0; }; Foo.prototype.boo = function (x) { return x; }; diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index 1881e6b8c878c..de5657b087e72 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -267,7 +267,7 @@ var SuperParent = (function () { var SuperChild = (function (_super) { __extends(SuperChild, _super); function SuperChild() { - _super.call(this, 1); + return _super.call(this, 1) || this; } SuperChild.prototype.b = function () { _super.prototype.b.call(this, 'str'); @@ -314,7 +314,7 @@ var BaseClassWithConstructor = (function () { var ChildClassWithoutConstructor = (function (_super) { __extends(ChildClassWithoutConstructor, _super); function ChildClassWithoutConstructor() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ChildClassWithoutConstructor; }(BaseClassWithConstructor)); diff --git a/tests/baselines/reference/es6ClassTest7.js b/tests/baselines/reference/es6ClassTest7.js index 14662410a1405..f786fce446187 100644 --- a/tests/baselines/reference/es6ClassTest7.js +++ b/tests/baselines/reference/es6ClassTest7.js @@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar; }(M.Foo)); diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.js b/tests/baselines/reference/exportAssignmentOfGenericType1.js index 0504bad39c7b0..7c1831ecac487 100644 --- a/tests/baselines/reference/exportAssignmentOfGenericType1.js +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.js @@ -34,7 +34,7 @@ define(["require", "exports", "exportAssignmentOfGenericType1_0"], function (req var M = (function (_super) { __extends(M, _super); function M() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return M; }(q)); diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js index a9ea4bf5eda00..518c66369476d 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.js +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -32,7 +32,7 @@ var Bbb = (function () { var Aaa = (function (_super) { __extends(Aaa, _super); function Aaa() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Aaa; }(Bbb)); diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js index 446c6df9c94d9..b20a463338cdc 100644 --- a/tests/baselines/reference/extBaseClass1.js +++ b/tests/baselines/reference/extBaseClass1.js @@ -37,7 +37,7 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); @@ -48,7 +48,7 @@ var M; var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(M.B)); @@ -59,7 +59,7 @@ var N; var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C3; }(M.B)); diff --git a/tests/baselines/reference/extBaseClass2.js b/tests/baselines/reference/extBaseClass2.js index f7bd85d685c25..3ab217eb01979 100644 --- a/tests/baselines/reference/extBaseClass2.js +++ b/tests/baselines/reference/extBaseClass2.js @@ -21,7 +21,7 @@ var N; var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C4; }(M.B)); @@ -32,7 +32,7 @@ var M; var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C5; }(B)); diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js index e52e5b497acce..74bbf3a27ac93 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -28,7 +28,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.baz = function () { }; return D; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js index 1f4f62a42ee82..fa7963487d579 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -33,7 +33,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.baz = function () { }; return D; diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js index d598389d0fa2a..596ab319b2ce8 100644 --- a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js @@ -12,7 +12,7 @@ var __extends = (this && this.__extends) || function (d, b) { var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return derived; }(base)); diff --git a/tests/baselines/reference/extendClassExpressionFromModule.js b/tests/baselines/reference/extendClassExpressionFromModule.js index 6532603b73c50..895cdedfaff65 100644 --- a/tests/baselines/reference/extendClassExpressionFromModule.js +++ b/tests/baselines/reference/extendClassExpressionFromModule.js @@ -31,7 +31,7 @@ var x = foo1; var y = (function (_super) { __extends(y, _super); function y() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return y; }(x)); diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.js b/tests/baselines/reference/extendConstructSignatureInInterface.js index 20f43a948b895..4bf92dd0315d9 100644 --- a/tests/baselines/reference/extendConstructSignatureInInterface.js +++ b/tests/baselines/reference/extendConstructSignatureInInterface.js @@ -20,7 +20,7 @@ var CStatic; var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(CStatic)); diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index 558e6d6ba5773..b23b601bc2902 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -19,7 +19,7 @@ var x = A; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(x)); // error, could not find symbol xs diff --git a/tests/baselines/reference/extendNonClassSymbol2.js b/tests/baselines/reference/extendNonClassSymbol2.js index 3785c7c58469e..78dfaa918277e 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.js +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -18,7 +18,7 @@ var x = new Foo(); // legal, considered a constructor function var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(Foo)); // error, could not find symbol Foo diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js index 6542492e200cf..da081154d8a2e 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js @@ -51,7 +51,7 @@ var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); @@ -67,7 +67,7 @@ var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.js b/tests/baselines/reference/extendsClauseAlreadySeen.js index fb9a3f1237858..267cd86eed09f 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen.js @@ -20,7 +20,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.baz = function () { }; return D; diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.js b/tests/baselines/reference/extendsClauseAlreadySeen2.js index 9423789dd3538..76fbc3365af2f 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.js @@ -20,7 +20,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.baz = function () { }; return D; diff --git a/tests/baselines/reference/fluentClasses.js b/tests/baselines/reference/fluentClasses.js index 3d5efcc1b1a64..ac44416e13392 100644 --- a/tests/baselines/reference/fluentClasses.js +++ b/tests/baselines/reference/fluentClasses.js @@ -35,7 +35,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return this; @@ -45,7 +45,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.baz = function () { return this; diff --git a/tests/baselines/reference/for-inStatements.js b/tests/baselines/reference/for-inStatements.js index 5c097a68ccc3b..4f52b5e1456f6 100644 --- a/tests/baselines/reference/for-inStatements.js +++ b/tests/baselines/reference/for-inStatements.js @@ -126,7 +126,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.boz = function () { for (var x in this.biz()) { } diff --git a/tests/baselines/reference/for-inStatementsInvalid.js b/tests/baselines/reference/for-inStatementsInvalid.js index caec9bd1987ce..d1181760a367d 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.js +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -107,7 +107,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.boz = function () { for (var x in this.biz()) { } diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js index aff01bc85655a..3666ad930a6cc 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -68,7 +68,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(C)); diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 2dc6c8a1bc442..433418af41d22 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -134,14 +134,14 @@ var AnotherClass = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index 6e37f929efef7..86636b84a87b8 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -236,7 +236,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -287,7 +287,7 @@ function f6() { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.js b/tests/baselines/reference/functionSubtypingOfVarArgs.js index 7485abe192735..55917962184ef 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.js @@ -32,7 +32,7 @@ var EventBase = (function () { var StringEvent = (function (_super) { __extends(StringEvent, _super); function StringEvent() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } StringEvent.prototype.add = function (listener) { _super.prototype.add.call(this, listener); diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.js b/tests/baselines/reference/functionSubtypingOfVarArgs2.js index 33d0e8c7e03e9..a676316459f93 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs2.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.js @@ -32,7 +32,7 @@ var EventBase = (function () { var StringEvent = (function (_super) { __extends(StringEvent, _super); function StringEvent() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } StringEvent.prototype.add = function (listener) { _super.prototype.add.call(this, listener); diff --git a/tests/baselines/reference/generatedContextualTyping.js b/tests/baselines/reference/generatedContextualTyping.js index e5488121d34eb..2a6911d9cf539 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -369,14 +369,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.js b/tests/baselines/reference/genericBaseClassLiteralProperty.js index 5aa43d78826a6..a075eff955014 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.js @@ -26,7 +26,7 @@ var BaseClass = (function () { var SubClass = (function (_super) { __extends(SubClass, _super); function SubClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SubClass.prototype.Error = function () { var x = this._getValue1(); diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.js b/tests/baselines/reference/genericBaseClassLiteralProperty2.js index 3226f1cd6595b..2b562742bf71c 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.js @@ -35,7 +35,7 @@ var BaseCollection2 = (function () { var DataView2 = (function (_super) { __extends(DataView2, _super); function DataView2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } DataView2.prototype.fillItems = function (item) { this._itemsByKey['dummy'] = item; diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js index 04d5bd2d99794..afef6224ba15b 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -122,14 +122,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index 509dd9a11360b..7b621b3ffd902 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -46,14 +46,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index d3f18e0bfcb24..892cda0ee2d64 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -54,7 +54,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index acab51690d343..addfbc756a8ed 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -52,14 +52,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js index 31b4cd181b97e..c2ad2ba29a395 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -46,7 +46,7 @@ var M; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(C1)); diff --git a/tests/baselines/reference/genericClassExpressionInFunction.js b/tests/baselines/reference/genericClassExpressionInFunction.js index f334da5262567..dc574dedb0097 100644 --- a/tests/baselines/reference/genericClassExpressionInFunction.js +++ b/tests/baselines/reference/genericClassExpressionInFunction.js @@ -47,7 +47,7 @@ function B1() { return (function (_super) { __extends(class_1, _super); function class_1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class_1; }(A)); @@ -57,7 +57,7 @@ var B2 = (function () { this.anon = (function (_super) { __extends(class_2, _super); function class_2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class_2; }(A)); @@ -68,7 +68,7 @@ function B3() { return (function (_super) { __extends(Inner, _super); function Inner() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Inner; }(A)); @@ -77,14 +77,14 @@ function B3() { var K = (function (_super) { __extends(K, _super); function K() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return K; }(B1())); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }((new B2().anon))); @@ -92,7 +92,7 @@ var b3Number = B3(); var S = (function (_super) { __extends(S, _super); function S() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return S; }(b3Number)); diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js index 9f71ace88a96c..1f3a6e17f1410 100644 --- a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js @@ -14,14 +14,14 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A; }(B)); var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(C)); diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index 8f90c2fb6e437..28eaf46496807 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -109,7 +109,7 @@ var PortalFx; var Validator = (function (_super) { __extends(Validator, _super); function Validator(message) { - _super.call(this, message); + return _super.call(this, message) || this; } return Validator; }(Portal.Controls.Validators.Validator)); diff --git a/tests/baselines/reference/genericClassStaticMethod.js b/tests/baselines/reference/genericClassStaticMethod.js index 394e6650e0a0e..4609e3bc9db45 100644 --- a/tests/baselines/reference/genericClassStaticMethod.js +++ b/tests/baselines/reference/genericClassStaticMethod.js @@ -26,7 +26,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Bar.getFoo = function () { }; diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js index 2bd33efb3dcfb..5371e2479aad0 100644 --- a/tests/baselines/reference/genericClasses3.js +++ b/tests/baselines/reference/genericClasses3.js @@ -31,7 +31,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index d2bf12667fc9e..b0974c26edefc 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -52,7 +52,7 @@ var EndGate; var NumberTween = (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { - _super.call(this, from); + return _super.call(this, from) || this; } return NumberTween; }(Tweening.Tween)); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index f61f57cb6157f..a403c0de0b3a5 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -51,7 +51,7 @@ var EndGate; var NumberTween = (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { - _super.call(this, from); + return _super.call(this, from) || this; } return NumberTween; }(Tweening.Tween)); diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js index 906145850f15a..1b455073196dd 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js @@ -26,7 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js index 1c73075acc4f4..0abd655e1daaa 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js @@ -26,7 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/genericInheritedDefaultConstructors.js b/tests/baselines/reference/genericInheritedDefaultConstructors.js index 170ef89abb2c4..059a3213b7aa0 100644 --- a/tests/baselines/reference/genericInheritedDefaultConstructors.js +++ b/tests/baselines/reference/genericInheritedDefaultConstructors.js @@ -24,7 +24,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/genericPrototypeProperty2.js b/tests/baselines/reference/genericPrototypeProperty2.js index 3f1b6e21adc86..eac025cce9ba9 100644 --- a/tests/baselines/reference/genericPrototypeProperty2.js +++ b/tests/baselines/reference/genericPrototypeProperty2.js @@ -29,7 +29,7 @@ var BaseEvent = (function () { var MyEvent = (function (_super) { __extends(MyEvent, _super); function MyEvent() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyEvent; }(BaseEvent)); @@ -41,7 +41,7 @@ var BaseEventWrapper = (function () { var MyEventWrapper = (function (_super) { __extends(MyEventWrapper, _super); function MyEventWrapper() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyEventWrapper; }(BaseEventWrapper)); diff --git a/tests/baselines/reference/genericPrototypeProperty3.js b/tests/baselines/reference/genericPrototypeProperty3.js index b7cca85561c63..9e3ede0019d03 100644 --- a/tests/baselines/reference/genericPrototypeProperty3.js +++ b/tests/baselines/reference/genericPrototypeProperty3.js @@ -28,7 +28,7 @@ var BaseEvent = (function () { var MyEvent = (function (_super) { __extends(MyEvent, _super); function MyEvent() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyEvent; }(BaseEvent)); @@ -40,7 +40,7 @@ var BaseEventWrapper = (function () { var MyEventWrapper = (function (_super) { __extends(MyEventWrapper, _super); function MyEventWrapper() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyEventWrapper; }(BaseEventWrapper)); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js index 73012f714e8af..6d65ee5531b6d 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js @@ -57,7 +57,7 @@ var TypeScript2; var PullTypeSymbol = (function (_super) { __extends(PullTypeSymbol, _super); function PullTypeSymbol() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PullTypeSymbol; }(PullSymbol)); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index 61cb758c48e76..5a02ceb0ff4b5 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -59,8 +59,9 @@ var TypeScript; var PullTypeSymbol = (function (_super) { __extends(PullTypeSymbol, _super); function PullTypeSymbol() { - _super.apply(this, arguments); - this._elementType = null; + var _this = _super.apply(this, arguments) || this; + _this._elementType = null; + return _this; } PullTypeSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { var s = this.getScopedNameEx(scopeSymbol, useConstraintInName).toString(); diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index 02a51aed35de1..687d593f01e12 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -28,7 +28,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return null; diff --git a/tests/baselines/reference/genericTypeAssertions4.js b/tests/baselines/reference/genericTypeAssertions4.js index 2c5bbf51d7f89..50dbe5debbd9a 100644 --- a/tests/baselines/reference/genericTypeAssertions4.js +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -40,7 +40,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return 1; }; return B; @@ -48,7 +48,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.baz = function () { return 1; }; return C; diff --git a/tests/baselines/reference/genericTypeAssertions6.js b/tests/baselines/reference/genericTypeAssertions6.js index 5bc7a943163d4..7bbd7351f1dd4 100644 --- a/tests/baselines/reference/genericTypeAssertions6.js +++ b/tests/baselines/reference/genericTypeAssertions6.js @@ -44,7 +44,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.g = function (x) { var a = x; diff --git a/tests/baselines/reference/genericTypeConstraints.js b/tests/baselines/reference/genericTypeConstraints.js index 5f4bb41a83fc9..67303166aa327 100644 --- a/tests/baselines/reference/genericTypeConstraints.js +++ b/tests/baselines/reference/genericTypeConstraints.js @@ -38,7 +38,7 @@ var Bar = (function () { var BarExtended = (function (_super) { __extends(BarExtended, _super); function BarExtended() { - _super.call(this); + return _super.call(this) || this; } return BarExtended; }(Bar)); diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index 7fe6c49d65efd..cf19feede3436 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -60,7 +60,7 @@ var g = function f(x) { var y; return y; }; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -76,7 +76,7 @@ var M; var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(M.E)); diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js index 12be456a8a829..973ee23176282 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -55,14 +55,14 @@ var g = function f(x) { var y; return y; }; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(I)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(M.C)); diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js index 1f016b401ede4..d6fb98b67cae0 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -31,7 +31,7 @@ define(["require", "exports"], function (require, exports) { var List = (function (_super) { __extends(List, _super); function List() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } List.prototype.Bar = function () { }; return List; @@ -46,7 +46,7 @@ define(["require", "exports"], function (require, exports) { var ListItem = (function (_super) { __extends(ListItem, _super); function ListItem() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ListItem; }(CollectionItem)); diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index e482f0d33d3c2..60a8976722d7f 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -160,14 +160,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index 75762ffbb54de..483370bee5c5c 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -177,7 +177,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(C)); diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index 88671ce1ceeea..868d53daad54b 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -34,18 +34,20 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var r2 = function () { return _super.call(this); }; - var r3 = function () { _super.call(this); }; - var r4 = function () { _super.call(this); }; + var _this; + var r2 = function () { return _this = _super.call(this) || this; }; + var r3 = function () { _this = _super.call(this) || this; }; + var r4 = function () { _this = _super.call(this) || this; }; var r5 = { get foo() { - _super.call(this); + _this = _super.call(this) || this; return 1; }, set foo(v) { - _super.call(this); + _this = _super.call(this) || this; } }; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/implementClausePrecedingExtends.js b/tests/baselines/reference/implementClausePrecedingExtends.js index ba3583c3051aa..df725cde43a08 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.js +++ b/tests/baselines/reference/implementClausePrecedingExtends.js @@ -16,7 +16,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js index 8fec5dc27da52..a5a5e02c15675 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -99,21 +99,21 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar3; }(Foo)); @@ -128,28 +128,28 @@ var M; var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Baz; }(Foo)); var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar3; }(Foo)); @@ -165,14 +165,14 @@ var M2; var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Baz; }(Foo)); var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); @@ -183,14 +183,14 @@ var M2; var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar3; }(Foo)); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js index 915e652056cc4..d0f7484714164 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js @@ -75,28 +75,28 @@ var Bar4 = (function () { var Bar5 = (function (_super) { __extends(Bar5, _super); function Bar5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar5; }(Foo)); var Bar6 = (function (_super) { __extends(Bar6, _super); function Bar6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar6; }(Foo)); var Bar7 = (function (_super) { __extends(Bar7, _super); function Bar7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar7; }(Foo)); var Bar8 = (function (_super) { __extends(Bar8, _super); function Bar8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar8; }(Foo)); diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js index 60e142dd5f71b..b4f45cac8067a 100644 --- a/tests/baselines/reference/importAsBaseClass.js +++ b/tests/baselines/reference/importAsBaseClass.js @@ -30,7 +30,7 @@ var Greeter = require("./importAsBaseClass_0"); var Hello = (function (_super) { __extends(Hello, _super); function Hello() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Hello; }(Greeter)); diff --git a/tests/baselines/reference/importHelpers.js b/tests/baselines/reference/importHelpers.js index f850b5cf17727..ae4d312701024 100644 --- a/tests/baselines/reference/importHelpers.js +++ b/tests/baselines/reference/importHelpers.js @@ -45,7 +45,7 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -93,7 +93,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersAmd.js b/tests/baselines/reference/importHelpersAmd.js index bb02cbf04173a..fea93840fa92c 100644 --- a/tests/baselines/reference/importHelpersAmd.js +++ b/tests/baselines/reference/importHelpersAmd.js @@ -32,7 +32,7 @@ define(["require", "exports", "tslib", "./a"], function (require, exports, tslib var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/importHelpersInIsolatedModules.js b/tests/baselines/reference/importHelpersInIsolatedModules.js index a5929bc152cf2..28c00f975544c 100644 --- a/tests/baselines/reference/importHelpersInIsolatedModules.js +++ b/tests/baselines/reference/importHelpersInIsolatedModules.js @@ -45,7 +45,7 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -78,7 +78,7 @@ var A = (function () { var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersNoHelpers.js b/tests/baselines/reference/importHelpersNoHelpers.js index 8c5afc99ece8b..e22d1f4353d71 100644 --- a/tests/baselines/reference/importHelpersNoHelpers.js +++ b/tests/baselines/reference/importHelpersNoHelpers.js @@ -39,7 +39,7 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -87,7 +87,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersNoModule.js b/tests/baselines/reference/importHelpersNoModule.js index 36bc0c5f76bee..41df9710f3325 100644 --- a/tests/baselines/reference/importHelpersNoModule.js +++ b/tests/baselines/reference/importHelpersNoModule.js @@ -37,7 +37,7 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -85,7 +85,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersOutFile.js b/tests/baselines/reference/importHelpersOutFile.js index cb50330c20c65..a45f6285782cd 100644 --- a/tests/baselines/reference/importHelpersOutFile.js +++ b/tests/baselines/reference/importHelpersOutFile.js @@ -35,7 +35,7 @@ define("b", ["require", "exports", "tslib", "a"], function (require, exports, ts var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(a_1.A)); @@ -46,7 +46,7 @@ define("c", ["require", "exports", "tslib", "a"], function (require, exports, ts var C = (function (_super) { tslib_2.__extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(a_2.A)); diff --git a/tests/baselines/reference/importHelpersSystem.js b/tests/baselines/reference/importHelpersSystem.js index 3c1ee19ec48a9..20f2d299c5254 100644 --- a/tests/baselines/reference/importHelpersSystem.js +++ b/tests/baselines/reference/importHelpersSystem.js @@ -51,7 +51,7 @@ System.register(["tslib", "./a"], function (exports_1, context_1) { B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/importShadowsGlobalName.js b/tests/baselines/reference/importShadowsGlobalName.js index 316a94d9069b2..34cc0604e7ae9 100644 --- a/tests/baselines/reference/importShadowsGlobalName.js +++ b/tests/baselines/reference/importShadowsGlobalName.js @@ -31,7 +31,7 @@ define(["require", "exports", "Foo"], function (require, exports, Error) { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar; }(Error)); diff --git a/tests/baselines/reference/importUsedInExtendsList1.js b/tests/baselines/reference/importUsedInExtendsList1.js index b9827d5bc9368..a40c3a51a782b 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.js +++ b/tests/baselines/reference/importUsedInExtendsList1.js @@ -31,7 +31,7 @@ var foo = require("./importUsedInExtendsList1_require"); var Sub = (function (_super) { __extends(Sub, _super); function Sub() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Sub; }(foo.Super)); diff --git a/tests/baselines/reference/indexerConstraints2.js b/tests/baselines/reference/indexerConstraints2.js index dd143da97e672..d7357f021d0ed 100644 --- a/tests/baselines/reference/indexerConstraints2.js +++ b/tests/baselines/reference/indexerConstraints2.js @@ -42,7 +42,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -55,7 +55,7 @@ var F = (function () { var G = (function (_super) { __extends(G, _super); function G() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return G; }(F)); @@ -68,7 +68,7 @@ var H = (function () { var I = (function (_super) { __extends(I, _super); function I() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return I; }(H)); @@ -81,7 +81,7 @@ var J = (function () { var K = (function (_super) { __extends(K, _super); function K() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return K; }(J)); diff --git a/tests/baselines/reference/indirectSelfReference.js b/tests/baselines/reference/indirectSelfReference.js index 66d23a45b7267..2f4f37b9b53a5 100644 --- a/tests/baselines/reference/indirectSelfReference.js +++ b/tests/baselines/reference/indirectSelfReference.js @@ -11,14 +11,14 @@ var __extends = (this && this.__extends) || function (d, b) { var a = (function (_super) { __extends(a, _super); function a() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return a; }(b)); var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.js b/tests/baselines/reference/indirectSelfReferenceGeneric.js index 99ab918e63142..9171bb0eeb6ee 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.js +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.js @@ -11,14 +11,14 @@ var __extends = (this && this.__extends) || function (d, b) { var a = (function (_super) { __extends(a, _super); function a() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return a; }(b)); var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js index 6321f77d31fb0..ad1a063bfb0fd 100644 --- a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js @@ -43,7 +43,7 @@ var Base = (function () { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A; }(Base)); diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.js b/tests/baselines/reference/inheritFromGenericTypeParameter.js index f5bc099cb8dcf..40e6abd3e5366 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.js +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(T)); diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js index 9462df7a3c3af..a0874eb1c723f 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js @@ -24,14 +24,14 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(B)); diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js index 52fbfaffddeca..cbfef2d3382a4 100644 --- a/tests/baselines/reference/inheritance.js +++ b/tests/baselines/reference/inheritance.js @@ -53,14 +53,14 @@ var B2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(B2)); @@ -72,7 +72,7 @@ var N = (function () { var ND = (function (_super) { __extends(ND, _super); function ND() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ND; }(N)); @@ -86,7 +86,7 @@ var Good = (function () { var Baad = (function (_super) { __extends(Baad, _super); function Baad() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Baad.prototype.f = function () { return 0; }; Baad.prototype.g = function (n) { return 0; }; diff --git a/tests/baselines/reference/inheritance1.js b/tests/baselines/reference/inheritance1.js index c65155ee55ccc..86de0b7635066 100644 --- a/tests/baselines/reference/inheritance1.js +++ b/tests/baselines/reference/inheritance1.js @@ -75,7 +75,7 @@ var Control = (function () { var Button = (function (_super) { __extends(Button, _super); function Button() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Button.prototype.select = function () { }; return Button; @@ -83,7 +83,7 @@ var Button = (function (_super) { var TextBox = (function (_super) { __extends(TextBox, _super); function TextBox() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } TextBox.prototype.select = function () { }; return TextBox; @@ -91,14 +91,14 @@ var TextBox = (function (_super) { var ImageBase = (function (_super) { __extends(ImageBase, _super); function ImageBase() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ImageBase; }(Control)); var Image1 = (function (_super) { __extends(Image1, _super); function Image1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Image1; }(Control)); diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js index b416cf3fb93de..57a9c89758357 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -25,14 +25,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.myMethod = function () { }; return C; diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js index 25a977531ca45..83c5aa3e4cdfc 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -25,14 +25,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.myMethod = function () { }; return C; diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js index dfd055569257f..b11b6e318a7cb 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -25,14 +25,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.myMethod = function () { }; return C; diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js index b4efaa896211b..09ea08899d9dd 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js @@ -40,7 +40,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(b.prototype, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js index 5044a8e03ac29..59d2abdaab2b5 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js @@ -31,7 +31,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(b.prototype, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js index 6ebdc336a6445..98a95747a8e8b 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js @@ -26,7 +26,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(b.prototype, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js index 3ddff027c1a01..0d54e5d42fab9 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js @@ -37,7 +37,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.prototype.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js index a6c3beea4efb3..9af25c6fdb807 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js @@ -28,7 +28,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.prototype.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js index 94b602d29d9ee..5c77ce081010d 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js @@ -23,7 +23,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.prototype.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js index a8fc4d5a3dd71..82c7a94d17c77 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js @@ -37,7 +37,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js index 7d5cdb43e96c8..e6929218e6396 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js @@ -26,7 +26,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js index 648f1d1622e92..85764cddc5230 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js @@ -21,7 +21,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js index 59675c56e5fd0..28fe814450996 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -21,7 +21,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js index 97464233027b9..0cc71e168f4a8 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -40,7 +40,7 @@ var N; var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(M.C1)); @@ -48,7 +48,7 @@ var N; var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(M.C2)); diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js index 49145b010d4ba..bb91ee5f9ead4 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js @@ -40,7 +40,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(b, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js index 4a202b7649792..363852a84bf49 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js @@ -31,7 +31,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(b, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js index a0dd1177cfb45..ba8df7a5f0bca 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js @@ -26,7 +26,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(b, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js index 06f907371ea1b..e464029fba5d9 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js @@ -37,7 +37,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js index ea36c40480f0b..cc825cfa9b5e8 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js @@ -32,7 +32,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js index ae523d53d9bcf..466c65fa7d5b1 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js @@ -28,7 +28,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js index 93890bd829457..dfc0ce2c13fcd 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js @@ -23,7 +23,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js index 4d0f2438459d2..da7850f2071fd 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js @@ -23,7 +23,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js index f2dfda4e48ffa..d5916a9d452c1 100644 --- a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js @@ -23,7 +23,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } b.x = function () { return new b().x; diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.js b/tests/baselines/reference/inheritanceStaticMembersCompatible.js index 0dc736a375d7a..b4cae99b64be9 100644 --- a/tests/baselines/reference/inheritanceStaticMembersCompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.js @@ -21,7 +21,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js index 51c474430ad1f..38c637dd8d1b0 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js @@ -21,7 +21,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js index d138ac3eba8f7..49dc86fc50036 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js @@ -36,7 +36,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js index 3d3f550713ebc..bcd63537540d8 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js @@ -26,7 +26,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js index e23917e40a411..c1bdd9b66a234 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js @@ -21,7 +21,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.js b/tests/baselines/reference/inheritedConstructorWithRestParams.js index 2d312d9859daa..c9db175667637 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.js @@ -32,7 +32,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.js b/tests/baselines/reference/inheritedConstructorWithRestParams2.js index 0ad25b302f059..9a1b13a84348c 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.js @@ -53,14 +53,14 @@ var BaseBase2 = (function () { var Base = (function (_super) { __extends(Base, _super); function Base() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Base; }(BaseBase)); var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js index 95b71069584ce..7ba382e8c470b 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.js +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -38,7 +38,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -53,7 +53,7 @@ var D; var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.bar = function () { return this.foo(); diff --git a/tests/baselines/reference/instanceOfAssignability.js b/tests/baselines/reference/instanceOfAssignability.js index 775afe869461b..b8f39c5b0e21a 100644 --- a/tests/baselines/reference/instanceOfAssignability.js +++ b/tests/baselines/reference/instanceOfAssignability.js @@ -115,14 +115,14 @@ var Animal = (function () { var Mammal = (function (_super) { __extends(Mammal, _super); function Mammal() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Mammal; }(Animal)); var Giraffe = (function (_super) { __extends(Giraffe, _super); function Giraffe() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Giraffe; }(Mammal)); diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js index a507a19a456ee..8dc5227685f76 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js @@ -69,7 +69,7 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -101,7 +101,7 @@ var Generic; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/instanceSubtypeCheck2.js b/tests/baselines/reference/instanceSubtypeCheck2.js index d72f29e93bf0d..914f37960012e 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.js +++ b/tests/baselines/reference/instanceSubtypeCheck2.js @@ -21,7 +21,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js index 97be21377229d..54a574238e562 100644 --- a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js +++ b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js @@ -128,7 +128,7 @@ var A = (function () { var A1 = (function (_super) { __extends(A1, _super); function A1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A1; }(A)); @@ -140,7 +140,7 @@ var A2 = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.js b/tests/baselines/reference/instantiatedReturnTypeContravariance.js index 4d5e437630809..bc496a63632d3 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.js +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.js @@ -47,7 +47,7 @@ var c = (function () { var d = (function (_super) { __extends(d, _super); function d() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } d.prototype.foo = function () { return null; diff --git a/tests/baselines/reference/interfaceClassMerging.js b/tests/baselines/reference/interfaceClassMerging.js index 8138e7888b344..6542376a19bde 100644 --- a/tests/baselines/reference/interfaceClassMerging.js +++ b/tests/baselines/reference/interfaceClassMerging.js @@ -57,7 +57,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Bar.prototype.method = function (a) { return this.optionalProperty; diff --git a/tests/baselines/reference/interfaceClassMerging2.js b/tests/baselines/reference/interfaceClassMerging2.js index 99f5b07696d57..70a62da4131ed 100644 --- a/tests/baselines/reference/interfaceClassMerging2.js +++ b/tests/baselines/reference/interfaceClassMerging2.js @@ -53,7 +53,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Bar.prototype.classBarMethod = function () { return this; diff --git a/tests/baselines/reference/interfaceExtendsClass1.js b/tests/baselines/reference/interfaceExtendsClass1.js index 43c7c6f6fa473..8324a001f9146 100644 --- a/tests/baselines/reference/interfaceExtendsClass1.js +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -32,7 +32,7 @@ var Control = (function () { var Button = (function (_super) { __extends(Button, _super); function Button() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Button.prototype.select = function () { }; return Button; @@ -40,7 +40,7 @@ var Button = (function (_super) { var TextBox = (function (_super) { __extends(TextBox, _super); function TextBox() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } TextBox.prototype.select = function () { }; return TextBox; @@ -48,7 +48,7 @@ var TextBox = (function (_super) { var Image = (function (_super) { __extends(Image, _super); function Image() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Image; }(Control)); diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js index e1bdbff85dd9d..1179ff101df0b 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -43,7 +43,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.foo = function (x) { return x; }; D.prototype.other = function (x) { return x; }; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index 1592b1a723b54..49b5efbd01268 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -39,9 +39,10 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); - this.x = 2; - this.y = 3; + var _this = _super.apply(this, arguments) || this; + _this.x = 2; + _this.y = 3; + return _this; } D.prototype.foo = function (x) { return x; }; D.prototype.other = function (x) { return x; }; @@ -51,8 +52,9 @@ var D = (function (_super) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); - this.x = ""; + var _this = _super.apply(this, arguments) || this; + _this.x = ""; + return _this; } D2.prototype.foo = function (x) { return x; }; D2.prototype.other = function (x) { return x; }; diff --git a/tests/baselines/reference/interfaceImplementation8.js b/tests/baselines/reference/interfaceImplementation8.js index edfb33bfe1b4f..afb5a795264cc 100644 --- a/tests/baselines/reference/interfaceImplementation8.js +++ b/tests/baselines/reference/interfaceImplementation8.js @@ -64,21 +64,21 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C4; }(C1)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C5; }(C2)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C6; }(C3)); @@ -90,7 +90,7 @@ var C7 = (function () { var C8 = (function (_super) { __extends(C8, _super); function C8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C8; }(C7)); diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js index cb3c22b52eb16..6e9b09c906f8e 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js @@ -95,7 +95,7 @@ var Y; var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return BB; }(A)); @@ -110,7 +110,7 @@ var Y2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(AA)); @@ -144,7 +144,7 @@ var YY; var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return BB; }(A)); @@ -159,7 +159,7 @@ var YY2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(AA)); @@ -193,7 +193,7 @@ var YYY; var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return BB; }(A)); @@ -208,7 +208,7 @@ var YYY2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(AA)); diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js index 0c90c6d002598..340429cc3982c 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.js +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -67,7 +67,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(C)); diff --git a/tests/baselines/reference/invalidReturnStatements.js b/tests/baselines/reference/invalidReturnStatements.js index 0f5b0d3e08dd5..a6b07b7d7bd3a 100644 --- a/tests/baselines/reference/invalidReturnStatements.js +++ b/tests/baselines/reference/invalidReturnStatements.js @@ -41,7 +41,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/isolatedModulesImportExportElision.js b/tests/baselines/reference/isolatedModulesImportExportElision.js index 2d391a64fe72b..6f1d38dcbb5bf 100644 --- a/tests/baselines/reference/isolatedModulesImportExportElision.js +++ b/tests/baselines/reference/isolatedModulesImportExportElision.js @@ -26,7 +26,7 @@ var ns = require("module"); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(module_2.c2.C)); diff --git a/tests/baselines/reference/jsxViaImport.js b/tests/baselines/reference/jsxViaImport.js index 63c84090c9cb2..604787af744e6 100644 --- a/tests/baselines/reference/jsxViaImport.js +++ b/tests/baselines/reference/jsxViaImport.js @@ -35,7 +35,7 @@ var BaseComponent = require("BaseComponent"); var TestComponent = (function (_super) { __extends(TestComponent, _super); function TestComponent() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } TestComponent.prototype.render = function () { return ; diff --git a/tests/baselines/reference/lambdaArgCrash.js b/tests/baselines/reference/lambdaArgCrash.js index 822aa71efd047..47db7f3ce64c1 100644 --- a/tests/baselines/reference/lambdaArgCrash.js +++ b/tests/baselines/reference/lambdaArgCrash.js @@ -56,7 +56,7 @@ var Event = (function () { var ItemSetEvent = (function (_super) { __extends(ItemSetEvent, _super); function ItemSetEvent() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } ItemSetEvent.prototype.add = function (listener) { _super.prototype.add.call(this, listener); diff --git a/tests/baselines/reference/lift.js b/tests/baselines/reference/lift.js index 568379948bcf3..364d52d938567 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -32,9 +32,10 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C(y, z, w) { - _super.call(this, y); + var _this = _super.call(this, y) || this; var x = 10 + w; var ll = x * w; + return _this; } C.prototype.liftxyz = function () { return x + z + this.y; }; C.prototype.liftxylocllz = function () { return x + z + this.y + this.ll; }; diff --git a/tests/baselines/reference/localTypes1.js b/tests/baselines/reference/localTypes1.js index a4f835c8669c7..100452b7a96c0 100644 --- a/tests/baselines/reference/localTypes1.js +++ b/tests/baselines/reference/localTypes1.js @@ -300,7 +300,7 @@ function f6() { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -308,7 +308,7 @@ function f6() { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/m7Bugs.js b/tests/baselines/reference/m7Bugs.js index 6292356faf553..e5a4d11f00cd8 100644 --- a/tests/baselines/reference/m7Bugs.js +++ b/tests/baselines/reference/m7Bugs.js @@ -42,7 +42,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/mergedDeclarations5.js b/tests/baselines/reference/mergedDeclarations5.js index ce4b929c7f99c..b24e86eca5815 100644 --- a/tests/baselines/reference/mergedDeclarations5.js +++ b/tests/baselines/reference/mergedDeclarations5.js @@ -27,7 +27,7 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.foo = function () { }; return B; diff --git a/tests/baselines/reference/mergedDeclarations6.js b/tests/baselines/reference/mergedDeclarations6.js index 2ff9d3e660423..d610e4ab46f3d 100644 --- a/tests/baselines/reference/mergedDeclarations6.js +++ b/tests/baselines/reference/mergedDeclarations6.js @@ -47,7 +47,7 @@ define(["require", "exports", "./a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.setProtected = function () { }; diff --git a/tests/baselines/reference/mergedInheritedClassInterface.js b/tests/baselines/reference/mergedInheritedClassInterface.js index 72ac1c8a92882..0f598f2cf7858 100644 --- a/tests/baselines/reference/mergedInheritedClassInterface.js +++ b/tests/baselines/reference/mergedInheritedClassInterface.js @@ -61,7 +61,7 @@ var BaseClass = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Child.prototype.method = function () { }; return Child; @@ -75,7 +75,7 @@ var ChildNoBaseClass = (function () { var Grandchild = (function (_super) { __extends(Grandchild, _super); function Grandchild() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Grandchild; }(ChildNoBaseClass)); diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js index a7e341c31cebd..6dccf1dfdd9e9 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -50,14 +50,14 @@ var C2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(C2)); diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js index 3d9c4e1175ed8..a3ca796575c66 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js @@ -57,7 +57,7 @@ var C2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/missingPropertiesOfClassExpression.js b/tests/baselines/reference/missingPropertiesOfClassExpression.js index 54834397b64c2..c7b30882b145e 100644 --- a/tests/baselines/reference/missingPropertiesOfClassExpression.js +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.js @@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || function (d, b) { var George = (function (_super) { __extends(George, _super); function George() { - _super.call(this); + return _super.call(this) || this; } return George; }((function () { diff --git a/tests/baselines/reference/moduleAsBaseType.js b/tests/baselines/reference/moduleAsBaseType.js index 71f168463635a..fc0533a2470e3 100644 --- a/tests/baselines/reference/moduleAsBaseType.js +++ b/tests/baselines/reference/moduleAsBaseType.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(M)); diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js index cd2df2633aed0..51d9eb89b1d2c 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js @@ -31,7 +31,7 @@ define(["require", "exports"], function (require, exports) { var Test1 = (function (_super) { __extends(Test1, _super); function Test1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Test1; }(C1)); diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js index ec434286f4327..1558ef742ab14 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -79,14 +79,14 @@ var A; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(AA)); var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return BB; }(A)); @@ -130,7 +130,7 @@ var Y; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(AA)); @@ -138,7 +138,7 @@ var Y; var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return BB; }(A)); diff --git a/tests/baselines/reference/multipleInheritance.js b/tests/baselines/reference/multipleInheritance.js index 26372bfb71827..9c0e865cdb774 100644 --- a/tests/baselines/reference/multipleInheritance.js +++ b/tests/baselines/reference/multipleInheritance.js @@ -57,28 +57,28 @@ var B2 = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B1)); var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(B2)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(D1)); @@ -90,7 +90,7 @@ var N = (function () { var ND = (function (_super) { __extends(ND, _super); function ND() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ND; }(N)); @@ -104,7 +104,7 @@ var Good = (function () { var Baad = (function (_super) { __extends(Baad, _super); function Baad() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Baad.prototype.f = function () { return 0; }; Baad.prototype.g = function (n) { return 0; }; diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js index c8cca671327e1..8b59564d46595 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -25,7 +25,7 @@ var foo = (function () { var foo2 = (function (_super) { __extends(foo2, _super); function foo2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return foo2; }(foo)); diff --git a/tests/baselines/reference/noEmitHelpers.js b/tests/baselines/reference/noEmitHelpers.js index b2c26c6af75df..fdb7cbab7d4ed 100644 --- a/tests/baselines/reference/noEmitHelpers.js +++ b/tests/baselines/reference/noEmitHelpers.js @@ -13,7 +13,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js index 69d98d4b0c6f8..cc4c942237329 100644 --- a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js @@ -26,7 +26,7 @@ var Parent = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(Child.prototype, "message", { set: function (str) { diff --git a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js index 7ad703fd3b72d..1323955c05e7f 100644 --- a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js @@ -25,7 +25,7 @@ var Parent = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(Child.prototype, "message", { get: function () { diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js index b9927ebf193e9..b0a3365193d25 100644 --- a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -19,7 +19,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); // Valid diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js index cef2759e1d530..92c8b380e00af 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -61,7 +61,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return ''; }; return B; diff --git a/tests/baselines/reference/numericIndexerConstraint3.js b/tests/baselines/reference/numericIndexerConstraint3.js index 9f7a61fe30d0d..29cb75b423469 100644 --- a/tests/baselines/reference/numericIndexerConstraint3.js +++ b/tests/baselines/reference/numericIndexerConstraint3.js @@ -26,7 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js index a9eace23833da..135e169c4a9f8 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.js +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -26,7 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js index 47fb46794f093..5b9e797bdecde 100644 --- a/tests/baselines/reference/numericIndexerTyping2.js +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -26,7 +26,7 @@ var I = (function () { var I2 = (function (_super) { __extends(I2, _super); function I2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return I2; }(I)); diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index dce09972c8387..a1739ce0d8e29 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -81,50 +81,56 @@ var Food = (function () { var MonsterFood = (function (_super) { __extends(MonsterFood, _super); function MonsterFood(name, flavor) { - _super.call(this, name); - this.flavor = flavor; + var _this = _super.call(this, name) || this; + _this.flavor = flavor; + return _this; } return MonsterFood; }(Food)); var IceCream = (function (_super) { __extends(IceCream, _super); function IceCream(flavor) { - _super.call(this, "Ice Cream", flavor); - this.flavor = flavor; + var _this = _super.call(this, "Ice Cream", flavor) || this; + _this.flavor = flavor; + return _this; } return IceCream; }(MonsterFood)); var Cookie = (function (_super) { __extends(Cookie, _super); function Cookie(flavor, isGlutenFree) { - _super.call(this, "Cookie", flavor); - this.flavor = flavor; - this.isGlutenFree = isGlutenFree; + var _this = _super.call(this, "Cookie", flavor) || this; + _this.flavor = flavor; + _this.isGlutenFree = isGlutenFree; + return _this; } return Cookie; }(MonsterFood)); var PetFood = (function (_super) { __extends(PetFood, _super); function PetFood(name, whereToBuy) { - _super.call(this, name); - this.whereToBuy = whereToBuy; + var _this = _super.call(this, name) || this; + _this.whereToBuy = whereToBuy; + return _this; } return PetFood; }(Food)); var ExpensiveOrganicDogFood = (function (_super) { __extends(ExpensiveOrganicDogFood, _super); function ExpensiveOrganicDogFood(whereToBuy) { - _super.call(this, "Origen", whereToBuy); - this.whereToBuy = whereToBuy; + var _this = _super.call(this, "Origen", whereToBuy) || this; + _this.whereToBuy = whereToBuy; + return _this; } return ExpensiveOrganicDogFood; }(PetFood)); var ExpensiveOrganicCatFood = (function (_super) { __extends(ExpensiveOrganicCatFood, _super); function ExpensiveOrganicCatFood(whereToBuy, containsFish) { - _super.call(this, "Nature's Logic", whereToBuy); - this.whereToBuy = whereToBuy; - this.containsFish = containsFish; + var _this = _super.call(this, "Nature's Logic", whereToBuy) || this; + _this.whereToBuy = whereToBuy; + _this.containsFish = containsFish; + return _this; } return ExpensiveOrganicCatFood; }(PetFood)); diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index 9c5bcfb8e2d43..17045d65af0a9 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -68,7 +68,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js index 29781229b5abe..e82cef9bdd6f2 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -147,14 +147,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js index 7ecb597a2d9ab..abcea11367078 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -140,7 +140,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -162,14 +162,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js index 9710afe700d05..f5aeb177472f7 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -147,14 +147,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js index 7d6be5eaf8fbe..3946027063f4d 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -145,14 +145,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js index cb9c677f024ef..9cae6960a2ea0 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -53,7 +53,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js index 241fbcaf27e96..68754a583aa15 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js @@ -39,7 +39,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(C1)); @@ -53,7 +53,7 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C4; }(C3)); diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js index c0578c2fba18b..b0211bbbba741 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -147,14 +147,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js index 0670d45a5a529..00d7d1e81d84d 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -140,7 +140,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -162,14 +162,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index 3e6a47b4de21a..e460ab3fb15b3 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -25,7 +25,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/optionalMethods.js b/tests/baselines/reference/optionalMethods.js index 98629f5718bff..28ed0bcd76e38 100644 --- a/tests/baselines/reference/optionalMethods.js +++ b/tests/baselines/reference/optionalMethods.js @@ -109,8 +109,9 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); - this.a = 1; + var _this = _super.apply(this, arguments) || this; + _this.a = 1; + return _this; } Derived.prototype.f = function () { return 1; }; return Derived; diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 6d42c38f90738..1b603898aa698 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -162,7 +162,7 @@ var C2 = (function (_super) { __extends(C2, _super); function C2(v2) { if (v2 === void 0) { v2 = 6; } - _super.call(this, v2); + return _super.call(this, v2) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js index f6ccdbe3fab16..1312a89502ad1 100644 --- a/tests/baselines/reference/optionalParamInOverride.js +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -22,7 +22,7 @@ var Z = (function () { var Y = (function (_super) { __extends(Y, _super); function Y() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Y.prototype.func = function (value) { }; return Y; diff --git a/tests/baselines/reference/optionalParameterProperty.js b/tests/baselines/reference/optionalParameterProperty.js index 48cefeef22ce6..f9b9ecaf99091 100644 --- a/tests/baselines/reference/optionalParameterProperty.js +++ b/tests/baselines/reference/optionalParameterProperty.js @@ -25,8 +25,9 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D(p) { - _super.call(this); - this.p = p; + var _this = _super.call(this) || this; + _this.p = p; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/outModuleConcatAmd.js b/tests/baselines/reference/outModuleConcatAmd.js index 8a478e675c69e..5054c2a3c335e 100644 --- a/tests/baselines/reference/outModuleConcatAmd.js +++ b/tests/baselines/reference/outModuleConcatAmd.js @@ -28,7 +28,7 @@ define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/outModuleConcatAmd.js.map b/tests/baselines/reference/outModuleConcatAmd.js.map index 7f9893b234677..e987d5deb8a10 100644 --- a/tests/baselines/reference/outModuleConcatAmd.js.map +++ b/tests/baselines/reference/outModuleConcatAmd.js.map @@ -1,2 +1,2 @@ //// [all.js.map] -{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;IACA;QAAA;QAAiB,CAAC;QAAD,QAAC;IAAD,CAAC,AAAlB,IAAkB;IAAlB,cAAkB;;;;ICAlB;QAAuB,qBAAC;QAAxB;YAAuB,8BAAC;QAAG,CAAC;QAAD,QAAC;IAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;IAA5B,cAA4B"} \ No newline at end of file +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;IACA;QAAA;QAAiB,CAAC;QAAD,QAAC;IAAD,CAAC,AAAlB,IAAkB;IAAlB,cAAkB;;;;ICAlB;QAAuB,qBAAC;QAAxB;;QAA2B,CAAC;QAAD,QAAC;IAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;IAA5B,cAA4B"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt index ba7f1d932451e..1bfda04977630 100644 --- a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt @@ -92,25 +92,18 @@ sourceFile:tests/cases/compiler/b.ts --- >>> function B() { 1 >^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(19, 9) Source(2, 1) + SourceIndex(1) --- ->>> _super.apply(this, arguments); -1->^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1->export class B extends -2 > A -1->Emitted(20, 13) Source(2, 24) + SourceIndex(1) -2 >Emitted(20, 43) Source(2, 25) + SourceIndex(1) ---- +>>> return _super.apply(this, arguments) || this; >>> } -1 >^^^^^^^^ +1->^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> -1 > { +1->export class B extends A { 2 > } -1 >Emitted(21, 9) Source(2, 28) + SourceIndex(1) +1->Emitted(21, 9) Source(2, 28) + SourceIndex(1) 2 >Emitted(21, 10) Source(2, 29) + SourceIndex(1) --- >>> return B; diff --git a/tests/baselines/reference/outModuleConcatSystem.js b/tests/baselines/reference/outModuleConcatSystem.js index b23b73caf83ae..a615090f33a50 100644 --- a/tests/baselines/reference/outModuleConcatSystem.js +++ b/tests/baselines/reference/outModuleConcatSystem.js @@ -44,7 +44,7 @@ System.register("b", ["ref/a"], function (exports_2, context_2) { B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/outModuleConcatSystem.js.map b/tests/baselines/reference/outModuleConcatSystem.js.map index 59ab70de53188..ac8fb23d87c13 100644 --- a/tests/baselines/reference/outModuleConcatSystem.js.map +++ b/tests/baselines/reference/outModuleConcatSystem.js.map @@ -1,2 +1,2 @@ //// [all.js.map] -{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;;;;;;YACA;gBAAA;gBAAiB,CAAC;gBAAD,QAAC;YAAD,CAAC,AAAlB,IAAkB;;QAClB,CAAC;;;;;;;;;;;;;;YCDD;gBAAuB,qBAAC;gBAAxB;oBAAuB,8BAAC;gBAAG,CAAC;gBAAD,QAAC;YAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;;QAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;;;;;;YACA;gBAAA;gBAAiB,CAAC;gBAAD,QAAC;YAAD,CAAC,AAAlB,IAAkB;;QAClB,CAAC;;;;;;;;;;;;;;YCDD;gBAAuB,qBAAC;gBAAxB;;gBAA2B,CAAC;gBAAD,QAAC;YAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;;QAAA,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt index 86573493e2011..732214237fa32 100644 --- a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt @@ -109,25 +109,18 @@ sourceFile:tests/cases/compiler/b.ts --- >>> function B() { 1 >^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(35, 17) Source(2, 1) + SourceIndex(1) --- ->>> _super.apply(this, arguments); -1->^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1->export class B extends -2 > A -1->Emitted(36, 21) Source(2, 24) + SourceIndex(1) -2 >Emitted(36, 51) Source(2, 25) + SourceIndex(1) ---- +>>> return _super.apply(this, arguments) || this; >>> } -1 >^^^^^^^^^^^^^^^^ +1->^^^^^^^^^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> -1 > { +1->export class B extends A { 2 > } -1 >Emitted(37, 17) Source(2, 28) + SourceIndex(1) +1->Emitted(37, 17) Source(2, 28) + SourceIndex(1) 2 >Emitted(37, 18) Source(2, 29) + SourceIndex(1) --- >>> return B; diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js b/tests/baselines/reference/outModuleTripleSlashRefs.js index 90f8feab7bc52..b9ff7c15b61a2 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.js +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js @@ -57,7 +57,7 @@ define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js.map b/tests/baselines/reference/outModuleTripleSlashRefs.js.map index c6e1aab6bc886..45d5799045001 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.js.map +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js.map @@ -1,2 +1,2 @@ //// [all.js.map] -{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/b.ts","tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;AAAA,iCAAiC;AACjC;IAAA;IAEA,CAAC;IAAD,UAAC;AAAD,CAAC,AAFD,IAEC;;;ICFD,+BAA+B;IAC/B;QAAA;QAEA,CAAC;QAAD,QAAC;IAAD,CAAC,AAFD,IAEC;IAFD,cAEC;;;;ICHD;QAAuB,qBAAC;QAAxB;YAAuB,8BAAC;QAAG,CAAC;QAAD,QAAC;IAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;IAA5B,cAA4B"} \ No newline at end of file +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/b.ts","tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;AAAA,iCAAiC;AACjC;IAAA;IAEA,CAAC;IAAD,UAAC;AAAD,CAAC,AAFD,IAEC;;;ICFD,+BAA+B;IAC/B;QAAA;QAEA,CAAC;QAAD,QAAC;IAAD,CAAC,AAFD,IAEC;IAFD,cAEC;;;;ICHD;QAAuB,qBAAC;QAAxB;;QAA2B,CAAC;QAAD,QAAC;IAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;IAA5B,cAA4B"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt index 8be4382641967..482c898e0cb03 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt +++ b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt @@ -168,25 +168,18 @@ sourceFile:tests/cases/compiler/b.ts --- >>> function B() { 1 >^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(26, 9) Source(2, 1) + SourceIndex(2) --- ->>> _super.apply(this, arguments); -1->^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1->export class B extends -2 > A -1->Emitted(27, 13) Source(2, 24) + SourceIndex(2) -2 >Emitted(27, 43) Source(2, 25) + SourceIndex(2) ---- +>>> return _super.apply(this, arguments) || this; >>> } -1 >^^^^^^^^ +1->^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> -1 > { +1->export class B extends A { 2 > } -1 >Emitted(28, 9) Source(2, 28) + SourceIndex(2) +1->Emitted(28, 9) Source(2, 28) + SourceIndex(2) 2 >Emitted(28, 10) Source(2, 29) + SourceIndex(2) --- >>> return B; diff --git a/tests/baselines/reference/overload1.js b/tests/baselines/reference/overload1.js index fd05873c64795..41aafdfb29c2d 100644 --- a/tests/baselines/reference/overload1.js +++ b/tests/baselines/reference/overload1.js @@ -56,7 +56,7 @@ var O; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -64,7 +64,7 @@ var O; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js index a3b7a32986150..f9d1c81b06b99 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -37,7 +37,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -45,7 +45,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -53,7 +53,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.js b/tests/baselines/reference/overloadOnConstConstraintChecks2.js index efb57153b13a6..a680a62ddfef6 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -25,14 +25,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.foo = function () { }; return C; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.js b/tests/baselines/reference/overloadOnConstConstraintChecks3.js index 181f9d8129c50..025e449fd6f69 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -27,14 +27,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.foo = function () { }; return C; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index d73c59863adca..0f436a5f0b2c9 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -27,22 +27,23 @@ var Z = (function () { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); - this.x = 1; + var _this = _super.apply(this, arguments) || this; + _this.x = 1; + return _this; } return A; }(Z)); var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.foo = function () { }; return C; diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js index c98075c04a180..e3f58c0f7d0d2 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -26,7 +26,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -34,7 +34,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -42,7 +42,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/overloadResolution.js b/tests/baselines/reference/overloadResolution.js index 0d25322fdfcd8..e5cc35c39c4cb 100644 --- a/tests/baselines/reference/overloadResolution.js +++ b/tests/baselines/reference/overloadResolution.js @@ -108,21 +108,21 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js index 9fa55fe1e95a1..7c8b2e2ccb6ed 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.js +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -115,21 +115,21 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js index 12d8480eefb3c..44bbfbcec2b51 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.js +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -116,21 +116,21 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js index b261201be40d9..96f4f7baf2442 100644 --- a/tests/baselines/reference/overloadingOnConstants1.js +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -40,7 +40,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -48,7 +48,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -56,7 +56,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/overloadingOnConstants2.js b/tests/baselines/reference/overloadingOnConstants2.js index 977ae7ec5b9ad..0c34d0f4b7694 100644 --- a/tests/baselines/reference/overloadingOnConstants2.js +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -42,7 +42,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.js b/tests/baselines/reference/overridingPrivateStaticMembers.js index ddd9fae642989..ca5616450baea 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.js +++ b/tests/baselines/reference/overridingPrivateStaticMembers.js @@ -21,7 +21,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/parseErrorInHeritageClause1.js b/tests/baselines/reference/parseErrorInHeritageClause1.js index e2f66bfadd77d..a9ca0a6db7342 100644 --- a/tests/baselines/reference/parseErrorInHeritageClause1.js +++ b/tests/baselines/reference/parseErrorInHeritageClause1.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parser509630.js b/tests/baselines/reference/parser509630.js index 4d94ea619ecc0..d3648dc5b6457 100644 --- a/tests/baselines/reference/parser509630.js +++ b/tests/baselines/reference/parser509630.js @@ -21,7 +21,7 @@ var Type = (function () { var Any = (function (_super) { __extends(Any, _super); function Any() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Any; }(Type)); diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index 41f07380e97fa..6b86353b959d4 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -318,8 +318,9 @@ var c2 = (function () { var c3 = (function (_super) { __extends(c3, _super); function c3() { - _super.call(this, 10); - this.p1 = _super.prototype.c2_p1; + var _this = _super.call(this, 10) || this; + _this.p1 = _super.prototype.c2_p1; + return _this; } /** c3 f1*/ c3.prototype.f1 = function () { @@ -362,7 +363,7 @@ c2_i.nc_f1(); var c4 = (function (_super) { __extends(c4, _super); function c4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return c4; }(c2)); @@ -404,8 +405,9 @@ var c5 = (function () { var c6 = (function (_super) { __extends(c6, _super); function c6() { - _super.call(this); - this.d = _super.prototype.b; + var _this = _super.call(this) || this; + _this.d = _super.prototype.b; + return _this; } return c6; }(c5)); diff --git a/tests/baselines/reference/parserClassDeclaration1.js b/tests/baselines/reference/parserClassDeclaration1.js index 41ecc9135c043..a61b492b7a935 100644 --- a/tests/baselines/reference/parserClassDeclaration1.js +++ b/tests/baselines/reference/parserClassDeclaration1.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration3.js b/tests/baselines/reference/parserClassDeclaration3.js index c375b4b5a211c..f58f0ab00cb96 100644 --- a/tests/baselines/reference/parserClassDeclaration3.js +++ b/tests/baselines/reference/parserClassDeclaration3.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/parserClassDeclaration4.js b/tests/baselines/reference/parserClassDeclaration4.js index f19ac06c35cc4..912aa8c658198 100644 --- a/tests/baselines/reference/parserClassDeclaration4.js +++ b/tests/baselines/reference/parserClassDeclaration4.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration5.js b/tests/baselines/reference/parserClassDeclaration5.js index 272edc89fb6d5..054aaf0eb7a49 100644 --- a/tests/baselines/reference/parserClassDeclaration5.js +++ b/tests/baselines/reference/parserClassDeclaration5.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration6.js b/tests/baselines/reference/parserClassDeclaration6.js index 88d8481d52a91..1423edfe037ad 100644 --- a/tests/baselines/reference/parserClassDeclaration6.js +++ b/tests/baselines/reference/parserClassDeclaration6.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js index b53c41fb45c33..aa0679bb8f5af 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js index 500f6d38c6d38..1308c7c194bff 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js index 8c02a996ea514..b1471628fbd9b 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.js b/tests/baselines/reference/parserGenericsInTypeContexts1.js index f6f4f39393fb4..641d296dc4359 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.js @@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.js b/tests/baselines/reference/parserGenericsInTypeContexts2.js index 99e19586c52da..b0f14a090ae5f 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.js @@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 255cad3ca21aa..253f856a9900f 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -826,9 +826,10 @@ var TypeScript; var NumberLiteralToken = (function (_super) { __extends(NumberLiteralToken, _super); function NumberLiteralToken(value, hasEmptyFraction) { - _super.call(this, TokenID.NumberLiteral); - this.value = value; - this.hasEmptyFraction = hasEmptyFraction; + var _this = _super.call(this, TokenID.NumberLiteral) || this; + _this.value = value; + _this.hasEmptyFraction = hasEmptyFraction; + return _this; } NumberLiteralToken.prototype.getText = function () { return this.hasEmptyFraction ? this.value.toString() + ".0" : this.value.toString(); @@ -842,8 +843,9 @@ var TypeScript; var StringLiteralToken = (function (_super) { __extends(StringLiteralToken, _super); function StringLiteralToken(value) { - _super.call(this, TokenID.StringLiteral); - this.value = value; + var _this = _super.call(this, TokenID.StringLiteral) || this; + _this.value = value; + return _this; } StringLiteralToken.prototype.getText = function () { return this.value; @@ -857,9 +859,10 @@ var TypeScript; var IdentifierToken = (function (_super) { __extends(IdentifierToken, _super); function IdentifierToken(value, hasEscapeSequence) { - _super.call(this, TokenID.Identifier); - this.value = value; - this.hasEscapeSequence = hasEscapeSequence; + var _this = _super.call(this, TokenID.Identifier) || this; + _this.value = value; + _this.hasEscapeSequence = hasEscapeSequence; + return _this; } IdentifierToken.prototype.getText = function () { return this.value; @@ -873,8 +876,9 @@ var TypeScript; var WhitespaceToken = (function (_super) { __extends(WhitespaceToken, _super); function WhitespaceToken(tokenId, value) { - _super.call(this, tokenId); - this.value = value; + var _this = _super.call(this, tokenId) || this; + _this.value = value; + return _this; } WhitespaceToken.prototype.getText = function () { return this.value; @@ -888,12 +892,13 @@ var TypeScript; var CommentToken = (function (_super) { __extends(CommentToken, _super); function CommentToken(tokenID, value, isBlock, startPos, line, endsLine) { - _super.call(this, tokenID); - this.value = value; - this.isBlock = isBlock; - this.startPos = startPos; - this.line = line; - this.endsLine = endsLine; + var _this = _super.call(this, tokenID) || this; + _this.value = value; + _this.isBlock = isBlock; + _this.startPos = startPos; + _this.line = line; + _this.endsLine = endsLine; + return _this; } CommentToken.prototype.getText = function () { return this.value; @@ -907,8 +912,9 @@ var TypeScript; var RegularExpressionLiteralToken = (function (_super) { __extends(RegularExpressionLiteralToken, _super); function RegularExpressionLiteralToken(regex) { - _super.call(this, TokenID.RegularExpressionLiteral); - this.regex = regex; + var _this = _super.call(this, TokenID.RegularExpressionLiteral) || this; + _this.regex = regex; + return _this; } RegularExpressionLiteralToken.prototype.getText = function () { return this.regex.toString(); diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index 0c1d106425564..eb05d13f4ed43 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2386,15 +2386,16 @@ var TypeScript; var AST = (function (_super) { __extends(AST, _super); function AST(nodeType) { - _super.call(this); - this.nodeType = nodeType; - this.type = null; - this.flags = ASTFlags.Writeable; + var _this = _super.call(this) || this; + _this.nodeType = nodeType; + _this.type = null; + _this.flags = ASTFlags.Writeable; // REVIEW: for diagnostic purposes - this.passCreated = CompilerDiagnostics.analysisPass; - this.preComments = null; - this.postComments = null; - this.isParenthesized = false; + _this.passCreated = CompilerDiagnostics.analysisPass; + _this.preComments = null; + _this.postComments = null; + _this.isParenthesized = false; + return _this; } AST.prototype.isExpression = function () { return false; }; AST.prototype.isStatementOrExpression = function () { return false; }; @@ -2542,9 +2543,10 @@ var TypeScript; var IncompleteAST = (function (_super) { __extends(IncompleteAST, _super); function IncompleteAST(min, lim) { - _super.call(this, NodeType.Error); - this.minChar = min; - this.limChar = lim; + var _this = _super.call(this, NodeType.Error) || this; + _this.minChar = min; + _this.limChar = lim; + return _this; } return IncompleteAST; }(AST)); @@ -2552,9 +2554,10 @@ var TypeScript; var ASTList = (function (_super) { __extends(ASTList, _super); function ASTList() { - _super.call(this, NodeType.List); - this.enclosingScope = null; - this.members = new AST[]; + var _this = _super.call(this, NodeType.List) || this; + _this.enclosingScope = null; + _this.members = new AST[]; + return _this; } ASTList.prototype.addToControlFlow = function (context) { var len = this.members.length; @@ -2619,12 +2622,13 @@ var TypeScript; // To change text, and to avoid running into a situation where 'actualText' does not // match 'text', always use setText. function Identifier(actualText, hasEscapeSequence) { - _super.call(this, NodeType.Name); - this.actualText = actualText; - this.hasEscapeSequence = hasEscapeSequence; - this.sym = null; - this.cloId = -1; - this.setText(actualText, hasEscapeSequence); + var _this = _super.call(this, NodeType.Name) || this; + _this.actualText = actualText; + _this.hasEscapeSequence = hasEscapeSequence; + _this.sym = null; + _this.cloId = -1; + _this.setText(actualText, hasEscapeSequence); + return _this; } Identifier.prototype.setText = function (actualText, hasEscapeSequence) { this.actualText = actualText; @@ -2663,7 +2667,7 @@ var TypeScript; var MissingIdentifier = (function (_super) { __extends(MissingIdentifier, _super); function MissingIdentifier() { - _super.call(this, "__missing"); + return _super.call(this, "__missing") || this; } MissingIdentifier.prototype.isMissing = function () { return true; @@ -2677,8 +2681,9 @@ var TypeScript; var Label = (function (_super) { __extends(Label, _super); function Label(id) { - _super.call(this, NodeType.Label); - this.id = id; + var _this = _super.call(this, NodeType.Label) || this; + _this.id = id; + return _this; } Label.prototype.printLabel = function () { return this.id.actualText + ":"; }; Label.prototype.typeCheck = function (typeFlow) { @@ -2701,7 +2706,7 @@ var TypeScript; var Expression = (function (_super) { __extends(Expression, _super); function Expression(nodeType) { - _super.call(this, nodeType); + return _super.call(this, nodeType) || this; } Expression.prototype.isExpression = function () { return true; }; Expression.prototype.isStatementOrExpression = function () { return true; }; @@ -2711,10 +2716,11 @@ var TypeScript; var UnaryExpression = (function (_super) { __extends(UnaryExpression, _super); function UnaryExpression(nodeType, operand) { - _super.call(this, nodeType); - this.operand = operand; - this.targetType = null; // Target type for an object literal (null if no target type) - this.castTerm = null; + var _this = _super.call(this, nodeType) || this; + _this.operand = operand; + _this.targetType = null; // Target type for an object literal (null if no target type) + _this.castTerm = null; + return _this; } UnaryExpression.prototype.addToControlFlow = function (context) { _super.prototype.addToControlFlow.call(this, context); @@ -2855,11 +2861,12 @@ var TypeScript; var CallExpression = (function (_super) { __extends(CallExpression, _super); function CallExpression(nodeType, target, arguments) { - _super.call(this, nodeType); - this.target = target; - this.arguments = arguments; - this.signature = null; - this.minChar = this.target.minChar; + var _this = _super.call(this, nodeType) || this; + _this.target = target; + _this.arguments = arguments; + _this.signature = null; + _this.minChar = _this.target.minChar; + return _this; } CallExpression.prototype.typeCheck = function (typeFlow) { if (this.nodeType == NodeType.New) { @@ -2887,9 +2894,10 @@ var TypeScript; var BinaryExpression = (function (_super) { __extends(BinaryExpression, _super); function BinaryExpression(nodeType, operand1, operand2) { - _super.call(this, nodeType); - this.operand1 = operand1; - this.operand2 = operand2; + var _this = _super.call(this, nodeType) || this; + _this.operand1 = operand1; + _this.operand2 = operand2; + return _this; } BinaryExpression.prototype.typeCheck = function (typeFlow) { switch (this.nodeType) { @@ -3039,10 +3047,11 @@ var TypeScript; var ConditionalExpression = (function (_super) { __extends(ConditionalExpression, _super); function ConditionalExpression(operand1, operand2, operand3) { - _super.call(this, NodeType.ConditionalExpression); - this.operand1 = operand1; - this.operand2 = operand2; - this.operand3 = operand3; + var _this = _super.call(this, NodeType.ConditionalExpression) || this; + _this.operand1 = operand1; + _this.operand2 = operand2; + _this.operand3 = operand3; + return _this; } ConditionalExpression.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckQMark(this); @@ -3064,10 +3073,11 @@ var TypeScript; var NumberLiteral = (function (_super) { __extends(NumberLiteral, _super); function NumberLiteral(value, hasEmptyFraction) { - _super.call(this, NodeType.NumberLit); - this.value = value; - this.hasEmptyFraction = hasEmptyFraction; - this.isNegativeZero = false; + var _this = _super.call(this, NodeType.NumberLit) || this; + _this.value = value; + _this.hasEmptyFraction = hasEmptyFraction; + _this.isNegativeZero = false; + return _this; } NumberLiteral.prototype.typeCheck = function (typeFlow) { this.type = typeFlow.doubleType; @@ -3105,8 +3115,9 @@ var TypeScript; var RegexLiteral = (function (_super) { __extends(RegexLiteral, _super); function RegexLiteral(regex) { - _super.call(this, NodeType.Regex); - this.regex = regex; + var _this = _super.call(this, NodeType.Regex) || this; + _this.regex = regex; + return _this; } RegexLiteral.prototype.typeCheck = function (typeFlow) { this.type = typeFlow.regexType; @@ -3125,8 +3136,9 @@ var TypeScript; var StringLiteral = (function (_super) { __extends(StringLiteral, _super); function StringLiteral(text) { - _super.call(this, NodeType.QString); - this.text = text; + var _this = _super.call(this, NodeType.QString) || this; + _this.text = text; + return _this; } StringLiteral.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3151,7 +3163,7 @@ var TypeScript; var ModuleElement = (function (_super) { __extends(ModuleElement, _super); function ModuleElement(nodeType) { - _super.call(this, nodeType); + return _super.call(this, nodeType) || this; } return ModuleElement; }(AST)); @@ -3159,11 +3171,12 @@ var TypeScript; var ImportDeclaration = (function (_super) { __extends(ImportDeclaration, _super); function ImportDeclaration(id, alias) { - _super.call(this, NodeType.ImportDeclaration); - this.id = id; - this.alias = alias; - this.varFlags = VarFlags.None; - this.isDynamicImport = false; + var _this = _super.call(this, NodeType.ImportDeclaration) || this; + _this.id = id; + _this.alias = alias; + _this.varFlags = VarFlags.None; + _this.isDynamicImport = false; + return _this; } ImportDeclaration.prototype.isStatementOrExpression = function () { return true; }; ImportDeclaration.prototype.emit = function (emitter, tokenId, startLine) { @@ -3218,13 +3231,14 @@ var TypeScript; var BoundDecl = (function (_super) { __extends(BoundDecl, _super); function BoundDecl(id, nodeType, nestingLevel) { - _super.call(this, nodeType); - this.id = id; - this.nestingLevel = nestingLevel; - this.init = null; - this.typeExpr = null; - this.varFlags = VarFlags.None; - this.sym = null; + var _this = _super.call(this, nodeType) || this; + _this.id = id; + _this.nestingLevel = nestingLevel; + _this.init = null; + _this.typeExpr = null; + _this.varFlags = VarFlags.None; + _this.sym = null; + return _this; } BoundDecl.prototype.isStatementOrExpression = function () { return true; }; BoundDecl.prototype.isPrivate = function () { return hasFlag(this.varFlags, VarFlags.Private); }; @@ -3242,7 +3256,7 @@ var TypeScript; var VarDecl = (function (_super) { __extends(VarDecl, _super); function VarDecl(id, nest) { - _super.call(this, id, NodeType.VarDecl, nest); + return _super.call(this, id, NodeType.VarDecl, nest) || this; } VarDecl.prototype.isAmbient = function () { return hasFlag(this.varFlags, VarFlags.Ambient); }; VarDecl.prototype.isExported = function () { return hasFlag(this.varFlags, VarFlags.Exported); }; @@ -3259,9 +3273,10 @@ var TypeScript; var ArgDecl = (function (_super) { __extends(ArgDecl, _super); function ArgDecl(id) { - _super.call(this, id, NodeType.ArgDecl, 0); - this.isOptional = false; - this.parameterPropertySym = null; + var _this = _super.call(this, id, NodeType.ArgDecl, 0) || this; + _this.isOptional = false; + _this.parameterPropertySym = null; + return _this; } ArgDecl.prototype.isOptionalArg = function () { return this.isOptional || this.init; }; ArgDecl.prototype.treeViewLabel = function () { @@ -3281,36 +3296,37 @@ var TypeScript; var FuncDecl = (function (_super) { __extends(FuncDecl, _super); function FuncDecl(name, bod, isConstructor, arguments, vars, scopes, statics, nodeType) { - _super.call(this, nodeType); - this.name = name; - this.bod = bod; - this.isConstructor = isConstructor; - this.arguments = arguments; - this.vars = vars; - this.scopes = scopes; - this.statics = statics; - this.hint = null; - this.fncFlags = FncFlags.None; - this.returnTypeAnnotation = null; - this.variableArgList = false; - this.jumpRefs = null; - this.internalNameCache = null; - this.tmp1Declared = false; - this.enclosingFnc = null; - this.freeVariables = []; - this.unitIndex = -1; - this.classDecl = null; - this.boundToProperty = null; - this.isOverload = false; - this.innerStaticFuncs = []; - this.isTargetTypedAsMethod = false; - this.isInlineCallLiteral = false; - this.accessorSymbol = null; - this.leftCurlyCount = 0; - this.rightCurlyCount = 0; - this.returnStatementsWithExpressions = []; - this.scopeType = null; // Type of the FuncDecl, before target typing - this.endingToken = null; + var _this = _super.call(this, nodeType) || this; + _this.name = name; + _this.bod = bod; + _this.isConstructor = isConstructor; + _this.arguments = arguments; + _this.vars = vars; + _this.scopes = scopes; + _this.statics = statics; + _this.hint = null; + _this.fncFlags = FncFlags.None; + _this.returnTypeAnnotation = null; + _this.variableArgList = false; + _this.jumpRefs = null; + _this.internalNameCache = null; + _this.tmp1Declared = false; + _this.enclosingFnc = null; + _this.freeVariables = []; + _this.unitIndex = -1; + _this.classDecl = null; + _this.boundToProperty = null; + _this.isOverload = false; + _this.innerStaticFuncs = []; + _this.isTargetTypedAsMethod = false; + _this.isInlineCallLiteral = false; + _this.accessorSymbol = null; + _this.leftCurlyCount = 0; + _this.rightCurlyCount = 0; + _this.returnStatementsWithExpressions = []; + _this.scopeType = null; // Type of the FuncDecl, before target typing + _this.endingToken = null; + return _this; } FuncDecl.prototype.internalName = function () { if (this.internalNameCache == null) { @@ -3421,22 +3437,23 @@ var TypeScript; var Script = (function (_super) { __extends(Script, _super); function Script(vars, scopes) { - _super.call(this, new Identifier("script"), null, false, null, vars, scopes, null, NodeType.Script); - this.locationInfo = null; - this.referencedFiles = []; - this.requiresGlobal = false; - this.requiresInherits = false; - this.isResident = false; - this.isDeclareFile = false; - this.hasBeenTypeChecked = false; - this.topLevelMod = null; - this.leftCurlyCount = 0; - this.rightCurlyCount = 0; + var _this = _super.call(this, new Identifier("script"), null, false, null, vars, scopes, null, NodeType.Script) || this; + _this.locationInfo = null; + _this.referencedFiles = []; + _this.requiresGlobal = false; + _this.requiresInherits = false; + _this.isResident = false; + _this.isDeclareFile = false; + _this.hasBeenTypeChecked = false; + _this.topLevelMod = null; + _this.leftCurlyCount = 0; + _this.rightCurlyCount = 0; // Remember if the script contains Unicode chars, that is needed when generating code for this script object to decide the output file correct encoding. - this.containsUnicodeChar = false; - this.containsUnicodeCharInComment = false; - this.vars = vars; - this.scopes = scopes; + _this.containsUnicodeChar = false; + _this.containsUnicodeCharInComment = false; + _this.vars = vars; + _this.scopes = scopes; + return _this; } Script.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckScript(this); @@ -3490,11 +3507,12 @@ var TypeScript; var NamedDeclaration = (function (_super) { __extends(NamedDeclaration, _super); function NamedDeclaration(nodeType, name, members) { - _super.call(this, nodeType); - this.name = name; - this.members = members; - this.leftCurlyCount = 0; - this.rightCurlyCount = 0; + var _this = _super.call(this, nodeType) || this; + _this.name = name; + _this.members = members; + _this.leftCurlyCount = 0; + _this.rightCurlyCount = 0; + return _this; } return NamedDeclaration; }(ModuleElement)); @@ -3502,16 +3520,17 @@ var TypeScript; var ModuleDeclaration = (function (_super) { __extends(ModuleDeclaration, _super); function ModuleDeclaration(name, members, vars, scopes, endingToken) { - _super.call(this, NodeType.ModuleDeclaration, name, members); - this.endingToken = endingToken; - this.modFlags = ModuleFlags.ShouldEmitModuleDecl; - this.amdDependencies = []; + var _this = _super.call(this, NodeType.ModuleDeclaration, name, members) || this; + _this.endingToken = endingToken; + _this.modFlags = ModuleFlags.ShouldEmitModuleDecl; + _this.amdDependencies = []; // Remember if the module contains Unicode chars, that is needed for dynamic module as we will generate a file for each. - this.containsUnicodeChar = false; - this.containsUnicodeCharInComment = false; - this.vars = vars; - this.scopes = scopes; - this.prettyName = this.name.actualText; + _this.containsUnicodeChar = false; + _this.containsUnicodeCharInComment = false; + _this.vars = vars; + _this.scopes = scopes; + _this.prettyName = _this.name.actualText; + return _this; } ModuleDeclaration.prototype.isExported = function () { return hasFlag(this.modFlags, ModuleFlags.Exported); }; ModuleDeclaration.prototype.isAmbient = function () { return hasFlag(this.modFlags, ModuleFlags.Ambient); }; @@ -3537,10 +3556,11 @@ var TypeScript; var TypeDeclaration = (function (_super) { __extends(TypeDeclaration, _super); function TypeDeclaration(nodeType, name, extendsList, implementsList, members) { - _super.call(this, nodeType, name, members); - this.extendsList = extendsList; - this.implementsList = implementsList; - this.varFlags = VarFlags.None; + var _this = _super.call(this, nodeType, name, members) || this; + _this.extendsList = extendsList; + _this.implementsList = implementsList; + _this.varFlags = VarFlags.None; + return _this; } TypeDeclaration.prototype.isExported = function () { return hasFlag(this.varFlags, VarFlags.Exported); @@ -3554,11 +3574,12 @@ var TypeScript; var ClassDeclaration = (function (_super) { __extends(ClassDeclaration, _super); function ClassDeclaration(name, members, extendsList, implementsList) { - _super.call(this, NodeType.ClassDeclaration, name, extendsList, implementsList, members); - this.knownMemberNames = {}; - this.constructorDecl = null; - this.constructorNestingLevel = 0; - this.endingToken = null; + var _this = _super.call(this, NodeType.ClassDeclaration, name, extendsList, implementsList, members) || this; + _this.knownMemberNames = {}; + _this.constructorDecl = null; + _this.constructorNestingLevel = 0; + _this.endingToken = null; + return _this; } ClassDeclaration.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckClass(this); @@ -3572,7 +3593,7 @@ var TypeScript; var InterfaceDeclaration = (function (_super) { __extends(InterfaceDeclaration, _super); function InterfaceDeclaration(name, members, extendsList, implementsList) { - _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members); + return _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) || this; } InterfaceDeclaration.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckInterface(this); @@ -3585,8 +3606,9 @@ var TypeScript; var Statement = (function (_super) { __extends(Statement, _super); function Statement(nodeType) { - _super.call(this, nodeType); - this.flags |= ASTFlags.IsStatement; + var _this = _super.call(this, nodeType) || this; + _this.flags |= ASTFlags.IsStatement; + return _this; } Statement.prototype.isLoop = function () { return false; }; Statement.prototype.isStatementOrExpression = function () { return true; }; @@ -3601,9 +3623,10 @@ var TypeScript; var LabeledStatement = (function (_super) { __extends(LabeledStatement, _super); function LabeledStatement(labels, stmt) { - _super.call(this, NodeType.LabeledStatement); - this.labels = labels; - this.stmt = stmt; + var _this = _super.call(this, NodeType.LabeledStatement) || this; + _this.labels = labels; + _this.stmt = stmt; + return _this; } LabeledStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3635,9 +3658,10 @@ var TypeScript; var Block = (function (_super) { __extends(Block, _super); function Block(statements, isStatementBlock) { - _super.call(this, NodeType.Block); - this.statements = statements; - this.isStatementBlock = isStatementBlock; + var _this = _super.call(this, NodeType.Block) || this; + _this.statements = statements; + _this.isStatementBlock = isStatementBlock; + return _this; } Block.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3690,9 +3714,10 @@ var TypeScript; var Jump = (function (_super) { __extends(Jump, _super); function Jump(nodeType) { - _super.call(this, nodeType); - this.target = null; - this.resolvedTarget = null; + var _this = _super.call(this, nodeType) || this; + _this.target = null; + _this.resolvedTarget = null; + return _this; } Jump.prototype.hasExplicitTarget = function () { return (this.target); }; Jump.prototype.setResolvedTarget = function (parser, stmt) { @@ -3741,9 +3766,10 @@ var TypeScript; var WhileStatement = (function (_super) { __extends(WhileStatement, _super); function WhileStatement(cond) { - _super.call(this, NodeType.While); - this.cond = cond; - this.body = null; + var _this = _super.call(this, NodeType.While) || this; + _this.cond = cond; + _this.body = null; + return _this; } WhileStatement.prototype.isLoop = function () { return true; }; WhileStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -3793,10 +3819,11 @@ var TypeScript; var DoWhileStatement = (function (_super) { __extends(DoWhileStatement, _super); function DoWhileStatement() { - _super.call(this, NodeType.DoWhile); - this.body = null; - this.whileAST = null; - this.cond = null; + var _this = _super.call(this, NodeType.DoWhile) || this; + _this.body = null; + _this.whileAST = null; + _this.cond = null; + return _this; } DoWhileStatement.prototype.isLoop = function () { return true; }; DoWhileStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -3849,10 +3876,11 @@ var TypeScript; var IfStatement = (function (_super) { __extends(IfStatement, _super); function IfStatement(cond) { - _super.call(this, NodeType.If); - this.cond = cond; - this.elseBod = null; - this.statement = new ASTSpan(); + var _this = _super.call(this, NodeType.If) || this; + _this.cond = cond; + _this.elseBod = null; + _this.statement = new ASTSpan(); + return _this; } IfStatement.prototype.isCompoundStatement = function () { return true; }; IfStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -3927,8 +3955,9 @@ var TypeScript; var ReturnStatement = (function (_super) { __extends(ReturnStatement, _super); function ReturnStatement() { - _super.call(this, NodeType.Return); - this.returnExpression = null; + var _this = _super.call(this, NodeType.Return) || this; + _this.returnExpression = null; + return _this; } ReturnStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3958,7 +3987,7 @@ var TypeScript; var EndCode = (function (_super) { __extends(EndCode, _super); function EndCode() { - _super.call(this, NodeType.EndCode); + return _super.call(this, NodeType.EndCode) || this; } return EndCode; }(AST)); @@ -3966,13 +3995,14 @@ var TypeScript; var ForInStatement = (function (_super) { __extends(ForInStatement, _super); function ForInStatement(lval, obj) { - _super.call(this, NodeType.ForIn); - this.lval = lval; - this.obj = obj; - this.statement = new ASTSpan(); - if (this.lval && (this.lval.nodeType == NodeType.VarDecl)) { - this.lval.varFlags |= VarFlags.AutoInit; + var _this = _super.call(this, NodeType.ForIn) || this; + _this.lval = lval; + _this.obj = obj; + _this.statement = new ASTSpan(); + if (_this.lval && (_this.lval.nodeType == NodeType.VarDecl)) { + _this.lval.varFlags |= VarFlags.AutoInit; } + return _this; } ForInStatement.prototype.isLoop = function () { return true; }; ForInStatement.prototype.isFiltered = function () { @@ -4081,8 +4111,9 @@ var TypeScript; var ForStatement = (function (_super) { __extends(ForStatement, _super); function ForStatement(init) { - _super.call(this, NodeType.For); - this.init = init; + var _this = _super.call(this, NodeType.For) || this; + _this.init = init; + return _this; } ForStatement.prototype.isLoop = function () { return true; }; ForStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -4172,9 +4203,10 @@ var TypeScript; var WithStatement = (function (_super) { __extends(WithStatement, _super); function WithStatement(expr) { - _super.call(this, NodeType.With); - this.expr = expr; - this.withSym = null; + var _this = _super.call(this, NodeType.With) || this; + _this.expr = expr; + _this.withSym = null; + return _this; } WithStatement.prototype.isCompoundStatement = function () { return true; }; WithStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -4198,10 +4230,11 @@ var TypeScript; var SwitchStatement = (function (_super) { __extends(SwitchStatement, _super); function SwitchStatement(val) { - _super.call(this, NodeType.Switch); - this.val = val; - this.defaultCase = null; - this.statement = new ASTSpan(); + var _this = _super.call(this, NodeType.Switch) || this; + _this.val = val; + _this.defaultCase = null; + _this.statement = new ASTSpan(); + return _this; } SwitchStatement.prototype.isCompoundStatement = function () { return true; }; SwitchStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -4270,8 +4303,9 @@ var TypeScript; var CaseStatement = (function (_super) { __extends(CaseStatement, _super); function CaseStatement() { - _super.call(this, NodeType.Case); - this.expr = null; + var _this = _super.call(this, NodeType.Case) || this; + _this.expr = null; + return _this; } CaseStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4323,9 +4357,10 @@ var TypeScript; var TypeReference = (function (_super) { __extends(TypeReference, _super); function TypeReference(term, arrayCount) { - _super.call(this, NodeType.TypeRef); - this.term = term; - this.arrayCount = arrayCount; + var _this = _super.call(this, NodeType.TypeRef) || this; + _this.term = term; + _this.arrayCount = arrayCount; + return _this; } TypeReference.prototype.emit = function (emitter, tokenId, startLine) { throw new Error("should not emit a type ref"); @@ -4353,9 +4388,10 @@ var TypeScript; var TryFinally = (function (_super) { __extends(TryFinally, _super); function TryFinally(tryNode, finallyNode) { - _super.call(this, NodeType.TryFinally); - this.tryNode = tryNode; - this.finallyNode = finallyNode; + var _this = _super.call(this, NodeType.TryFinally) || this; + _this.tryNode = tryNode; + _this.finallyNode = finallyNode; + return _this; } TryFinally.prototype.isCompoundStatement = function () { return true; }; TryFinally.prototype.emit = function (emitter, tokenId, startLine) { @@ -4398,9 +4434,10 @@ var TypeScript; var TryCatch = (function (_super) { __extends(TryCatch, _super); function TryCatch(tryNode, catchNode) { - _super.call(this, NodeType.TryCatch); - this.tryNode = tryNode; - this.catchNode = catchNode; + var _this = _super.call(this, NodeType.TryCatch) || this; + _this.tryNode = tryNode; + _this.catchNode = catchNode; + return _this; } TryCatch.prototype.isCompoundStatement = function () { return true; }; TryCatch.prototype.emit = function (emitter, tokenId, startLine) { @@ -4448,8 +4485,9 @@ var TypeScript; var Try = (function (_super) { __extends(Try, _super); function Try(body) { - _super.call(this, NodeType.Try); - this.body = body; + var _this = _super.call(this, NodeType.Try) || this; + _this.body = body; + return _this; } Try.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4476,14 +4514,15 @@ var TypeScript; var Catch = (function (_super) { __extends(Catch, _super); function Catch(param, body) { - _super.call(this, NodeType.Catch); - this.param = param; - this.body = body; - this.statement = new ASTSpan(); - this.containedScope = null; - if (this.param) { - this.param.varFlags |= VarFlags.AutoInit; + var _this = _super.call(this, NodeType.Catch) || this; + _this.param = param; + _this.body = body; + _this.statement = new ASTSpan(); + _this.containedScope = null; + if (_this.param) { + _this.param.varFlags |= VarFlags.AutoInit; } + return _this; } Catch.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4549,8 +4588,9 @@ var TypeScript; var Finally = (function (_super) { __extends(Finally, _super); function Finally(body) { - _super.call(this, NodeType.Finally); - this.body = body; + var _this = _super.call(this, NodeType.Finally) || this; + _this.body = body; + return _this; } Finally.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4577,11 +4617,12 @@ var TypeScript; var Comment = (function (_super) { __extends(Comment, _super); function Comment(content, isBlockComment, endsLine) { - _super.call(this, NodeType.Comment); - this.content = content; - this.isBlockComment = isBlockComment; - this.endsLine = endsLine; - this.text = null; + var _this = _super.call(this, NodeType.Comment) || this; + _this.content = content; + _this.isBlockComment = isBlockComment; + _this.endsLine = endsLine; + _this.text = null; + return _this; } Comment.prototype.getText = function () { if (this.text == null) { @@ -4603,7 +4644,7 @@ var TypeScript; var DebuggerStatement = (function (_super) { __extends(DebuggerStatement, _super); function DebuggerStatement() { - _super.call(this, NodeType.Debugger); + return _super.call(this, NodeType.Debugger) || this; } DebuggerStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); diff --git a/tests/baselines/reference/parserharness.js b/tests/baselines/reference/parserharness.js index 1a525c49d197f..14ce433817695 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2380,9 +2380,10 @@ var Harness; var TestCase = (function (_super) { __extends(TestCase, _super); function TestCase(description, block) { - _super.call(this, description, block); - this.description = description; - this.block = block; + var _this = _super.call(this, description, block) || this; + _this.description = description; + _this.block = block; + return _this; } TestCase.prototype.addChild = function (child) { throw new Error("Testcases may not be nested inside other testcases"); @@ -2414,9 +2415,10 @@ var Harness; var Scenario = (function (_super) { __extends(Scenario, _super); function Scenario(description, block) { - _super.call(this, description, block); - this.description = description; - this.block = block; + var _this = _super.call(this, description, block) || this; + _this.description = description; + _this.block = block; + return _this; } /** Run the block, and if the block doesn't raise an error, run the children. */ Scenario.prototype.run = function (done) { @@ -2469,7 +2471,7 @@ var Harness; var Run = (function (_super) { __extends(Run, _super); function Run() { - _super.call(this, 'Test Run', null); + return _super.call(this, 'Test Run', null) || this; } Run.prototype.run = function () { emitLog('start'); diff --git a/tests/baselines/reference/primitiveMembers.js b/tests/baselines/reference/primitiveMembers.js index caf41fe27086a..7b94b555eb16a 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -63,7 +63,7 @@ var baz = (function () { var foo = (function (_super) { __extends(foo, _super); function foo() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } foo.prototype.bar = function () { return undefined; }; ; diff --git a/tests/baselines/reference/privacyClass.js b/tests/baselines/reference/privacyClass.js index a149aa26f7529..7e56edf2cf1b4 100644 --- a/tests/baselines/reference/privacyClass.js +++ b/tests/baselines/reference/privacyClass.js @@ -152,21 +152,21 @@ var m1; var m1_C1_private = (function (_super) { __extends(m1_C1_private, _super); function m1_C1_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C1_private; }(m1_c_public)); var m1_C2_private = (function (_super) { __extends(m1_C2_private, _super); function m1_C2_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C2_private; }(m1_c_private)); var m1_C3_public = (function (_super) { __extends(m1_C3_public, _super); function m1_C3_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C3_public; }(m1_c_public)); @@ -174,7 +174,7 @@ var m1; var m1_C4_public = (function (_super) { __extends(m1_C4_public, _super); function m1_C4_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C4_public; }(m1_c_private)); @@ -204,21 +204,21 @@ var m1; var m1_C9_private = (function (_super) { __extends(m1_C9_private, _super); function m1_C9_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C9_private; }(m1_c_public)); var m1_C10_private = (function (_super) { __extends(m1_C10_private, _super); function m1_C10_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C10_private; }(m1_c_private)); var m1_C11_public = (function (_super) { __extends(m1_C11_public, _super); function m1_C11_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C11_public; }(m1_c_public)); @@ -226,7 +226,7 @@ var m1; var m1_C12_public = (function (_super) { __extends(m1_C12_public, _super); function m1_C12_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C12_public; }(m1_c_private)); @@ -250,21 +250,21 @@ var m2; var m2_C1_private = (function (_super) { __extends(m2_C1_private, _super); function m2_C1_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m2_C1_private; }(m2_c_public)); var m2_C2_private = (function (_super) { __extends(m2_C2_private, _super); function m2_C2_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m2_C2_private; }(m2_c_private)); var m2_C3_public = (function (_super) { __extends(m2_C3_public, _super); function m2_C3_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m2_C3_public; }(m2_c_public)); @@ -272,7 +272,7 @@ var m2; var m2_C4_public = (function (_super) { __extends(m2_C4_public, _super); function m2_C4_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m2_C4_public; }(m2_c_private)); @@ -302,21 +302,21 @@ var m2; var m2_C9_private = (function (_super) { __extends(m2_C9_private, _super); function m2_C9_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m2_C9_private; }(m2_c_public)); var m2_C10_private = (function (_super) { __extends(m2_C10_private, _super); function m2_C10_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m2_C10_private; }(m2_c_private)); var m2_C11_public = (function (_super) { __extends(m2_C11_public, _super); function m2_C11_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m2_C11_public; }(m2_c_public)); @@ -324,7 +324,7 @@ var m2; var m2_C12_public = (function (_super) { __extends(m2_C12_public, _super); function m2_C12_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m2_C12_public; }(m2_c_private)); @@ -346,21 +346,21 @@ var glo_c_private = (function () { var glo_C1_private = (function (_super) { __extends(glo_C1_private, _super); function glo_C1_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C1_private; }(glo_c_public)); var glo_C2_private = (function (_super) { __extends(glo_C2_private, _super); function glo_C2_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C2_private; }(glo_c_private)); var glo_C3_public = (function (_super) { __extends(glo_C3_public, _super); function glo_C3_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C3_public; }(glo_c_public)); @@ -368,7 +368,7 @@ exports.glo_C3_public = glo_C3_public; var glo_C4_public = (function (_super) { __extends(glo_C4_public, _super); function glo_C4_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C4_public; }(glo_c_private)); @@ -398,21 +398,21 @@ exports.glo_C8_public = glo_C8_public; var glo_C9_private = (function (_super) { __extends(glo_C9_private, _super); function glo_C9_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C9_private; }(glo_c_public)); var glo_C10_private = (function (_super) { __extends(glo_C10_private, _super); function glo_C10_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C10_private; }(glo_c_private)); var glo_C11_public = (function (_super) { __extends(glo_C11_public, _super); function glo_C11_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C11_public; }(glo_c_public)); @@ -420,7 +420,7 @@ exports.glo_C11_public = glo_C11_public; var glo_C12_public = (function (_super) { __extends(glo_C12_public, _super); function glo_C12_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C12_public; }(glo_c_private)); diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js index e2bb58781dec0..e0828809416bd 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js @@ -122,21 +122,21 @@ var publicModule; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPublicModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClassInModule; }(publicClassInPublicModule)); @@ -144,7 +144,7 @@ var publicModule; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); @@ -152,14 +152,14 @@ var publicModule; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -183,21 +183,21 @@ var privateModule; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPrivateModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPrivateModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClassInModule; }(publicClassInPrivateModule)); @@ -205,7 +205,7 @@ var privateModule; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPrivateModule)); @@ -213,14 +213,14 @@ var privateModule; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -242,21 +242,21 @@ var privateClass = (function () { var privateClassExtendingPublicClass = (function (_super) { __extends(privateClassExtendingPublicClass, _super); function privateClassExtendingPublicClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingPublicClass; }(publicClass)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClass)); var publicClassExtendingPublicClass = (function (_super) { __extends(publicClassExtendingPublicClass, _super); function publicClassExtendingPublicClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClass; }(publicClass)); @@ -264,7 +264,7 @@ exports.publicClassExtendingPublicClass = publicClassExtendingPublicClass; var publicClassExtendingPrivateClass = (function (_super) { __extends(publicClassExtendingPrivateClass, _super); function publicClassExtendingPrivateClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPrivateClass; }(privateClass)); @@ -272,14 +272,14 @@ exports.publicClassExtendingPrivateClass = publicClassExtendingPrivateClass; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -308,21 +308,21 @@ var publicModuleInGlobal; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPublicModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClassInModule; }(publicClassInPublicModule)); @@ -330,7 +330,7 @@ var publicModuleInGlobal; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); @@ -344,7 +344,7 @@ var publicClassInGlobal = (function () { var publicClassExtendingPublicClassInGlobal = (function (_super) { __extends(publicClassExtendingPublicClassInGlobal, _super); function publicClassExtendingPublicClassInGlobal() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClassInGlobal; }(publicClassInGlobal)); diff --git a/tests/baselines/reference/privacyGloClass.js b/tests/baselines/reference/privacyGloClass.js index e8c8c447cf9f9..fa769a606ae89 100644 --- a/tests/baselines/reference/privacyGloClass.js +++ b/tests/baselines/reference/privacyGloClass.js @@ -84,21 +84,21 @@ var m1; var m1_C1_private = (function (_super) { __extends(m1_C1_private, _super); function m1_C1_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C1_private; }(m1_c_public)); var m1_C2_private = (function (_super) { __extends(m1_C2_private, _super); function m1_C2_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C2_private; }(m1_c_private)); var m1_C3_public = (function (_super) { __extends(m1_C3_public, _super); function m1_C3_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C3_public; }(m1_c_public)); @@ -106,7 +106,7 @@ var m1; var m1_C4_public = (function (_super) { __extends(m1_C4_public, _super); function m1_C4_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C4_public; }(m1_c_private)); @@ -136,21 +136,21 @@ var m1; var m1_C9_private = (function (_super) { __extends(m1_C9_private, _super); function m1_C9_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C9_private; }(m1_c_public)); var m1_C10_private = (function (_super) { __extends(m1_C10_private, _super); function m1_C10_private() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C10_private; }(m1_c_private)); var m1_C11_public = (function (_super) { __extends(m1_C11_public, _super); function m1_C11_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C11_public; }(m1_c_public)); @@ -158,7 +158,7 @@ var m1; var m1_C12_public = (function (_super) { __extends(m1_C12_public, _super); function m1_C12_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return m1_C12_public; }(m1_c_private)); @@ -174,7 +174,7 @@ var glo_c_public = (function () { var glo_C3_public = (function (_super) { __extends(glo_C3_public, _super); function glo_C3_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C3_public; }(glo_c_public)); @@ -186,7 +186,7 @@ var glo_C7_public = (function () { var glo_C11_public = (function (_super) { __extends(glo_C11_public, _super); function glo_C11_public() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return glo_C11_public; }(glo_c_public)); diff --git a/tests/baselines/reference/privateAccessInSubclass1.js b/tests/baselines/reference/privateAccessInSubclass1.js index 188c3149fd03a..21ff4793fb35e 100644 --- a/tests/baselines/reference/privateAccessInSubclass1.js +++ b/tests/baselines/reference/privateAccessInSubclass1.js @@ -23,7 +23,7 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.myMethod = function () { this.options; diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index 8fbe5121136fb..6fa05178f9128 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -27,9 +27,10 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); - this.x = _super.prototype.foo; // error - this.z = _super.prototype.foo; // error + var _this = _super.apply(this, arguments) || this; + _this.x = _super.prototype.foo; // error + _this.z = _super.prototype.foo; // error + return _this; } Derived.prototype.y = function () { return _super.prototype.foo; // error diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js index 058a6ba1b6544..b732661edfc3e 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js @@ -40,7 +40,7 @@ var K = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.prototype.m2 = function () { var a = this.priv; // error diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index 352256ac9bd66..c1897e8503a92 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -22,8 +22,9 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); - this.bing = function () { return Base.foo; }; // error + var _this = _super.apply(this, arguments) || this; + _this.bing = function () { return Base.foo; }; // error + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index 7ed6f3d679266..11959f2f17468 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -29,7 +29,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js index 3b6e407d045c0..99a4842f63641 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js @@ -14,7 +14,7 @@ var m2; var class1 = (function (_super) { __extends(class1, _super); function class1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class1; }(m2.mExported.me.class1)); @@ -27,7 +27,7 @@ var m2; var class2 = (function (_super) { __extends(class2, _super); function class2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class2; }(m2.mExported.me.class1)); @@ -40,7 +40,7 @@ var m2; var class3 = (function (_super) { __extends(class3, _super); function class3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class3; }(mNonExported.mne.class1)); @@ -53,7 +53,7 @@ var m2; var class4 = (function (_super) { __extends(class4, _super); function class4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class4; }(mNonExported.mne.class1)); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js index 3b6e407d045c0..99a4842f63641 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js @@ -14,7 +14,7 @@ var m2; var class1 = (function (_super) { __extends(class1, _super); function class1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class1; }(m2.mExported.me.class1)); @@ -27,7 +27,7 @@ var m2; var class2 = (function (_super) { __extends(class2, _super); function class2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class2; }(m2.mExported.me.class1)); @@ -40,7 +40,7 @@ var m2; var class3 = (function (_super) { __extends(class3, _super); function class3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class3; }(mNonExported.mne.class1)); @@ -53,7 +53,7 @@ var m2; var class4 = (function (_super) { __extends(class4, _super); function class4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class4; }(mNonExported.mne.class1)); diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index 6a07c9a92ca1c..7ee160b82efac 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -18,7 +18,7 @@ var m; var child = (function (_super) { __extends(child, _super); function child() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return child; }(base)); diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js index 6a07c9a92ca1c..7ee160b82efac 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -18,7 +18,7 @@ var m; var child = (function (_super) { __extends(child, _super); function child() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return child; }(base)); diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js index 64a207a7cad2c..b793b07534c46 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js @@ -7,7 +7,7 @@ var __extends = (this && this.__extends) || function (d, b) { var ClassC = (function (_super) { __extends(ClassC, _super); function ClassC() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ClassC; }(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 64a207a7cad2c..b793b07534c46 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js @@ -7,7 +7,7 @@ var __extends = (this && this.__extends) || function (d, b) { var ClassC = (function (_super) { __extends(ClassC, _super); function ClassC() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ClassC; }(test.ClassA)); diff --git a/tests/baselines/reference/propertiesAndIndexers.js b/tests/baselines/reference/propertiesAndIndexers.js index 591c4760e58ee..dff86f3954e21 100644 --- a/tests/baselines/reference/propertiesAndIndexers.js +++ b/tests/baselines/reference/propertiesAndIndexers.js @@ -65,7 +65,7 @@ var P = (function () { var Q = (function (_super) { __extends(Q, _super); function Q() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Q; }(P)); diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index 2dbb316d84852..0a4c9082a2162 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -164,7 +164,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index bbd2def2206cb..d36d7e27efe94 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -97,7 +97,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return ''; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js index 76da06166d4f8..4aedfe12b0404 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -72,7 +72,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return ''; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js index c49153c59b066..3cb1443814122 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -59,7 +59,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return ''; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js index 255c05ac3ac93..429dfdf6b14aa 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js @@ -52,7 +52,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(C.prototype, "y", { get: function () { return this.x; }, @@ -93,7 +93,7 @@ var C = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return E; }(C)); diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js index 02ad29bd31285..0571b85ea9e2a 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js @@ -147,7 +147,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.prototype.method1 = function () { var B = (function () { @@ -173,7 +173,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.prototype.method2 = function () { var C = (function () { @@ -199,7 +199,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived3.prototype.method3 = function () { var D = (function () { @@ -225,7 +225,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived4.prototype.method4 = function () { var E = (function () { diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js index a87f67e15f288..a10b39b402e4d 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js @@ -34,7 +34,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(C.prototype, "y", { get: function () { return this.x; }, diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js index 05dc85e251e1d..a404b8049bc47 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js @@ -120,7 +120,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.prototype.method1 = function () { var b; @@ -139,7 +139,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.prototype.method2 = function () { var b; @@ -158,7 +158,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived3.prototype.method3 = function () { var b; @@ -177,7 +177,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived4.prototype.method4 = function () { var b; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js index 6675589226e93..7d449bdcbd4c9 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js @@ -30,7 +30,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.prototype.method1 = function () { this.x; // OK, accessed within a subclass of the declaring class diff --git a/tests/baselines/reference/protectedInstanceMemberAccessibility.js b/tests/baselines/reference/protectedInstanceMemberAccessibility.js index eba89aac28ee8..3259d401270d8 100644 --- a/tests/baselines/reference/protectedInstanceMemberAccessibility.js +++ b/tests/baselines/reference/protectedInstanceMemberAccessibility.js @@ -61,7 +61,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.g = function () { var t1 = this.x; @@ -93,7 +93,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/protectedMembers.js b/tests/baselines/reference/protectedMembers.js index dcc68e0c946c4..46b4691dff77f 100644 --- a/tests/baselines/reference/protectedMembers.js +++ b/tests/baselines/reference/protectedMembers.js @@ -137,7 +137,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C2.prototype.f = function () { return _super.prototype.f.call(this) + this.x; @@ -151,7 +151,7 @@ var C2 = (function (_super) { var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C3.prototype.f = function () { return _super.prototype.f.call(this); @@ -187,14 +187,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } C.foo = function (a, b, c, d, e) { a.x = 1; // Error, access must be through C or type derived from C @@ -208,7 +208,7 @@ var C = (function (_super) { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -239,7 +239,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -252,7 +252,7 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js index 323a5a2f2b6c3..ad1b1682aa73e 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js @@ -63,7 +63,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.staticMethod1 = function () { Base.x; // OK, accessed within a class derived from their declaring class @@ -76,7 +76,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.staticMethod2 = function () { Base.x; // OK, accessed within a class derived from their declaring class @@ -89,7 +89,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived3.staticMethod3 = function () { Base.x; // OK, accessed within a class derived from their declaring class diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js index 1295dc7448e28..a2346b8be40a3 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js @@ -38,7 +38,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.staticMethod1 = function () { this.x; // OK, accessed within a class derived from their declaring class @@ -49,7 +49,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived2.staticMethod3 = function () { this.x; // OK, accessed within a class derived from their declaring class 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 f396c2483e80e..a881eb55a1811 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 @@ -19,7 +19,7 @@ var Alpha; var Beta = (function (_super) { __extends(Beta, _super); function Beta() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Beta; }(Alpha.x)); diff --git a/tests/baselines/reference/readonlyConstructorAssignment.js b/tests/baselines/reference/readonlyConstructorAssignment.js index 40c292e4ce884..872c00486c001 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.js +++ b/tests/baselines/reference/readonlyConstructorAssignment.js @@ -56,9 +56,10 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x) { - _super.call(this, x); + var _this = _super.call(this, x) || this; // Fails, x is readonly - this.x = 1; + _this.x = 1; + return _this; } return B; }(A)); @@ -67,9 +68,10 @@ var C = (function (_super) { // This is the usual behavior of readonly properties: // if one is redeclared in a base class, then it can be assigned to. function C(x) { - _super.call(this, x); - this.x = x; - this.x = 1; + var _this = _super.call(this, x) || this; + _this.x = x; + _this.x = 1; + return _this; } return C; }(A)); @@ -84,9 +86,10 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E(x) { - _super.call(this, x); - this.x = x; - this.x = 1; + var _this = _super.call(this, x) || this; + _this.x = x; + _this.x = 1; + return _this; } return E; }(D)); diff --git a/tests/baselines/reference/recursiveBaseCheck3.js b/tests/baselines/reference/recursiveBaseCheck3.js index b032ce6774db3..250a9e0b6183a 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.js +++ b/tests/baselines/reference/recursiveBaseCheck3.js @@ -13,14 +13,14 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return A; }(C)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/recursiveBaseCheck4.js b/tests/baselines/reference/recursiveBaseCheck4.js index 07ba40c68b133..7f0c6b5f95d51 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.js +++ b/tests/baselines/reference/recursiveBaseCheck4.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var M = (function (_super) { __extends(M, _super); function M() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return M; }(M)); diff --git a/tests/baselines/reference/recursiveBaseCheck6.js b/tests/baselines/reference/recursiveBaseCheck6.js index 5b880c294b736..53a608baeca64 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.js +++ b/tests/baselines/reference/recursiveBaseCheck6.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var S18 = (function (_super) { __extends(S18, _super); function S18() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return S18; }(S18)); diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index dd79ba068bba2..344750974cbfd 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -21,7 +21,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js index 62e5958715e98..34aa110b7ee74 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js @@ -28,7 +28,7 @@ var TypeScript2; var MemberNameArray = (function (_super) { __extends(MemberNameArray, _super); function MemberNameArray() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MemberNameArray; }(MemberName)); diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index 3aa066d158d6b..4c88b77822671 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -190,7 +190,7 @@ var Sample; var Mode = (function (_super) { __extends(Mode, _super); function Mode() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } // scenario 2 Mode.prototype.getInitialState = function () { diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index 7e0b27b82b45c..bd22ec3389852 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":[],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAAC,IAAA,OAAO,CAUpB;IAVa,WAAA,OAAO;QAAC,IAAA,KAAK,CAU1B;QAVqB,WAAA,OAAK;YAAC,IAAA,IAAI,CAU/B;YAV2B,WAAA,IAAI;gBAC/B;oBAAA;oBAQA,CAAC;oBANO,+BAAK,GAAZ,cAAiB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBAExB,6BAAG,GAAV,UAAW,KAA6B;wBAEvC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBACF,sBAAC;gBAAD,CAAC,AARD,IAQC;gBARY,oBAAe,kBAQ3B,CAAA;YACF,CAAC,EAV2B,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAU/B;QAAD,CAAC,EAVqB,KAAK,GAAL,aAAK,KAAL,aAAK,QAU1B;IAAD,CAAC,EAVa,OAAO,GAAP,cAAO,KAAP,cAAO,QAUpB;AAAD,CAAC,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAAC,IAAA,KAAK,CAoBlB;IApBa,WAAA,KAAK;QAAC,IAAA,OAAO,CAoB1B;QApBmB,WAAA,OAAO;YAC1B;gBAKC,oBAAoB,SAAkC;oBAAlC,cAAS,GAAT,SAAS,CAAyB;oBAD9C,YAAO,GAAO,IAAI,CAAC;oBAEvB,aAAa;oBACb,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBAC3C,CAAC;gBANM,wBAAG,GAAV,UAAW,MAAyC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;oBAAA,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAAA,CAAC,CAAA,CAAC;gBAQlF,+BAAU,GAAjB;oBACC,MAAM,CAAC,OAAO,CAAC;gBAChB,CAAC;gBAEM,4BAAO,GAAd;gBAEA,CAAC;gBAEF,iBAAC;YAAD,CAAC,AAlBD,IAkBC;YAlBY,kBAAU,aAkBtB,CAAA;QACF,CAAC,EApBmB,OAAO,GAAP,aAAO,KAAP,aAAO,QAoB1B;IAAD,CAAC,EApBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAoBlB;AAAD,CAAC,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAA;IAAuF,CAAC;IAA3C,sCAAe,GAAtB,cAAmC,MAAM,CAAC,IAAI,CAAC,CAAA,CAAC;IAAC,mBAAC;AAAD,CAAC,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAAC,IAAA,KAAK,CAwBlB;IAxBa,WAAA,KAAK;QAAC,IAAA,SAAS,CAwB5B;QAxBmB,WAAA,SAAS;YAAC,IAAA,SAAS,CAwBtC;YAxB6B,WAAA,SAAS;gBAEtC;oBACO,eAAoB,IAAW;wBAAX,SAAI,GAAJ,IAAI,CAAO;oBAAI,CAAC;oBACnC,qBAAK,GAAZ;wBACC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBAEM,sBAAM,GAAb,UAAc,KAAY;wBACzB,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC;oBACvB,CAAC;oBAEM,uBAAO,GAAd,cAA0B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzC,YAAC;gBAAD,CAAC,AAXD,IAWC;gBAXY,eAAK,QAWjB,CAAA;gBAED;oBAA0B,wBAAY;oBAAtC;wBAA0B,8BAAY;oBAQtC,CAAC;oBANA,aAAa;oBACN,8BAAe,GAAtB;wBACC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;oBACxB,CAAC;oBAGF,WAAC;gBAAD,CAAC,AARD,CAA0B,YAAY,GAQrC;gBARY,cAAI,OAQhB,CAAA;YACF,CAAC,EAxB6B,SAAS,GAAT,mBAAS,KAAT,mBAAS,QAwBtC;QAAD,CAAC,EAxBmB,SAAS,GAAT,eAAS,KAAT,eAAS,QAwB5B;IAAD,CAAC,EAxBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAwBlB;AAAD,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file +{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAAC,IAAA,OAAO,CAUpB;IAVa,WAAA,OAAO;QAAC,IAAA,KAAK,CAU1B;QAVqB,WAAA,OAAK;YAAC,IAAA,IAAI,CAU/B;YAV2B,WAAA,IAAI;gBAC/B;oBAAA;oBAQA,CAAC;oBANO,+BAAK,GAAZ,cAAiB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBAExB,6BAAG,GAAV,UAAW,KAA6B;wBAEvC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBACF,sBAAC;gBAAD,CAAC,AARD,IAQC;gBARY,oBAAe,kBAQ3B,CAAA;YACF,CAAC,EAV2B,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAU/B;QAAD,CAAC,EAVqB,KAAK,GAAL,aAAK,KAAL,aAAK,QAU1B;IAAD,CAAC,EAVa,OAAO,GAAP,cAAO,KAAP,cAAO,QAUpB;AAAD,CAAC,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAAC,IAAA,KAAK,CAoBlB;IApBa,WAAA,KAAK;QAAC,IAAA,OAAO,CAoB1B;QApBmB,WAAA,OAAO;YAC1B;gBAKC,oBAAoB,SAAkC;oBAAlC,cAAS,GAAT,SAAS,CAAyB;oBAD9C,YAAO,GAAO,IAAI,CAAC;oBAEvB,aAAa;oBACb,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBAC3C,CAAC;gBANM,wBAAG,GAAV,UAAW,MAAyC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;oBAAA,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAAA,CAAC,CAAA,CAAC;gBAQlF,+BAAU,GAAjB;oBACC,MAAM,CAAC,OAAO,CAAC;gBAChB,CAAC;gBAEM,4BAAO,GAAd;gBAEA,CAAC;gBAEF,iBAAC;YAAD,CAAC,AAlBD,IAkBC;YAlBY,kBAAU,aAkBtB,CAAA;QACF,CAAC,EApBmB,OAAO,GAAP,aAAO,KAAP,aAAO,QAoB1B;IAAD,CAAC,EApBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAoBlB;AAAD,CAAC,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAA;IAAuF,CAAC;IAA3C,sCAAe,GAAtB,cAAmC,MAAM,CAAC,IAAI,CAAC,CAAA,CAAC;IAAC,mBAAC;AAAD,CAAC,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAAC,IAAA,KAAK,CAwBlB;IAxBa,WAAA,KAAK;QAAC,IAAA,SAAS,CAwB5B;QAxBmB,WAAA,SAAS;YAAC,IAAA,SAAS,CAwBtC;YAxB6B,WAAA,SAAS;gBAEtC;oBACO,eAAoB,IAAW;wBAAX,SAAI,GAAJ,IAAI,CAAO;oBAAI,CAAC;oBACnC,qBAAK,GAAZ;wBACC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBAEM,sBAAM,GAAb,UAAc,KAAY;wBACzB,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC;oBACvB,CAAC;oBAEM,uBAAO,GAAd,cAA0B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzC,YAAC;gBAAD,CAAC,AAXD,IAWC;gBAXY,eAAK,QAWjB,CAAA;gBAED;oBAA0B,wBAAY;oBAAtC;;oBAQA,CAAC;oBANA,aAAa;oBACN,8BAAe,GAAtB;wBACC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;oBACxB,CAAC;oBAGF,WAAC;gBAAD,CAAC,AARD,CAA0B,YAAY,GAQrC;gBARY,cAAI,OAQhB,CAAA;YACF,CAAC,EAxB6B,SAAS,GAAT,mBAAS,KAAT,mBAAS,QAwBtC;QAAD,CAAC,EAxBmB,SAAS,GAAT,eAAS,KAAT,eAAS,QAwB5B;IAAD,CAAC,EAxBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAwBlB;AAAD,CAAC,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 7e9da7dddf3cb..9dfefe4e1dcf6 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -1692,23 +1692,16 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> function Mode() { 1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(87, 21) Source(91, 2) + SourceIndex(0) --- ->>> _super.apply(this, arguments); -1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1->export class Mode extends -2 > AbstractMode -1->Emitted(88, 25) Source(91, 28) + SourceIndex(0) -2 >Emitted(88, 55) Source(91, 40) + SourceIndex(0) ---- +>>> return _super.apply(this, arguments) || this; >>> } -1 >^^^^^^^^^^^^^^^^^^^^ +1->^^^^^^^^^^^^^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^^^^^-> -1 > { +1->export class Mode extends AbstractMode { > > // scenario 2 > public getInitialState(): IState { @@ -1718,7 +1711,7 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(89, 21) Source(99, 2) + SourceIndex(0) +1->Emitted(89, 21) Source(99, 2) + SourceIndex(0) 2 >Emitted(89, 22) Source(99, 3) + SourceIndex(0) --- >>> // scenario 2 diff --git a/tests/baselines/reference/recursiveComplicatedClasses.js b/tests/baselines/reference/recursiveComplicatedClasses.js index a57560244582f..8441ff9e15a78 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.js +++ b/tests/baselines/reference/recursiveComplicatedClasses.js @@ -51,21 +51,21 @@ var Symbol = (function () { var InferenceSymbol = (function (_super) { __extends(InferenceSymbol, _super); function InferenceSymbol() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return InferenceSymbol; }(Symbol)); var ParameterSymbol = (function (_super) { __extends(ParameterSymbol, _super); function ParameterSymbol() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ParameterSymbol; }(InferenceSymbol)); var TypeSymbol = (function (_super) { __extends(TypeSymbol, _super); function TypeSymbol() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return TypeSymbol; }(InferenceSymbol)); diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js index 92cc2f72cac4f..76224741e6033 100644 --- a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js @@ -52,7 +52,7 @@ var MsPortal; var ViewModel = (function (_super) { __extends(ViewModel, _super); function ViewModel() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ViewModel; }(ItemValue)); diff --git a/tests/baselines/reference/reexportClassDefinition.js b/tests/baselines/reference/reexportClassDefinition.js index a4b68115ac258..a75a90d4d8687 100644 --- a/tests/baselines/reference/reexportClassDefinition.js +++ b/tests/baselines/reference/reexportClassDefinition.js @@ -42,7 +42,7 @@ var foo2 = require("./foo2"); var x = (function (_super) { __extends(x, _super); function x() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return x; }(foo2.x)); diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index 6e621a1880595..615b0034caaa5 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -1030,7 +1030,7 @@ var rionegrensis; var caniventer = (function (_super) { __extends(caniventer, _super); function caniventer() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } caniventer.prototype.salomonseni = function () { var _this = this; @@ -1068,7 +1068,7 @@ var rionegrensis; var veraecrucis = (function (_super) { __extends(veraecrucis, _super); function veraecrucis() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } veraecrucis.prototype.naso = function () { var _this = this; @@ -1247,7 +1247,7 @@ var julianae; var oralis = (function (_super) { __extends(oralis, _super); function oralis() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } oralis.prototype.cepapi = function () { var _this = this; @@ -1333,7 +1333,7 @@ var julianae; var sumatrana = (function (_super) { __extends(sumatrana, _super); function sumatrana() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } sumatrana.prototype.wolffsohni = function () { var _this = this; @@ -1533,7 +1533,7 @@ var julianae; var durangae = (function (_super) { __extends(durangae, _super); function durangae() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } durangae.prototype.Californium = function () { var _this = this; @@ -1607,7 +1607,7 @@ var Lanthanum; var nitidus = (function (_super) { __extends(nitidus, _super); function nitidus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } nitidus.prototype.granatensis = function () { var _this = this; @@ -1675,7 +1675,7 @@ var Lanthanum; var megalonyx = (function (_super) { __extends(megalonyx, _super); function megalonyx() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } megalonyx.prototype.phillipsii = function () { var _this = this; @@ -1824,7 +1824,7 @@ var rendalli; var zuluensis = (function (_super) { __extends(zuluensis, _super); function zuluensis() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } zuluensis.prototype.telfairi = function () { var _this = this; @@ -1982,7 +1982,7 @@ var rendalli; var crenulata = (function (_super) { __extends(crenulata, _super); function crenulata() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } crenulata.prototype.salvanius = function () { var _this = this; @@ -2065,7 +2065,7 @@ var trivirgatus; var mixtus = (function (_super) { __extends(mixtus, _super); function mixtus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } mixtus.prototype.ochrogaster = function () { var _this = this; @@ -2307,7 +2307,7 @@ var ruatanica; var americanus = (function (_super) { __extends(americanus, _super); function americanus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } americanus.prototype.nasoloi = function () { var _this = this; @@ -2342,7 +2342,7 @@ var lavali; var wilsoni = (function (_super) { __extends(wilsoni, _super); function wilsoni() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } wilsoni.prototype.setiger = function () { var _this = this; @@ -2434,7 +2434,7 @@ var lavali; var otion = (function (_super) { __extends(otion, _super); function otion() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } otion.prototype.bonaerensis = function () { var _this = this; @@ -2598,7 +2598,7 @@ var lavali; var thaeleri = (function (_super) { __extends(thaeleri, _super); function thaeleri() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } thaeleri.prototype.coromandra = function () { var _this = this; @@ -2654,7 +2654,7 @@ var lavali; var lepturus = (function (_super) { __extends(lepturus, _super); function lepturus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } lepturus.prototype.ferrumequinum = function () { var _this = this; @@ -2677,7 +2677,7 @@ var dogramacii; var robustulus = (function (_super) { __extends(robustulus, _super); function robustulus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } robustulus.prototype.fossor = function () { var _this = this; @@ -2892,7 +2892,7 @@ var lutreolus; var schlegeli = (function (_super) { __extends(schlegeli, _super); function schlegeli() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } schlegeli.prototype.mittendorfi = function () { var _this = this; @@ -3119,7 +3119,7 @@ var panglima; var amphibius = (function (_super) { __extends(amphibius, _super); function amphibius() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } amphibius.prototype.bottegi = function () { var _this = this; @@ -3163,7 +3163,7 @@ var panglima; var fundatus = (function (_super) { __extends(fundatus, _super); function fundatus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } fundatus.prototype.crassulus = function () { var _this = this; @@ -3189,7 +3189,7 @@ var panglima; var abidi = (function (_super) { __extends(abidi, _super); function abidi() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } abidi.prototype.greyii = function () { var _this = this; @@ -3281,7 +3281,7 @@ var minutus; var himalayana = (function (_super) { __extends(himalayana, _super); function himalayana() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } himalayana.prototype.simoni = function () { var _this = this; @@ -3364,7 +3364,7 @@ var caurinus; var mahaganus = (function (_super) { __extends(mahaganus, _super); function mahaganus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } mahaganus.prototype.martiniquensis = function () { var _this = this; @@ -3438,7 +3438,7 @@ var howi; var angulatus = (function (_super) { __extends(angulatus, _super); function angulatus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } angulatus.prototype.pennatus = function () { var _this = this; @@ -3521,7 +3521,7 @@ var sagitta; var walkeri = (function (_super) { __extends(walkeri, _super); function walkeri() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } walkeri.prototype.maracajuensis = function () { var _this = this; @@ -3538,7 +3538,7 @@ var minutus; var inez = (function (_super) { __extends(inez, _super); function inez() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } inez.prototype.vexillaris = function () { var _this = this; @@ -3555,7 +3555,7 @@ var macrorhinos; var konganensis = (function (_super) { __extends(konganensis, _super); function konganensis() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return konganensis; }(imperfecta.lasiurus)); @@ -3566,7 +3566,7 @@ var panamensis; var linulus = (function (_super) { __extends(linulus, _super); function linulus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } linulus.prototype.goslingi = function () { var _this = this; @@ -3718,7 +3718,7 @@ var samarensis; var pelurus = (function (_super) { __extends(pelurus, _super); function pelurus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } pelurus.prototype.Palladium = function () { var _this = this; @@ -3804,7 +3804,7 @@ var samarensis; var fuscus = (function (_super) { __extends(fuscus, _super); function fuscus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } fuscus.prototype.planifrons = function () { var _this = this; @@ -3965,7 +3965,7 @@ var sagitta; var leptoceros = (function (_super) { __extends(leptoceros, _super); function leptoceros() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } leptoceros.prototype.victus = function () { var _this = this; @@ -4006,7 +4006,7 @@ var daubentonii; var nigricans = (function (_super) { __extends(nigricans, _super); function nigricans() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } nigricans.prototype.woosnami = function () { var _this = this; @@ -4032,7 +4032,7 @@ var argurus; var pygmaea = (function (_super) { __extends(pygmaea, _super); function pygmaea() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } pygmaea.prototype.pajeros = function () { var _this = this; @@ -4061,7 +4061,7 @@ var chrysaeolus; var sarasinorum = (function (_super) { __extends(sarasinorum, _super); function sarasinorum() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } sarasinorum.prototype.belzebul = function () { var _this = this; @@ -4165,7 +4165,7 @@ var argurus; var oreas = (function (_super) { __extends(oreas, _super); function oreas() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } oreas.prototype.salamonis = function () { var _this = this; @@ -4392,7 +4392,7 @@ var provocax; var melanoleuca = (function (_super) { __extends(melanoleuca, _super); function melanoleuca() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } melanoleuca.prototype.Neodymium = function () { var _this = this; @@ -4436,7 +4436,7 @@ var howi; var marcanoi = (function (_super) { __extends(marcanoi, _super); function marcanoi() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } marcanoi.prototype.formosae = function () { var _this = this; @@ -4843,7 +4843,7 @@ var gabriellae; var klossii = (function (_super) { __extends(klossii, _super); function klossii() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return klossii; }(imperfecta.lasiurus)); @@ -5046,7 +5046,7 @@ var imperfecta; var ciliolabrum = (function (_super) { __extends(ciliolabrum, _super); function ciliolabrum() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } ciliolabrum.prototype.leschenaultii = function () { var _this = this; @@ -5108,7 +5108,7 @@ var petrophilus; var sodyi = (function (_super) { __extends(sodyi, _super); function sodyi() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } sodyi.prototype.saundersiae = function () { var _this = this; @@ -5173,7 +5173,7 @@ var caurinus; var megaphyllus = (function (_super) { __extends(megaphyllus, _super); function megaphyllus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } megaphyllus.prototype.montana = function () { var _this = this; @@ -5346,7 +5346,7 @@ var lutreolus; var cor = (function (_super) { __extends(cor, _super); function cor() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } cor.prototype.antinorii = function () { var _this = this; @@ -5438,7 +5438,7 @@ var argurus; var germaini = (function (_super) { __extends(germaini, _super); function germaini() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } germaini.prototype.sharpei = function () { var _this = this; @@ -5536,7 +5536,7 @@ var dammermani; var melanops = (function (_super) { __extends(melanops, _super); function melanops() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } melanops.prototype.blarina = function () { var _this = this; @@ -5625,7 +5625,7 @@ var argurus; var peninsulae = (function (_super) { __extends(peninsulae, _super); function peninsulae() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } peninsulae.prototype.aitkeni = function () { var _this = this; @@ -5771,7 +5771,7 @@ var ruatanica; var Praseodymium = (function (_super) { __extends(Praseodymium, _super); function Praseodymium() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Praseodymium.prototype.clara = function () { var _this = this; @@ -5860,7 +5860,7 @@ var caurinus; var johorensis = (function (_super) { __extends(johorensis, _super); function johorensis() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } johorensis.prototype.maini = function () { var _this = this; @@ -5988,7 +5988,7 @@ var caurinus; var psilurus = (function (_super) { __extends(psilurus, _super); function psilurus() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } psilurus.prototype.socialis = function () { var _this = this; diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index fab0fe8fe0916..a47fa7ed51357 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -123,7 +123,7 @@ var G = (function () { var H = (function (_super) { __extends(H, _super); function H() { - _super.call(this); + var _this = _super.call(this) || this; return new G(); //error } return H; @@ -131,7 +131,7 @@ var H = (function (_super) { var I = (function (_super) { __extends(I, _super); function I() { - _super.call(this); + var _this = _super.call(this) || this; return new G(); } return I; diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js index a543ad3bddae7..f786e9949634e 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -48,7 +48,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js index 3833a5caf7a82..1474f8ab29a82 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js @@ -22,7 +22,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.c = function () { v = 1; diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js index d5de584e77958..0baf01870094c 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js @@ -22,7 +22,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.c = function () { v = 1; diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index 833e84ee5f3ae..48863404a8ecb 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -25,10 +25,11 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); - this.v = 1; - this.p = 1; + var _this = _super.call(this) || this; + _this.v = 1; + _this.p = 1; C.s = 1; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js index a1474a24777c1..4906814f7eb43 100644 --- a/tests/baselines/reference/shadowPrivateMembers.js +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -18,7 +18,7 @@ var base = (function () { var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } derived.prototype.n = function () { }; return derived; diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index 1d852127963ae..4bac0210c85ab 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -21,9 +21,10 @@ var AbstractGreeter = (function () { var Greeter = (function (_super) { __extends(Greeter, _super); function Greeter() { - _super.apply(this, arguments); - this.a = 10; - this.nameA = "Ten"; + var _this = _super.apply(this, arguments) || this; + _this.a = 10; + _this.nameA = "Ten"; + return _this; } return Greeter; }(AbstractGreeter)); diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map index 9c350133f2bf9..6b18a783dfa1c 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":[],"mappings":";;;;;AAAA;IAAA;IACA,CAAC;IAAD,sBAAC;AAAD,CAAC,AADD,IACC;AAED;IAAsB,2BAAe;IAArC;;QACW,MAAC,GAAG,EAAE,CAAC;QACP,UAAK,GAAG,KAAK,CAAC;IACzB,CAAC;IAAD,cAAC;AAAD,CAAC,AAHD,CAAsB,eAAe,GAGpC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts"],"names":[],"mappings":";;;;;AAAA;IAAA;IACA,CAAC;IAAD,sBAAC;AAAD,CAAC,AADD,IACC;AAED;IAAsB,2BAAe;IAArC;QAAA,kDAGC;QAFU,OAAC,GAAG,EAAE,CAAC;QACP,WAAK,GAAG,KAAK,CAAC;;IACzB,CAAC;IAAD,cAAC;AAAD,CAAC,AAHD,CAAsB,eAAe,GAGpC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt index f305238465126..91e284fd06385 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -77,48 +77,58 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts --- >>> function Greeter() { 1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(13, 5) Source(4, 1) + SourceIndex(0) --- ->>> _super.apply(this, arguments); ->>> this.a = 10; +>>> var _this = _super.apply(this, arguments) || this; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->class Greeter extends AbstractGreeter { - > public +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > class Greeter extends AbstractGreeter { + > public a = 10; + > public nameA = "Ten"; + > } +1->Emitted(14, 9) Source(4, 1) + SourceIndex(0) +2 >Emitted(14, 59) Source(7, 2) + SourceIndex(0) +--- +>>> _this.a = 10; +1 >^^^^^^^^ +2 > ^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > 2 > a -3 > = -4 > 10 -5 > ; -1->Emitted(15, 9) Source(5, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(5, 13) + SourceIndex(0) -3 >Emitted(15, 18) Source(5, 16) + SourceIndex(0) -4 >Emitted(15, 20) Source(5, 18) + SourceIndex(0) -5 >Emitted(15, 21) Source(5, 19) + SourceIndex(0) +3 > = +4 > 10 +5 > ; +1 >Emitted(15, 9) Source(5, 12) + SourceIndex(0) +2 >Emitted(15, 16) Source(5, 13) + SourceIndex(0) +3 >Emitted(15, 19) Source(5, 16) + SourceIndex(0) +4 >Emitted(15, 21) Source(5, 18) + SourceIndex(0) +5 >Emitted(15, 22) Source(5, 19) + SourceIndex(0) --- ->>> this.nameA = "Ten"; +>>> _this.nameA = "Ten"; 1->^^^^^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^^^^ -5 > ^ +2 > ^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ 1-> > public 2 > nameA -3 > = -4 > "Ten" -5 > ; +3 > = +4 > "Ten" +5 > ; 1->Emitted(16, 9) Source(6, 12) + SourceIndex(0) -2 >Emitted(16, 19) Source(6, 17) + SourceIndex(0) -3 >Emitted(16, 22) Source(6, 20) + SourceIndex(0) -4 >Emitted(16, 27) Source(6, 25) + SourceIndex(0) -5 >Emitted(16, 28) Source(6, 26) + SourceIndex(0) +2 >Emitted(16, 20) Source(6, 17) + SourceIndex(0) +3 >Emitted(16, 23) Source(6, 20) + SourceIndex(0) +4 >Emitted(16, 28) Source(6, 25) + SourceIndex(0) +5 >Emitted(16, 29) Source(6, 26) + SourceIndex(0) --- +>>> return _this; >>> } 1 >^^^^ 2 > ^ @@ -126,8 +136,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1 > > 2 > } -1 >Emitted(17, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(17, 6) Source(7, 2) + SourceIndex(0) +1 >Emitted(18, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(18, 6) Source(7, 2) + SourceIndex(0) --- >>> return Greeter; 1->^^^^ @@ -135,8 +145,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > ^^^-> 1-> 2 > } -1->Emitted(18, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(18, 19) Source(7, 2) + SourceIndex(0) +1->Emitted(19, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(19, 19) Source(7, 2) + SourceIndex(0) --- >>>}(AbstractGreeter)); 1-> @@ -155,11 +165,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts > public a = 10; > public nameA = "Ten"; > } -1->Emitted(19, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(19, 2) Source(7, 2) + SourceIndex(0) -3 >Emitted(19, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(19, 3) Source(4, 23) + SourceIndex(0) -5 >Emitted(19, 18) Source(4, 38) + SourceIndex(0) -6 >Emitted(19, 21) Source(7, 2) + SourceIndex(0) +1->Emitted(20, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(7, 2) + SourceIndex(0) +3 >Emitted(20, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(20, 3) Source(4, 23) + SourceIndex(0) +5 >Emitted(20, 18) Source(4, 38) + SourceIndex(0) +6 >Emitted(20, 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 f521ba14838b6..f65f42941bfdb 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -36,7 +36,7 @@ var Model = (function () { var MyView = (function (_super) { __extends(MyView, _super); function MyView() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyView; }(View)); diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js index 62688f7cb7ef3..b76afaff08c37 100644 --- a/tests/baselines/reference/specializedOverloadWithRestParameters.js +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -27,7 +27,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; diff --git a/tests/baselines/reference/staticFactory1.js b/tests/baselines/reference/staticFactory1.js index 6ccd30e37d15a..de7588c3ebefc 100644 --- a/tests/baselines/reference/staticFactory1.js +++ b/tests/baselines/reference/staticFactory1.js @@ -31,7 +31,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Derived.prototype.foo = function () { return 2; }; return Derived; diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index 52868930792a8..d204c1aed47a8 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -27,9 +27,10 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); - this.p1 = doThing(A); // OK - this.p2 = doThing(B); // OK + var _this = _super.apply(this, arguments) || this; + _this.p1 = doThing(A); // OK + _this.p2 = doThing(B); // OK + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js index 1c76a2512208f..7b8ca52b9a41f 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js @@ -26,7 +26,7 @@ var SomeBase = (function () { var P = (function (_super) { __extends(P, _super); function P() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return P; }(SomeBase)); diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index c25c406746dfb..6240f8c454f49 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -49,8 +49,10 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; var x = 1; // should not error - _super.call(this); + _this = _super.call(this) || this; + return _this; } return B; }(A)); @@ -58,24 +60,30 @@ B.s = 9; var C = (function (_super) { __extends(C, _super); function C() { - this.p = 10; + var _this; + _this.p = 10; var x = 1; // should error + return _this; } return C; }(A)); var D = (function (_super) { __extends(D, _super); function D() { - this.p = 11; + var _this; + _this.p = 11; var x = 1; // should error + return _this; } return D; }(A)); var E = (function (_super) { __extends(E, _super); function E() { - this.p = 12; + var _this; + _this.p = 12; var x = 1; // should error + return _this; } return E; }(A)); diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index 446fed5b76a2f..da45bda5c6efb 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -75,27 +75,31 @@ var B = (function (_super) { __extends(B, _super); function B() { "use strict"; // No error - _super.call(this); - this.s = 9; + var _this = _super.call(this) || this; + _this.s = 9; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.call(this); // No error - this.s = 9; + var _this = _super.call(this) || this; + _this.s = 9; "use strict"; + return _this; } return C; }(A)); var D = (function (_super) { __extends(D, _super); function D() { - this.s = 9; + var _this; + _this.s = 9; var x = 1; // Error - _super.call(this); + _this = _super.call(this) || this; "use strict"; + return _this; } return D; }(A)); @@ -103,7 +107,7 @@ var Bs = (function (_super) { __extends(Bs, _super); function Bs() { "use strict"; // No error - _super.call(this); + return _super.call(this) || this; } return Bs; }(A)); @@ -111,8 +115,9 @@ Bs.s = 9; var Cs = (function (_super) { __extends(Cs, _super); function Cs() { - _super.call(this); // No error + var _this = _super.call(this) || this; "use strict"; + return _this; } return Cs; }(A)); @@ -120,9 +125,11 @@ Cs.s = 9; var Ds = (function (_super) { __extends(Ds, _super); function Ds() { + var _this; var x = 1; // no Error - _super.call(this); + _this = _super.call(this) || this; "use strict"; + return _this; } return Ds; }(A)); diff --git a/tests/baselines/reference/strictModeReservedWord.js b/tests/baselines/reference/strictModeReservedWord.js index 210d9ec75be64..29715745890eb 100644 --- a/tests/baselines/reference/strictModeReservedWord.js +++ b/tests/baselines/reference/strictModeReservedWord.js @@ -48,7 +48,7 @@ function foo() { var myClass = (function (_super) { __extends(package, _super); function package() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return package; }(public)); diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js index 281b4ade5d6b7..1507e53d8cf8d 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js @@ -75,14 +75,14 @@ var F1 = (function () { var G = (function (_super) { __extends(G, _super); function G() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return G; }(package)); var H = (function (_super) { __extends(H, _super); function H() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return H; }(package.A)); diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js index 08a26230f3742..b532df7b1201a 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -55,7 +55,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return ''; }; return B; diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index 10d9e3e42eca4..a6606c5d55989 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -120,7 +120,7 @@ var C3 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(C3)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js index 0753c52dc9eb7..82bcbf14eccf9 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js @@ -182,28 +182,28 @@ var C3 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(C3)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(C3)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D3; }(C3)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D4; }(C3)); @@ -213,21 +213,21 @@ var D4 = (function (_super) { var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D5; }(C3)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D6; }(C3)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D7; }(C3)); @@ -236,21 +236,21 @@ var D7 = (function (_super) { var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D8; }(C3)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D9; }(C3)); var D10 = (function (_super) { __extends(D10, _super); function D10() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D10; }(C3)); @@ -259,21 +259,21 @@ var D10 = (function (_super) { var D11 = (function (_super) { __extends(D11, _super); function D11() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D11; }(C3)); var D12 = (function (_super) { __extends(D12, _super); function D12() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D12; }(C3)); var D13 = (function (_super) { __extends(D13, _super); function D13() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D13; }(C3)); @@ -283,28 +283,28 @@ var D13 = (function (_super) { var D14 = (function (_super) { __extends(D14, _super); function D14() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D14; }(C3)); var D15 = (function (_super) { __extends(D15, _super); function D15() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D15; }(C3)); var D16 = (function (_super) { __extends(D16, _super); function D16() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D16; }(C3)); var D17 = (function (_super) { __extends(D17, _super); function D17() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D17; }(C3)); @@ -313,28 +313,28 @@ var D17 = (function (_super) { var D18 = (function (_super) { __extends(D18, _super); function D18() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D18; }(C3)); var D19 = (function (_super) { __extends(D19, _super); function D19() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D19; }(C3)); var D20 = (function (_super) { __extends(D20, _super); function D20() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D20; }(C3)); var D21 = (function (_super) { __extends(D21, _super); function D21() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D21; }(C3)); @@ -343,28 +343,28 @@ var D21 = (function (_super) { var D22 = (function (_super) { __extends(D22, _super); function D22() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D22; }(C3)); var D23 = (function (_super) { __extends(D23, _super); function D23() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D23; }(C3)); var D24 = (function (_super) { __extends(D24, _super); function D24() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D24; }(C3)); var D25 = (function (_super) { __extends(D25, _super); function D25() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D25; }(C3)); @@ -373,28 +373,28 @@ var D25 = (function (_super) { var D26 = (function (_super) { __extends(D26, _super); function D26() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D26; }(C3)); var D27 = (function (_super) { __extends(D27, _super); function D27() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D27; }(C3)); var D28 = (function (_super) { __extends(D28, _super); function D28() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D28; }(C3)); var D29 = (function (_super) { __extends(D29, _super); function D29() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D29; }(C3)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js index f388bd4e04759..e0baced37a4ea 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js @@ -118,63 +118,63 @@ var B1 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(B1)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D3; }(B1)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D4; }(B1)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D5; }(B1)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D6; }(B1)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D7; }(B1)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D8; }(B1)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D9; }(B1)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js index cffda7d7f5527..0b17fc07f24d5 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js @@ -217,63 +217,63 @@ var M1; var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(Base)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(Base)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D3; }(Base)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D4; }(Base)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D5; }(Base)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D6; }(Base)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D7; }(Base)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D8; }(Base)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D9; }(Base)); @@ -288,63 +288,63 @@ var M2; var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(Base2)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(Base2)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D3; }(Base2)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D4; }(Base2)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D5; }(Base2)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D6; }(Base2)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D7; }(Base2)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D8; }(Base2)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D9; }(Base2)); diff --git a/tests/baselines/reference/subtypingTransitivity.js b/tests/baselines/reference/subtypingTransitivity.js index 9d3df207a0ce1..9c4c90117589e 100644 --- a/tests/baselines/reference/subtypingTransitivity.js +++ b/tests/baselines/reference/subtypingTransitivity.js @@ -33,14 +33,14 @@ var B = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(B)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(B)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index 014ce4a30038f..843a727c33e6b 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -187,21 +187,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index 55f5fa60e7154..a9e7d01aab661 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -136,21 +136,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.js b/tests/baselines/reference/subtypingWithCallSignatures4.js index b8839316e8669..94f549c62c18a 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.js +++ b/tests/baselines/reference/subtypingWithCallSignatures4.js @@ -126,21 +126,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index c4168febf4eea..1d12aeb945f73 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -187,21 +187,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index 171e52505e0a9..78582304cb8e5 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -138,21 +138,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures4.js b/tests/baselines/reference/subtypingWithConstructSignatures4.js index 1152dde04dd29..17252fdb809df 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures4.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures4.js @@ -126,21 +126,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures5.js b/tests/baselines/reference/subtypingWithConstructSignatures5.js index 24a5ce77dd00d..a0561606393ca 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures5.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures5.js @@ -64,21 +64,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures6.js b/tests/baselines/reference/subtypingWithConstructSignatures6.js index 8778255dbd576..c508781e089bf 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures6.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures6.js @@ -67,21 +67,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.js b/tests/baselines/reference/subtypingWithNumericIndexer.js index cd447c116daee..3cf75dd83fd78 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer.js @@ -54,14 +54,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); @@ -75,28 +75,28 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B4; }(A)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.js b/tests/baselines/reference/subtypingWithNumericIndexer3.js index 104141b761d5f..e9e8d39bf3c28 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.js @@ -58,14 +58,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); @@ -79,35 +79,35 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B4; }(A)); var B5 = (function (_super) { __extends(B5, _super); function B5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B5; }(A)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.js b/tests/baselines/reference/subtypingWithNumericIndexer4.js index 59f8cd95ad01d..798e775083fa2 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.js @@ -42,7 +42,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -56,14 +56,14 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A)); diff --git a/tests/baselines/reference/subtypingWithObjectMembers.js b/tests/baselines/reference/subtypingWithObjectMembers.js index c3cef6601e6b0..3675ed6a41051 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.js +++ b/tests/baselines/reference/subtypingWithObjectMembers.js @@ -81,14 +81,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); @@ -102,7 +102,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -114,7 +114,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -126,7 +126,7 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A3)); @@ -140,7 +140,7 @@ var TwoLevels; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -152,7 +152,7 @@ var TwoLevels; var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -164,7 +164,7 @@ var TwoLevels; var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembers4.js b/tests/baselines/reference/subtypingWithObjectMembers4.js index d5c1107e45d56..404b6cbe98857 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers4.js +++ b/tests/baselines/reference/subtypingWithObjectMembers4.js @@ -48,7 +48,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -60,7 +60,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -72,7 +72,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -84,7 +84,7 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js index 25faacad88e4c..8b168ea73b5cf 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js @@ -48,7 +48,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -60,7 +60,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -72,7 +72,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -84,7 +84,7 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js index 7b0398143a28c..0a83b760218d0 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js @@ -76,7 +76,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -90,7 +90,7 @@ var ExplicitPublic; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -102,7 +102,7 @@ var ExplicitPublic; var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -114,7 +114,7 @@ var ExplicitPublic; var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A3)); @@ -129,7 +129,7 @@ var ImplicitPublic; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -141,7 +141,7 @@ var ImplicitPublic; var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -153,7 +153,7 @@ var ImplicitPublic; var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer.js b/tests/baselines/reference/subtypingWithStringIndexer.js index 0740743a5d9c3..195b7d2192e87 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.js +++ b/tests/baselines/reference/subtypingWithStringIndexer.js @@ -55,14 +55,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); @@ -76,28 +76,28 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B4; }(A)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.js b/tests/baselines/reference/subtypingWithStringIndexer3.js index 5ed44177d5283..0b2a57324ebe2 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.js +++ b/tests/baselines/reference/subtypingWithStringIndexer3.js @@ -58,14 +58,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); @@ -79,35 +79,35 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B4; }(A)); var B5 = (function (_super) { __extends(B5, _super); function B5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B5; }(A)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.js b/tests/baselines/reference/subtypingWithStringIndexer4.js index d6fb874c0900b..2937261ad0510 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.js +++ b/tests/baselines/reference/subtypingWithStringIndexer4.js @@ -42,7 +42,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -56,14 +56,14 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B3; }(A)); diff --git a/tests/baselines/reference/super.js b/tests/baselines/reference/super.js index 81d76aec62bc3..504e8542d4d9e 100644 --- a/tests/baselines/reference/super.js +++ b/tests/baselines/reference/super.js @@ -58,7 +58,7 @@ var Base = (function () { var Sub1 = (function (_super) { __extends(Sub1, _super); function Sub1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Sub1.prototype.foo = function () { return "sub1" + _super.prototype.foo.call(this) + _super.prototype.bar.call(this); @@ -68,7 +68,7 @@ var Sub1 = (function (_super) { var SubSub1 = (function (_super) { __extends(SubSub1, _super); function SubSub1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SubSub1.prototype.foo = function () { return "subsub1" + _super.prototype.foo.call(this); diff --git a/tests/baselines/reference/super1.js b/tests/baselines/reference/super1.js index 4179843b79a02..9f1289dce554c 100644 --- a/tests/baselines/reference/super1.js +++ b/tests/baselines/reference/super1.js @@ -84,7 +84,7 @@ var Base1 = (function () { var Sub1 = (function (_super) { __extends(Sub1, _super); function Sub1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Sub1.prototype.bar = function () { return "base"; @@ -94,7 +94,7 @@ var Sub1 = (function (_super) { var SubSub1 = (function (_super) { __extends(SubSub1, _super); function SubSub1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SubSub1.prototype.bar = function () { return _super.prototype.super.foo; @@ -113,7 +113,7 @@ var Base2 = (function () { var SubE2 = (function (_super) { __extends(SubE2, _super); function SubE2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SubE2.prototype.bar = function () { return _super.prototype.prototype.foo = null; @@ -132,7 +132,7 @@ var Base3 = (function () { var SubE3 = (function (_super) { __extends(SubE3, _super); function SubE3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SubE3.prototype.bar = function () { return _super.prototype.bar.call(this); @@ -153,7 +153,7 @@ var Base4; var SubSub4 = (function (_super) { __extends(SubSub4, _super); function SubSub4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SubSub4.prototype.x = function () { return _super.prototype.x.call(this); diff --git a/tests/baselines/reference/super2.js b/tests/baselines/reference/super2.js index 979bdba84e418..1d2331052db1a 100644 --- a/tests/baselines/reference/super2.js +++ b/tests/baselines/reference/super2.js @@ -71,7 +71,7 @@ var Base5 = (function () { var Sub5 = (function (_super) { __extends(Sub5, _super); function Sub5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Sub5.prototype.x = function () { return "SubX"; @@ -81,7 +81,7 @@ var Sub5 = (function (_super) { var SubSub5 = (function (_super) { __extends(SubSub5, _super); function SubSub5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SubSub5.prototype.x = function () { return _super.prototype.x.call(this); @@ -103,7 +103,7 @@ var Base6 = (function () { var Sub6 = (function (_super) { __extends(Sub6, _super); function Sub6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Sub6.prototype.y = function () { return "SubY"; @@ -113,7 +113,7 @@ var Sub6 = (function (_super) { var SubSub6 = (function (_super) { __extends(SubSub6, _super); function SubSub6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SubSub6.prototype.y = function () { return _super.prototype.y.call(this); diff --git a/tests/baselines/reference/superAccess.js b/tests/baselines/reference/superAccess.js index 6e5cd9aca4476..0bd9d305d2eaf 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -30,7 +30,7 @@ MyBase.S1 = 5; var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } MyDerived.prototype.foo = function () { var l3 = _super.prototype.S1; // Expected => Error: Only public instance methods of the base class are accessible via the 'super' keyword diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index 8de13b5ef51cc..da19770584acf 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -41,13 +41,13 @@ var Q = (function (_super) { __extends(Q, _super); // Super is not allowed in constructor args function Q(z, zz, zzz) { - var _this = this; if (z === void 0) { z = _super.; } if (zz === void 0) { zz = _super.; } if (zzz === void 0) { zzz = function () { return _super.; }; } - _super.call(this); - this.z = z; - this.xx = _super.prototype.; + var _this = _super.call(this) || this; + _this.z = z; + _this.xx = _super.prototype.; + return _this; } Q.prototype.foo = function (zz) { if (zz === void 0) { zz = _super.prototype.; } diff --git a/tests/baselines/reference/superAccessInFatArrow1.js b/tests/baselines/reference/superAccessInFatArrow1.js index 3cd4e199c6218..a7f964309f736 100644 --- a/tests/baselines/reference/superAccessInFatArrow1.js +++ b/tests/baselines/reference/superAccessInFatArrow1.js @@ -34,7 +34,7 @@ var test; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.bar = function (callback) { }; diff --git a/tests/baselines/reference/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index 9dcdbda8e31ae..106d7433bf5a9 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -40,10 +40,12 @@ var T5 = (function () { var T6 = (function (_super) { __extends(T6, _super); function T6() { + var _this = // Should error; base constructor has type T for first arg, // which is instantiated with 'number' in the extends clause - _super.call(this, "hi"); - var x = this.foo; + _super.call(this, "hi") || this; + var x = _this.foo; + return _this; } return T6; }(T5)); diff --git a/tests/baselines/reference/superCallAssignResult.js b/tests/baselines/reference/superCallAssignResult.js index 7002f94eb7d45..6e30cc64052a8 100644 --- a/tests/baselines/reference/superCallAssignResult.js +++ b/tests/baselines/reference/superCallAssignResult.js @@ -24,8 +24,10 @@ var E = (function () { var H = (function (_super) { __extends(H, _super); function H() { - var x = _super.call(this, 5); // Should be of type void, not E. + var _this; + var x = _this = _super.call(this, 5) || this; // Should be of type void, not E. x = 5; + return _this; } return H; }(E)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing1.js b/tests/baselines/reference/superCallBeforeThisAccessing1.js index 1fc7ab39c9179..e3aed9e40e9e2 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing1.js @@ -30,11 +30,12 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this, i); + var _this = _super.call(this, i) || this; var s = { - t: this._t + t: _this._t }; var i = Factory.create(s); + return _this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing2.js b/tests/baselines/reference/superCallBeforeThisAccessing2.js index e5acf06bbfd49..7331718a9edcf 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing2.js @@ -24,8 +24,7 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = this; - _super.call(this, function () { _this._t; }); // no error. only check when this is directly accessing in constructor + return _super.call(this, function () { _this._t; }) || this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing3.js b/tests/baselines/reference/superCallBeforeThisAccessing3.js index 101d74e4bc724..185767fefb6ba 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing3.js @@ -27,11 +27,12 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = this; + var _this; var x = function () { _this._t; }; x(); // no error; we only check super is called before this when the container is a constructor - this._t; // error - _super.call(this, undefined); + _this._t; // error + _this = _super.call(this, undefined) || this; + return _this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing4.js b/tests/baselines/reference/superCallBeforeThisAccessing4.js index 9c3c5ab60c4c9..91acb88ce224c 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing4.js @@ -24,16 +24,19 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - this._t; - _super.call(this); + var _this; + _this._t; + _this = _super.call(this) || this; + return _this; } return D; }(null)); var E = (function (_super) { __extends(E, _super); function E() { - _super.call(this); - this._t; + var _this = _super.call(this) || this; + _this._t; + return _this; } return E; }(null)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing5.js b/tests/baselines/reference/superCallBeforeThisAccessing5.js index 3281a3f8b55da..57228538faf37 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing5.js @@ -16,7 +16,9 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - this._t; // No error + var _this; + _this._t; // No error + return _this; } return D; }(null)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing6.js b/tests/baselines/reference/superCallBeforeThisAccessing6.js index 746ce9f2791f1..e4dfb3f714ad8 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing6.js @@ -24,7 +24,7 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this, this); + return _super.call(this, this) || this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing7.js b/tests/baselines/reference/superCallBeforeThisAccessing7.js index c3aa1655cf75c..9cfe87367741d 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing7.js @@ -27,10 +27,12 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { + var _this; var x = { - j: this._t + j: _this._t }; - _super.call(this, undefined); + _this = _super.call(this, undefined) || this; + return _this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing8.js b/tests/baselines/reference/superCallBeforeThisAccessing8.js index 0865c4305a5ff..fe459b5e03147 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing8.js @@ -27,10 +27,12 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { + var _this; var x = { - k: _super.call(this, undefined), - j: this._t + k: _this = _super.call(this, undefined) || this, + j: _this._t }; + return _this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js index 50830480b1a47..bc196299bf9c2 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -20,7 +20,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + return _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index ef77098588896..8a0ef085590dd 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -19,7 +19,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + return _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index ebb70023b538a..0529d5e3dc222 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -25,7 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { return String(value); }); + return _super.call(this, function (value) { return String(value); }) || this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js index d619343ba142b..fb08ec289028f 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -25,7 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { return String(value); }); + return _super.call(this, function (value) { return String(value); }) || this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js index e9ee84be15224..50153391f62a5 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -25,7 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { return String(value); }); + return _super.call(this, function (value) { return String(value); }) || this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js b/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js index d793e9bb2ae0b..e4b358c9a0a61 100644 --- a/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js +++ b/tests/baselines/reference/superCallFromClassThatHasNoBaseType1.js @@ -19,7 +19,7 @@ var A = (function () { }()); var B = (function () { function B() { - _super.call(this, function (value) { return String(value); }); + _this = _super.call(this, function (value) { return String(value); }) || this; } return B; }()); diff --git a/tests/baselines/reference/superCallFromFunction1.js b/tests/baselines/reference/superCallFromFunction1.js index a7fcbaaeff0d5..7f34628c58a89 100644 --- a/tests/baselines/reference/superCallFromFunction1.js +++ b/tests/baselines/reference/superCallFromFunction1.js @@ -6,5 +6,5 @@ function foo() { //// [superCallFromFunction1.js] function foo() { - _super.call(this, function (value) { return String(value); }); + _this = _super.call(this, function (value) { return String(value); }) || this; } diff --git a/tests/baselines/reference/superCallInConstructorWithNoBaseType.js b/tests/baselines/reference/superCallInConstructorWithNoBaseType.js index 9746ab6a9de5d..dcbebeaa452e6 100644 --- a/tests/baselines/reference/superCallInConstructorWithNoBaseType.js +++ b/tests/baselines/reference/superCallInConstructorWithNoBaseType.js @@ -14,13 +14,13 @@ class D { //// [superCallInConstructorWithNoBaseType.js] var C = (function () { function C() { - _super.call(this); // error + _this = _super.call(this) || this; // error } return C; }()); var D = (function () { function D(x) { - _super.call(this); // error + _this = _super.call(this) || this; // error this.x = x; } return D; diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index 3ff07edf4c9ef..cd84052ca3cae 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -66,11 +66,11 @@ var Doing = (function () { var Other = (function (_super) { __extends(Other, _super); function Other() { - var _this = this; - _super.call(this); - this.propertyInitializer = _super.prototype.instanceMethod.call(this); - this.functionProperty = function () { _super.prototype.instanceMethod.call(_this); }; - _super.prototype.instanceMethod.call(this); + var _this = _super.call(this) || this; + _this.propertyInitializer = _super.prototype.instanceMethod.call(_this); + _this.functionProperty = function () { _super.prototype.instanceMethod.call(_this); }; + _super.prototype.instanceMethod.call(_this); + return _this; } // in instance method Other.prototype.instanceMethod = function () { diff --git a/tests/baselines/reference/superCallInStaticMethod.js b/tests/baselines/reference/superCallInStaticMethod.js index 91558e47d3f88..b31110fdf7896 100644 --- a/tests/baselines/reference/superCallInStaticMethod.js +++ b/tests/baselines/reference/superCallInStaticMethod.js @@ -62,7 +62,7 @@ var Doing = (function () { var Other = (function (_super) { __extends(Other, _super); function Other() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } // in static method Other.staticMethod = function () { diff --git a/tests/baselines/reference/superCallInsideClassDeclaration.js b/tests/baselines/reference/superCallInsideClassDeclaration.js index e677c426e0241..05e44119608aa 100644 --- a/tests/baselines/reference/superCallInsideClassDeclaration.js +++ b/tests/baselines/reference/superCallInsideClassDeclaration.js @@ -35,13 +35,15 @@ var C = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + return _super.call(this) || this; } return D; }(C)); + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallInsideClassExpression.js b/tests/baselines/reference/superCallInsideClassExpression.js index ee373f69f4600..3d55fe11cff49 100644 --- a/tests/baselines/reference/superCallInsideClassExpression.js +++ b/tests/baselines/reference/superCallInsideClassExpression.js @@ -35,13 +35,15 @@ var C = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; var D = (function (_super) { __extends(class_1, _super); function class_1() { - _super.call(this); + return _super.call(this) || this; } return class_1; }(C)); + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js index 3f9a0a9ce9c87..636b03c227f89 100644 --- a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js +++ b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js @@ -28,9 +28,11 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; var x = { - x: _super.call(this) + x: _this = _super.call(this) || this }; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index 202ed531a10c2..e32bfc660502b 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -37,14 +37,15 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); - this.x = _super.call(this); + var _this = _super.call(this) || this; + _this.x = _this = _super.call(this) || this; var y = function () { - _super.call(this); + _this = _super.call(this) || this; }; var y2 = function () { - _super.call(this); + _this = _super.call(this) || this; }; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index 5bfe3927a512e..d8491b4ee830a 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -28,7 +28,7 @@ var B = (function (_super) { __extends(B, _super); // Ensure 'value' is of type 'number (and not '{}') by using its 'toExponential()' method. function B() { - _super.call(this, function (value) { return String(value.toExponential()); }); + return _super.call(this, function (value) { return String(value.toExponential()); }) || this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.js b/tests/baselines/reference/superCallParameterContextualTyping2.js index 539ecbed065e4..9868a7db1240b 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -27,7 +27,7 @@ var C = (function (_super) { __extends(C, _super); // Ensure 'value' is not of type 'any' by invoking it with type arguments. function C() { - _super.call(this, function (value) { return String(value()); }); + return _super.call(this, function (value) { return String(value()); }) || this; } return C; }(A)); diff --git a/tests/baselines/reference/superCallParameterContextualTyping3.js b/tests/baselines/reference/superCallParameterContextualTyping3.js index d35a1707bb74c..6a43d58c47124 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -47,20 +47,22 @@ var CBase = (function () { var C = (function (_super) { __extends(C, _super); function C() { + var _this = // Should be okay. // 'p' should have type 'string'. _super.call(this, { method: function (p) { p.length; } - }); + }) || this; // Should be okay. // 'p' should have type 'string'. - _super.prototype.foo.call(this, { + _super.prototype.foo.call(_this, { method: function (p) { p.length; } }); + return _this; } return C; }(CBase)); diff --git a/tests/baselines/reference/superCallWithMissingBaseClass.js b/tests/baselines/reference/superCallWithMissingBaseClass.js index 7758bcfd89d99..16f1108864006 100644 --- a/tests/baselines/reference/superCallWithMissingBaseClass.js +++ b/tests/baselines/reference/superCallWithMissingBaseClass.js @@ -18,7 +18,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Foo.prototype.m1 = function () { return _super.prototype.m1.call(this); diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index ae8327ec20022..99a3b78752c9e 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -47,11 +47,12 @@ var Derived = (function (_super) { __extends(Derived, _super); //super call in class constructor of derived type function Derived(q) { - _super.call(this, ''); - this.q = q; + var _this = _super.call(this, '') || this; + _this.q = q; //type of super call expression is void - var p = _super.call(this, ''); + var p = _this = _super.call(this, '') || this; var p = v(); + return _this; } return Derived; }(Base)); @@ -63,8 +64,10 @@ var OtherBase = (function () { var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { + var _this; var p = ''; - _super.call(this); + _this = _super.call(this) || this; + return _this; } return OtherDerived; }(OtherBase)); diff --git a/tests/baselines/reference/superCallsInConstructor.js b/tests/baselines/reference/superCallsInConstructor.js index 434f730c76b82..48b79acadf4dc 100644 --- a/tests/baselines/reference/superCallsInConstructor.js +++ b/tests/baselines/reference/superCallsInConstructor.js @@ -41,15 +41,17 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { + var _this; with (new C()) { foo(); - _super.call(this); + _this = _super.call(this) || this; bar(); } try { } catch (e) { - _super.call(this); + _this = _super.call(this) || this; } + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index fd70114d0fd0c..19f0d74f6774a 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -76,8 +76,8 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - _super.call(this); - this.name = "Frank"; + var _this = _super.call(this) || this; + _this.name = "Frank"; // super call in an inner function in a constructor function inner() { _super.sayHello.call(this); @@ -92,6 +92,7 @@ var RegisteredUser = (function (_super) { var _this = this; return function () { return _super.; }; })(); + return _this; } RegisteredUser.prototype.sayHello = function () { // super call in a method diff --git a/tests/baselines/reference/superInCatchBlock1.js b/tests/baselines/reference/superInCatchBlock1.js index 9d5cb1affdcaa..e1fc0f970244d 100644 --- a/tests/baselines/reference/superInCatchBlock1.js +++ b/tests/baselines/reference/superInCatchBlock1.js @@ -28,7 +28,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.m = function () { try { diff --git a/tests/baselines/reference/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index 3c6eb0bdad2c2..8c99b64991733 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -27,7 +27,9 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C(a) { - if (a === void 0) { a = _super.foo.call(this); } + if (a === void 0) { a = _super.foo.call(_this); } + var _this; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index b0940b1d53809..73ca53c3b5cb9 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -85,13 +85,13 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - var _this = this; - _super.call(this); - this.name = "Frank"; + var _this = _super.call(this) || this; + _this.name = "Frank"; // super call in a constructor - _super.prototype.sayHello.call(this); + _super.prototype.sayHello.call(_this); // super call in a lambda in a constructor var x = function () { return _super.prototype.sayHello.call(_this); }; + return _this; } RegisteredUser.prototype.sayHello = function () { var _this = this; @@ -105,11 +105,11 @@ var RegisteredUser = (function (_super) { var RegisteredUser2 = (function (_super) { __extends(RegisteredUser2, _super); function RegisteredUser2() { - var _this = this; - _super.call(this); - this.name = "Joe"; + var _this = _super.call(this) || this; + _this.name = "Joe"; // super call in a nested lambda in a constructor var x = function () { return function () { return function () { return _super.prototype.sayHello.call(_this); }; }; }; + return _this; } RegisteredUser2.prototype.sayHello = function () { var _this = this; @@ -121,11 +121,11 @@ var RegisteredUser2 = (function (_super) { var RegisteredUser3 = (function (_super) { __extends(RegisteredUser3, _super); function RegisteredUser3() { - var _this = this; - _super.call(this); - this.name = "Sam"; + var _this = _super.call(this) || this; + _this.name = "Sam"; // super property in a nested lambda in a constructor var superName = function () { return function () { return function () { return _super.prototype.name; }; }; }; + return _this; } RegisteredUser3.prototype.sayHello = function () { var _this = this; @@ -137,11 +137,11 @@ var RegisteredUser3 = (function (_super) { var RegisteredUser4 = (function (_super) { __extends(RegisteredUser4, _super); function RegisteredUser4() { - var _this = this; - _super.call(this); - this.name = "Mark"; + var _this = _super.call(this) || this; + _this.name = "Mark"; // super in a nested lambda in a constructor var x = function () { return function () { return _super.prototype.; }; }; + return _this; } RegisteredUser4.prototype.sayHello = function () { var _this = this; diff --git a/tests/baselines/reference/superInObjectLiterals_ES5.js b/tests/baselines/reference/superInObjectLiterals_ES5.js index 5d1fed24b4f1a..816277e4e9eb6 100644 --- a/tests/baselines/reference/superInObjectLiterals_ES5.js +++ b/tests/baselines/reference/superInObjectLiterals_ES5.js @@ -100,7 +100,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.f = function () { var _this = this; diff --git a/tests/baselines/reference/superNewCall1.js b/tests/baselines/reference/superNewCall1.js index 01ae169b598d5..30b07308bb25f 100644 --- a/tests/baselines/reference/superNewCall1.js +++ b/tests/baselines/reference/superNewCall1.js @@ -27,7 +27,9 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; new _super.prototype(function (value) { return String(value); }); + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superPropertyAccess.js b/tests/baselines/reference/superPropertyAccess.js index 0e1e878344860..7b5823e598b31 100644 --- a/tests/baselines/reference/superPropertyAccess.js +++ b/tests/baselines/reference/superPropertyAccess.js @@ -61,7 +61,7 @@ var MyBase = (function () { var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } MyDerived.prototype.foo = function () { _super.prototype.m1.call(this, "hi"); // Should be allowed, method on base prototype diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index 4df9398024c84..0b1e4fc280f40 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -50,9 +50,10 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); - _super.prototype.bar.call(this); + var _this = _super.call(this) || this; + _super.prototype.bar.call(_this); _super.prototype.x; // error + return _this; } D.prototype.foo = function () { _super.prototype.bar.call(this); diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index ec74a2ea0694b..7c72ad5d1bbc4 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -50,9 +50,10 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); - _super.prototype.bar.call(this); // error + var _this = _super.call(this) || this; + _super.prototype.bar.call(_this); // error _super.prototype.x; // error + return _this; } D.foo = function () { _super.bar.call(this); // OK diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js index a91dfc76e3daf..956bce4ef2eb6 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js @@ -29,7 +29,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } B.prototype.foo = function () { return 2; }; B.prototype.bar = function () { diff --git a/tests/baselines/reference/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index df230ce3703db..88a5da8b8fb13 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -99,9 +99,10 @@ var SomeBaseClass = (function () { var SomeDerivedClass = (function (_super) { __extends(SomeDerivedClass, _super); function SomeDerivedClass() { - _super.call(this); - var x = _super.prototype.func.call(this); + var _this = _super.call(this) || this; + var x = _super.prototype.func.call(_this); var x; + return _this; } SomeDerivedClass.prototype.fn = function () { var _this = this; diff --git a/tests/baselines/reference/superPropertyAccess_ES5.js b/tests/baselines/reference/superPropertyAccess_ES5.js index 63f5f6f316aae..45c32076be960 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.js +++ b/tests/baselines/reference/superPropertyAccess_ES5.js @@ -49,9 +49,10 @@ var MyBase = (function () { var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - _super.call(this); - var f1 = _super.prototype.getValue.call(this); + var _this = _super.call(this) || this; + var f1 = _super.prototype.getValue.call(_this); var f2 = _super.prototype.value; + return _this; } return MyDerived; }(MyBase)); @@ -71,7 +72,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Object.defineProperty(B.prototype, "property", { set: function (value) { diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.js b/tests/baselines/reference/superSymbolIndexedAccess5.js index 3acd26d297456..dd37deb5af31d 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.js +++ b/tests/baselines/reference/superSymbolIndexedAccess5.js @@ -31,7 +31,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Bar.prototype[symbol] = function () { return _super.prototype[symbol].call(this); diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.js b/tests/baselines/reference/superSymbolIndexedAccess6.js index 8b04075c41193..8c8534b428ab9 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.js +++ b/tests/baselines/reference/superSymbolIndexedAccess6.js @@ -31,7 +31,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Bar[symbol] = function () { return _super[symbol].call(this); diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index a54ee1bbcbc94..a0381d0b944d8 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -28,7 +28,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); // uses the type parameter type of the base class, ie string + return _super.call(this) || this; } return D; }(C)); diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index b4fe56bee4c0a..803f229bd4bd4 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -20,7 +20,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + return _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index 766b5f7920e28..a1c0497540442 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -23,7 +23,9 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.prototype..call(this); + var _this; + _super.prototype..call(_this); + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/superWithTypeArgument2.js b/tests/baselines/reference/superWithTypeArgument2.js index e0d2a40633f32..42a0e46d4c03e 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -23,7 +23,9 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D(x) { - _super.prototype..call(this, x); + var _this; + _super.prototype..call(_this, x); + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index 586dc595b3976..803e5c264c22a 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -28,7 +28,9 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.prototype..call(this); + var _this; + _super.prototype..call(_this); + return _this; } D.prototype.bar = function () { _super.prototype.bar.call(this, null); 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 db6db37ac8a58..6815b71ce117d 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 @@ -57,7 +57,7 @@ var F = (function () { var SuperObjectTest = (function (_super) { __extends(SuperObjectTest, _super); function SuperObjectTest() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } SuperObjectTest.prototype.testing = function () { var test = { diff --git a/tests/baselines/reference/switchStatements.js b/tests/baselines/reference/switchStatements.js index 093a7fb2f2c19..2e1aecc728830 100644 --- a/tests/baselines/reference/switchStatements.js +++ b/tests/baselines/reference/switchStatements.js @@ -98,7 +98,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/systemModuleWithSuperClass.js b/tests/baselines/reference/systemModuleWithSuperClass.js index 31cd542d2e23b..78c09355fa006 100644 --- a/tests/baselines/reference/systemModuleWithSuperClass.js +++ b/tests/baselines/reference/systemModuleWithSuperClass.js @@ -49,7 +49,7 @@ System.register(["./foo"], function (exports_1, context_1) { Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Bar; }(foo_1.Foo)); diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index d028c04d711d8..cac93023a00e0 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -35,7 +35,7 @@ new Foo(function (s) { s = 5; }); // error, if types are applied correctly var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.call(this, function (s) { s = 5; }); + return _super.call(this, function (s) { s = 5; }) || this; } return Bar; }(Foo)); // error, if types are applied correctly diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 76eeef0139c76..1fc1c7346396b 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -70,7 +70,7 @@ var ClassWithNoInitializer = (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { - _super.call(this, this); // Error + return _super.call(this, _this) || this; } return ClassWithNoInitializer; }(BaseErrClass)); @@ -78,8 +78,9 @@ var ClassWithInitializer = (function (_super) { __extends(ClassWithInitializer, _super); //'this' in required super call function ClassWithInitializer() { - _super.call(this, this); // Error - this.t = 4; + var _this = _super.call(this, _this) || this; + _this.t = 4; + return _this; } return ClassWithInitializer; }(BaseErrClass)); @@ -96,7 +97,7 @@ genericFunc(undefined); // Should be an error var ErrClass3 = (function (_super) { __extends(ErrClass3, _super); function ErrClass3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ErrClass3; }(this)); diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 634b5ef0a2024..f8cb6d695dcce 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -71,7 +71,7 @@ var ClassWithNoInitializer = (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { - _super.call(this, this); // error: "super" has to be called before "this" accessing + return _super.call(this, _this) || this; } return ClassWithNoInitializer; }(BaseErrClass)); @@ -79,8 +79,9 @@ var ClassWithInitializer = (function (_super) { __extends(ClassWithInitializer, _super); //'this' in required super call function ClassWithInitializer() { - _super.call(this, this); // Error - this.t = 4; + var _this = _super.call(this, _this) || this; + _this.t = 4; + return _this; } return ClassWithInitializer; }(BaseErrClass)); @@ -97,7 +98,7 @@ genericFunc(undefined); // Should be an error var ErrClass3 = (function (_super) { __extends(ErrClass3, _super); function ErrClass3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return ErrClass3; }(this)); diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index 827d101c95aed..2a4d15973ab2b 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -36,23 +36,25 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - _super.call(this, this); // error: "super" has to be called before "this" accessing + return _super.call(this, _this) || this; } return Foo; }(Base)); var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - _super.call(this, this); // error - this.p = 0; + var _this = _super.call(this, _this) || this; + _this.p = 0; + return _this; } return Foo2; }(Base)); var Foo3 = (function (_super) { __extends(Foo3, _super); function Foo3(p) { - _super.call(this, this); // error - this.p = p; + var _this = _super.call(this, _this) || this; + _this.p = p; + return _this; } return Foo3; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index a1cfc196ac634..e3eea1fb91de2 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -24,8 +24,9 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x) { - _super.call(this, this); - this.x = x; + var _this = _super.call(this, _this) || this; + _this.x = x; + return _this; } return Foo; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index fdffdd27d6d4b..eabfa9d562c61 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -33,15 +33,16 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - _super.call(this, this); // error: "super" has to be called before "this" accessing + return _super.call(this, _this) || this; } return Foo; }(Base)); var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - _super.call(this, this); // error - this.x = 0; + var _this = _super.call(this, _this) || this; + _this.x = 0; + return _this; } return Foo2; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index 09ad6b705a942..6a72f17248f4b 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -26,8 +26,9 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - _super.call(this, this); - this.x = 0; + var _this = _super.call(this, _this) || this; + _this.x = 0; + return _this; } return Foo; }(Base)); diff --git a/tests/baselines/reference/thisTypeInFunctions.js b/tests/baselines/reference/thisTypeInFunctions.js index cfe1706ae99db..6400f410a0926 100644 --- a/tests/baselines/reference/thisTypeInFunctions.js +++ b/tests/baselines/reference/thisTypeInFunctions.js @@ -227,7 +227,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -336,7 +336,7 @@ var Base1 = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived1; }(Base1)); @@ -350,7 +350,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.js b/tests/baselines/reference/thisTypeInFunctionsNegative.js index 4b40ca2e1e78f..446bc15e6d9da 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.js +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.js @@ -296,7 +296,7 @@ var Base1 = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived1; }(Base1)); @@ -310,7 +310,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/tsxDynamicTagName5.js b/tests/baselines/reference/tsxDynamicTagName5.js index a8d154998e16a..d3bb404ceea6c 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.js +++ b/tests/baselines/reference/tsxDynamicTagName5.js @@ -30,8 +30,9 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - _super.apply(this, arguments); - this._tagName = 'div'; + var _this = _super.apply(this, arguments) || this; + _this._tagName = 'div'; + return _this; } Text.prototype.render = function () { return (); diff --git a/tests/baselines/reference/tsxDynamicTagName7.js b/tests/baselines/reference/tsxDynamicTagName7.js index dbe171f968276..84debfd3e7194 100644 --- a/tests/baselines/reference/tsxDynamicTagName7.js +++ b/tests/baselines/reference/tsxDynamicTagName7.js @@ -30,8 +30,9 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - _super.apply(this, arguments); - this._tagName = 'div'; + var _this = _super.apply(this, arguments) || this; + _this._tagName = 'div'; + return _this; } Text.prototype.render = function () { return ( // this should be an error diff --git a/tests/baselines/reference/tsxDynamicTagName8.js b/tests/baselines/reference/tsxDynamicTagName8.js index e6f63b6a9bf00..6166b99f4accb 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.js +++ b/tests/baselines/reference/tsxDynamicTagName8.js @@ -30,8 +30,9 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - _super.apply(this, arguments); - this._tagName = 'div'; + var _this = _super.apply(this, arguments) || this; + _this._tagName = 'div'; + return _this; } Text.prototype.render = function () { return ( Hello world ); diff --git a/tests/baselines/reference/tsxDynamicTagName9.js b/tests/baselines/reference/tsxDynamicTagName9.js index 589cc7cd226de..928649264c8b6 100644 --- a/tests/baselines/reference/tsxDynamicTagName9.js +++ b/tests/baselines/reference/tsxDynamicTagName9.js @@ -30,8 +30,9 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - _super.apply(this, arguments); - this._tagName = 'div'; + var _this = _super.apply(this, arguments) || this; + _this._tagName = 'div'; + return _this; } Text.prototype.render = function () { return ( Hello world ); diff --git a/tests/baselines/reference/tsxExternalModuleEmit1.js b/tests/baselines/reference/tsxExternalModuleEmit1.js index 0d4e58d7008e0..58e7f1c8d856e 100644 --- a/tests/baselines/reference/tsxExternalModuleEmit1.js +++ b/tests/baselines/reference/tsxExternalModuleEmit1.js @@ -42,7 +42,7 @@ var React = require("react"); var Button = (function (_super) { __extends(Button, _super); function Button() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Button.prototype.render = function () { return ; @@ -63,7 +63,7 @@ var button_1 = require("./button"); var App = (function (_super) { __extends(App, _super); function App() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } App.prototype.render = function () { return ; diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents2.js b/tests/baselines/reference/tsxStatelessFunctionComponents2.js index b93832567d567..88d917235012b 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents2.js +++ b/tests/baselines/reference/tsxStatelessFunctionComponents2.js @@ -52,7 +52,7 @@ function Greet(x) { var BigGreeter = (function (_super) { __extends(BigGreeter, _super); function BigGreeter() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } BigGreeter.prototype.render = function () { return
; diff --git a/tests/baselines/reference/tsxUnionTypeComponent1.js b/tests/baselines/reference/tsxUnionTypeComponent1.js index 444542068be3e..3520b5af3720a 100644 --- a/tests/baselines/reference/tsxUnionTypeComponent1.js +++ b/tests/baselines/reference/tsxUnionTypeComponent1.js @@ -35,7 +35,7 @@ var React = require("react"); var MyComponent = (function (_super) { __extends(MyComponent, _super); function MyComponent() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } MyComponent.prototype.render = function () { var AnyComponent = this.props.AnyComponent; @@ -49,7 +49,7 @@ React.createElement(MyComponent, { AnyComponent: function () { return React.crea var MyButtonComponent = (function (_super) { __extends(MyButtonComponent, _super); function MyButtonComponent() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return MyButtonComponent; }(React.Component)); diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index 1d33fa927a79b..a57fb222a77c0 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -74,7 +74,7 @@ var SomeBase = (function () { var SomeDerived = (function (_super) { __extends(SomeDerived, _super); function SomeDerived() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return SomeDerived; }(SomeBase)); diff --git a/tests/baselines/reference/typeGuardFunction.js b/tests/baselines/reference/typeGuardFunction.js index fcd6435ca1d6b..b88d1038969d2 100644 --- a/tests/baselines/reference/typeGuardFunction.js +++ b/tests/baselines/reference/typeGuardFunction.js @@ -102,7 +102,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionErrors.js b/tests/baselines/reference/typeGuardFunctionErrors.js index f3ff5ffab4afc..6f0880ad7f59a 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.js +++ b/tests/baselines/reference/typeGuardFunctionErrors.js @@ -164,7 +164,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionGenerics.js b/tests/baselines/reference/typeGuardFunctionGenerics.js index 2b5bd5e826598..703c809274fc7 100644 --- a/tests/baselines/reference/typeGuardFunctionGenerics.js +++ b/tests/baselines/reference/typeGuardFunctionGenerics.js @@ -52,7 +52,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThis.js b/tests/baselines/reference/typeGuardFunctionOfFormThis.js index ad85f679e0ab2..c052ea7d72b3c 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThis.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThis.js @@ -161,7 +161,7 @@ var RoyalGuard = (function () { var LeadGuard = (function (_super) { __extends(LeadGuard, _super); function LeadGuard() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } LeadGuard.prototype.lead = function () { }; ; @@ -170,7 +170,7 @@ var LeadGuard = (function (_super) { var FollowerGuard = (function (_super) { __extends(FollowerGuard, _super); function FollowerGuard() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } FollowerGuard.prototype.follow = function () { }; ; @@ -224,7 +224,7 @@ var ArrowGuard = (function () { var ArrowElite = (function (_super) { __extends(ArrowElite, _super); function ArrowElite() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } ArrowElite.prototype.defend = function () { }; return ArrowElite; @@ -232,7 +232,7 @@ var ArrowElite = (function (_super) { var ArrowMedic = (function (_super) { __extends(ArrowMedic, _super); function ArrowMedic() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } ArrowMedic.prototype.heal = function () { }; return ArrowMedic; @@ -266,7 +266,7 @@ var MimicGuard = (function () { var MimicLeader = (function (_super) { __extends(MimicLeader, _super); function MimicLeader() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } MimicLeader.prototype.lead = function () { }; return MimicLeader; @@ -274,7 +274,7 @@ var MimicLeader = (function (_super) { var MimicFollower = (function (_super) { __extends(MimicFollower, _super); function MimicFollower() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } MimicFollower.prototype.follow = function () { }; return MimicFollower; diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js index 73622bf60cc18..a85a207a665f7 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js @@ -79,7 +79,7 @@ var RoyalGuard = (function () { var LeadGuard = (function (_super) { __extends(LeadGuard, _super); function LeadGuard() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } LeadGuard.prototype.lead = function () { }; ; @@ -88,7 +88,7 @@ var LeadGuard = (function (_super) { var FollowerGuard = (function (_super) { __extends(FollowerGuard, _super); function FollowerGuard() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } FollowerGuard.prototype.follow = function () { }; ; diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.js b/tests/baselines/reference/typeGuardOfFormInstanceOf.js index a6881cf3cea15..a181a446a81e2 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.js +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -91,7 +91,7 @@ var C2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(C1)); diff --git a/tests/baselines/reference/typeGuardOfFormIsType.js b/tests/baselines/reference/typeGuardOfFormIsType.js index 3f55b9d41ea9e..14e9259a9e781 100644 --- a/tests/baselines/reference/typeGuardOfFormIsType.js +++ b/tests/baselines/reference/typeGuardOfFormIsType.js @@ -56,7 +56,7 @@ var C2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(C1)); diff --git a/tests/baselines/reference/typeGuardOfFormThisMember.js b/tests/baselines/reference/typeGuardOfFormThisMember.js index 9d71613ed8ffe..52097af34f782 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMember.js +++ b/tests/baselines/reference/typeGuardOfFormThisMember.js @@ -118,8 +118,9 @@ var Test; var File = (function (_super) { __extends(File, _super); function File(path, content) { - _super.call(this, path); - this.content = content; + var _this = _super.call(this, path) || this; + _this.content = content; + return _this; } return File; }(FileSystemObject)); @@ -127,7 +128,7 @@ var Test; var Directory = (function (_super) { __extends(Directory, _super); function Directory() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Directory; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js index 5991fdd316971..c65445a3a5a80 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js +++ b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js @@ -68,8 +68,9 @@ var Test; var File = (function (_super) { __extends(File, _super); function File(path, content) { - _super.call(this, path); - this.content = content; + var _this = _super.call(this, path) || this; + _this.content = content; + return _this; } return File; }(FileSystemObject)); @@ -77,7 +78,7 @@ var Test; var Directory = (function (_super) { __extends(Directory, _super); function Directory() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Directory; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeMatch2.js b/tests/baselines/reference/typeMatch2.js index 57ba67752e239..2cae93924bc55 100644 --- a/tests/baselines/reference/typeMatch2.js +++ b/tests/baselines/reference/typeMatch2.js @@ -65,7 +65,7 @@ var Animal = (function () { var Giraffe = (function (_super) { __extends(Giraffe, _super); function Giraffe() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Giraffe; }(Animal)); diff --git a/tests/baselines/reference/typeOfSuperCall.js b/tests/baselines/reference/typeOfSuperCall.js index 94215d4ae1bf9..179e981b8d1dc 100644 --- a/tests/baselines/reference/typeOfSuperCall.js +++ b/tests/baselines/reference/typeOfSuperCall.js @@ -22,7 +22,9 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var x = _super.call(this); + var _this; + var x = _this = _super.call(this) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/typeParameterAsBaseClass.js b/tests/baselines/reference/typeParameterAsBaseClass.js index a01b6a0cac2ac..15d1c3b396e3f 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.js +++ b/tests/baselines/reference/typeParameterAsBaseClass.js @@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(T)); diff --git a/tests/baselines/reference/typeParameterAsBaseType.js b/tests/baselines/reference/typeParameterAsBaseType.js index 9c3a9bcfcd0c6..2d0962f01d77d 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.js +++ b/tests/baselines/reference/typeParameterAsBaseType.js @@ -21,14 +21,14 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(T)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(U)); diff --git a/tests/baselines/reference/typeParameterExtendingUnion1.js b/tests/baselines/reference/typeParameterExtendingUnion1.js index 75614f46d2194..2738aa205281e 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion1.js +++ b/tests/baselines/reference/typeParameterExtendingUnion1.js @@ -27,14 +27,14 @@ var Animal = (function () { var Cat = (function (_super) { __extends(Cat, _super); function Cat() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Cat; }(Animal)); var Dog = (function (_super) { __extends(Dog, _super); function Dog() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Dog; }(Animal)); diff --git a/tests/baselines/reference/typeParameterExtendingUnion2.js b/tests/baselines/reference/typeParameterExtendingUnion2.js index b32c43bc5ec5a..b3754436f2684 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion2.js +++ b/tests/baselines/reference/typeParameterExtendingUnion2.js @@ -27,14 +27,14 @@ var Animal = (function () { var Cat = (function (_super) { __extends(Cat, _super); function Cat() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Cat; }(Animal)); var Dog = (function (_super) { __extends(Dog, _super); function Dog() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Dog; }(Animal)); diff --git a/tests/baselines/reference/typeRelationships.js b/tests/baselines/reference/typeRelationships.js index 6f8f1ccd4ccc9..2f97f4b0d1c07 100644 --- a/tests/baselines/reference/typeRelationships.js +++ b/tests/baselines/reference/typeRelationships.js @@ -72,11 +72,12 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); - this.self1 = this; - this.self2 = this.self; - this.self3 = this.foo(); - this.d = new D(); + var _this = _super.apply(this, arguments) || this; + _this.self1 = _this; + _this.self2 = _this.self; + _this.self3 = _this.foo(); + _this.d = new D(); + return _this; } D.prototype.bar = function () { this.self = this.self1; diff --git a/tests/baselines/reference/typeValueConflict1.js b/tests/baselines/reference/typeValueConflict1.js index eaca97d31dde0..8711a656bf5f9 100644 --- a/tests/baselines/reference/typeValueConflict1.js +++ b/tests/baselines/reference/typeValueConflict1.js @@ -33,7 +33,7 @@ var M2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(M1.A)); diff --git a/tests/baselines/reference/typeValueConflict2.js b/tests/baselines/reference/typeValueConflict2.js index d89ab0fd357ca..7abda8110b6c6 100644 --- a/tests/baselines/reference/typeValueConflict2.js +++ b/tests/baselines/reference/typeValueConflict2.js @@ -40,7 +40,7 @@ var M2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(M1.A)); @@ -51,7 +51,7 @@ var M3; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return B; }(M1.A)); diff --git a/tests/baselines/reference/typeofClass2.js b/tests/baselines/reference/typeofClass2.js index a0c30c1b1665f..f1ec6a77b14d3 100644 --- a/tests/baselines/reference/typeofClass2.js +++ b/tests/baselines/reference/typeofClass2.js @@ -37,7 +37,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.baz = function (x) { }; D.prototype.foo = function () { }; diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.js b/tests/baselines/reference/typesWithSpecializedCallSignatures.js index e83fd36ae625d..045f7b40e555c 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.js @@ -56,14 +56,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js index 63d5e9bb5b2c9..b4d42d819edb6 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js @@ -54,14 +54,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/undeclaredBase.js b/tests/baselines/reference/undeclaredBase.js index 3dd27a3dbfbdb..4b7813231cf86 100644 --- a/tests/baselines/reference/undeclaredBase.js +++ b/tests/baselines/reference/undeclaredBase.js @@ -14,7 +14,7 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C; }(M.I)); diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js index 513464daa85b1..86948a2d9e668 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -136,105 +136,105 @@ var Base = (function () { var D0 = (function (_super) { __extends(D0, _super); function D0() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D0; }(Base)); var DA = (function (_super) { __extends(DA, _super); function DA() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return DA; }(Base)); var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1; }(Base)); var D1A = (function (_super) { __extends(D1A, _super); function D1A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D1A; }(Base)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2; }(Base)); var D2A = (function (_super) { __extends(D2A, _super); function D2A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D2A; }(Base)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D3; }(Base)); var D3A = (function (_super) { __extends(D3A, _super); function D3A() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D3A; }(Base)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D4; }(Base)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D5; }(Base)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D6; }(Base)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D7; }(Base)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D8; }(Base)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D9; }(Base)); var D10 = (function (_super) { __extends(D10, _super); function D10() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D10; }(Base)); @@ -245,7 +245,7 @@ var E; var D11 = (function (_super) { __extends(D11, _super); function D11() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D11; }(Base)); @@ -257,7 +257,7 @@ var f; var D12 = (function (_super) { __extends(D12, _super); function D12() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D12; }(Base)); @@ -273,21 +273,21 @@ var c; var D13 = (function (_super) { __extends(D13, _super); function D13() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D13; }(Base)); var D14 = (function (_super) { __extends(D14, _super); function D14() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D14; }(Base)); var D15 = (function (_super) { __extends(D15, _super); function D15() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D15; }(Base)); @@ -297,14 +297,14 @@ var D15 = (function (_super) { var D16 = (function (_super) { __extends(D16, _super); function D16() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D16; }(Base)); var D17 = (function (_super) { __extends(D17, _super); function D17() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return D17; }(Base)); diff --git a/tests/baselines/reference/underscoreMapFirst.js b/tests/baselines/reference/underscoreMapFirst.js index a615faea805e9..c8e936af5277f 100644 --- a/tests/baselines/reference/underscoreMapFirst.js +++ b/tests/baselines/reference/underscoreMapFirst.js @@ -57,7 +57,7 @@ var __extends = (this && this.__extends) || function (d, b) { var MyView = (function (_super) { __extends(MyView, _super); function MyView() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } MyView.prototype.getDataSeries = function () { var data = this.model.get("data"); diff --git a/tests/baselines/reference/underscoreThisInDerivedClass01.errors.txt b/tests/baselines/reference/underscoreThisInDerivedClass01.errors.txt new file mode 100644 index 0000000000000..3828825cb6b82 --- /dev/null +++ b/tests/baselines/reference/underscoreThisInDerivedClass01.errors.txt @@ -0,0 +1,29 @@ +tests/cases/compiler/underscoreThisInDerivedClass01.ts(20,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + +==== tests/cases/compiler/underscoreThisInDerivedClass01.ts (1 errors) ==== + // @target es5 + + // Original test intent: + // When arrow functions capture 'this', the lexical 'this' owner + // currently captures 'this' using a variable named '_this'. + // That means that '_this' becomes a reserved identifier in certain places. + // + // Constructors have adopted the same identifier name ('_this') + // for capturing any potential return values from super calls, + // so we expect the same behavior. + + class C { + constructor() { + return {}; + } + } + + class D extends C { + constructor() { + var _this = "uh-oh?"; + ~~~~~ +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + super(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/underscoreThisInDerivedClass01.js b/tests/baselines/reference/underscoreThisInDerivedClass01.js new file mode 100644 index 0000000000000..000176c213f48 --- /dev/null +++ b/tests/baselines/reference/underscoreThisInDerivedClass01.js @@ -0,0 +1,56 @@ +//// [underscoreThisInDerivedClass01.ts] +// @target es5 + +// Original test intent: +// When arrow functions capture 'this', the lexical 'this' owner +// currently captures 'this' using a variable named '_this'. +// That means that '_this' becomes a reserved identifier in certain places. +// +// Constructors have adopted the same identifier name ('_this') +// for capturing any potential return values from super calls, +// so we expect the same behavior. + +class C { + constructor() { + return {}; + } +} + +class D extends C { + constructor() { + var _this = "uh-oh?"; + super(); + } +} + +//// [underscoreThisInDerivedClass01.js] +// @target es5 +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +// Original test intent: +// When arrow functions capture 'this', the lexical 'this' owner +// currently captures 'this' using a variable named '_this'. +// That means that '_this' becomes a reserved identifier in certain places. +// +// Constructors have adopted the same identifier name ('_this') +// for capturing any potential return values from super calls, +// so we expect the same behavior. +var C = (function () { + function C() { + return {}; + } + return C; +}()); +var D = (function (_super) { + __extends(D, _super); + function D() { + var _this; + var _this = "uh-oh?"; + _this = _super.call(this) || this; + return _this; + } + return D; +}(C)); diff --git a/tests/baselines/reference/underscoreThisInDerivedClass01.symbols b/tests/baselines/reference/underscoreThisInDerivedClass01.symbols new file mode 100644 index 0000000000000..c05cd4f6fc327 --- /dev/null +++ b/tests/baselines/reference/underscoreThisInDerivedClass01.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/underscoreThisInDerivedClass01.ts === +// @target es5 + +// Original test intent: +// When arrow functions capture 'this', the lexical 'this' owner +// currently captures 'this' using a variable named '_this'. +// That means that '_this' becomes a reserved identifier in certain places. +// +// Constructors have adopted the same identifier name ('_this') +// for capturing any potential return values from super calls, +// so we expect the same behavior. + +class C { +>C : Symbol(C, Decl(underscoreThisInDerivedClass01.ts, 0, 0)) + + constructor() { + return {}; + } +} + +class D extends C { +>D : Symbol(D, Decl(underscoreThisInDerivedClass01.ts, 15, 1)) +>C : Symbol(C, Decl(underscoreThisInDerivedClass01.ts, 0, 0)) + + constructor() { + var _this = "uh-oh?"; +>_this : Symbol(_this, Decl(underscoreThisInDerivedClass01.ts, 19, 11)) + + super(); +>super : Symbol(C, Decl(underscoreThisInDerivedClass01.ts, 0, 0)) + } +} diff --git a/tests/baselines/reference/underscoreThisInDerivedClass01.types b/tests/baselines/reference/underscoreThisInDerivedClass01.types new file mode 100644 index 0000000000000..b07f3e0efbf8a --- /dev/null +++ b/tests/baselines/reference/underscoreThisInDerivedClass01.types @@ -0,0 +1,35 @@ +=== tests/cases/compiler/underscoreThisInDerivedClass01.ts === +// @target es5 + +// Original test intent: +// When arrow functions capture 'this', the lexical 'this' owner +// currently captures 'this' using a variable named '_this'. +// That means that '_this' becomes a reserved identifier in certain places. +// +// Constructors have adopted the same identifier name ('_this') +// for capturing any potential return values from super calls, +// so we expect the same behavior. + +class C { +>C : C + + constructor() { + return {}; +>{} : {} + } +} + +class D extends C { +>D : D +>C : C + + constructor() { + var _this = "uh-oh?"; +>_this : string +>"uh-oh?" : string + + super(); +>super() : void +>super : typeof C + } +} diff --git a/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt b/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt new file mode 100644 index 0000000000000..5569ebf1af6fb --- /dev/null +++ b/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/underscoreThisInDerivedClass02.ts(14,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/compiler/underscoreThisInDerivedClass02.ts(15,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + +==== tests/cases/compiler/underscoreThisInDerivedClass02.ts (2 errors) ==== + // @target es5 + + // Original test intent: + // Errors on '_this' should be reported in derived constructors, + // even if 'super()' is not called. + + class C { + constructor() { + return {}; + } + } + + class D extends C { + constructor() { + ~~~~~~~~~~~~~~~ + var _this = "uh-oh?"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + } + ~~~~~ +!!! error TS2377: Constructors for derived classes must contain a 'super' call. + } \ No newline at end of file diff --git a/tests/baselines/reference/underscoreThisInDerivedClass02.js b/tests/baselines/reference/underscoreThisInDerivedClass02.js new file mode 100644 index 0000000000000..c1e9494376b53 --- /dev/null +++ b/tests/baselines/reference/underscoreThisInDerivedClass02.js @@ -0,0 +1,44 @@ +//// [underscoreThisInDerivedClass02.ts] +// @target es5 + +// Original test intent: +// Errors on '_this' should be reported in derived constructors, +// even if 'super()' is not called. + +class C { + constructor() { + return {}; + } +} + +class D extends C { + constructor() { + var _this = "uh-oh?"; + } +} + +//// [underscoreThisInDerivedClass02.js] +// @target es5 +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +// Original test intent: +// Errors on '_this' should be reported in derived constructors, +// even if 'super()' is not called. +var C = (function () { + function C() { + return {}; + } + return C; +}()); +var D = (function (_super) { + __extends(D, _super); + function D() { + var _this; + var _this = "uh-oh?"; + return _this; + } + return D; +}(C)); diff --git a/tests/baselines/reference/unionTypeEquivalence.js b/tests/baselines/reference/unionTypeEquivalence.js index 1ff47f68e5f1b..e4d0acc893cc0 100644 --- a/tests/baselines/reference/unionTypeEquivalence.js +++ b/tests/baselines/reference/unionTypeEquivalence.js @@ -34,7 +34,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.foo = function () { }; return D; diff --git a/tests/baselines/reference/unionTypeFromArrayLiteral.js b/tests/baselines/reference/unionTypeFromArrayLiteral.js index 95dd9d398536b..83ad2a343946b 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.js +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.js @@ -54,7 +54,7 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.foo3 = function () { }; return E; @@ -62,7 +62,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } F.prototype.foo4 = function () { }; return F; diff --git a/tests/baselines/reference/unionTypesAssignability.js b/tests/baselines/reference/unionTypesAssignability.js index c710560800406..231b8b27f3ba6 100644 --- a/tests/baselines/reference/unionTypesAssignability.js +++ b/tests/baselines/reference/unionTypesAssignability.js @@ -88,7 +88,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } D.prototype.foo1 = function () { }; return D; @@ -96,7 +96,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } E.prototype.foo2 = function () { }; return E; diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 03ed4990c29ed..832868c4b8ff8 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -63,7 +63,7 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.call(this, asdf); + return _super.call(this, asdf) || this; } return C4; }(C3)); diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index 7b3938c7099d1..1343bea602e39 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -169,7 +169,7 @@ var ts; var Type = (function (_super) { __extends(Type, _super); function Type() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } Type.prototype.equals = function (that) { if (this === that) @@ -233,10 +233,11 @@ var ts; var Property = (function (_super) { __extends(Property, _super); function Property(name, type, flags) { - _super.call(this); - this.name = name; - this.type = type; - this.flags = flags; + var _this = _super.call(this) || this; + _this.name = name; + _this.type = type; + _this.flags = flags; + return _this; } Property.prototype.equals = function (other) { return this.name === other.name && @@ -253,10 +254,11 @@ var ts; var Signature = (function (_super) { __extends(Signature, _super); function Signature(typeParameters, parameters, returnType) { - _super.call(this); - this.typeParameters = typeParameters; - this.parameters = parameters; - this.returnType = returnType; + var _this = _super.call(this) || this; + _this.typeParameters = typeParameters; + _this.parameters = parameters; + _this.returnType = returnType; + return _this; } Signature.prototype.equalsNoReturn = function (other) { return this.parameters.length === other.parameters.length && @@ -273,10 +275,11 @@ var ts; var Parameter = (function (_super) { __extends(Parameter, _super); function Parameter(name, type, flags) { - _super.call(this); - this.name = name; - this.type = type; - this.flags = flags; + var _this = _super.call(this) || this; + _this.name = name; + _this.type = type; + _this.flags = flags; + return _this; } Parameter.prototype.equals = function (other) { return this.name === other.name && diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js index e991db69367f3..b82a7cbc0ae9e 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js @@ -70,7 +70,7 @@ var r4 = c2(); // should be an error var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return C2; }(Function)); // error diff --git a/tests/baselines/reference/unusedClassesinNamespace4.js b/tests/baselines/reference/unusedClassesinNamespace4.js index 65198c1c1aa7e..0ab1227bf3d04 100644 --- a/tests/baselines/reference/unusedClassesinNamespace4.js +++ b/tests/baselines/reference/unusedClassesinNamespace4.js @@ -36,7 +36,7 @@ var Validation; var c3 = (function (_super) { __extends(c3, _super); function c3() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return c3; }(c1)); diff --git a/tests/baselines/reference/unusedIdentifiersConsolidated1.js b/tests/baselines/reference/unusedIdentifiersConsolidated1.js index 521f17bf5ef7e..dbb261e5f2a03 100644 --- a/tests/baselines/reference/unusedIdentifiersConsolidated1.js +++ b/tests/baselines/reference/unusedIdentifiersConsolidated1.js @@ -168,7 +168,7 @@ var Greeter; var class2 = (function (_super) { __extends(class2, _super); function class2() { - _super.apply(this, arguments); + return _super.apply(this, arguments) || this; } return class2; }(class1)); diff --git a/tests/baselines/reference/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index 027ba254ae019..483e905b48ab6 100644 --- a/tests/baselines/reference/validUseOfThisInSuper.js +++ b/tests/baselines/reference/validUseOfThisInSuper.js @@ -24,8 +24,7 @@ var Base = (function () { var Super = (function (_super) { __extends(Super, _super); function Super() { - var _this = this; - _super.call(this, (function () { return _this; })()); // ok since this is not the case: The constructor declares parameter properties or the containing class declares instance member variables with initializers. + return _super.call(this, (function () { return _this; })()) || this; } return Super; }(Base)); diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index db8f566702aa3..0875f2ba1dd85 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -41,9 +41,10 @@ define(["require", "exports"], function (require, exports) { var B = (function (_super) { __extends(B, _super); function B(element, url) { - _super.call(this, element); - this.p1 = element; - this.p2 = url; + var _this = _super.call(this, element) || this; + _this.p1 = element; + _this.p2 = url; + return _this; } return B; }(A)); diff --git a/tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts b/tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts new file mode 100644 index 0000000000000..2475eac0bb2d3 --- /dev/null +++ b/tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts @@ -0,0 +1,36 @@ +// @target: es5 +// @sourcemap: true + +class C { + cProp = 10; + + foo() { return "this never gets used."; } + + constructor(value: number) { + return { + cProp: value, + foo() { + return "well this looks kinda C-ish."; + } + } + } +} + +class D extends C { + dProp = () => this; + + constructor(a = 100) { + super(a); + + if (Math.random() < 0.5) { + "You win!" + return { + cProp: 1, + dProp: () => this, + foo() { return "You win!!!!!" } + }; + } + else + return null; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/underscoreThisInDerivedClass01.ts b/tests/cases/compiler/underscoreThisInDerivedClass01.ts new file mode 100644 index 0000000000000..0d3f5849cb157 --- /dev/null +++ b/tests/cases/compiler/underscoreThisInDerivedClass01.ts @@ -0,0 +1,23 @@ +// @target es5 + +// Original test intent: +// When arrow functions capture 'this', the lexical 'this' owner +// currently captures 'this' using a variable named '_this'. +// That means that '_this' becomes a reserved identifier in certain places. +// +// Constructors have adopted the same identifier name ('_this') +// for capturing any potential return values from super calls, +// so we expect the same behavior. + +class C { + constructor() { + return {}; + } +} + +class D extends C { + constructor() { + var _this = "uh-oh?"; + super(); + } +} \ No newline at end of file diff --git a/tests/cases/compiler/underscoreThisInDerivedClass02.ts b/tests/cases/compiler/underscoreThisInDerivedClass02.ts new file mode 100644 index 0000000000000..da197258a7348 --- /dev/null +++ b/tests/cases/compiler/underscoreThisInDerivedClass02.ts @@ -0,0 +1,17 @@ +// @target es5 + +// Original test intent: +// Errors on '_this' should be reported in derived constructors, +// even if 'super()' is not called. + +class C { + constructor() { + return {}; + } +} + +class D extends C { + constructor() { + var _this = "uh-oh?"; + } +} \ No newline at end of file