From 9dbab972b906ecba5984aaf255c5557b9c0a2857 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 1 Sep 2016 18:15:44 -0700 Subject: [PATCH 01/47] Emit '_this' declaration for derived classes; initialize it when calling 'super(...)'. --- src/compiler/transformers/es6.ts | 103 ++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 30 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 4e994c1acb0..aab894dc4ff 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -770,7 +770,7 @@ namespace ts { const statements: Statement[] = []; startLexicalEnvironment(); if (constructor) { - addCaptureThisForNodeIfNeeded(statements, constructor); + declareOrCaptureThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement); addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); } @@ -781,6 +781,13 @@ namespace ts { const body = saveStateAndInvoke(constructor, hasSynthesizedSuper ? transformConstructorBodyWithSynthesizedSuper : transformConstructorBodyWithoutSynthesizedSuper); addRange(statements, body); } + if (constructor ? hasSynthesizedSuper : extendsClauseElement) { + statements.push( + createReturn( + createIdentifier("_this") + ) + ); + } addRange(statements, endLexicalEnvironment()); const block = createBlock( @@ -800,11 +807,11 @@ namespace ts { } function transformConstructorBodyWithSynthesizedSuper(node: ConstructorDeclaration) { - return visitNodes(node.body.statements, visitor, isStatement, 1); + return visitNodes(node.body.statements, visitor, isStatement, /*start*/ 1); } function transformConstructorBodyWithoutSynthesizedSuper(node: ConstructorDeclaration) { - return visitNodes(node.body.statements, visitor, isStatement, 0); + return visitNodes(node.body.statements, visitor, isStatement, /*start*/ 0); } /** @@ -823,16 +830,27 @@ namespace ts { // 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 - ) + const superCall = createFunctionApply( + createIdentifier("_super"), + createThis(), + createIdentifier("arguments"), ); + const superReturnValueOrThis = createLogicalOr(superCall, createThis()); + + statements.push( + createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList([ + createVariableDeclaration( + "_this", + /*type*/ undefined, + superReturnValueOrThis + ) + ]), + /*location*/ extendsClauseElement) + ); + + enableSubstitutionsForCapturedThis(); } } @@ -1079,6 +1097,15 @@ namespace ts { statements.push(forStatement); } + function declareOrCaptureThisForConstructorIfNeeded(statements: Statement[], ctor: ConstructorDeclaration, hasExtendsClause: boolean) { + if (hasExtendsClause) { + captureThisForNode(statements, ctor, /*initializer*/ undefined); + } + else { + addCaptureThisForNodeIfNeeded(statements, ctor); + } + } + /** * Adds a statement to capture the `this` of a function declaration if it is needed. * @@ -1087,24 +1114,28 @@ 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() - ) - ]) - ); - - setNodeEmitFlags(captureThisStatement, NodeEmitFlags.NoComments | NodeEmitFlags.CustomPrologue); - setSourceMapRange(captureThisStatement, node); - statements.push(captureThisStatement); + captureThisForNode(statements, node, createThis()); } } + function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined) { + enableSubstitutionsForCapturedThis(); + const captureThisStatement = createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList([ + createVariableDeclaration( + "_this", + /*type*/ undefined, + initializer + ) + ]) + ); + + setNodeEmitFlags(captureThisStatement, NodeEmitFlags.NoComments | NodeEmitFlags.CustomPrologue); + setSourceMapRange(captureThisStatement, node); + statements.push(captureThisStatement); + } + /** * Adds statements to the class body function for a class to define the members of the * class. @@ -2468,11 +2499,12 @@ namespace ts { * * @param node a CallExpression. */ - function visitCallExpression(node: CallExpression): LeftHandSideExpression { + function visitCallExpression(node: CallExpression): 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); + let resultingCall: CallExpression | BinaryExpression; if (node.transformFlags & TransformFlags.ContainsSpreadElementExpression) { // [source] // f(...a, b) @@ -2488,7 +2520,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) @@ -2505,13 +2537,24 @@ 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) { + return createAssignment( + createIdentifier("_this"), + createLogicalOr( + resultingCall, + createThis() + ) + ); + } + return resultingCall; } /** From 99f1df4c0a7de520522cc3ab05aeb5e5ef92ccb9 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 1 Sep 2016 20:31:21 -0700 Subject: [PATCH 02/47] Accepted baselines. --- ...sClassHeritageListMemberTypeAnnotations.js | 3 +- ...accessibleTypeInTypeParameterConstraint.js | 3 +- .../reference/abstractClassInLocalScope.js | 3 +- .../abstractClassInLocalScopeIsAbstract.js | 3 +- tests/baselines/reference/abstractProperty.js | 3 +- .../reference/abstractPropertyNegative.js | 12 +- .../accessOverriddenBaseClassMember1.js | 3 +- .../accessors_spec_section-4.5_inference.js | 3 +- .../reference/aliasUsageInAccessorsOfClass.js | 3 +- .../baselines/reference/aliasUsageInArray.js | 3 +- .../aliasUsageInFunctionExpression.js | 3 +- .../reference/aliasUsageInGenericFunction.js | 3 +- .../reference/aliasUsageInIndexerOfClass.js | 3 +- .../reference/aliasUsageInObjectLiteral.js | 3 +- .../reference/aliasUsageInOrExpression.js | 3 +- ...aliasUsageInTypeArgumentOfExtendsClause.js | 6 +- .../reference/aliasUsageInVarAssignment.js | 3 +- .../reference/ambiguousOverloadResolution.js | 3 +- .../reference/apparentTypeSubtyping.js | 6 +- .../reference/apparentTypeSupertype.js | 3 +- .../reference/arrayAssignmentTest1.js | 3 +- .../reference/arrayAssignmentTest2.js | 3 +- .../reference/arrayBestCommonTypes.js | 6 +- .../reference/arrayLiteralTypeInference.js | 6 +- tests/baselines/reference/arrayLiterals.js | 6 +- .../arrayLiteralsWithRecursiveGenerics.js | 3 +- ...rayOfSubtypeIsAssignableToReadonlyArray.js | 6 +- .../reference/arrowFunctionContexts.js | 8 +- .../assignmentCompatWithCallSignatures3.js | 9 +- .../assignmentCompatWithCallSignatures4.js | 9 +- .../assignmentCompatWithCallSignatures5.js | 9 +- .../assignmentCompatWithCallSignatures6.js | 9 +- ...ssignmentCompatWithConstructSignatures3.js | 9 +- ...ssignmentCompatWithConstructSignatures4.js | 9 +- ...ssignmentCompatWithConstructSignatures5.js | 9 +- ...ssignmentCompatWithConstructSignatures6.js | 9 +- .../assignmentCompatWithNumericIndexer.js | 3 +- .../assignmentCompatWithNumericIndexer3.js | 3 +- .../assignmentCompatWithObjectMembers4.js | 12 +- ...nmentCompatWithObjectMembersOptionality.js | 6 +- ...mentCompatWithObjectMembersOptionality2.js | 6 +- .../assignmentCompatWithStringIndexer.js | 6 +- .../reference/assignmentLHSIsValue.js | 3 +- .../reference/asyncImportedPromise_es5.js | 3 +- .../reference/asyncMethodWithSuper_es5.js | 3 +- .../reference/asyncQualifiedReturnType_es5.js | 3 +- tests/baselines/reference/autolift4.js | 3 +- .../reference/awaitClassExpression_es5.js | 3 +- tests/baselines/reference/baseCheck.js | 15 +- .../reference/baseIndexSignatureResolution.js | 3 +- .../reference/baseTypeOrderChecking.js | 6 +- .../baseTypeWrappingInstantiationChain.js | 6 +- tests/baselines/reference/bases.js | 1 + .../bestCommonTypeOfConditionalExpressions.js | 6 +- ...bestCommonTypeOfConditionalExpressions2.js | 6 +- .../reference/bestCommonTypeOfTuple2.js | 6 +- ...allSignatureAssignabilityInInheritance2.js | 9 +- ...allSignatureAssignabilityInInheritance3.js | 9 +- ...allSignatureAssignabilityInInheritance4.js | 9 +- ...allSignatureAssignabilityInInheritance5.js | 9 +- ...allSignatureAssignabilityInInheritance6.js | 9 +- tests/baselines/reference/callWithSpread.js | 5 +- .../reference/captureThisInSuperCall.js | 4 +- tests/baselines/reference/castingTuple.js | 6 +- .../baselines/reference/chainedAssignment3.js | 3 +- ...arameterConstrainedToOtherTypeParameter.js | 6 +- .../reference/checkForObjectTooStrict.js | 6 +- .../checkSuperCallBeforeThisAccessing1.js | 3 +- .../checkSuperCallBeforeThisAccessing2.js | 3 +- .../checkSuperCallBeforeThisAccessing3.js | 3 +- .../checkSuperCallBeforeThisAccessing4.js | 6 +- .../checkSuperCallBeforeThisAccessing5.js | 3 +- .../checkSuperCallBeforeThisAccessing6.js | 4 +- .../checkSuperCallBeforeThisAccessing7.js | 4 +- .../checkSuperCallBeforeThisAccessing8.js | 3 +- .../reference/circularImportAlias.js | 3 +- .../circularTypeofWithFunctionModule.js | 3 +- .../classAbstractConstructorAssignability.js | 6 +- .../reference/classAbstractCrashedOnce.js | 3 +- .../reference/classAbstractExtends.js | 12 +- .../reference/classAbstractFactoryFunction.js | 3 +- .../reference/classAbstractGeneric.js | 18 ++- .../reference/classAbstractInAModule.js | 3 +- .../reference/classAbstractInheritance.js | 24 ++- .../reference/classAbstractInstantiations1.js | 6 +- .../reference/classAbstractInstantiations2.js | 12 +- .../classAbstractOverrideWithAbstract.js | 12 +- .../reference/classAbstractSuperCalls.js | 9 +- .../classAbstractUsingAbstractMethod1.js | 6 +- .../classAbstractUsingAbstractMethods2.js | 21 ++- .../classConstructorAccessibility2.js | 9 +- .../classConstructorAccessibility4.js | 6 +- .../classConstructorAccessibility5.js | 3 +- ...classConstructorParametersAccessibility.js | 3 +- ...lassConstructorParametersAccessibility2.js | 3 +- ...lassConstructorParametersAccessibility3.js | 3 +- ...clarationMergedInModuleWithContinuation.js | 3 +- .../classDoesNotDependOnBaseTypes.js | 3 +- tests/baselines/reference/classExpression2.js | 3 +- tests/baselines/reference/classExpression3.js | 6 +- .../classExpressionExtendingAbstractClass.js | 3 +- .../reference/classExtendingBuiltinType.js | 30 ++-- .../reference/classExtendingClass.js | 6 +- .../reference/classExtendingClassLikeType.js | 20 ++- .../reference/classExtendingNonConstructor.js | 21 ++- .../baselines/reference/classExtendingNull.js | 6 +- .../reference/classExtendingPrimitive.js | 27 ++-- .../reference/classExtendingPrimitive2.js | 3 +- .../reference/classExtendingQualifiedName.js | 3 +- .../reference/classExtendingQualifiedName2.js | 3 +- .../reference/classExtendsAcrossFiles.js | 6 +- ...sMergedWithModuleNotReferingConstructor.js | 3 +- ...tendsClauseClassNotReferringConstructor.js | 3 +- .../reference/classExtendsEveryObjectType.js | 18 ++- .../reference/classExtendsEveryObjectType2.js | 6 +- .../reference/classExtendsInterface.js | 6 +- .../classExtendsInterfaceInExpression.js | 3 +- .../classExtendsInterfaceInModule.js | 9 +- .../baselines/reference/classExtendsItself.js | 9 +- .../reference/classExtendsItselfIndirectly.js | 18 ++- .../classExtendsItselfIndirectly2.js | 18 ++- .../classExtendsItselfIndirectly3.js | 18 ++- .../classExtendsMultipleBaseClasses.js | 3 +- tests/baselines/reference/classExtendsNull.js | 4 +- ...classExtendsShadowedConstructorFunction.js | 3 +- .../classExtendsValidConstructorFunction.js | 3 +- .../classHeritageWithTrailingSeparator.js | 3 +- .../reference/classImplementsClass2.js | 3 +- .../reference/classImplementsClass3.js | 3 +- .../reference/classImplementsClass4.js | 3 +- .../reference/classImplementsClass5.js | 3 +- .../reference/classImplementsClass6.js | 3 +- tests/baselines/reference/classIndexer3.js | 3 +- tests/baselines/reference/classInheritence.js | 6 +- .../reference/classIsSubtypeOfBaseType.js | 6 +- tests/baselines/reference/classOrder2.js | 3 +- tests/baselines/reference/classOrderBug.js | 3 +- .../reference/classSideInheritance1.js | 3 +- .../reference/classSideInheritance2.js | 3 +- .../reference/classSideInheritance3.js | 6 +- tests/baselines/reference/classUpdateTests.js | 24 ++- .../classWithBaseClassButNoConstructor.js | 12 +- .../reference/classWithConstructors.js | 6 +- .../reference/classWithProtectedProperty.js | 3 +- .../reference/classWithStaticMembers.js | 3 +- tests/baselines/reference/classdecl.js | 9 +- .../reference/clodulesDerivedClasses.js | 3 +- ...llisionSuperAndLocalFunctionInAccessors.js | 6 +- ...isionSuperAndLocalFunctionInConstructor.js | 6 +- .../collisionSuperAndLocalFunctionInMethod.js | 6 +- ...ollisionSuperAndLocalFunctionInProperty.js | 3 +- .../collisionSuperAndLocalVarInAccessors.js | 6 +- .../collisionSuperAndLocalVarInConstructor.js | 6 +- .../collisionSuperAndLocalVarInMethod.js | 6 +- .../collisionSuperAndLocalVarInProperty.js | 3 +- .../collisionSuperAndNameResolution.js | 3 +- .../reference/collisionSuperAndParameter.js | 6 +- .../reference/collisionSuperAndParameter1.js | 3 +- ...perAndPropertyNameAsConstuctorParameter.js | 12 +- ...xpressionAndLocalVarWithSuperExperssion.js | 6 +- .../reference/commentsInheritance.js | 6 +- .../comparisonOperatorWithIdenticalObjects.js | 6 +- ...ithNoRelationshipObjectsOnCallSignature.js | 3 +- ...lationshipObjectsOnConstructorSignature.js | 3 +- ...thNoRelationshipObjectsOnIndexSignature.js | 3 +- ...nshipObjectsOnInstantiatedCallSignature.js | 3 +- ...jectsOnInstantiatedConstructorSignature.js | 3 +- ...peratorWithSubtypeObjectOnCallSignature.js | 3 +- ...WithSubtypeObjectOnConstructorSignature.js | 3 +- ...eratorWithSubtypeObjectOnIndexSignature.js | 3 +- ...ubtypeObjectOnInstantiatedCallSignature.js | 3 +- ...bjectOnInstantiatedConstructorSignature.js | 3 +- ...isonOperatorWithSubtypeObjectOnProperty.js | 6 +- .../reference/complexClassRelationships.js | 3 +- ...catedGenericRecursiveBaseClassReference.js | 3 +- .../reference/compoundAssignmentLHSIsValue.js | 3 +- ...poundExponentiationAssignmentLHSIsValue.js | 3 +- .../reference/computedPropertyNames24_ES5.js | 3 +- .../reference/computedPropertyNames25_ES5.js | 3 +- .../reference/computedPropertyNames26_ES5.js | 3 +- .../reference/computedPropertyNames27_ES5.js | 5 +- .../reference/computedPropertyNames28_ES5.js | 5 +- .../reference/computedPropertyNames30_ES5.js | 5 +- .../reference/computedPropertyNames31_ES5.js | 3 +- .../reference/computedPropertyNames43_ES5.js | 3 +- .../reference/computedPropertyNames44_ES5.js | 3 +- .../reference/computedPropertyNames45_ES5.js | 3 +- .../conditionalOperatorWithIdenticalBCT.js | 6 +- .../conditionalOperatorWithoutIdenticalBCT.js | 6 +- .../reference/constantOverloadFunction.js | 9 +- .../constantOverloadFunctionNoSubtypeError.js | 9 +- ...nstraintCheckInGenericBaseTypeReference.js | 3 +- ...uctSignatureAssignabilityInInheritance2.js | 9 +- ...uctSignatureAssignabilityInInheritance3.js | 9 +- ...uctSignatureAssignabilityInInheritance4.js | 9 +- ...uctSignatureAssignabilityInInheritance5.js | 9 +- ...uctSignatureAssignabilityInInheritance6.js | 9 +- tests/baselines/reference/constructorArgs.js | 3 +- ...uctorFunctionTypeIsAssignableToBaseType.js | 6 +- ...ctorFunctionTypeIsAssignableToBaseType2.js | 6 +- .../constructorHasPrototypeProperty.js | 6 +- .../reference/constructorOverloads2.js | 3 +- .../reference/constructorOverloads3.js | 1 + ...constructorWithIncompleteTypeAnnotation.js | 3 +- .../contextualTypingArrayOfLambdas.js | 6 +- ...contextualTypingOfConditionalExpression.js | 6 +- ...ontextualTypingOfConditionalExpression2.js | 6 +- ...urcePropertyIsRelatableToTargetProperty.js | 3 +- .../reference/declFileClassExtendsNull.js | 3 +- .../declFileForFunctionTypeAsTypeParameter.js | 3 +- ...ileGenericClassWithGenericExtendedClass.js | 3 +- .../reference/declFileGenericType.js | 3 +- .../reference/declFileGenericType2.js | 6 +- ...lictingWithClassReferredByExtendsClause.js | 6 +- ...dsClauseThatHasItsContainerNameConflict.js | 3 +- .../declarationEmitThisPredicates01.js | 3 +- ...tionEmitThisPredicatesWithPrivateName01.js | 3 +- .../declarationEmit_expressionInExtends.js | 3 +- .../declarationEmit_expressionInExtends2.js | 3 +- .../declarationEmit_expressionInExtends3.js | 12 +- .../declarationEmit_expressionInExtends4.js | 9 +- .../declarationEmit_nameConflicts3.js | 3 +- .../declarationEmit_protectedMembers.js | 6 +- .../reference/declareDottedExtend.js | 6 +- .../reference/decoratorOnClassConstructor2.js | 3 +- .../reference/decoratorOnClassConstructor3.js | 3 +- .../reference/decoratorOnClassMethod12.js | 3 +- ...derivedClassConstructorWithoutSuperCall.js | 10 +- ...ClassFunctionOverridesBaseClassAccessor.js | 3 +- .../derivedClassIncludesInheritedMembers.js | 6 +- ...idesIndexersWithAssignmentCompatibility.js | 6 +- .../derivedClassOverridesPrivateFunction1.js | 3 +- .../derivedClassOverridesPrivates.js | 6 +- .../derivedClassOverridesProtectedMembers.js | 3 +- .../derivedClassOverridesProtectedMembers2.js | 6 +- .../derivedClassOverridesProtectedMembers3.js | 30 ++-- .../derivedClassOverridesProtectedMembers4.js | 6 +- .../derivedClassOverridesPublicMembers.js | 6 +- .../derivedClassOverridesWithoutSubtype.js | 6 +- .../derivedClassParameterProperties.js | 30 ++-- ...dClassSuperCallsInNonConstructorMembers.js | 19 +-- .../derivedClassSuperCallsWithThisArg.js | 13 +- .../reference/derivedClassTransitivity.js | 6 +- .../reference/derivedClassTransitivity2.js | 6 +- .../reference/derivedClassTransitivity3.js | 6 +- .../reference/derivedClassTransitivity4.js | 6 +- .../reference/derivedClassWithAny.js | 6 +- ...ivateInstanceShadowingProtectedInstance.js | 3 +- ...hPrivateInstanceShadowingPublicInstance.js | 3 +- ...thPrivateStaticShadowingProtectedStatic.js | 3 +- ...sWithPrivateStaticShadowingPublicStatic.js | 3 +- .../derivedClassWithoutExplicitConstructor.js | 6 +- ...derivedClassWithoutExplicitConstructor2.js | 6 +- ...derivedClassWithoutExplicitConstructor3.js | 12 +- tests/baselines/reference/derivedClasses.js | 6 +- .../reference/derivedGenericClassWithAny.js | 6 +- ...sesHiddenBaseCallViaSuperPropertyAccess.js | 3 +- .../derivedTypeDoesNotRequireExtendsClause.js | 3 +- .../destructuringParameterDeclaration5.js | 6 +- ...BeforeEmitParameterPropertyDeclaration1.js | 3 +- ...SuperCallBeforeEmitPropertyDeclaration1.js | 3 +- ...arationAndParameterPropertyDeclaration1.js | 3 +- .../reference/emitThisInSuperMethodCall.js | 3 +- tests/baselines/reference/emptyModuleName.js | 3 +- ...rorForwardReferenceForwadingConstructor.js | 3 +- tests/baselines/reference/errorSuperCalls.js | 32 ++-- .../reference/errorSuperPropertyAccess.js | 9 +- .../reference/errorsInGenericTypeReference.js | 3 +- .../reference/es6ClassSuperCodegenBug.js | 5 +- tests/baselines/reference/es6ClassTest.js | 3 +- tests/baselines/reference/es6ClassTest2.js | 6 +- tests/baselines/reference/es6ClassTest7.js | 3 +- .../exportAssignmentOfGenericType1.js | 3 +- .../exportDeclarationInInternalModule.js | 3 +- tests/baselines/reference/extBaseClass1.js | 9 +- tests/baselines/reference/extBaseClass2.js | 6 +- .../extendAndImplementTheSameBaseType.js | 3 +- .../extendAndImplementTheSameBaseType2.js | 3 +- .../extendBaseClassBeforeItsDeclared.js | 3 +- .../extendClassExpressionFromModule.js | 3 +- .../extendConstructSignatureInInterface.js | 3 +- .../reference/extendNonClassSymbol1.js | 3 +- .../reference/extendNonClassSymbol2.js | 3 +- ...xtendingClassFromAliasAndUsageInIndexer.js | 6 +- .../reference/extendsClauseAlreadySeen.js | 3 +- .../reference/extendsClauseAlreadySeen2.js | 3 +- tests/baselines/reference/fluentClasses.js | 6 +- tests/baselines/reference/for-inStatements.js | 3 +- .../reference/for-inStatementsInvalid.js | 3 +- .../forStatementsMultipleInvalidDecl.js | 3 +- .../reference/functionImplementationErrors.js | 6 +- .../reference/functionImplementations.js | 6 +- .../reference/functionSubtypingOfVarArgs.js | 3 +- .../reference/functionSubtypingOfVarArgs2.js | 3 +- .../reference/generatedContextualTyping.js | 6 +- .../genericBaseClassLiteralProperty.js | 3 +- .../genericBaseClassLiteralProperty2.js | 3 +- ...allWithConstraintsTypeArgumentInference.js | 6 +- .../genericCallWithObjectTypeArgs2.js | 6 +- ...icCallWithObjectTypeArgsAndConstraints2.js | 3 +- ...icCallWithObjectTypeArgsAndConstraints3.js | 6 +- .../genericCallbacksAndClassHierarchy.js | 3 +- .../genericClassExpressionInFunction.js | 18 ++- ...sInheritsConstructorFromNonGenericClass.js | 6 +- ...cClassPropertyInheritanceSpecialization.js | 3 +- .../reference/genericClassStaticMethod.js | 3 +- tests/baselines/reference/genericClasses3.js | 3 +- ...genericConstraintOnExtendedBuiltinTypes.js | 3 +- ...enericConstraintOnExtendedBuiltinTypes2.js | 3 +- .../genericDerivedTypeWithSpecializedBase.js | 3 +- .../genericDerivedTypeWithSpecializedBase2.js | 3 +- .../genericInheritedDefaultConstructors.js | 3 +- .../reference/genericPrototypeProperty2.js | 6 +- .../reference/genericPrototypeProperty3.js | 6 +- ...ericRecursiveImplicitConstructorErrors2.js | 3 +- ...ericRecursiveImplicitConstructorErrors3.js | 3 +- .../reference/genericTypeAssertions2.js | 3 +- .../reference/genericTypeAssertions4.js | 6 +- .../reference/genericTypeAssertions6.js | 3 +- .../reference/genericTypeConstraints.js | 3 +- ...genericTypeReferenceWithoutTypeArgument.js | 6 +- ...enericTypeReferenceWithoutTypeArgument2.js | 6 +- .../genericWithIndexerOfTypeParameterType2.js | 6 +- .../reference/heterogeneousArrayLiterals.js | 6 +- .../reference/ifDoWhileStatements.js | 3 +- .../illegalSuperCallsInConstructor.js | 11 +- .../implementClausePrecedingExtends.js | 3 +- ...gAnInterfaceExtendingClassWithPrivates2.js | 33 ++-- ...AnInterfaceExtendingClassWithProtecteds.js | 12 +- .../baselines/reference/importAsBaseClass.js | 3 +- tests/baselines/reference/importHelpers.js | 6 +- tests/baselines/reference/importHelpersAmd.js | 3 +- .../importHelpersInIsolatedModules.js | 6 +- .../reference/importHelpersNoHelpers.js | 6 +- .../reference/importHelpersNoModule.js | 6 +- .../reference/importHelpersOutFile.js | 6 +- .../reference/importHelpersSystem.js | 3 +- .../reference/importShadowsGlobalName.js | 3 +- .../reference/importUsedInExtendsList1.js | 3 +- .../reference/indexerConstraints2.js | 12 +- .../reference/indirectSelfReference.js | 6 +- .../reference/indirectSelfReferenceGeneric.js | 6 +- .../infinitelyExpandingTypesNonGenericBase.js | 3 +- .../inheritFromGenericTypeParameter.js | 3 +- ...SameNamePrivatePropertiesFromSameOrigin.js | 6 +- tests/baselines/reference/inheritance.js | 12 +- tests/baselines/reference/inheritance1.js | 12 +- ...itanceGrandParentPrivateMemberCollision.js | 6 +- ...tPrivateMemberCollisionWithPublicMember.js | 6 +- ...tPublicMemberCollisionWithPrivateMember.js | 6 +- ...ritanceMemberAccessorOverridingAccessor.js | 3 +- ...heritanceMemberAccessorOverridingMethod.js | 3 +- ...ritanceMemberAccessorOverridingProperty.js | 3 +- ...inheritanceMemberFuncOverridingAccessor.js | 3 +- .../inheritanceMemberFuncOverridingMethod.js | 3 +- ...inheritanceMemberFuncOverridingProperty.js | 3 +- ...ritanceMemberPropertyOverridingAccessor.js | 3 +- ...heritanceMemberPropertyOverridingMethod.js | 3 +- ...ritanceMemberPropertyOverridingProperty.js | 3 +- .../inheritanceOfGenericConstructorMethod1.js | 3 +- .../inheritanceOfGenericConstructorMethod2.js | 6 +- ...ritanceStaticAccessorOverridingAccessor.js | 3 +- ...heritanceStaticAccessorOverridingMethod.js | 3 +- ...ritanceStaticAccessorOverridingProperty.js | 3 +- ...inheritanceStaticFuncOverridingAccessor.js | 3 +- ...eStaticFuncOverridingAccessorOfFuncType.js | 3 +- .../inheritanceStaticFuncOverridingMethod.js | 3 +- ...inheritanceStaticFuncOverridingProperty.js | 3 +- ...eStaticFuncOverridingPropertyOfFuncType.js | 3 +- ...taticFunctionOverridingInstanceProperty.js | 3 +- .../inheritanceStaticMembersCompatible.js | 3 +- .../inheritanceStaticMembersIncompatible.js | 3 +- ...ritanceStaticPropertyOverridingAccessor.js | 3 +- ...heritanceStaticPropertyOverridingMethod.js | 3 +- ...ritanceStaticPropertyOverridingProperty.js | 3 +- .../inheritedConstructorWithRestParams.js | 3 +- .../inheritedConstructorWithRestParams2.js | 6 +- .../inheritedModuleMembersForClodule.js | 6 +- .../reference/instanceOfAssignability.js | 6 +- ...nstancePropertiesInheritedIntoClassType.js | 6 +- .../reference/instanceSubtypeCheck2.js | 3 +- ...nstanceofWithStructurallyIdenticalTypes.js | 6 +- .../instantiatedReturnTypeContravariance.js | 3 +- .../reference/interfaceClassMerging.js | 3 +- .../reference/interfaceClassMerging2.js | 3 +- .../reference/interfaceExtendsClass1.js | 9 +- .../interfaceExtendsClassWithPrivate1.js | 3 +- .../interfaceExtendsClassWithPrivate2.js | 6 +- .../reference/interfaceImplementation8.js | 12 +- .../invalidModuleWithStatementsOfEveryKind.js | 18 ++- .../invalidMultipleVariableDeclarations.js | 3 +- .../reference/invalidReturnStatements.js | 3 +- .../isolatedModulesImportExportElision.js | 3 +- tests/baselines/reference/jsxViaImport.js | 3 +- tests/baselines/reference/lambdaArgCrash.js | 3 +- tests/baselines/reference/lift.js | 3 +- tests/baselines/reference/localTypes1.js | 6 +- tests/baselines/reference/m7Bugs.js | 3 +- .../reference/mergedDeclarations5.js | 3 +- .../reference/mergedDeclarations6.js | 3 +- .../mergedInheritedClassInterface.js | 6 +- .../mergedInterfacesWithInheritedPrivates2.js | 6 +- .../mergedInterfacesWithInheritedPrivates3.js | 3 +- .../missingPropertiesOfClassExpression.js | 3 +- tests/baselines/reference/moduleAsBaseType.js | 3 +- .../moduleImportedForTypeArgumentPosition.js | 3 +- .../moduleWithStatementsOfEveryKind.js | 12 +- .../reference/multipleInheritance.js | 18 ++- .../mutuallyRecursiveGenericBaseTypes2.js | 3 +- tests/baselines/reference/noEmitHelpers.js | 3 +- ...enericClassExtendingGenericClassWithAny.js | 3 +- ...cIndexerConstrainsPropertyDeclarations2.js | 3 +- .../reference/numericIndexerConstraint3.js | 3 +- .../reference/numericIndexerConstraint4.js | 3 +- .../reference/numericIndexerTyping2.js | 3 +- ...objectCreationOfElementAccessExpression.js | 18 ++- ...objectTypeHidingMembersOfExtendedObject.js | 3 +- ...objectTypesIdentityWithNumericIndexers1.js | 6 +- ...objectTypesIdentityWithNumericIndexers2.js | 9 +- ...objectTypesIdentityWithNumericIndexers3.js | 6 +- .../objectTypesIdentityWithPrivates.js | 6 +- .../objectTypesIdentityWithPrivates2.js | 3 +- .../objectTypesIdentityWithPrivates3.js | 6 +- .../objectTypesIdentityWithStringIndexers.js | 6 +- .../objectTypesIdentityWithStringIndexers2.js | 9 +- .../optionalConstructorArgInSuper.js | 3 +- tests/baselines/reference/optionalMethods.js | 3 +- .../reference/optionalParamArgsTest.js | 3 +- .../reference/optionalParamInOverride.js | 3 +- .../reference/optionalParameterProperty.js | 3 +- .../baselines/reference/outModuleConcatAmd.js | 3 +- .../reference/outModuleConcatAmd.js.map | 2 +- .../outModuleConcatAmd.sourcemap.txt | 33 ++-- .../reference/outModuleConcatSystem.js | 3 +- .../reference/outModuleConcatSystem.js.map | 2 +- .../outModuleConcatSystem.sourcemap.txt | 33 ++-- .../reference/outModuleTripleSlashRefs.js | 3 +- .../reference/outModuleTripleSlashRefs.js.map | 2 +- .../outModuleTripleSlashRefs.sourcemap.txt | 33 ++-- tests/baselines/reference/overload1.js | 6 +- .../overloadOnConstConstraintChecks1.js | 9 +- .../overloadOnConstConstraintChecks2.js | 6 +- .../overloadOnConstConstraintChecks3.js | 6 +- .../overloadOnConstConstraintChecks4.js | 9 +- .../overloadOnConstantsInvalidOverload1.js | 9 +- .../baselines/reference/overloadResolution.js | 9 +- .../overloadResolutionClassConstructors.js | 9 +- .../overloadResolutionConstructors.js | 9 +- .../reference/overloadingOnConstants1.js | 9 +- .../reference/overloadingOnConstants2.js | 3 +- .../overridingPrivateStaticMembers.js | 3 +- .../reference/parseErrorInHeritageClause1.js | 3 +- tests/baselines/reference/parser509630.js | 3 +- tests/baselines/reference/parserAstSpans1.js | 9 +- .../reference/parserClassDeclaration1.js | 3 +- .../reference/parserClassDeclaration3.js | 3 +- .../reference/parserClassDeclaration4.js | 3 +- .../reference/parserClassDeclaration5.js | 3 +- .../reference/parserClassDeclaration6.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause2.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause4.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause5.js | 3 +- .../parserGenericsInTypeContexts1.js | 3 +- .../parserGenericsInTypeContexts2.js | 3 +- .../baselines/reference/parserRealSource10.js | 18 ++- .../baselines/reference/parserRealSource11.js | 144 ++++++++++++------ tests/baselines/reference/parserharness.js | 9 +- tests/baselines/reference/primitiveMembers.js | 3 +- tests/baselines/reference/privacyClass.js | 72 ++++++--- .../privacyClassExtendsClauseDeclFile.js | 69 ++++++--- tests/baselines/reference/privacyGloClass.js | 30 ++-- .../reference/privateAccessInSubclass1.js | 3 +- .../privateInstanceMemberAccessibility.js | 3 +- ...tedMembersAreNotAccessibleDestructuring.js | 3 +- .../privateStaticMemberAccessibility.js | 3 +- .../privateStaticNotAccessibleInClodule2.js | 3 +- .../amd/testGlo.js | 12 +- .../node/testGlo.js | 12 +- .../reference/project/prologueEmit/amd/out.js | 3 +- .../project/prologueEmit/node/out.js | 3 +- .../amd/m'ain.js | 3 +- .../node/m'ain.js | 3 +- .../reference/propertiesAndIndexers.js | 3 +- tests/baselines/reference/propertyAccess.js | 3 +- ...tyAccessOnTypeParameterWithConstraints2.js | 3 +- ...tyAccessOnTypeParameterWithConstraints3.js | 3 +- ...tyAccessOnTypeParameterWithConstraints5.js | 3 +- ...sPropertyAccessibleWithinNestedSubclass.js | 6 +- ...PropertyAccessibleWithinNestedSubclass1.js | 12 +- ...edClassPropertyAccessibleWithinSubclass.js | 3 +- ...dClassPropertyAccessibleWithinSubclass2.js | 12 +- ...dClassPropertyAccessibleWithinSubclass3.js | 3 +- .../protectedInstanceMemberAccessibility.js | 6 +- tests/baselines/reference/protectedMembers.js | 21 ++- ...icClassPropertyAccessibleWithinSubclass.js | 9 +- ...cClassPropertyAccessibleWithinSubclass2.js | 6 +- ...solution-does-not-affect-class-heritage.js | 3 +- .../readonlyConstructorAssignment.js | 9 +- .../reference/recursiveBaseCheck3.js | 6 +- .../reference/recursiveBaseCheck4.js | 3 +- .../reference/recursiveBaseCheck6.js | 3 +- .../recursiveBaseConstructorCreation1.js | 3 +- ...ssInstantiationsWithDefaultConstructors.js | 3 +- .../reference/recursiveClassReferenceTest.js | 3 +- .../recursiveClassReferenceTest.js.map | 2 +- .../recursiveClassReferenceTest.sourcemap.txt | 137 ++++++++--------- .../reference/recursiveComplicatedClasses.js | 9 +- ...sivelySpecializedConstructorDeclaration.js | 3 +- .../reference/reexportClassDefinition.js | 3 +- ...lassDeclarationWhenInBaseTypeResolution.js | 141 +++++++++++------ .../reference/returnInConstructor1.js | 6 +- tests/baselines/reference/returnStatements.js | 3 +- ...peCheckExtendedClassInsidePublicMethod2.js | 3 +- ...peCheckExtendedClassInsideStaticMethod1.js | 3 +- tests/baselines/reference/scopeTests.js | 3 +- .../reference/shadowPrivateMembers.js | 3 +- ...sWithDefaultConstructorAndExtendsClause.js | 3 +- ...hDefaultConstructorAndExtendsClause.js.map | 2 +- ...tConstructorAndExtendsClause.sourcemap.txt | 59 ++++--- .../specializedInheritedConstructors1.js | 3 +- .../specializedOverloadWithRestParameters.js | 3 +- tests/baselines/reference/staticFactory1.js | 3 +- .../baselines/reference/staticInheritance.js | 3 +- .../staticMemberAccessOffDerivedType1.js | 3 +- tests/baselines/reference/staticPropSuper.js | 6 +- .../reference/strictModeInConstructor.js | 18 ++- .../reference/strictModeReservedWord.js | 3 +- ...trictModeReservedWordInClassDeclaration.js | 6 +- ...gIndexerConstrainsPropertyDeclarations2.js | 3 +- .../reference/subtypesOfTypeParameter.js | 3 +- .../subtypesOfTypeParameterWithConstraints.js | 87 +++++++---- ...subtypesOfTypeParameterWithConstraints4.js | 27 ++-- ...OfTypeParameterWithRecursiveConstraints.js | 54 ++++--- .../reference/subtypingTransitivity.js | 6 +- .../reference/subtypingWithCallSignatures2.js | 9 +- .../reference/subtypingWithCallSignatures3.js | 9 +- .../reference/subtypingWithCallSignatures4.js | 9 +- .../subtypingWithConstructSignatures2.js | 9 +- .../subtypingWithConstructSignatures3.js | 9 +- .../subtypingWithConstructSignatures4.js | 9 +- .../subtypingWithConstructSignatures5.js | 9 +- .../subtypingWithConstructSignatures6.js | 9 +- .../reference/subtypingWithNumericIndexer.js | 18 ++- .../reference/subtypingWithNumericIndexer3.js | 21 ++- .../reference/subtypingWithNumericIndexer4.js | 9 +- .../reference/subtypingWithObjectMembers.js | 24 ++- .../reference/subtypingWithObjectMembers4.js | 12 +- ...subtypingWithObjectMembersAccessibility.js | 12 +- ...ubtypingWithObjectMembersAccessibility2.js | 21 ++- .../reference/subtypingWithStringIndexer.js | 18 ++- .../reference/subtypingWithStringIndexer3.js | 21 ++- .../reference/subtypingWithStringIndexer4.js | 9 +- tests/baselines/reference/super.js | 6 +- tests/baselines/reference/super1.js | 15 +- tests/baselines/reference/super2.js | 12 +- tests/baselines/reference/superAccess.js | 3 +- tests/baselines/reference/superAccess2.js | 4 +- .../reference/superAccessInFatArrow1.js | 3 +- .../reference/superCallArgsMustMatch.js | 3 +- .../reference/superCallAssignResult.js | 3 +- .../superCallBeforeThisAccessing1.js | 3 +- .../superCallBeforeThisAccessing2.js | 4 +- .../superCallBeforeThisAccessing3.js | 4 +- .../superCallBeforeThisAccessing4.js | 6 +- .../superCallBeforeThisAccessing5.js | 1 + .../superCallBeforeThisAccessing6.js | 3 +- .../superCallBeforeThisAccessing7.js | 3 +- .../superCallBeforeThisAccessing8.js | 3 +- ...allFromClassThatDerivesFromGenericType1.js | 3 +- ...allFromClassThatDerivesFromGenericType2.js | 3 +- ...eButWithIncorrectNumberOfTypeArguments1.js | 3 +- ...sFromGenericTypeButWithNoTypeArguments1.js | 3 +- ...ivesNonGenericTypeButWithTypeArguments1.js | 3 +- .../superCallFromClassThatHasNoBaseType1.js | 2 +- .../reference/superCallFromFunction1.js | 2 +- .../superCallInConstructorWithNoBaseType.js | 4 +- .../reference/superCallInNonStaticMethod.js | 4 +- .../reference/superCallInStaticMethod.js | 3 +- .../superCallInsideClassDeclaration.js | 4 +- .../superCallInsideClassExpression.js | 4 +- .../superCallInsideObjectLiteralExpression.js | 3 +- .../reference/superCallOutsideConstructor.js | 9 +- .../superCallParameterContextualTyping1.js | 3 +- .../superCallParameterContextualTyping2.js | 3 +- .../superCallParameterContextualTyping3.js | 5 +- .../superCallWithMissingBaseClass.js | 3 +- tests/baselines/reference/superCalls.js | 8 +- .../reference/superCallsInConstructor.js | 5 +- tests/baselines/reference/superErrors.js | 3 +- .../baselines/reference/superInCatchBlock1.js | 3 +- .../reference/superInConstructorParam1.js | 1 + tests/baselines/reference/superInLambdas.js | 16 +- .../reference/superInObjectLiterals_ES5.js | 3 +- tests/baselines/reference/superNewCall1.js | 1 + .../reference/superPropertyAccess.js | 3 +- .../reference/superPropertyAccess1.js | 3 +- .../reference/superPropertyAccess2.js | 3 +- ...essInComputedPropertiesOfNestedType_ES5.js | 3 +- .../reference/superPropertyAccessNoError.js | 3 +- .../reference/superPropertyAccess_ES5.js | 6 +- .../reference/superSymbolIndexedAccess5.js | 3 +- .../reference/superSymbolIndexedAccess6.js | 3 +- .../superWithGenericSpecialization.js | 3 +- .../baselines/reference/superWithGenerics.js | 3 +- .../reference/superWithTypeArgument.js | 1 + .../reference/superWithTypeArgument2.js | 1 + .../reference/superWithTypeArgument3.js | 1 + ...side-object-literal-getters-and-setters.js | 3 +- tests/baselines/reference/switchStatements.js | 3 +- .../reference/systemModuleWithSuperClass.js | 3 +- .../reference/targetTypeBaseCalls.js | 3 +- .../reference/thisInInvalidContexts.js | 9 +- .../thisInInvalidContextsExternalModule.js | 9 +- tests/baselines/reference/thisInSuperCall.js | 9 +- tests/baselines/reference/thisInSuperCall1.js | 3 +- tests/baselines/reference/thisInSuperCall2.js | 6 +- tests/baselines/reference/thisInSuperCall3.js | 3 +- .../reference/thisTypeInFunctions.js | 9 +- .../reference/thisTypeInFunctionsNegative.js | 6 +- .../baselines/reference/tsxDynamicTagName5.js | 3 +- .../baselines/reference/tsxDynamicTagName7.js | 3 +- .../baselines/reference/tsxDynamicTagName8.js | 3 +- .../baselines/reference/tsxDynamicTagName9.js | 3 +- .../reference/tsxExternalModuleEmit1.js | 6 +- .../tsxStatelessFunctionComponents2.js | 3 +- .../reference/tsxUnionTypeComponent1.js | 6 +- tests/baselines/reference/typeAssertions.js | 3 +- .../baselines/reference/typeGuardFunction.js | 3 +- .../reference/typeGuardFunctionErrors.js | 3 +- .../reference/typeGuardFunctionGenerics.js | 3 +- .../reference/typeGuardFunctionOfFormThis.js | 18 ++- .../typeGuardFunctionOfFormThisErrors.js | 6 +- .../reference/typeGuardOfFormInstanceOf.js | 3 +- .../reference/typeGuardOfFormIsType.js | 3 +- .../reference/typeGuardOfFormThisMember.js | 6 +- .../typeGuardOfFormThisMemberErrors.js | 6 +- tests/baselines/reference/typeMatch2.js | 3 +- tests/baselines/reference/typeOfSuperCall.js | 3 +- .../reference/typeParameterAsBaseClass.js | 3 +- .../reference/typeParameterAsBaseType.js | 6 +- .../reference/typeParameterExtendingUnion1.js | 6 +- .../reference/typeParameterExtendingUnion2.js | 6 +- .../baselines/reference/typeRelationships.js | 3 +- .../baselines/reference/typeValueConflict1.js | 3 +- .../baselines/reference/typeValueConflict2.js | 6 +- tests/baselines/reference/typeofClass2.js | 3 +- .../typesWithSpecializedCallSignatures.js | 6 +- ...typesWithSpecializedConstructSignatures.js | 6 +- tests/baselines/reference/undeclaredBase.js | 3 +- .../undefinedIsSubtypeOfEverything.js | 66 +++++--- .../baselines/reference/underscoreMapFirst.js | 3 +- .../reference/unionTypeEquivalence.js | 3 +- .../reference/unionTypeFromArrayLiteral.js | 6 +- .../reference/unionTypesAssignability.js | 6 +- tests/baselines/reference/unknownSymbols1.js | 3 +- .../reference/unspecializedConstraints.js | 12 +- ...untypedFunctionCallsWithTypeParameters1.js | 3 +- .../reference/unusedClassesinNamespace4.js | 3 +- .../unusedIdentifiersConsolidated1.js | 3 +- .../reference/validUseOfThisInSuper.js | 4 +- .../reference/varArgsOnConstructorTypes.js | 3 +- 661 files changed, 2983 insertions(+), 1586 deletions(-) diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index 7dcbfef1d72..de8e08843a2 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -38,7 +38,8 @@ var A; var Point3d = (function (_super) { __extends(Point3d, _super); function Point3d() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Point3d; }(Point)); diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index 8f175621af4..58c7bd4c3c1 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -41,7 +41,8 @@ var A; var Point3d = (function (_super) { __extends(Point3d, _super); function Point3d() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Point3d; }(Point)); diff --git a/tests/baselines/reference/abstractClassInLocalScope.js b/tests/baselines/reference/abstractClassInLocalScope.js index a49da04c8a1..04407cfc08c 100644 --- a/tests/baselines/reference/abstractClassInLocalScope.js +++ b/tests/baselines/reference/abstractClassInLocalScope.js @@ -22,7 +22,8 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js index 1f6c1dfdd7a..09109c40675 100644 --- a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js +++ b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js @@ -22,7 +22,8 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/abstractProperty.js b/tests/baselines/reference/abstractProperty.js index 87b5475111b..803df9f1d56 100644 --- a/tests/baselines/reference/abstractProperty.js +++ b/tests/baselines/reference/abstractProperty.js @@ -35,7 +35,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.raw = "edge"; this.ro = "readonly please"; } diff --git a/tests/baselines/reference/abstractPropertyNegative.js b/tests/baselines/reference/abstractPropertyNegative.js index 5fc340c58d0..d6e1ce1813f 100644 --- a/tests/baselines/reference/abstractPropertyNegative.js +++ b/tests/baselines/reference/abstractPropertyNegative.js @@ -57,7 +57,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.ro = "readonly please"; } Object.defineProperty(C.prototype, "concreteWithNoBody", { @@ -77,7 +78,8 @@ var WrongTypeProperty = (function () { var WrongTypePropertyImpl = (function (_super) { __extends(WrongTypePropertyImpl, _super); function WrongTypePropertyImpl() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.num = "nope, wrong"; } return WrongTypePropertyImpl; @@ -90,7 +92,8 @@ var WrongTypeAccessor = (function () { var WrongTypeAccessorImpl = (function (_super) { __extends(WrongTypeAccessorImpl, _super); function WrongTypeAccessorImpl() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(WrongTypeAccessorImpl.prototype, "num", { get: function () { return "nope, wrong"; }, @@ -102,7 +105,8 @@ var WrongTypeAccessorImpl = (function (_super) { var WrongTypeAccessorImpl2 = (function (_super) { __extends(WrongTypeAccessorImpl2, _super); function WrongTypeAccessorImpl2() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.num = "nope, wrong"; } return WrongTypeAccessorImpl2; diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index c04532078e9..d60f260a163 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -34,7 +34,8 @@ var Point = (function () { var ColoredPoint = (function (_super) { __extends(ColoredPoint, _super); function ColoredPoint(x, y, color) { - _super.call(this, x, y); + var _this; + _this = _super.call(this, x, y) || this; this.color = color; } ColoredPoint.prototype.toString = function () { 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 7294aa1aff7..860d74f5204 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,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js index 905ed9bce0e..d717da94d38 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js @@ -46,7 +46,8 @@ var Backbone = require("./aliasUsage1_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInArray.js b/tests/baselines/reference/aliasUsageInArray.js index 2d9f7cfed6e..f08363776cc 100644 --- a/tests/baselines/reference/aliasUsageInArray.js +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -40,7 +40,8 @@ var Backbone = require("./aliasUsageInArray_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.js b/tests/baselines/reference/aliasUsageInFunctionExpression.js index 21565dc99fc..06e3e266ee9 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.js +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -39,7 +39,8 @@ var Backbone = require("./aliasUsageInFunctionExpression_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.js b/tests/baselines/reference/aliasUsageInGenericFunction.js index af24b61cf33..96121364837 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.js +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -43,7 +43,8 @@ var Backbone = require("./aliasUsageInGenericFunction_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js index 3b21f15777c..bbfe2952594 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -45,7 +45,8 @@ var Backbone = require("./aliasUsageInIndexerOfClass_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.js b/tests/baselines/reference/aliasUsageInObjectLiteral.js index b380104b461..3b036f52a9d 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.js +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -40,7 +40,8 @@ var Backbone = require("./aliasUsageInObjectLiteral_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInOrExpression.js b/tests/baselines/reference/aliasUsageInOrExpression.js index 1e9a5420345..4167294e5f2 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.js +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -43,7 +43,8 @@ var Backbone = require("./aliasUsageInOrExpression_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 76b90c01bf0..1893f6586ee 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -43,7 +43,8 @@ var Backbone = require("./aliasUsageInTypeArgumentOfExtendsClause_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); @@ -64,7 +65,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = moduleA; } return D; diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.js b/tests/baselines/reference/aliasUsageInVarAssignment.js index 7c73fac2d67..0ba5cbbc8d0 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.js +++ b/tests/baselines/reference/aliasUsageInVarAssignment.js @@ -39,7 +39,8 @@ var Backbone = require("./aliasUsageInVarAssignment_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js index 275bbf67602..27e6dd714ba 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -22,7 +22,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js index 2d04b059a9a..914679c7de2 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.js +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -38,7 +38,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -51,7 +52,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js index de1b1ba11bd..01fdb92a24e 100644 --- a/tests/baselines/reference/apparentTypeSupertype.js +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -28,7 +28,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index e2ca36cbd1d..911df30a423 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -101,7 +101,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C2.prototype.C2M1 = function () { return null; }; return C2; diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index a15df1b14b7..aff812247a2 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -75,7 +75,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C2.prototype.C2M1 = function () { return null; }; return C2; diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index f45f67a8765..7df39836542 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -128,7 +128,8 @@ var EmptyTypes; var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return derived; }(base)); @@ -187,7 +188,8 @@ var NonEmptyTypes; var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return derived; }(base)); diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index f54dec83c9c..81155544cab 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -65,14 +65,16 @@ var Action = (function () { var ActionA = (function (_super) { __extends(ActionA, _super); function ActionA() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ActionA; }(Action)); var ActionB = (function (_super) { __extends(ActionB, _super); function ActionB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ActionB; }(Action)); diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index 4dbf88f8688..53066c70391 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -70,7 +70,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived1; }(Base)); @@ -78,7 +79,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index c15782a8e20..3c5f4365053 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -39,7 +39,8 @@ var List = (function () { var DerivedList = (function (_super) { __extends(DerivedList, _super); function DerivedList() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return DerivedList; }(List)); diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js index 255b52e16c9..aba7a7cbc8c 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js @@ -33,14 +33,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(Array)); diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index 73e3be15e11..bfd49be6bbf 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -116,8 +116,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = this; - _super.call(this, function () { return _this; }); + var _this; + _this = _super.call(this, function () { return _this; }) || this; } return Derived; }(Base)); @@ -158,8 +158,8 @@ var M2; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = this; - _super.call(this, function () { return _this; }); + var _this; + _this = _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 24f95ec61ea..80a9aa9cf14 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -114,21 +114,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js index 43608565039..5932aec049a 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -115,21 +115,24 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js index b3318dd53e8..7ea579d87ed 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -80,21 +80,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js index becbfea57a0..0fb5867836c 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -57,21 +57,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index d062a563a4d..b933425ffb0 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -114,21 +114,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js index 5744424f878..e407c3acdb0 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -115,21 +115,24 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js index de42671c9f1..59c816dcc5c 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -80,21 +80,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js index 206ae7768ba..b3b349ebc06 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -57,21 +57,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js index 56b206786f1..6e14fb66ecd 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -72,7 +72,8 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js index 53f92dd3b59..3b32f327b07 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -59,7 +59,8 @@ b = a; // ok var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index 092de2ca707..ce80efc3c7a 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -108,14 +108,16 @@ var OnlyDerived; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); @@ -167,14 +169,16 @@ var WithBase; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index 791ae494ab2..d95eb43f0e5 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -103,14 +103,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index d93ddf8b3a4..f4c401979cf 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -105,14 +105,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js index ef6befe268e..54839da4b5a 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -82,7 +82,8 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -93,7 +94,8 @@ var Generics; var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 8a3b4b35d0b..070c151ee51 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -118,7 +118,8 @@ value; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this); + var _this; + _this = _super.call(this) || this; _super.prototype. = value; } Derived.prototype.foo = function () { _super.prototype. = value; }; diff --git a/tests/baselines/reference/asyncImportedPromise_es5.js b/tests/baselines/reference/asyncImportedPromise_es5.js index 54d1b0fdac8..6fcc24b06bf 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5.js +++ b/tests/baselines/reference/asyncImportedPromise_es5.js @@ -19,7 +19,8 @@ var __extends = (this && this.__extends) || function (d, b) { var Task = (function (_super) { __extends(Task, _super); function Task() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Task; }(Promise)); diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5.js b/tests/baselines/reference/asyncMethodWithSuper_es5.js index 87debbdc55c..22ca0aa0cbe 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5.js +++ b/tests/baselines/reference/asyncMethodWithSuper_es5.js @@ -61,7 +61,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 19de38325e2..0081a30d930 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es5.js +++ b/tests/baselines/reference/asyncQualifiedReturnType_es5.js @@ -13,7 +13,8 @@ var X; var MyPromise = (function (_super) { __extends(MyPromise, _super); function MyPromise() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyPromise; }(Promise)); diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index e6790021f63..85dd3725639 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -43,7 +43,8 @@ Point.origin = new Point(0, 0); var Point3D = (function (_super) { __extends(Point3D, _super); function Point3D(x, y, z, m) { - _super.call(this, x, y); + var _this; + _this = _super.call(this, x, y) || this; this.z = z; } Point3D.prototype.getDist = function () { diff --git a/tests/baselines/reference/awaitClassExpression_es5.js b/tests/baselines/reference/awaitClassExpression_es5.js index 9123f5f2ea8..f81b5800929 100644 --- a/tests/baselines/reference/awaitClassExpression_es5.js +++ b/tests/baselines/reference/awaitClassExpression_es5.js @@ -17,7 +17,8 @@ function func() { _a = function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }; diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index c4210f3f6a5..800742ff63b 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -43,14 +43,16 @@ var C = (function () { var ELoc = (function (_super) { __extends(ELoc, _super); function ELoc(x) { - _super.call(this, 0, x); + var _this; + _this = _super.call(this, 0, x) || this; } return ELoc; }(C)); var ELocVar = (function (_super) { __extends(ELocVar, _super); function ELocVar(x) { - _super.call(this, 0, loc); + var _this; + _this = _super.call(this, 0, loc) || this; } ELocVar.prototype.m = function () { var loc = 10; @@ -60,7 +62,8 @@ var ELocVar = (function (_super) { var D = (function (_super) { __extends(D, _super); function D(z) { - _super.call(this, this.z); + var _this; + _this = _super.call(this, this.z) || this; this.z = z; } return D; @@ -68,7 +71,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E(z) { - _super.call(this, 0, this.z); + var _this; + _this = _super.call(this, 0, this.z) || this; this.z = z; } return E; @@ -76,7 +80,8 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F(z) { - _super.call(this, "hello", this.z); + var _this; + _this = _super.call(this, "hello", this.z) || this; this.z = z; } return F; diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js index 3f3fa3cc0b9..6629ef35dda 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.js +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -38,7 +38,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js index 66d2135f01d..187a354553d 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.js +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -51,7 +51,8 @@ var Class1 = (function () { var Class2 = (function (_super) { __extends(Class2, _super); function Class2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Class2; }(Class1)); @@ -63,7 +64,8 @@ var Class3 = (function () { var Class4 = (function (_super) { __extends(Class4, _super); function Class4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Class4; }(Class3)); diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js index dc52eeeaee6..bbf57046a97 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js @@ -41,7 +41,8 @@ var CBaseBase = (function () { var CBase = (function (_super) { __extends(CBase, _super); function CBase() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return CBase; }(CBaseBase)); @@ -59,7 +60,8 @@ var Wrapper = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.works = function () { new CBaseBase(this); diff --git a/tests/baselines/reference/bases.js b/tests/baselines/reference/bases.js index f67f754d063..fcf1d7fe124 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -36,6 +36,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { + var _this; this.x; any; } diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index 1c2fc896a6a..a9e38f0520c 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -44,14 +44,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js index 21a69f517fc..9af685812c2 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -40,14 +40,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index e38ce2854bd..36232ad04b1 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -46,7 +46,8 @@ var E = (function () { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return F; }(C)); @@ -59,7 +60,8 @@ var C1 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.i = "bar"; } return D1; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js index 6b3bf8e125e..4fd0dc2cefc 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -84,21 +84,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js index a823047fc0d..710725f145b 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -131,21 +131,24 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js index b60cf2014f1..154aee0693b 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -64,21 +64,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js index 434af36123e..7359d330cd6 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -64,21 +64,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js index 9776d14612e..594d2dcafb7 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -67,21 +67,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index e89e9d9345b..2149db744b0 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; + _this = _super.call(this, 1, 2) || this; + _this = _super.apply(this, [1, 2].concat(a)) || 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 791b6f4c979..0c36877d9dc 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -22,8 +22,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = this; - _super.call(this, { test: function () { return _this.someMethod(); } }); + var _this; + _this = _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 bcff0938157..426889df7de 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -59,7 +59,8 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(A)); @@ -67,7 +68,8 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return F; }(A)); diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js index b4b6330a7cf..71b345a311c 100644 --- a/tests/baselines/reference/chainedAssignment3.js +++ b/tests/baselines/reference/chainedAssignment3.js @@ -36,7 +36,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index c53910e00ac..7c428751b28 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -42,14 +42,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index cdc19a5688d..48825a01a67 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -49,14 +49,16 @@ var Foo; var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return Bar; }(Foo.Object)); var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return Baz; }(Object)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js index cfb5726dac1..dc70f3e8d08 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js @@ -24,7 +24,8 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this); + var _this; + _this = _super.call(this) || this; this; this.x = 10; var that = this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js index afbc15cf912..f1fcdb48dae 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js @@ -24,8 +24,9 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { + var _this; this.x = 100; - _super.call(this); + _this = _super.call(this) || this; this.x = 10; var that = this; } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js index 7e9c23c1f83..d2ede7d04b1 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js @@ -29,13 +29,14 @@ 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 = _super.call(this) || this; this.x = 10; var that = this; } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js index 1257b446ccb..c6eddf4ef48 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,8 +43,8 @@ var Derived = (function (_super) { (function () { _this; // No error })(); - _super.call(this); - _super.call(this); + _this = _super.call(this) || this; + _this = _super.call(this) || this; this.x = 10; var that = this; } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js index 1889ee998ca..e58d55fd274 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -25,7 +25,8 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this, this.x); + var _this; + _this = _super.call(this, this.x) || this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js index 39db4dec174..15fcbff4c89 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js @@ -28,9 +28,9 @@ 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 Super; }(Base)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js index d071c05db5d..0cade04664d 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js @@ -23,8 +23,8 @@ var Base = (function () { var Super = (function (_super) { __extends(Super, _super); function Super() { - var _this = this; - _super.call(this, (function () { return _this; })); // No error + var _this; + _this = _super.call(this, (function () { return _this; })) || this; // No error } return Super; }(Base)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js index f334cc7f42b..cf0da205d71 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js @@ -28,8 +28,9 @@ var Base = (function () { var Super = (function (_super) { __extends(Super, _super); function Super() { + var _this; var that = this; - _super.call(this); + _this = _super.call(this) || this; } return Super; }(Base)); diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js index 19c156176bf..9d0e7648dcb 100644 --- a/tests/baselines/reference/circularImportAlias.js +++ b/tests/baselines/reference/circularImportAlias.js @@ -32,7 +32,8 @@ var B; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(B.a.C)); diff --git a/tests/baselines/reference/circularTypeofWithFunctionModule.js b/tests/baselines/reference/circularTypeofWithFunctionModule.js index 6ce1dd62fc5..811e86b21ca 100644 --- a/tests/baselines/reference/circularTypeofWithFunctionModule.js +++ b/tests/baselines/reference/circularTypeofWithFunctionModule.js @@ -32,7 +32,8 @@ var maker; var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar; }(Foo)); diff --git a/tests/baselines/reference/classAbstractConstructorAssignability.js b/tests/baselines/reference/classAbstractConstructorAssignability.js index 5695e6c79d3..8738b43bb3f 100644 --- a/tests/baselines/reference/classAbstractConstructorAssignability.js +++ b/tests/baselines/reference/classAbstractConstructorAssignability.js @@ -28,14 +28,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/classAbstractCrashedOnce.js b/tests/baselines/reference/classAbstractCrashedOnce.js index 46f0a8938c4..02d31377de8 100644 --- a/tests/baselines/reference/classAbstractCrashedOnce.js +++ b/tests/baselines/reference/classAbstractCrashedOnce.js @@ -24,7 +24,8 @@ var foo = (function () { var bar = (function (_super) { __extends(bar, _super); function bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } bar.prototype.test = function () { this. diff --git a/tests/baselines/reference/classAbstractExtends.js b/tests/baselines/reference/classAbstractExtends.js index 8d7128cc03d..8ac2cc9de3d 100644 --- a/tests/baselines/reference/classAbstractExtends.js +++ b/tests/baselines/reference/classAbstractExtends.js @@ -31,28 +31,32 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(B)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } E.prototype.bar = function () { }; return E; diff --git a/tests/baselines/reference/classAbstractFactoryFunction.js b/tests/baselines/reference/classAbstractFactoryFunction.js index d5b0417f995..4f612e3d9c6 100644 --- a/tests/baselines/reference/classAbstractFactoryFunction.js +++ b/tests/baselines/reference/classAbstractFactoryFunction.js @@ -31,7 +31,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/classAbstractGeneric.js b/tests/baselines/reference/classAbstractGeneric.js index c9409e97466..b76117fddfc 100644 --- a/tests/baselines/reference/classAbstractGeneric.js +++ b/tests/baselines/reference/classAbstractGeneric.js @@ -39,28 +39,32 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); // error -- inherits abstract methods var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(A)); // error -- inherits abstract methods var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } E.prototype.foo = function () { return this.t; }; return E; @@ -68,7 +72,8 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } F.prototype.bar = function (t) { }; return F; @@ -76,7 +81,8 @@ var F = (function (_super) { var G = (function (_super) { __extends(G, _super); function G() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 17fbf568601..aa66ba540a8 100644 --- a/tests/baselines/reference/classAbstractInAModule.js +++ b/tests/baselines/reference/classAbstractInAModule.js @@ -24,7 +24,8 @@ var M; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/classAbstractInheritance.js b/tests/baselines/reference/classAbstractInheritance.js index 4d5c804e557..0bd5dab31a9 100644 --- a/tests/baselines/reference/classAbstractInheritance.js +++ b/tests/baselines/reference/classAbstractInheritance.js @@ -35,14 +35,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); @@ -54,42 +56,48 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return BB; }(AA)); var CC = (function (_super) { __extends(CC, _super); function CC() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return CC; }(AA)); var DD = (function (_super) { __extends(DD, _super); function DD() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return DD; }(BB)); var EE = (function (_super) { __extends(EE, _super); function EE() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return EE; }(BB)); var FF = (function (_super) { __extends(FF, _super); function FF() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return FF; }(CC)); var GG = (function (_super) { __extends(GG, _super); function GG() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return GG; }(CC)); diff --git a/tests/baselines/reference/classAbstractInstantiations1.js b/tests/baselines/reference/classAbstractInstantiations1.js index 0263e9e97b3..aef8f58fab2 100644 --- a/tests/baselines/reference/classAbstractInstantiations1.js +++ b/tests/baselines/reference/classAbstractInstantiations1.js @@ -41,14 +41,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/classAbstractInstantiations2.js b/tests/baselines/reference/classAbstractInstantiations2.js index 379e0b18ccc..2e6cd648dc0 100644 --- a/tests/baselines/reference/classAbstractInstantiations2.js +++ b/tests/baselines/reference/classAbstractInstantiations2.js @@ -82,21 +82,24 @@ new x; // okay -- undefined behavior at runtime var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); // error -- not declared abstract var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(B)); // okay var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } E.prototype.bar = function () { return 1; }; return E; @@ -104,7 +107,8 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } F.prototype.bar = function () { return 2; }; return F; diff --git a/tests/baselines/reference/classAbstractOverrideWithAbstract.js b/tests/baselines/reference/classAbstractOverrideWithAbstract.js index d613dd1fe31..5cb07934658 100644 --- a/tests/baselines/reference/classAbstractOverrideWithAbstract.js +++ b/tests/baselines/reference/classAbstractOverrideWithAbstract.js @@ -38,7 +38,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -51,7 +52,8 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } BB.prototype.bar = function () { }; return BB; @@ -59,14 +61,16 @@ var BB = (function (_super) { var CC = (function (_super) { __extends(CC, _super); function CC() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return CC; }(BB)); // error var DD = (function (_super) { __extends(DD, _super); function DD() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } DD.prototype.foo = function () { }; return DD; diff --git a/tests/baselines/reference/classAbstractSuperCalls.js b/tests/baselines/reference/classAbstractSuperCalls.js index 7ada903974c..44b15710c73 100644 --- a/tests/baselines/reference/classAbstractSuperCalls.js +++ b/tests/baselines/reference/classAbstractSuperCalls.js @@ -42,7 +42,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { _super.prototype.foo.call(this); }; B.prototype.baz = function () { return this.foo; }; @@ -51,7 +52,8 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 +70,8 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return BB; }(AA)); diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js index 457195f5449..ae6b08e4bca 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js @@ -31,7 +31,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.foo = function () { return 1; }; return B; @@ -39,7 +40,8 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js index dc025b11dde..9f43ee1a6b3 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js @@ -41,21 +41,24 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.foo = function () { }; return D; @@ -63,7 +66,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } E.prototype.foo = function () { }; return E; @@ -76,21 +80,24 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return BB; }(AA)); var CC = (function (_super) { __extends(CC, _super); function CC() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return CC; }(AA)); var DD = (function (_super) { __extends(DD, _super); function DD() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } DD.prototype.foo = function () { }; return DD; diff --git a/tests/baselines/reference/classConstructorAccessibility2.js b/tests/baselines/reference/classConstructorAccessibility2.js index 03b7af3e716..95206681372 100644 --- a/tests/baselines/reference/classConstructorAccessibility2.js +++ b/tests/baselines/reference/classConstructorAccessibility2.js @@ -77,7 +77,8 @@ var BaseC = (function () { var DerivedA = (function (_super) { __extends(DerivedA, _super); function DerivedA(x) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; this.x = x; } DerivedA.prototype.createInstance = function () { new DerivedA(5); }; @@ -88,7 +89,8 @@ var DerivedA = (function (_super) { var DerivedB = (function (_super) { __extends(DerivedB, _super); function DerivedB(x) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; this.x = x; } DerivedB.prototype.createInstance = function () { new DerivedB(7); }; @@ -99,7 +101,8 @@ var DerivedB = (function (_super) { var DerivedC = (function (_super) { __extends(DerivedC, _super); function DerivedC(x) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; this.x = x; } DerivedC.prototype.createInstance = function () { new DerivedC(9); }; diff --git a/tests/baselines/reference/classConstructorAccessibility4.js b/tests/baselines/reference/classConstructorAccessibility4.js index 6342facae21..dfbc70de115 100644 --- a/tests/baselines/reference/classConstructorAccessibility4.js +++ b/tests/baselines/reference/classConstructorAccessibility4.js @@ -51,7 +51,8 @@ var A = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); @@ -73,7 +74,8 @@ var D = (function () { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return F; }(D)); diff --git a/tests/baselines/reference/classConstructorAccessibility5.js b/tests/baselines/reference/classConstructorAccessibility5.js index ec9e9f83a8e..b73ecb4a92b 100644 --- a/tests/baselines/reference/classConstructorAccessibility5.js +++ b/tests/baselines/reference/classConstructorAccessibility5.js @@ -25,7 +25,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.make = function () { new Base(); }; // ok return Derived; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index c31fd8bf9dd..1f282ba7132 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -59,7 +59,8 @@ c3.p; // protected, error var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - _super.call(this, p); + var _this; + _this = _super.call(this, p) || this; this.p; // OK } return Derived; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 7f52a6a581f..81ad696ddc8 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -59,7 +59,8 @@ c3.p; // protected, error var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - _super.call(this, p); + var _this; + _this = _super.call(this, p) || this; this.p; // OK } return Derived; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index 0da9449a3a7..95509867cc5 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -28,7 +28,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - _super.call(this, p); + var _this; + _this = _super.call(this, p) || this; this.p = p; this.p; // OK } diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index 7ab6cb2ceca..83152355a13 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -35,7 +35,8 @@ var M; var O = (function (_super) { __extends(O, _super); function O() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return O; }(M.N)); diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js index 5a455edc082..ef584afd6e9 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -31,7 +31,8 @@ var StringTreeCollectionBase = (function () { var StringTreeCollection = (function (_super) { __extends(StringTreeCollection, _super); function StringTreeCollection() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return StringTreeCollection; }(StringTreeCollectionBase)); diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js index ed9497c8729..f7405cfd38a 100644 --- a/tests/baselines/reference/classExpression2.js +++ b/tests/baselines/reference/classExpression2.js @@ -16,7 +16,8 @@ var D = (function () { var v = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(D)); diff --git a/tests/baselines/reference/classExpression3.js b/tests/baselines/reference/classExpression3.js index 508dc039387..b91d5413611 100644 --- a/tests/baselines/reference/classExpression3.js +++ b/tests/baselines/reference/classExpression3.js @@ -15,14 +15,16 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(class_1, _super); function class_1() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.c = 3; } return class_1; }((function (_super) { __extends(class_2, _super); function class_2() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.b = 2; } return class_2; diff --git a/tests/baselines/reference/classExpressionExtendingAbstractClass.js b/tests/baselines/reference/classExpressionExtendingAbstractClass.js index c4da02cb321..8673e48d65f 100644 --- a/tests/baselines/reference/classExpressionExtendingAbstractClass.js +++ b/tests/baselines/reference/classExpressionExtendingAbstractClass.js @@ -22,7 +22,8 @@ var A = (function () { var C = (function (_super) { __extends(class_1, _super); function class_1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class_1; }(A)); diff --git a/tests/baselines/reference/classExtendingBuiltinType.js b/tests/baselines/reference/classExtendingBuiltinType.js index ace4cf19fee..2a01c1aa8b3 100644 --- a/tests/baselines/reference/classExtendingBuiltinType.js +++ b/tests/baselines/reference/classExtendingBuiltinType.js @@ -20,70 +20,80 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C1; }(Object)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(Function)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C3; }(String)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C4; }(Boolean)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C5; }(Number)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C6; }(Date)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C7; }(RegExp)); var C8 = (function (_super) { __extends(C8, _super); function C8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C8; }(Error)); var C9 = (function (_super) { __extends(C9, _super); function C9() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C9; }(Array)); var C10 = (function (_super) { __extends(C10, _super); function C10() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C10; }(Array)); diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index 8073271b5ea..4218bfbea98 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -47,7 +47,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -66,7 +67,8 @@ var C2 = (function () { var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(C2)); diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index a41bb14451a..031253a19ad 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -68,14 +68,16 @@ var __extends = (this && this.__extends) || function (d, b) { var D0 = (function (_super) { __extends(D0, _super); function D0() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D0; }(Base)); var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.call(this, "abc", "def"); + var _this; + _this = _super.call(this, "abc", "def") || this; this.x = "x"; this.y = "y"; } @@ -84,8 +86,9 @@ var D1 = (function (_super) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.call(this, 10); - _super.call(this, 10, 20); + var _this; + _this = _super.call(this, 10) || this; + _this = _super.call(this, 10, 20) || this; this.x = 1; this.y = 2; } @@ -94,7 +97,8 @@ var D2 = (function (_super) { var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.call(this, "abc", 42); + var _this; + _this = _super.call(this, "abc", 42) || this; this.x = "x"; this.y = 2; } @@ -104,7 +108,8 @@ var D3 = (function (_super) { var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D4; }(getBase())); @@ -112,7 +117,8 @@ var D4 = (function (_super) { var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D5; }(getBadBase())); diff --git a/tests/baselines/reference/classExtendingNonConstructor.js b/tests/baselines/reference/classExtendingNonConstructor.js index c46e3c5ddbe..d33e6b4edef 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.js +++ b/tests/baselines/reference/classExtendingNonConstructor.js @@ -27,49 +27,56 @@ function foo() { var C1 = (function (_super) { __extends(C1, _super); function C1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C1; }(undefined)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(true)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C3; }(false)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C4; }(42)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C5; }("hello")); var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C6; }(x)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C7; }(foo)); diff --git a/tests/baselines/reference/classExtendingNull.js b/tests/baselines/reference/classExtendingNull.js index fa6f0357b0d..d6188aaf988 100644 --- a/tests/baselines/reference/classExtendingNull.js +++ b/tests/baselines/reference/classExtendingNull.js @@ -12,14 +12,16 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C1; }(null)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }((null))); diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index 8ecad9c24a5..c23683470d0 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -24,28 +24,32 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(number)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(string)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C3; }(boolean)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C4; }(Void)); @@ -58,28 +62,32 @@ void {}; var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C5; }(Null)); var C5a = (function (_super) { __extends(C5a, _super); function C5a() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C5a; }(null)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C6; }(undefined)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C7; }(Undefined)); @@ -90,7 +98,8 @@ var E; var C8 = (function (_super) { __extends(C8, _super); function C8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C8; }(E)); diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index af766977967..072dc8138c7 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -20,7 +20,8 @@ void {}; var C5a = (function (_super) { __extends(C5a, _super); function C5a() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C5a; }(null)); diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js index 17d888834ec..b5cf4ae1382 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.js +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -23,7 +23,8 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(M.C)); diff --git a/tests/baselines/reference/classExtendingQualifiedName2.js b/tests/baselines/reference/classExtendingQualifiedName2.js index 4f1d872e753..d1ee8b48b3a 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.js +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -24,7 +24,8 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(M.C)); diff --git a/tests/baselines/reference/classExtendsAcrossFiles.js b/tests/baselines/reference/classExtendsAcrossFiles.js index 0805389f268..0dcf4103f49 100644 --- a/tests/baselines/reference/classExtendsAcrossFiles.js +++ b/tests/baselines/reference/classExtendsAcrossFiles.js @@ -37,7 +37,8 @@ exports.b = { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -62,7 +63,8 @@ exports.a = { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index 80b4b7c175d..f1a695c0b2a 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -33,7 +33,8 @@ var Foo; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js index 4c593761f00..f754e140d37 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -23,7 +23,8 @@ var Foo; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index 8b4663ad2cb..584b31b7e8e 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -25,14 +25,16 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(I)); // error var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }({ foo: string })); // error @@ -40,7 +42,8 @@ var x; var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C3; }(x)); // error @@ -51,7 +54,8 @@ var M; var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C4; }(M)); // error @@ -59,14 +63,16 @@ function foo() { } var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C5; }(foo)); // error var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C6; }([])); // error diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index 6aceb0ffebf..e01e90d512d 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -12,14 +12,16 @@ var __extends = (this && this.__extends) || function (d, b) { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }({ foo: string })); // error var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C6; }([])); // error diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js index b324f7382d8..7047eaad658 100644 --- a/tests/baselines/reference/classExtendsInterface.js +++ b/tests/baselines/reference/classExtendsInterface.js @@ -17,7 +17,8 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A; }(Comparable)); @@ -29,7 +30,8 @@ var B = (function () { var A2 = (function (_super) { __extends(A2, _super); function A2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A2; }(Comparable2)); diff --git a/tests/baselines/reference/classExtendsInterfaceInExpression.js b/tests/baselines/reference/classExtendsInterfaceInExpression.js index 69e63f92570..64d519d6952 100644 --- a/tests/baselines/reference/classExtendsInterfaceInExpression.js +++ b/tests/baselines/reference/classExtendsInterfaceInExpression.js @@ -20,7 +20,8 @@ function factory(a) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(factory(A))); diff --git a/tests/baselines/reference/classExtendsInterfaceInModule.js b/tests/baselines/reference/classExtendsInterfaceInModule.js index 45415488700..ced164bca10 100644 --- a/tests/baselines/reference/classExtendsInterfaceInModule.js +++ b/tests/baselines/reference/classExtendsInterfaceInModule.js @@ -24,21 +24,24 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C1; }(M.I1)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(M.I2)); var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(Mod.Nested.I)); diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js index 279d0ad6899..654cd35c400 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -14,21 +14,24 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(C)); // error var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(D)); // error var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(E)); // error diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js index f8ea40ee69c..ae5852d91f9 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -20,42 +20,48 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(E)); // error var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(D)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(E2)); // error var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(C2)); var E2 = (function (_super) { __extends(E2, _super); function E2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E2; }(D2)); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index 269edb851e9..63eeb5bc178 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -31,7 +31,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(N.E)); // error @@ -40,7 +41,8 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -51,7 +53,8 @@ var N; var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(M.D)); @@ -62,7 +65,8 @@ var O; var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(Q.E2)); // error @@ -71,7 +75,8 @@ var O; var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(C2)); @@ -82,7 +87,8 @@ var O; var E2 = (function (_super) { __extends(E2, _super); function E2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E2; }(P.D2)); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js index 2d2cf938156..4e67909f2d3 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -27,7 +27,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(E)); // error @@ -40,7 +41,8 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -53,7 +55,8 @@ var __extends = (this && this.__extends) || function (d, b) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(D)); @@ -66,7 +69,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(E2)); // error @@ -79,7 +83,8 @@ var __extends = (this && this.__extends) || function (d, b) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(C2)); @@ -92,7 +97,8 @@ var __extends = (this && this.__extends) || function (d, b) { var E2 = (function (_super) { __extends(E2, _super); function E2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E2; }(D2)); diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.js b/tests/baselines/reference/classExtendsMultipleBaseClasses.js index 61db0a41a5c..a185f6cf40a 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.js +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.js @@ -22,7 +22,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/classExtendsNull.js b/tests/baselines/reference/classExtendsNull.js index afb2be21c68..3ff1c92a56e 100644 --- a/tests/baselines/reference/classExtendsNull.js +++ b/tests/baselines/reference/classExtendsNull.js @@ -21,7 +21,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.call(this); + var _this; + _this = _super.call(this) || this; return Object.create(null); } return C; @@ -29,6 +30,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 ae2f73cadc1..a7f4a4bb9d9 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -25,7 +25,8 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index 00cd35693f1..519074358cc 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -16,7 +16,8 @@ var x = new foo(); // can be used as a constructor function var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(foo)); // error, cannot extend it though diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.js b/tests/baselines/reference/classHeritageWithTrailingSeparator.js index 7f85e4e25d7..d3134a97ccd 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.js +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.js @@ -17,7 +17,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index 09cdd5c779b..d525fb8a6ad 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -33,7 +33,8 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C2.prototype.foo = function () { return 1; diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js index b47514b1286..3257e51b5b8 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -37,7 +37,8 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index 32ae1ef3e88..f0b8698c64d 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -40,7 +40,8 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index 923ac9c9829..bf5d0141a19 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -42,7 +42,8 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index a807590749e..f1929cdc798 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -47,7 +47,8 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(A)); diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js index 39fb844613e..ab825abcd31 100644 --- a/tests/baselines/reference/classIndexer3.js +++ b/tests/baselines/reference/classIndexer3.js @@ -24,7 +24,8 @@ var C123 = (function () { var D123 = (function (_super) { __extends(D123, _super); function D123() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D123; }(C123)); diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js index e6e7a1eaf42..11b0c5e3ae2 100644 --- a/tests/baselines/reference/classInheritence.js +++ b/tests/baselines/reference/classInheritence.js @@ -11,14 +11,16 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A; }(A)); diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js index b51488dbe1e..6caa97781dd 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.js +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -29,14 +29,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index ec49320b4be..49b2a428e06 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -28,7 +28,8 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } A.prototype.foo = function () { this.bar(); }; return A; diff --git a/tests/baselines/reference/classOrderBug.js b/tests/baselines/reference/classOrderBug.js index d937197fad5..1381df2797d 100644 --- a/tests/baselines/reference/classOrderBug.js +++ b/tests/baselines/reference/classOrderBug.js @@ -35,7 +35,8 @@ var baz = (function () { var foo = (function (_super) { __extends(foo, _super); function foo() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return foo; }(baz)); diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index 0e3897a4f46..7898ae8a2b2 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -33,7 +33,8 @@ var A = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(A)); diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index 72fd4af1eed..c5c506d1af6 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -29,7 +29,8 @@ var __extends = (this && this.__extends) || function (d, b) { var SubText = (function (_super) { __extends(SubText, _super); function SubText(text, span) { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return SubText; }(TextBase)); diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index b708489c518..d9e4c3f1482 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -33,7 +33,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x, data) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; this.data = data; } return B; @@ -41,7 +42,8 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C(x) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; } return C; }(A)); diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 581575d0d46..7b13fa1bf4c 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -157,7 +157,8 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.p1 = 0; } return E; @@ -165,34 +166,38 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { + var _this; } // ERROR - super call required return F; }(E)); var G = (function (_super) { __extends(G, _super); function G() { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.p1 = 0; } // 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); + var _this; + _this = _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 + var _this; + _this = _super.call(this) || this; // NO ERROR this.p1 = p1; } return J; @@ -200,16 +205,18 @@ var J = (function (_super) { var K = (function (_super) { __extends(K, _super); function K(p1) { + var _this; this.p1 = p1; var i = 0; - _super.call(this); + _this = _super.call(this) || this; } return K; }(G)); var L = (function (_super) { __extends(L, _super); function L(p1) { - _super.call(this); // NO ERROR + var _this; + _this = _super.call(this) || this; // NO ERROR this.p1 = p1; } return L; @@ -217,9 +224,10 @@ var L = (function (_super) { var M = (function (_super) { __extends(M, _super); function M(p1) { + var _this; this.p1 = p1; var i = 0; - _super.call(this); + _this = _super.call(this) || this; } return M; }(G)); diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index e94a4700506..6ff5ae2ac5b 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -54,7 +54,8 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(Base)); @@ -69,7 +70,8 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(Base2)); @@ -80,7 +82,8 @@ var d2 = new D(1); // ok var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(Base2)); @@ -90,7 +93,8 @@ var d4 = new D(1); // ok var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D3; }(Base2)); diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index 04dcfa2325c..6bb9387f673 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -75,7 +75,8 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C2)); @@ -103,7 +104,8 @@ var Generics; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C2)); diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index 2b2e01e59df..fb07eb3d0b2 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -48,7 +48,8 @@ C.g = function () { return ''; }; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.method = function () { // No errors diff --git a/tests/baselines/reference/classWithStaticMembers.js b/tests/baselines/reference/classWithStaticMembers.js index 327adead6b8..cd23c220231 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -45,7 +45,8 @@ var r3 = r.foo; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/classdecl.js b/tests/baselines/reference/classdecl.js index a8a440fa17d..d4f6bb11ca9 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -136,7 +136,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); @@ -161,7 +162,8 @@ var m2; var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return c; }(b)); @@ -177,7 +179,8 @@ var m2; var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return c; }(m1.b)); diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index 7e6f26ad591..dbbbe340ba7 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -44,7 +44,8 @@ var Shape; var Path = (function (_super) { __extends(Path, _super); function Path() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Path; }(Shape)); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js index fc64a8012ee..eaf031c2571 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js @@ -68,7 +68,8 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(b.prototype, "prop2", { get: function () { @@ -88,7 +89,8 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(c.prototype, "prop2", { get: function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index b6e7cb121d6..b961b8fa4a5 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -42,7 +42,8 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.call(this); + var _this; + _this = _super.call(this) || this; function _super() { } } @@ -51,7 +52,8 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.call(this); + var _this; + _this = _super.call(this) || this; var x = function () { function _super() { } diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js index 14b8bf46697..14965b53abd 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -50,7 +50,8 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.prototype.foo = function () { function _super() { @@ -63,7 +64,8 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } c.prototype.foo = function () { var x = function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index 2af7a6a870e..da4175fe5c7 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -40,7 +40,8 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.prop2 = { doStuff: function () { function _super() { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js index 6887a22ae20..55db3a5e625 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js @@ -58,7 +58,8 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(b.prototype, "prop2", { get: function () { @@ -76,7 +77,8 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(c.prototype, "prop2", { get: function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index d3b5e7a2030..b3ef3000762 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -36,7 +36,8 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.call(this); + var _this; + _this = _super.call(this) || this; var _super = 10; // Should be error } return b; @@ -44,7 +45,8 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.call(this); + var _this; + _this = _super.call(this) || this; var x = function () { var _super = 10; // Should be error }; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index 4553608756d..c5bb6ebcd01 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -36,7 +36,8 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.prototype.foo = function () { var _super = 10; // Should be error @@ -46,7 +47,8 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } c.prototype.foo = function () { var x = function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index df5d812cf54..598bb5b6e85 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -38,7 +38,8 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.prop2 = { doStuff: function () { var _super = 10; // Should be error diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index 2db90d8b026..5501b3e2df4 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -27,7 +27,8 @@ var base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 29b5ad3b496..9909ca512ce 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -94,7 +94,8 @@ var Foo = (function () { var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2(_super) { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.prop4 = { doStuff: function (_super) { } @@ -123,7 +124,8 @@ var Foo2 = (function (_super) { var Foo4 = (function (_super) { __extends(Foo4, _super); function Foo4(_super) { - _super.call(this); + var _this; + _this = _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 517c126ab44..105fe849767 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.js +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -23,7 +23,8 @@ var Foo = (function () { var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Foo2.prototype.x = function () { var lambda = function (_super) { diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index f94a9fde5f2..6a8dd340a20 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -44,14 +44,16 @@ var a = (function () { var b1 = (function (_super) { __extends(b1, _super); function b1(_super) { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return b1; }(a)); var b2 = (function (_super) { __extends(b2, _super); function b2(_super) { - _super.call(this); + var _this; + _this = _super.call(this) || this; this._super = _super; } return b2; @@ -59,14 +61,16 @@ var b2 = (function (_super) { var b3 = (function (_super) { __extends(b3, _super); function b3(_super) { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return b3; }(a)); var b4 = (function (_super) { __extends(b4, _super); function b4(_super) { - _super.call(this); + var _this; + _this = _super.call(this) || this; this._super = _super; } return b4; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index c71b0dcf1dd..59b64e4a9ba 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -34,7 +34,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.prototype.foo = function () { var _this = this; @@ -46,7 +47,8 @@ var b = (function (_super) { var b2 = (function (_super) { __extends(b2, _super); function b2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b2.prototype.foo = function () { var _this = this; diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index 42df3cca389..860c0b90e48 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -227,7 +227,8 @@ var c2 = (function () { var c3 = (function (_super) { __extends(c3, _super); function c3() { - _super.call(this, 10); + var _this; + _this = _super.call(this, 10) || this; } /** c3 f1*/ c3.prototype.f1 = function () { @@ -258,7 +259,8 @@ c2_i = c3_i; var c4 = (function (_super) { __extends(c4, _super); function c4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return c4; }(c2)); diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js index 0de25c15013..fb7a811cba3 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -227,14 +227,16 @@ var Base = (function () { var A2 = (function (_super) { __extends(A2, _super); function A2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A2; }(Base)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js index 4185af60dbc..675235ae324 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -182,7 +182,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js index 90c67439773..ceb386b3e14 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -182,7 +182,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js index 736b57e08ba..03494b4f88d 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -125,7 +125,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js index ca7eea70ad6..ee8185802d4 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -163,7 +163,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js index c64e33827c5..5a36f91c7ca 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -163,7 +163,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js index dc7a12eecdc..f23588dcbc5 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -273,7 +273,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js index d4be6df98dd..cc6fe9ce640 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -235,7 +235,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js index ee5ad2fbd07..d401defc2ed 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -121,7 +121,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js index 79e4bfd0bbf..b4b531b8084 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -178,7 +178,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js index 31c0dd3c7c5..69f46e2ccd2 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -178,7 +178,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js index 5decd7a21fb..171f21e77fc 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -92,7 +92,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -114,7 +115,8 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A2)); diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js index 46974055171..523002e5b57 100644 --- a/tests/baselines/reference/complexClassRelationships.js +++ b/tests/baselines/reference/complexClassRelationships.js @@ -57,7 +57,8 @@ var __extends = (this && this.__extends) || function (d, b) { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.createEmpty = function () { var item = new Derived(); diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js index 3d885d3eef1..1201dcf3d3d 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -14,7 +14,8 @@ var __extends = (this && this.__extends) || function (d, b) { var S18 = (function (_super) { __extends(S18, _super); function S18() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return S18; }(S18)); diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index a55c068d4a4..2057d63b38f 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -197,7 +197,8 @@ value; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this); + var _this; + _this = _super.call(this) || this; _super.prototype. *= value; _super.prototype. += value; } diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js index 16500b823b8..ef29163eda6 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -139,7 +139,8 @@ _a = Math.pow(['', ''], value), '' = _a[0], '' = _a[1]; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this); + var _this; + _this = _super.call(this) || this; (_a = _super.prototype). = Math.pow(_a., value); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.js b/tests/baselines/reference/computedPropertyNames24_ES5.js index 24cfe77d93c..00186f40a28 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.js +++ b/tests/baselines/reference/computedPropertyNames24_ES5.js @@ -25,7 +25,8 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 b03dd285ced..afc0e20eca9 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -30,7 +30,8 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 41a20ac6477..6b75da57e9a 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -27,7 +27,8 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 bdef47165b1..3c89ecd50c0 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.js +++ b/tests/baselines/reference/computedPropertyNames27_ES5.js @@ -19,8 +19,9 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 ed15bbf0145..aaac258504c 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -24,9 +24,10 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.call(this); + var _this; + _this = _super.call(this) || this; var obj = (_a = {}, - _a[(_super.call(this), "prop")] = function () { }, + _a[(_this = _super.call(this) || this, "prop")] = function () { }, _a); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index a900fd44c67..c31d873ffb9 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -29,13 +29,14 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.call(this); + var _this; + _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; }); diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index 2e38e2a131f..7b803e9c987 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -32,7 +32,8 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 c79a4d8d6d1..293d017734e 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -36,7 +36,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 78e20a7d6a3..c990298c4ac 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.js +++ b/tests/baselines/reference/computedPropertyNames44_ES5.js @@ -40,7 +40,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 9c7482a4713..f5a31fffabb 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.js +++ b/tests/baselines/reference/computedPropertyNames45_ES5.js @@ -41,7 +41,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(D.prototype, "set1", { set: function (p) { }, diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js index 3514965f1ce..a6d00d847f3 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -63,7 +63,8 @@ var X = (function () { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A; }(X)); @@ -71,7 +72,8 @@ var A = (function (_super) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(X)); diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 8780c92fc1e..58b050c5ebe 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -39,7 +39,8 @@ var X = (function () { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A; }(X)); @@ -47,7 +48,8 @@ var A = (function (_super) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(X)); diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index 09ff39f582e..934c7eceb0e 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -28,7 +28,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -36,7 +37,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -44,7 +46,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js index 37c1b1737cd..217cf23f9cb 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -29,7 +29,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -37,7 +38,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -45,7 +47,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js index 4fd63cf60d0..511c293d417 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -40,7 +40,8 @@ var GenericBase = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(GenericBase)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js index 88f35f53b17..0e14e958b28 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -84,21 +84,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js index 96318a0d616..cb2cadb7698 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -129,21 +129,24 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js index 171c4bc6210..25c69839117 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -74,21 +74,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js index 26757c43def..dcd972d3a97 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -64,21 +64,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js index ae1d0d90445..69fdebe8f5c 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -67,21 +67,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index 1d533506e15..3345708ddaa 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -29,7 +29,8 @@ var Super = (function () { var Sub = (function (_super) { __extends(Sub, _super); function Sub(options) { - _super.call(this, options.value); + var _this; + _this = _super.call(this, options.value) || this; this.options = options; } return Sub; diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js index d06faa80f20..b16721d0acc 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -33,14 +33,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index 1c3d6bf16d0..a235e2555f3 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -47,7 +47,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(x) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; } return Derived; }(Base)); @@ -55,7 +56,8 @@ var Derived2 = (function (_super) { __extends(Derived2, _super); // ok, not enforcing assignability relation on this function Derived2(x) { - _super.call(this, x); + var _this; + _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 960b76f52c4..956e8cd2e0d 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -47,7 +47,8 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -66,7 +67,8 @@ var Generic; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index 76481ec1bc6..a0ed6d890d4 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -40,7 +40,8 @@ var FooBase = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y) { - _super.call(this, x); + var _this; + _this = _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 61f0d50db03..7bc7989f7a3 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -31,6 +31,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y) { + var _this; } Foo.prototype.bar1 = function () { }; return Foo; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 905c12e07e3..1b91e8a131a 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -525,7 +525,8 @@ method2(); var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.method2 = function () { return this.method1(2); diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js index 5775e0f064d..365e17afc9b 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -28,14 +28,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index 29bb48e7970..7be8079cfd9 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -29,14 +29,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index 1d84d74e590..102562a841a 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -26,14 +26,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js index c385eff83d5..5fafe95c1a8 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js @@ -25,7 +25,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/declFileClassExtendsNull.js b/tests/baselines/reference/declFileClassExtendsNull.js index e9081acab55..58bff801774 100644 --- a/tests/baselines/reference/declFileClassExtendsNull.js +++ b/tests/baselines/reference/declFileClassExtendsNull.js @@ -12,7 +12,8 @@ var __extends = (this && this.__extends) || function (d, b) { var ExtendsNull = (function (_super) { __extends(ExtendsNull, _super); function ExtendsNull() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ExtendsNull; }(null)); diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js index 4b9535cd2c3..d58dcd1f536 100644 --- a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js @@ -23,7 +23,8 @@ var X = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(X)); diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js index 117bb6a7bd5..2f68300a4bf 100644 --- a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js @@ -26,7 +26,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index 0974f9d7b36..2ed404342d7 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -91,7 +91,8 @@ exports.g = C.F5(); var h = (function (_super) { __extends(h, _super); function h() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return h; }(C.A)); diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index a4636d82993..4ccc090f4f2 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -58,7 +58,8 @@ var templa; var AbstractElementController = (function (_super) { __extends(AbstractElementController, _super); function AbstractElementController() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return AbstractElementController; }(templa.mvc.AbstractController)); @@ -78,7 +79,8 @@ var templa; var AbstractCompositeElementController = (function (_super) { __extends(AbstractCompositeElementController, _super); function AbstractCompositeElementController() { - _super.call(this); + var _this; + _this = _super.call(this) || this; this._controllers = []; } return AbstractCompositeElementController; diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 4ac08f97a52..c9c569f8676 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -35,7 +35,8 @@ var X; var W = (function (_super) { __extends(W, _super); function W() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return W; }(A.B.Base.W)); @@ -54,7 +55,8 @@ var X; var W = (function (_super) { __extends(W, _super); function W() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return W; }(X.Y.base.W)); diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js index 6dfce6e8e63..3681f9fa859 100644 --- a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -45,7 +45,8 @@ var A; var ContextMenu = (function (_super) { __extends(ContextMenu, _super); function ContextMenu() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ContextMenu; }(B.EventManager)); diff --git a/tests/baselines/reference/declarationEmitThisPredicates01.js b/tests/baselines/reference/declarationEmitThisPredicates01.js index d05b5c46dad..0b364e90e45 100644 --- a/tests/baselines/reference/declarationEmitThisPredicates01.js +++ b/tests/baselines/reference/declarationEmitThisPredicates01.js @@ -28,7 +28,8 @@ exports.C = C; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js b/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js index e34dcc9810f..aea36311add 100644 --- a/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js +++ b/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js @@ -28,7 +28,8 @@ exports.C = C; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/declarationEmit_expressionInExtends.js b/tests/baselines/reference/declarationEmit_expressionInExtends.js index 061042aa34b..9fbb3a4bf63 100644 --- a/tests/baselines/reference/declarationEmit_expressionInExtends.js +++ b/tests/baselines/reference/declarationEmit_expressionInExtends.js @@ -29,7 +29,8 @@ var Q = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(x)); diff --git a/tests/baselines/reference/declarationEmit_expressionInExtends2.js b/tests/baselines/reference/declarationEmit_expressionInExtends2.js index da0478e26d0..d74f9361e28 100644 --- a/tests/baselines/reference/declarationEmit_expressionInExtends2.js +++ b/tests/baselines/reference/declarationEmit_expressionInExtends2.js @@ -29,7 +29,8 @@ function getClass(c) { var MyClass = (function (_super) { __extends(MyClass, _super); function MyClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyClass; }(getClass(2))); diff --git a/tests/baselines/reference/declarationEmit_expressionInExtends3.js b/tests/baselines/reference/declarationEmit_expressionInExtends3.js index 10ef42d6838..5b7754dff64 100644 --- a/tests/baselines/reference/declarationEmit_expressionInExtends3.js +++ b/tests/baselines/reference/declarationEmit_expressionInExtends3.js @@ -70,7 +70,8 @@ function getExportedClass(c) { var MyClass = (function (_super) { __extends(MyClass, _super); function MyClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyClass; }(getLocalClass(undefined))); @@ -78,7 +79,8 @@ exports.MyClass = MyClass; var MyClass2 = (function (_super) { __extends(MyClass2, _super); function MyClass2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyClass2; }(getExportedClass(undefined))); @@ -86,7 +88,8 @@ exports.MyClass2 = MyClass2; var MyClass3 = (function (_super) { __extends(MyClass3, _super); function MyClass3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyClass3; }(getExportedClass(undefined))); @@ -94,7 +97,8 @@ exports.MyClass3 = MyClass3; var MyClass4 = (function (_super) { __extends(MyClass4, _super); function MyClass4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyClass4; }(getExportedClass(undefined))); diff --git a/tests/baselines/reference/declarationEmit_expressionInExtends4.js b/tests/baselines/reference/declarationEmit_expressionInExtends4.js index 39ee7ce1e69..d304422f038 100644 --- a/tests/baselines/reference/declarationEmit_expressionInExtends4.js +++ b/tests/baselines/reference/declarationEmit_expressionInExtends4.js @@ -33,21 +33,24 @@ function getSomething() { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(getSomething())); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(SomeUndefinedFunction())); var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C3; }(SomeUndefinedFunction)); diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.js b/tests/baselines/reference/declarationEmit_nameConflicts3.js index f1ea96973b8..81236200ade 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.js @@ -64,7 +64,8 @@ var M; var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(C)); diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.js b/tests/baselines/reference/declarationEmit_protectedMembers.js index 192f0647ed6..e118e164dfc 100644 --- a/tests/baselines/reference/declarationEmit_protectedMembers.js +++ b/tests/baselines/reference/declarationEmit_protectedMembers.js @@ -88,7 +88,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C2.prototype.f = function () { return _super.prototype.f.call(this) + this.x; @@ -102,7 +103,8 @@ var C2 = (function (_super) { var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C3.prototype.f = function () { return _super.prototype.f.call(this); diff --git a/tests/baselines/reference/declareDottedExtend.js b/tests/baselines/reference/declareDottedExtend.js index f1e9ea0b4de..f167928087d 100644 --- a/tests/baselines/reference/declareDottedExtend.js +++ b/tests/baselines/reference/declareDottedExtend.js @@ -21,14 +21,16 @@ var ab = A.B; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(ab.C)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(A.B.C)); diff --git a/tests/baselines/reference/decoratorOnClassConstructor2.js b/tests/baselines/reference/decoratorOnClassConstructor2.js index 5fc5501c329..d50912fbeac 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor2.js +++ b/tests/baselines/reference/decoratorOnClassConstructor2.js @@ -45,7 +45,8 @@ var _0_ts_2 = require("./0.ts"); var C = (function (_super) { __extends(C, _super); function C(prop) { - _super.call(this); + var _this; + _this = _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 66946fab8bd..6f37ad9dea1 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor3.js +++ b/tests/baselines/reference/decoratorOnClassConstructor3.js @@ -48,7 +48,8 @@ var _0_2 = require("./0"); var C = (function (_super) { __extends(C, _super); function C(prop) { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return C; }(_0_1.base)); diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js index 6e9b9763a3a..6d95c696176 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.js +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -32,7 +32,8 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.method = function () { }; return C; diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index 2e6ac2c7934..75901c708b3 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -47,6 +47,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { + var _this; } return Derived; }(Base)); @@ -58,21 +59,24 @@ 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 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 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 Derived4; }(Base2)); diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js index 7dbb901362f..6dcf8f3fd83 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js @@ -38,7 +38,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.prototype.x = function () { return 1; diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js index 0c7a21232e6..2fe5906e746 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js @@ -68,7 +68,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -89,7 +90,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js index a44d4340b8f..dc63ccb21d8 100644 --- a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js @@ -32,7 +32,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -45,7 +46,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index c81c6f048f5..605ad6afa45 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -32,7 +32,8 @@ var BaseClass = (function () { var DerivedClass = (function (_super) { __extends(DerivedClass, _super); function DerivedClass() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } DerivedClass.prototype._init = function () { }; diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.js b/tests/baselines/reference/derivedClassOverridesPrivates.js index cd486152c1c..7ab70d93ff2 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.js +++ b/tests/baselines/reference/derivedClassOverridesPrivates.js @@ -29,7 +29,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -41,7 +42,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index 5b8af9e85bf..d3e3fe5d4c9 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -66,7 +66,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - _super.call(this, x); + var _this; + _this = _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 5c7d73d5dfd..1f43469596a 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -94,7 +94,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { @@ -131,7 +132,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index ebb675a26db..d678f5ce59f 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -103,14 +103,16 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } Derived2.prototype.b = function (a) { }; return Derived2; @@ -118,7 +120,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } Object.defineProperty(Derived3.prototype, "c", { get: function () { return x; }, @@ -130,7 +133,8 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } Object.defineProperty(Derived4.prototype, "c", { set: function (v) { }, @@ -142,21 +146,24 @@ var Derived4 = (function (_super) { var Derived5 = (function (_super) { __extends(Derived5, _super); function Derived5(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } return Derived5; }(Base)); var Derived6 = (function (_super) { __extends(Derived6, _super); function Derived6(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } return Derived6; }(Base)); var Derived7 = (function (_super) { __extends(Derived7, _super); function Derived7(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } Derived7.s = function (a) { }; return Derived7; @@ -164,7 +171,8 @@ var Derived7 = (function (_super) { var Derived8 = (function (_super) { __extends(Derived8, _super); function Derived8(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } Object.defineProperty(Derived8, "t", { get: function () { return x; }, @@ -176,7 +184,8 @@ var Derived8 = (function (_super) { var Derived9 = (function (_super) { __extends(Derived9, _super); function Derived9(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } Object.defineProperty(Derived9, "t", { set: function (v) { }, @@ -188,7 +197,8 @@ var Derived9 = (function (_super) { var Derived10 = (function (_super) { __extends(Derived10, _super); function Derived10(a) { - _super.call(this, a); + var _this; + _this = _super.call(this, a) || this; } return Derived10; }(Base)); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js index b8a15ee8b6c..eeaf80061af 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js @@ -30,14 +30,16 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived1)); diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index b62f0d8f7d3..7839398551d 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -92,7 +92,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { @@ -129,7 +130,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js index 147e6edbbb4..f2d8f72edfb 100644 --- a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js @@ -37,7 +37,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -49,7 +50,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index 8e5fa82cf0f..f7afd6529c0 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -109,24 +109,27 @@ 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 Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(y) { + var _this; this.y = y; var a = 1; - _super.call(this); // error + _this = _super.call(this) || this; // error } return Derived2; }(Base)); var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(y) { - _super.call(this); // ok + var _this; + _this = _super.call(this) || this; // ok this.y = y; var a = 1; } @@ -135,16 +138,18 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(y) { + var _this; this.a = 1; var b = 2; - _super.call(this); // error + _this = _super.call(this) || this; // error } return Derived4; }(Base)); var Derived5 = (function (_super) { __extends(Derived5, _super); function Derived5(y) { - _super.call(this); // ok + var _this; + _this = _super.call(this) || this; // ok this.a = 1; var b = 2; } @@ -153,26 +158,29 @@ var Derived5 = (function (_super) { var Derived6 = (function (_super) { __extends(Derived6, _super); function Derived6(y) { + 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 Derived6; }(Base)); var Derived7 = (function (_super) { __extends(Derived7, _super); function Derived7(y) { + var _this; this.a = 1; this.a = 3; this.b = 3; - _super.call(this); // error + _this = _super.call(this) || this; // error } return Derived7; }(Base)); var Derived8 = (function (_super) { __extends(Derived8, _super); function Derived8(y) { - _super.call(this); // ok + var _this; + _this = _super.call(this) || this; // ok this.a = 1; this.a = 3; this.b = 3; @@ -188,17 +196,19 @@ var Base2 = (function () { var Derived9 = (function (_super) { __extends(Derived9, _super); function Derived9(y) { + var _this; this.a = 1; this.a = 3; this.b = 3; - _super.call(this); // error + _this = _super.call(this) || this; // error } return Derived9; }(Base2)); var Derived10 = (function (_super) { __extends(Derived10, _super); function Derived10(y) { - _super.call(this); // ok + var _this; + _this = _super.call(this) || this; // ok this.a = 1; this.a = 3; this.b = 3; diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js index 50408d3bee7..ad2dc22debf 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; + _this = _super.apply(this, arguments) || this; + this.a = _this = _super.call(this) || 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 1c88306bf3a..a464970fe50 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -42,14 +42,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.call(this, this); // ok + var _this; + _this = _super.call(this, this) || this; // ok } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(a) { - _super.call(this, this); // error + var _this; + _this = _super.call(this, this) || this; // error this.a = a; } return Derived2; @@ -57,8 +59,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(a) { - var _this = this; - _super.call(this, function () { return _this; }); // error + var _this; + _this = _super.call(this, function () { return _this; }) || this; // error this.a = a; } return Derived3; @@ -66,7 +68,8 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(a) { - _super.call(this, function () { return this; }); // ok + var _this; + _this = _super.call(this, function () { return this; }) || this; // ok this.a = a; } return Derived4; diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index 38c465492e6..0e88d3664c6 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -36,7 +36,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.foo = function () { }; // ok to drop parameters return D; @@ -44,7 +45,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 5d08905a605..5a3f8f3cf57 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -36,7 +36,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.foo = function (x) { }; // ok to drop parameters return D; @@ -44,7 +45,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 be7e97a8fc5..f6aa6963795 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -36,7 +36,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.foo = function (x) { }; // ok to drop parameters return D; @@ -44,7 +45,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 0c70f03218e..8d18e311d88 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.js +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -36,7 +36,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.foo = function () { }; // ok to drop parameters return D; @@ -44,7 +45,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 34af167011d..70885570373 100644 --- a/tests/baselines/reference/derivedClassWithAny.js +++ b/tests/baselines/reference/derivedClassWithAny.js @@ -91,7 +91,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(D.prototype, "X", { get: function () { @@ -119,7 +120,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(E.prototype, "X", { get: function () { return ''; }, diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js index 2c0775efc19..24d43468dcf 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -46,7 +46,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.prototype.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js index 540be97d165..a6b7710ec6d 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js @@ -56,7 +56,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.prototype.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js index 93d5b49fcd0..3da7720b77e 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -45,7 +45,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js index b58acc01082..57f474affe7 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js @@ -58,7 +58,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index 479beebbbfe..84028f1d3f2 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -41,7 +41,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = 1; this.y = 'hello'; } @@ -58,7 +59,8 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = 2; this.y = null; } diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index 4dc35c5e006..6c3ce90d6f0 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -49,7 +49,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = 1; this.y = 'hello'; } @@ -68,7 +69,8 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = 2; this.y = null; } diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index 3b0a673d378..295fbac60e1 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -63,7 +63,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(y, z) { - _super.call(this, 2); + var _this; + _this = _super.call(this, 2) || this; this.b = ''; this.b = y; } @@ -72,7 +73,8 @@ var Derived = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = 1; this.y = 'hello'; } @@ -90,7 +92,8 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D(y, z) { - _super.call(this, 2); + var _this; + _this = _super.call(this, 2) || this; this.b = null; this.b = y; } @@ -99,7 +102,8 @@ var D = (function (_super) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = 2; this.y = null; } diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js index b6103940b33..27947b4f05f 100644 --- a/tests/baselines/reference/derivedClasses.js +++ b/tests/baselines/reference/derivedClasses.js @@ -39,7 +39,8 @@ var __extends = (this && this.__extends) || function (d, b) { var Red = (function (_super) { __extends(Red, _super); function Red() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Red.prototype.shade = function () { var _this = this; @@ -58,7 +59,8 @@ var Color = (function () { var Blue = (function (_super) { __extends(Blue, _super); function Blue() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Blue.prototype.shade = function () { var _this = this; diff --git a/tests/baselines/reference/derivedGenericClassWithAny.js b/tests/baselines/reference/derivedGenericClassWithAny.js index 56daf4b7310..e31b18e11e7 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.js +++ b/tests/baselines/reference/derivedGenericClassWithAny.js @@ -64,7 +64,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(D.prototype, "X", { get: function () { @@ -92,7 +93,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 2e0a561e846..4430ad5a31b 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -34,7 +34,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.prototype.foo = function (x) { return null; diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js index cfbe44166c9..f6415d84965 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -39,7 +39,8 @@ var Derived = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js index 2df6ce46b2c..a1f109ed49e 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -65,7 +65,8 @@ var Class = (function () { var SubClass = (function (_super) { __extends(SubClass, _super); function SubClass() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return SubClass; }(Class)); @@ -77,7 +78,8 @@ var D = (function () { var SubD = (function (_super) { __extends(SubD, _super); function SubD() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return SubD; }(D)); diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index 88ce3f1418b..4e07d5c8655 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -28,9 +28,10 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x) { + var _this; "use strict"; 'someStringForEgngInject'; - _super.call(this); + _this = _super.call(this) || this; this.x = x; } return B; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js index 920ad1f7bda..b6eabb2a418 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js @@ -30,9 +30,10 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; "use strict"; 'someStringForEgngInject'; - _super.call(this); + _this = _super.call(this) || this; this.blub = 12; } return B; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js index 3fa18140034..0e866e98f46 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -28,9 +28,10 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x) { + var _this; "use strict"; 'someStringForEgngInject'; - _super.call(this); + _this = _super.call(this) || this; this.x = x; this.blah = 2; } diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.js b/tests/baselines/reference/emitThisInSuperMethodCall.js index 1350ed9d4c8..4bb83a7c172 100644 --- a/tests/baselines/reference/emitThisInSuperMethodCall.js +++ b/tests/baselines/reference/emitThisInSuperMethodCall.js @@ -43,7 +43,8 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } RegisteredUser.prototype.f = function () { (function () { diff --git a/tests/baselines/reference/emptyModuleName.js b/tests/baselines/reference/emptyModuleName.js index 5c85d39e1ec..2292f0a494a 100644 --- a/tests/baselines/reference/emptyModuleName.js +++ b/tests/baselines/reference/emptyModuleName.js @@ -14,7 +14,8 @@ var A = require(""); var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js index 96f6c65b85c..7b05688b8c8 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js @@ -30,7 +30,8 @@ var base = (function () { var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return derived; }(base)); diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index 3e778535bb7..765fdf083b5 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,9 @@ var Derived = (function (_super) { __extends(Derived, _super); //super call with type arguments function Derived() { + var _this; _super.prototype..call(this); - _super.call(this); + _this = _super.call(this) || this; } return Derived; }(Base)); @@ -145,22 +146,23 @@ var OtherBase = (function () { var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this; + _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; } 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 dbfbdb46940..18c98868e93 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -186,7 +186,8 @@ SomeBase.publicStaticMember = 0; var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - _super.call(this); + var _this; + _this = _super.call(this) || this; _super.prototype.publicMember = 1; } SomeDerived1.prototype.fn = function () { @@ -219,7 +220,8 @@ var SomeDerived1 = (function (_super) { var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - _super.call(this); + var _this; + _this = _super.call(this) || this; _super.prototype.privateMember = 1; } SomeDerived2.prototype.fn = function () { @@ -245,7 +247,8 @@ var SomeDerived2 = (function (_super) { var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } SomeDerived3.fn = function () { _super.publicStaticMember = 3; diff --git a/tests/baselines/reference/errorsInGenericTypeReference.js b/tests/baselines/reference/errorsInGenericTypeReference.js index a7898810e10..d3d275ff25b 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.js +++ b/tests/baselines/reference/errorsInGenericTypeReference.js @@ -135,7 +135,8 @@ var testClass6 = (function () { var testClass7 = (function (_super) { __extends(testClass7, _super); function testClass7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 c32865478e3..88000a12bbe 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.js +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -28,11 +28,12 @@ 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 B; diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index a722cce1670..0a6323630fb 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -102,8 +102,9 @@ var Bar = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y, z) { + var _this; if (z === void 0) { z = 0; } - _super.call(this, x); + _this = _super.call(this, x) || this; this.y = y; this.z = z; this.gar = 0; diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index 1881e6b8c87..ebf779f7bba 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -267,7 +267,8 @@ var SuperParent = (function () { var SuperChild = (function (_super) { __extends(SuperChild, _super); function SuperChild() { - _super.call(this, 1); + var _this; + _this = _super.call(this, 1) || this; } SuperChild.prototype.b = function () { _super.prototype.b.call(this, 'str'); @@ -314,7 +315,8 @@ var BaseClassWithConstructor = (function () { var ChildClassWithoutConstructor = (function (_super) { __extends(ChildClassWithoutConstructor, _super); function ChildClassWithoutConstructor() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ChildClassWithoutConstructor; }(BaseClassWithConstructor)); diff --git a/tests/baselines/reference/es6ClassTest7.js b/tests/baselines/reference/es6ClassTest7.js index 14662410a14..6e30a1d7879 100644 --- a/tests/baselines/reference/es6ClassTest7.js +++ b/tests/baselines/reference/es6ClassTest7.js @@ -17,7 +17,8 @@ var __extends = (this && this.__extends) || function (d, b) { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar; }(M.Foo)); diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.js b/tests/baselines/reference/exportAssignmentOfGenericType1.js index 0504bad39c7..439f74a9c9d 100644 --- a/tests/baselines/reference/exportAssignmentOfGenericType1.js +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.js @@ -34,7 +34,8 @@ define(["require", "exports", "exportAssignmentOfGenericType1_0"], function (req var M = (function (_super) { __extends(M, _super); function M() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return M; }(q)); diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js index a9ea4bf5eda..b6eec928a07 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.js +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -32,7 +32,8 @@ var Bbb = (function () { var Aaa = (function (_super) { __extends(Aaa, _super); function Aaa() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Aaa; }(Bbb)); diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js index 446c6df9c94..508eea66500 100644 --- a/tests/baselines/reference/extBaseClass1.js +++ b/tests/baselines/reference/extBaseClass1.js @@ -37,7 +37,8 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); @@ -48,7 +49,8 @@ var M; var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(M.B)); @@ -59,7 +61,8 @@ var N; var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C3; }(M.B)); diff --git a/tests/baselines/reference/extBaseClass2.js b/tests/baselines/reference/extBaseClass2.js index f7bd85d685c..14f3d69ef3e 100644 --- a/tests/baselines/reference/extBaseClass2.js +++ b/tests/baselines/reference/extBaseClass2.js @@ -21,7 +21,8 @@ var N; var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C4; }(M.B)); @@ -32,7 +33,8 @@ var M; var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C5; }(B)); diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js index e52e5b497ac..03bf54db78d 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -28,7 +28,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.baz = function () { }; return D; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js index 1f4f62a42ee..50db54a05e9 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -33,7 +33,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.baz = function () { }; return D; diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js index d598389d0fa..6cab3a8c7f6 100644 --- a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js @@ -12,7 +12,8 @@ var __extends = (this && this.__extends) || function (d, b) { var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return derived; }(base)); diff --git a/tests/baselines/reference/extendClassExpressionFromModule.js b/tests/baselines/reference/extendClassExpressionFromModule.js index 6532603b73c..c0cb5d49023 100644 --- a/tests/baselines/reference/extendClassExpressionFromModule.js +++ b/tests/baselines/reference/extendClassExpressionFromModule.js @@ -31,7 +31,8 @@ var x = foo1; var y = (function (_super) { __extends(y, _super); function y() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return y; }(x)); diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.js b/tests/baselines/reference/extendConstructSignatureInInterface.js index 20f43a948b8..6985657ced3 100644 --- a/tests/baselines/reference/extendConstructSignatureInInterface.js +++ b/tests/baselines/reference/extendConstructSignatureInInterface.js @@ -20,7 +20,8 @@ var CStatic; var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(CStatic)); diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index 558e6d6ba57..829b1ae1a32 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -19,7 +19,8 @@ var x = A; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 3785c7c5846..9a2d4fb2adf 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.js +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -18,7 +18,8 @@ var x = new Foo(); // legal, considered a constructor function var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 6542492e200..db2fcdbbf36 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js @@ -51,7 +51,8 @@ var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); @@ -67,7 +68,8 @@ var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.js b/tests/baselines/reference/extendsClauseAlreadySeen.js index fb9a3f12378..db11c06d782 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen.js @@ -20,7 +20,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.baz = function () { }; return D; diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.js b/tests/baselines/reference/extendsClauseAlreadySeen2.js index 9423789dd35..f61317c2d50 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.js @@ -20,7 +20,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.baz = function () { }; return D; diff --git a/tests/baselines/reference/fluentClasses.js b/tests/baselines/reference/fluentClasses.js index 3d5efcc1b1a..68a2960b03f 100644 --- a/tests/baselines/reference/fluentClasses.js +++ b/tests/baselines/reference/fluentClasses.js @@ -35,7 +35,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { return this; @@ -45,7 +46,8 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.baz = function () { return this; diff --git a/tests/baselines/reference/for-inStatements.js b/tests/baselines/reference/for-inStatements.js index 5c097a68ccc..7176a27ebc9 100644 --- a/tests/baselines/reference/for-inStatements.js +++ b/tests/baselines/reference/for-inStatements.js @@ -126,7 +126,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 caec9bd1987..cca8e94dcab 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.js +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -107,7 +107,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 aff01bc8565..82910ff0435 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -68,7 +68,8 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(C)); diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 2dc6c8a1bc4..465ea54b73f 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -134,14 +134,16 @@ var AnotherClass = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index 6e37f929efe..e26e49c1b7a 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -236,7 +236,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -287,7 +288,8 @@ function f6() { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.js b/tests/baselines/reference/functionSubtypingOfVarArgs.js index 7485abe1927..c604461f32d 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.js @@ -32,7 +32,8 @@ var EventBase = (function () { var StringEvent = (function (_super) { __extends(StringEvent, _super); function StringEvent() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 33d0e8c7e03..38a98a3f114 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs2.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.js @@ -32,7 +32,8 @@ var EventBase = (function () { var StringEvent = (function (_super) { __extends(StringEvent, _super); function StringEvent() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 e5488121d34..5c512883a10 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -369,14 +369,16 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.js b/tests/baselines/reference/genericBaseClassLiteralProperty.js index 5aa43d78826..25dfb7ae722 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.js @@ -26,7 +26,8 @@ var BaseClass = (function () { var SubClass = (function (_super) { __extends(SubClass, _super); function SubClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } SubClass.prototype.Error = function () { var x = this._getValue1(); diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.js b/tests/baselines/reference/genericBaseClassLiteralProperty2.js index 3226f1cd659..e39353b6a7f 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.js @@ -35,7 +35,8 @@ var BaseCollection2 = (function () { var DataView2 = (function (_super) { __extends(DataView2, _super); function DataView2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 04d5bd2d997..53c02a85113 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -122,14 +122,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index 509dd9a1136..3835a4dd787 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -46,14 +46,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index d3f18e0bfcb..a16f8bcac68 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -54,7 +54,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index acab51690d3..410675804af 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -52,14 +52,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js index 31b4cd181b9..3fbb7c8a901 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -46,7 +46,8 @@ var M; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(C1)); diff --git a/tests/baselines/reference/genericClassExpressionInFunction.js b/tests/baselines/reference/genericClassExpressionInFunction.js index f334da52625..d14b70b6312 100644 --- a/tests/baselines/reference/genericClassExpressionInFunction.js +++ b/tests/baselines/reference/genericClassExpressionInFunction.js @@ -47,7 +47,8 @@ function B1() { return (function (_super) { __extends(class_1, _super); function class_1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class_1; }(A)); @@ -57,7 +58,8 @@ var B2 = (function () { this.anon = (function (_super) { __extends(class_2, _super); function class_2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class_2; }(A)); @@ -68,7 +70,8 @@ function B3() { return (function (_super) { __extends(Inner, _super); function Inner() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Inner; }(A)); @@ -77,14 +80,16 @@ function B3() { var K = (function (_super) { __extends(K, _super); function K() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return K; }(B1())); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }((new B2().anon))); @@ -92,7 +97,8 @@ var b3Number = B3(); var S = (function (_super) { __extends(S, _super); function S() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return S; }(b3Number)); diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js index 9f71ace88a9..a6c14b9ba0f 100644 --- a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js @@ -14,14 +14,16 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A; }(B)); var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(C)); diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index 8f90c2fb6e4..0cc1f5867a2 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -109,7 +109,8 @@ var PortalFx; var Validator = (function (_super) { __extends(Validator, _super); function Validator(message) { - _super.call(this, message); + var _this; + _this = _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 394e6650e0a..2124f414172 100644 --- a/tests/baselines/reference/genericClassStaticMethod.js +++ b/tests/baselines/reference/genericClassStaticMethod.js @@ -26,7 +26,8 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Bar.getFoo = function () { }; diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js index 2bd33efb3dc..6f10b979c4a 100644 --- a/tests/baselines/reference/genericClasses3.js +++ b/tests/baselines/reference/genericClasses3.js @@ -31,7 +31,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index d2bf12667fc..4581ecc31ec 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -52,7 +52,8 @@ var EndGate; var NumberTween = (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { - _super.call(this, from); + var _this; + _this = _super.call(this, from) || this; } return NumberTween; }(Tweening.Tween)); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index f61f57cb615..8f1e9c8365f 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -51,7 +51,8 @@ var EndGate; var NumberTween = (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { - _super.call(this, from); + var _this; + _this = _super.call(this, from) || this; } return NumberTween; }(Tweening.Tween)); diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js index 906145850f1..454bc77ae5b 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js @@ -26,7 +26,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js index 1c73075acc4..26749718d43 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js @@ -26,7 +26,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/genericInheritedDefaultConstructors.js b/tests/baselines/reference/genericInheritedDefaultConstructors.js index 170ef89abb2..e7c32cbe73f 100644 --- a/tests/baselines/reference/genericInheritedDefaultConstructors.js +++ b/tests/baselines/reference/genericInheritedDefaultConstructors.js @@ -24,7 +24,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/genericPrototypeProperty2.js b/tests/baselines/reference/genericPrototypeProperty2.js index 3f1b6e21adc..ccaf6fa8807 100644 --- a/tests/baselines/reference/genericPrototypeProperty2.js +++ b/tests/baselines/reference/genericPrototypeProperty2.js @@ -29,7 +29,8 @@ var BaseEvent = (function () { var MyEvent = (function (_super) { __extends(MyEvent, _super); function MyEvent() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyEvent; }(BaseEvent)); @@ -41,7 +42,8 @@ var BaseEventWrapper = (function () { var MyEventWrapper = (function (_super) { __extends(MyEventWrapper, _super); function MyEventWrapper() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyEventWrapper; }(BaseEventWrapper)); diff --git a/tests/baselines/reference/genericPrototypeProperty3.js b/tests/baselines/reference/genericPrototypeProperty3.js index b7cca85561c..85658593705 100644 --- a/tests/baselines/reference/genericPrototypeProperty3.js +++ b/tests/baselines/reference/genericPrototypeProperty3.js @@ -28,7 +28,8 @@ var BaseEvent = (function () { var MyEvent = (function (_super) { __extends(MyEvent, _super); function MyEvent() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyEvent; }(BaseEvent)); @@ -40,7 +41,8 @@ var BaseEventWrapper = (function () { var MyEventWrapper = (function (_super) { __extends(MyEventWrapper, _super); function MyEventWrapper() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyEventWrapper; }(BaseEventWrapper)); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js index 73012f714e8..e567e2a8042 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js @@ -57,7 +57,8 @@ var TypeScript2; var PullTypeSymbol = (function (_super) { __extends(PullTypeSymbol, _super); function PullTypeSymbol() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PullTypeSymbol; }(PullSymbol)); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index 61cb758c48e..226fede58b6 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -59,7 +59,8 @@ var TypeScript; var PullTypeSymbol = (function (_super) { __extends(PullTypeSymbol, _super); function PullTypeSymbol() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this._elementType = null; } PullTypeSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index 02a51aed35d..31d2b3976db 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -28,7 +28,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { return null; diff --git a/tests/baselines/reference/genericTypeAssertions4.js b/tests/baselines/reference/genericTypeAssertions4.js index 2c5bbf51d7f..41a187edb6a 100644 --- a/tests/baselines/reference/genericTypeAssertions4.js +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -40,7 +40,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { return 1; }; return B; @@ -48,7 +49,8 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.baz = function () { return 1; }; return C; diff --git a/tests/baselines/reference/genericTypeAssertions6.js b/tests/baselines/reference/genericTypeAssertions6.js index 5bc7a943163..b776668f2e2 100644 --- a/tests/baselines/reference/genericTypeAssertions6.js +++ b/tests/baselines/reference/genericTypeAssertions6.js @@ -44,7 +44,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.g = function (x) { var a = x; diff --git a/tests/baselines/reference/genericTypeConstraints.js b/tests/baselines/reference/genericTypeConstraints.js index 5f4bb41a83f..761220ae11a 100644 --- a/tests/baselines/reference/genericTypeConstraints.js +++ b/tests/baselines/reference/genericTypeConstraints.js @@ -38,7 +38,8 @@ var Bar = (function () { var BarExtended = (function (_super) { __extends(BarExtended, _super); function BarExtended() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return BarExtended; }(Bar)); diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index 7fe6c49d65e..39468204a5a 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -60,7 +60,8 @@ var g = function f(x) { var y; return y; }; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -76,7 +77,8 @@ var M; var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(M.E)); diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js index 12be456a8a8..a41d459b445 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -55,14 +55,16 @@ var g = function f(x) { var y; return y; }; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(I)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(M.C)); diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js index 1f016b401ed..c0498b351e1 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -31,7 +31,8 @@ define(["require", "exports"], function (require, exports) { var List = (function (_super) { __extends(List, _super); function List() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } List.prototype.Bar = function () { }; return List; @@ -46,7 +47,8 @@ define(["require", "exports"], function (require, exports) { var ListItem = (function (_super) { __extends(ListItem, _super); function ListItem() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ListItem; }(CollectionItem)); diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index e482f0d33d3..e3c50cfa8f7 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -160,14 +160,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index 75762ffbb54..af1e3be18ff 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -177,7 +177,8 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(C)); diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index 88671ce1cee..e27a9789cb1 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -34,16 +34,17 @@ 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; } }; } diff --git a/tests/baselines/reference/implementClausePrecedingExtends.js b/tests/baselines/reference/implementClausePrecedingExtends.js index ba3583c3051..0dfc867a2f7 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.js +++ b/tests/baselines/reference/implementClausePrecedingExtends.js @@ -16,7 +16,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js index 8fec5dc27da..033d6150194 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -99,21 +99,24 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar; }(Foo)); var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar3; }(Foo)); @@ -128,28 +131,32 @@ var M; var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Baz; }(Foo)); var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar; }(Foo)); var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar3; }(Foo)); @@ -165,14 +172,16 @@ var M2; var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Baz; }(Foo)); var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar; }(Foo)); @@ -183,14 +192,16 @@ var M2; var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar3; }(Foo)); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js index 915e652056c..78cfb6b51b9 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js @@ -75,28 +75,32 @@ var Bar4 = (function () { var Bar5 = (function (_super) { __extends(Bar5, _super); function Bar5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar5; }(Foo)); var Bar6 = (function (_super) { __extends(Bar6, _super); function Bar6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar6; }(Foo)); var Bar7 = (function (_super) { __extends(Bar7, _super); function Bar7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar7; }(Foo)); var Bar8 = (function (_super) { __extends(Bar8, _super); function Bar8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar8; }(Foo)); diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js index 60e142dd5f7..d9f40f83051 100644 --- a/tests/baselines/reference/importAsBaseClass.js +++ b/tests/baselines/reference/importAsBaseClass.js @@ -30,7 +30,8 @@ var Greeter = require("./importAsBaseClass_0"); var Hello = (function (_super) { __extends(Hello, _super); function Hello() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Hello; }(Greeter)); diff --git a/tests/baselines/reference/importHelpers.js b/tests/baselines/reference/importHelpers.js index f850b5cf177..6641ef9d212 100644 --- a/tests/baselines/reference/importHelpers.js +++ b/tests/baselines/reference/importHelpers.js @@ -45,7 +45,8 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -93,7 +94,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersAmd.js b/tests/baselines/reference/importHelpersAmd.js index bb02cbf0417..89fab70bdba 100644 --- a/tests/baselines/reference/importHelpersAmd.js +++ b/tests/baselines/reference/importHelpersAmd.js @@ -32,7 +32,8 @@ define(["require", "exports", "tslib", "./a"], function (require, exports, tslib var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/importHelpersInIsolatedModules.js b/tests/baselines/reference/importHelpersInIsolatedModules.js index a5929bc152c..2a97d3d2d87 100644 --- a/tests/baselines/reference/importHelpersInIsolatedModules.js +++ b/tests/baselines/reference/importHelpersInIsolatedModules.js @@ -45,7 +45,8 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -78,7 +79,8 @@ var A = (function () { var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersNoHelpers.js b/tests/baselines/reference/importHelpersNoHelpers.js index 8c5afc99ece..d5f8db60f97 100644 --- a/tests/baselines/reference/importHelpersNoHelpers.js +++ b/tests/baselines/reference/importHelpersNoHelpers.js @@ -39,7 +39,8 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -87,7 +88,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersNoModule.js b/tests/baselines/reference/importHelpersNoModule.js index 36bc0c5f76b..5891922f9f2 100644 --- a/tests/baselines/reference/importHelpersNoModule.js +++ b/tests/baselines/reference/importHelpersNoModule.js @@ -37,7 +37,8 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -85,7 +86,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersOutFile.js b/tests/baselines/reference/importHelpersOutFile.js index cb50330c20c..b4c2040aa71 100644 --- a/tests/baselines/reference/importHelpersOutFile.js +++ b/tests/baselines/reference/importHelpersOutFile.js @@ -35,7 +35,8 @@ 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); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(a_1.A)); @@ -46,7 +47,8 @@ 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); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(a_2.A)); diff --git a/tests/baselines/reference/importHelpersSystem.js b/tests/baselines/reference/importHelpersSystem.js index 3c1ee19ec48..552bd0ed404 100644 --- a/tests/baselines/reference/importHelpersSystem.js +++ b/tests/baselines/reference/importHelpersSystem.js @@ -51,7 +51,8 @@ System.register(["tslib", "./a"], function (exports_1, context_1) { B = (function (_super) { tslib_1.__extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/importShadowsGlobalName.js b/tests/baselines/reference/importShadowsGlobalName.js index 316a94d9069..b4950b039f3 100644 --- a/tests/baselines/reference/importShadowsGlobalName.js +++ b/tests/baselines/reference/importShadowsGlobalName.js @@ -31,7 +31,8 @@ define(["require", "exports", "Foo"], function (require, exports, Error) { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar; }(Error)); diff --git a/tests/baselines/reference/importUsedInExtendsList1.js b/tests/baselines/reference/importUsedInExtendsList1.js index b9827d5bc93..956e20a1045 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.js +++ b/tests/baselines/reference/importUsedInExtendsList1.js @@ -31,7 +31,8 @@ var foo = require("./importUsedInExtendsList1_require"); var Sub = (function (_super) { __extends(Sub, _super); function Sub() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Sub; }(foo.Super)); diff --git a/tests/baselines/reference/indexerConstraints2.js b/tests/baselines/reference/indexerConstraints2.js index dd143da97e6..c8b910abb2d 100644 --- a/tests/baselines/reference/indexerConstraints2.js +++ b/tests/baselines/reference/indexerConstraints2.js @@ -42,7 +42,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -55,7 +56,8 @@ var F = (function () { var G = (function (_super) { __extends(G, _super); function G() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return G; }(F)); @@ -68,7 +70,8 @@ var H = (function () { var I = (function (_super) { __extends(I, _super); function I() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return I; }(H)); @@ -81,7 +84,8 @@ var J = (function () { var K = (function (_super) { __extends(K, _super); function K() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return K; }(J)); diff --git a/tests/baselines/reference/indirectSelfReference.js b/tests/baselines/reference/indirectSelfReference.js index 66d23a45b72..c1c77ec5fc9 100644 --- a/tests/baselines/reference/indirectSelfReference.js +++ b/tests/baselines/reference/indirectSelfReference.js @@ -11,14 +11,16 @@ var __extends = (this && this.__extends) || function (d, b) { var a = (function (_super) { __extends(a, _super); function a() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return a; }(b)); var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.js b/tests/baselines/reference/indirectSelfReferenceGeneric.js index 99ab918e631..366ad1f0af5 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.js +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.js @@ -11,14 +11,16 @@ var __extends = (this && this.__extends) || function (d, b) { var a = (function (_super) { __extends(a, _super); function a() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return a; }(b)); var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js index 6321f77d31f..9b145b55d04 100644 --- a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js @@ -43,7 +43,8 @@ var Base = (function () { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A; }(Base)); diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.js b/tests/baselines/reference/inheritFromGenericTypeParameter.js index f5bc099cb8d..5db269f7c58 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.js +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(T)); diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js index 9462df7a3c3..7f3e872245b 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js @@ -24,14 +24,16 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(B)); diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js index 52fbfaffdde..c4acea22260 100644 --- a/tests/baselines/reference/inheritance.js +++ b/tests/baselines/reference/inheritance.js @@ -53,14 +53,16 @@ var B2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(B2)); @@ -72,7 +74,8 @@ var N = (function () { var ND = (function (_super) { __extends(ND, _super); function ND() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ND; }(N)); @@ -86,7 +89,8 @@ var Good = (function () { var Baad = (function (_super) { __extends(Baad, _super); function Baad() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 c65155ee55c..f555d5bf694 100644 --- a/tests/baselines/reference/inheritance1.js +++ b/tests/baselines/reference/inheritance1.js @@ -75,7 +75,8 @@ var Control = (function () { var Button = (function (_super) { __extends(Button, _super); function Button() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Button.prototype.select = function () { }; return Button; @@ -83,7 +84,8 @@ var Button = (function (_super) { var TextBox = (function (_super) { __extends(TextBox, _super); function TextBox() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } TextBox.prototype.select = function () { }; return TextBox; @@ -91,14 +93,16 @@ var TextBox = (function (_super) { var ImageBase = (function (_super) { __extends(ImageBase, _super); function ImageBase() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ImageBase; }(Control)); var Image1 = (function (_super) { __extends(Image1, _super); function Image1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Image1; }(Control)); diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js index b416cf3fb93..2ed366d7b8a 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -25,14 +25,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.myMethod = function () { }; return C; diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js index 25a977531ca..369c6b20a14 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -25,14 +25,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.myMethod = function () { }; return C; diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js index dfd05556925..d884364d95c 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -25,14 +25,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.myMethod = function () { }; return C; diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js index b4efaa89621..c1289f99a78 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js @@ -40,7 +40,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(b.prototype, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js index 5044a8e03ac..665b547154d 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js @@ -31,7 +31,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(b.prototype, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js index 6ebdc336a64..a9a92003542 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js @@ -26,7 +26,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(b.prototype, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js index 3ddff027c1a..17541ee163d 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js @@ -37,7 +37,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.prototype.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js index a6c3beea4ef..a154d0426a9 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js @@ -28,7 +28,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.prototype.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js index 94b602d29d9..be10895642e 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js @@ -23,7 +23,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.prototype.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js index a8fc4d5a3dd..6895077abda 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js @@ -37,7 +37,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js index 7d5cdb43e96..00c1093053b 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js @@ -26,7 +26,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js index 648f1d1622e..6cbb7ae7e8c 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js @@ -21,7 +21,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js index 59675c56e5f..370e27514c1 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -21,7 +21,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js index 97464233027..a61b6bafabd 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -40,7 +40,8 @@ var N; var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(M.C1)); @@ -48,7 +49,8 @@ var N; var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(M.C2)); diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js index 49145b010d4..9f71208e5db 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js @@ -40,7 +40,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(b, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js index 4a202b76497..2e0c3dc90d0 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js @@ -31,7 +31,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(b, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js index a0dd1177cfb..95bf94572b1 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js @@ -26,7 +26,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(b, "x", { get: function () { diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js index 06f907371ea..25d75bea5af 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js @@ -37,7 +37,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js index ea36c40480f..5c39c10e738 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js @@ -32,7 +32,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js index ae523d53d9b..c37caf8d53c 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js @@ -28,7 +28,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js index 93890bd8294..eb185d56d0b 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js @@ -23,7 +23,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js index 4d0f2438459..0779cc10d37 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js @@ -23,7 +23,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.x = function () { return "20"; diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js index f2dfda4e48f..4934947233f 100644 --- a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js @@ -23,7 +23,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } b.x = function () { return new b().x; diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.js b/tests/baselines/reference/inheritanceStaticMembersCompatible.js index 0dc736a375d..27a65d513fd 100644 --- a/tests/baselines/reference/inheritanceStaticMembersCompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.js @@ -21,7 +21,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js index 51c474430ad..7cfafdf1f9d 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js @@ -21,7 +21,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js index d138ac3eba8..1840a7829e8 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js @@ -36,7 +36,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js index 3d3f550713e..8e498273b86 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js @@ -26,7 +26,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js index e23917e40a4..c003eaa60b4 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js @@ -21,7 +21,8 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.js b/tests/baselines/reference/inheritedConstructorWithRestParams.js index 2d312d9859d..ca6a379816f 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.js @@ -32,7 +32,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.js b/tests/baselines/reference/inheritedConstructorWithRestParams2.js index 0ad25b302f0..b323aefbd48 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.js @@ -53,14 +53,16 @@ var BaseBase2 = (function () { var Base = (function (_super) { __extends(Base, _super); function Base() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Base; }(BaseBase)); var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js index 95b71069584..1de6f5f638a 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.js +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -38,7 +38,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -53,7 +54,8 @@ var D; var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } E.bar = function () { return this.foo(); diff --git a/tests/baselines/reference/instanceOfAssignability.js b/tests/baselines/reference/instanceOfAssignability.js index 775afe86946..f78378f0885 100644 --- a/tests/baselines/reference/instanceOfAssignability.js +++ b/tests/baselines/reference/instanceOfAssignability.js @@ -115,14 +115,16 @@ var Animal = (function () { var Mammal = (function (_super) { __extends(Mammal, _super); function Mammal() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Mammal; }(Animal)); var Giraffe = (function (_super) { __extends(Giraffe, _super); function Giraffe() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Giraffe; }(Mammal)); diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js index a507a19a456..cf056e768d8 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js @@ -69,7 +69,8 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -101,7 +102,8 @@ var Generic; var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/instanceSubtypeCheck2.js b/tests/baselines/reference/instanceSubtypeCheck2.js index d72f29e93bf..e70dc7b6481 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.js +++ b/tests/baselines/reference/instanceSubtypeCheck2.js @@ -21,7 +21,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(C1)); diff --git a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js index 97be2137722..de2789caa68 100644 --- a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js +++ b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js @@ -128,7 +128,8 @@ var A = (function () { var A1 = (function (_super) { __extends(A1, _super); function A1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A1; }(A)); @@ -140,7 +141,8 @@ var A2 = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.js b/tests/baselines/reference/instantiatedReturnTypeContravariance.js index 4d5e4376308..83ad38e64f0 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.js +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.js @@ -47,7 +47,8 @@ var c = (function () { var d = (function (_super) { __extends(d, _super); function d() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } d.prototype.foo = function () { return null; diff --git a/tests/baselines/reference/interfaceClassMerging.js b/tests/baselines/reference/interfaceClassMerging.js index 8138e7888b3..6111e7f8cee 100644 --- a/tests/baselines/reference/interfaceClassMerging.js +++ b/tests/baselines/reference/interfaceClassMerging.js @@ -57,7 +57,8 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Bar.prototype.method = function (a) { return this.optionalProperty; diff --git a/tests/baselines/reference/interfaceClassMerging2.js b/tests/baselines/reference/interfaceClassMerging2.js index 99f5b07696d..499bd219905 100644 --- a/tests/baselines/reference/interfaceClassMerging2.js +++ b/tests/baselines/reference/interfaceClassMerging2.js @@ -53,7 +53,8 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Bar.prototype.classBarMethod = function () { return this; diff --git a/tests/baselines/reference/interfaceExtendsClass1.js b/tests/baselines/reference/interfaceExtendsClass1.js index 43c7c6f6fa4..70ceaa8acd3 100644 --- a/tests/baselines/reference/interfaceExtendsClass1.js +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -32,7 +32,8 @@ var Control = (function () { var Button = (function (_super) { __extends(Button, _super); function Button() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Button.prototype.select = function () { }; return Button; @@ -40,7 +41,8 @@ var Button = (function (_super) { var TextBox = (function (_super) { __extends(TextBox, _super); function TextBox() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } TextBox.prototype.select = function () { }; return TextBox; @@ -48,7 +50,8 @@ var TextBox = (function (_super) { var Image = (function (_super) { __extends(Image, _super); function Image() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Image; }(Control)); diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js index e1bdbff85dd..5e6695dd200 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -43,7 +43,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 1592b1a723b..6f35c3f0e40 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -39,7 +39,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = 2; this.y = 3; } @@ -51,7 +52,8 @@ var D = (function (_super) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = ""; } D2.prototype.foo = function (x) { return x; }; diff --git a/tests/baselines/reference/interfaceImplementation8.js b/tests/baselines/reference/interfaceImplementation8.js index edfb33bfe1b..f3bfa4db6a5 100644 --- a/tests/baselines/reference/interfaceImplementation8.js +++ b/tests/baselines/reference/interfaceImplementation8.js @@ -64,21 +64,24 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C4; }(C1)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C5; }(C2)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C6; }(C3)); @@ -90,7 +93,8 @@ var C7 = (function () { var C8 = (function (_super) { __extends(C8, _super); function C8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C8; }(C7)); diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js index cb3c22b52eb..75bf3f91884 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js @@ -95,7 +95,8 @@ var Y; var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return BB; }(A)); @@ -110,7 +111,8 @@ var Y2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(AA)); @@ -144,7 +146,8 @@ var YY; var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return BB; }(A)); @@ -159,7 +162,8 @@ var YY2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(AA)); @@ -193,7 +197,8 @@ var YYY; var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return BB; }(A)); @@ -208,7 +213,8 @@ var YYY2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(AA)); diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js index 0c90c6d0025..b4fbd6f3698 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.js +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -67,7 +67,8 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(C)); diff --git a/tests/baselines/reference/invalidReturnStatements.js b/tests/baselines/reference/invalidReturnStatements.js index 0f5b0d3e08d..1409b1c59a8 100644 --- a/tests/baselines/reference/invalidReturnStatements.js +++ b/tests/baselines/reference/invalidReturnStatements.js @@ -41,7 +41,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/isolatedModulesImportExportElision.js b/tests/baselines/reference/isolatedModulesImportExportElision.js index 2d391a64fe7..baf2d1de129 100644 --- a/tests/baselines/reference/isolatedModulesImportExportElision.js +++ b/tests/baselines/reference/isolatedModulesImportExportElision.js @@ -26,7 +26,8 @@ var ns = require("module"); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(module_2.c2.C)); diff --git a/tests/baselines/reference/jsxViaImport.js b/tests/baselines/reference/jsxViaImport.js index 63c84090c9c..c149d4e3c3d 100644 --- a/tests/baselines/reference/jsxViaImport.js +++ b/tests/baselines/reference/jsxViaImport.js @@ -35,7 +35,8 @@ var BaseComponent = require("BaseComponent"); var TestComponent = (function (_super) { __extends(TestComponent, _super); function TestComponent() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } TestComponent.prototype.render = function () { return ; diff --git a/tests/baselines/reference/lambdaArgCrash.js b/tests/baselines/reference/lambdaArgCrash.js index 822aa71efd0..16653cfb4f3 100644 --- a/tests/baselines/reference/lambdaArgCrash.js +++ b/tests/baselines/reference/lambdaArgCrash.js @@ -56,7 +56,8 @@ var Event = (function () { var ItemSetEvent = (function (_super) { __extends(ItemSetEvent, _super); function ItemSetEvent() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 568379948bc..bfbf75b1731 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -32,7 +32,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C(y, z, w) { - _super.call(this, y); + var _this; + _this = _super.call(this, y) || this; var x = 10 + w; var ll = x * w; } diff --git a/tests/baselines/reference/localTypes1.js b/tests/baselines/reference/localTypes1.js index a4f835c8669..96c9337817d 100644 --- a/tests/baselines/reference/localTypes1.js +++ b/tests/baselines/reference/localTypes1.js @@ -300,7 +300,8 @@ function f6() { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -308,7 +309,8 @@ function f6() { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/m7Bugs.js b/tests/baselines/reference/m7Bugs.js index 6292356faf5..19cd9ee4630 100644 --- a/tests/baselines/reference/m7Bugs.js +++ b/tests/baselines/reference/m7Bugs.js @@ -42,7 +42,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(C1)); diff --git a/tests/baselines/reference/mergedDeclarations5.js b/tests/baselines/reference/mergedDeclarations5.js index ce4b929c7f9..53a8c983399 100644 --- a/tests/baselines/reference/mergedDeclarations5.js +++ b/tests/baselines/reference/mergedDeclarations5.js @@ -27,7 +27,8 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.foo = function () { }; return B; diff --git a/tests/baselines/reference/mergedDeclarations6.js b/tests/baselines/reference/mergedDeclarations6.js index 2ff9d3e6604..50108773a70 100644 --- a/tests/baselines/reference/mergedDeclarations6.js +++ b/tests/baselines/reference/mergedDeclarations6.js @@ -47,7 +47,8 @@ define(["require", "exports", "./a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.setProtected = function () { }; diff --git a/tests/baselines/reference/mergedInheritedClassInterface.js b/tests/baselines/reference/mergedInheritedClassInterface.js index 72ac1c8a928..fd0bea5494c 100644 --- a/tests/baselines/reference/mergedInheritedClassInterface.js +++ b/tests/baselines/reference/mergedInheritedClassInterface.js @@ -61,7 +61,8 @@ var BaseClass = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Child.prototype.method = function () { }; return Child; @@ -75,7 +76,8 @@ var ChildNoBaseClass = (function () { var Grandchild = (function (_super) { __extends(Grandchild, _super); function Grandchild() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Grandchild; }(ChildNoBaseClass)); diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js index a7e341c31ce..a3baa1920e3 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -50,14 +50,16 @@ var C2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(C2)); diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js index 3d9c4e1175e..e21ca151c87 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js @@ -57,7 +57,8 @@ var C2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/missingPropertiesOfClassExpression.js b/tests/baselines/reference/missingPropertiesOfClassExpression.js index 54834397b64..c1f4480241c 100644 --- a/tests/baselines/reference/missingPropertiesOfClassExpression.js +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.js @@ -15,7 +15,8 @@ var __extends = (this && this.__extends) || function (d, b) { var George = (function (_super) { __extends(George, _super); function George() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return George; }((function () { diff --git a/tests/baselines/reference/moduleAsBaseType.js b/tests/baselines/reference/moduleAsBaseType.js index 71f16846363..598ddaef2de 100644 --- a/tests/baselines/reference/moduleAsBaseType.js +++ b/tests/baselines/reference/moduleAsBaseType.js @@ -13,7 +13,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(M)); diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js index cd2df2633ae..2f4ac430cc1 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js @@ -31,7 +31,8 @@ define(["require", "exports"], function (require, exports) { var Test1 = (function (_super) { __extends(Test1, _super); function Test1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Test1; }(C1)); diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js index ec434286f43..11053d76d2d 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -79,14 +79,16 @@ var A; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(AA)); var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return BB; }(A)); @@ -130,7 +132,8 @@ var Y; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(AA)); @@ -138,7 +141,8 @@ var Y; var BB = (function (_super) { __extends(BB, _super); function BB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return BB; }(A)); diff --git a/tests/baselines/reference/multipleInheritance.js b/tests/baselines/reference/multipleInheritance.js index 26372bfb718..80e9a469398 100644 --- a/tests/baselines/reference/multipleInheritance.js +++ b/tests/baselines/reference/multipleInheritance.js @@ -57,28 +57,32 @@ var B2 = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B1)); var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(B2)); var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(D1)); @@ -90,7 +94,8 @@ var N = (function () { var ND = (function (_super) { __extends(ND, _super); function ND() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ND; }(N)); @@ -104,7 +109,8 @@ var Good = (function () { var Baad = (function (_super) { __extends(Baad, _super); function Baad() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 c8cca671327..7c5ec66c6be 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -25,7 +25,8 @@ var foo = (function () { var foo2 = (function (_super) { __extends(foo2, _super); function foo2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return foo2; }(foo)); diff --git a/tests/baselines/reference/noEmitHelpers.js b/tests/baselines/reference/noEmitHelpers.js index b2c26c6af75..c3d27cac8a9 100644 --- a/tests/baselines/reference/noEmitHelpers.js +++ b/tests/baselines/reference/noEmitHelpers.js @@ -13,7 +13,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js index b9927ebf193..bbab8e9ccdd 100644 --- a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -19,7 +19,8 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar; }(Foo)); // Valid diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js index cef2759e1d5..1901e169447 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -61,7 +61,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { return ''; }; return B; diff --git a/tests/baselines/reference/numericIndexerConstraint3.js b/tests/baselines/reference/numericIndexerConstraint3.js index 9f7a61fe30d..97c3e56d423 100644 --- a/tests/baselines/reference/numericIndexerConstraint3.js +++ b/tests/baselines/reference/numericIndexerConstraint3.js @@ -26,7 +26,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js index a9eace23833..732f7e2672c 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.js +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -26,7 +26,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js index 47fb46794f0..1d38f844384 100644 --- a/tests/baselines/reference/numericIndexerTyping2.js +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -26,7 +26,8 @@ var I = (function () { var I2 = (function (_super) { __extends(I2, _super); function I2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return I2; }(I)); diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index dce09972c83..ddfbce8fc12 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -81,7 +81,8 @@ var Food = (function () { var MonsterFood = (function (_super) { __extends(MonsterFood, _super); function MonsterFood(name, flavor) { - _super.call(this, name); + var _this; + _this = _super.call(this, name) || this; this.flavor = flavor; } return MonsterFood; @@ -89,7 +90,8 @@ var MonsterFood = (function (_super) { var IceCream = (function (_super) { __extends(IceCream, _super); function IceCream(flavor) { - _super.call(this, "Ice Cream", flavor); + var _this; + _this = _super.call(this, "Ice Cream", flavor) || this; this.flavor = flavor; } return IceCream; @@ -97,7 +99,8 @@ var IceCream = (function (_super) { var Cookie = (function (_super) { __extends(Cookie, _super); function Cookie(flavor, isGlutenFree) { - _super.call(this, "Cookie", flavor); + var _this; + _this = _super.call(this, "Cookie", flavor) || this; this.flavor = flavor; this.isGlutenFree = isGlutenFree; } @@ -106,7 +109,8 @@ var Cookie = (function (_super) { var PetFood = (function (_super) { __extends(PetFood, _super); function PetFood(name, whereToBuy) { - _super.call(this, name); + var _this; + _this = _super.call(this, name) || this; this.whereToBuy = whereToBuy; } return PetFood; @@ -114,7 +118,8 @@ var PetFood = (function (_super) { var ExpensiveOrganicDogFood = (function (_super) { __extends(ExpensiveOrganicDogFood, _super); function ExpensiveOrganicDogFood(whereToBuy) { - _super.call(this, "Origen", whereToBuy); + var _this; + _this = _super.call(this, "Origen", whereToBuy) || this; this.whereToBuy = whereToBuy; } return ExpensiveOrganicDogFood; @@ -122,7 +127,8 @@ var ExpensiveOrganicDogFood = (function (_super) { var ExpensiveOrganicCatFood = (function (_super) { __extends(ExpensiveOrganicCatFood, _super); function ExpensiveOrganicCatFood(whereToBuy, containsFish) { - _super.call(this, "Nature's Logic", whereToBuy); + var _this; + _this = _super.call(this, "Nature's Logic", whereToBuy) || this; this.whereToBuy = whereToBuy; this.containsFish = containsFish; } diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index 9c5bcfb8e2d..76c18900945 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -68,7 +68,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js index 29781229b5a..3df18cb27cb 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -147,14 +147,16 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js index 7ecb597a2d9..e7d2f603d5c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -140,7 +140,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -162,14 +163,16 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js index 9710afe700d..e0b75f54208 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -147,14 +147,16 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js index 7d6be5eaf8f..681af407bd4 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -145,14 +145,16 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js index cb9c677f024..2011b741df2 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -53,7 +53,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js index 241fbcaf27e..80bdd4c87e1 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js @@ -39,7 +39,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(C1)); @@ -53,7 +54,8 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C4; }(C3)); diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js index c0578c2fba1..3eac80c60fc 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -147,14 +147,16 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js index 0670d45a5a5..d55ef5eb28c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -140,7 +140,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -162,14 +163,16 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return PB; }(B)); diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index 3e6a47b4de2..04056fa9c14 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -25,7 +25,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/optionalMethods.js b/tests/baselines/reference/optionalMethods.js index 42decf512e4..408f73b6533 100644 --- a/tests/baselines/reference/optionalMethods.js +++ b/tests/baselines/reference/optionalMethods.js @@ -109,7 +109,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.a = 1; } Derived.prototype.f = function () { return 1; }; diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 6d42c38f907..f53f0c74a54 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -161,8 +161,9 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2(v2) { + var _this; if (v2 === void 0) { v2 = 6; } - _super.call(this, v2); + _this = _super.call(this, v2) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js index f6ccdbe3fab..a8bd88ed3a8 100644 --- a/tests/baselines/reference/optionalParamInOverride.js +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -22,7 +22,8 @@ var Z = (function () { var Y = (function (_super) { __extends(Y, _super); function Y() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Y.prototype.func = function (value) { }; return Y; diff --git a/tests/baselines/reference/optionalParameterProperty.js b/tests/baselines/reference/optionalParameterProperty.js index 48cefeef22c..b23da97c790 100644 --- a/tests/baselines/reference/optionalParameterProperty.js +++ b/tests/baselines/reference/optionalParameterProperty.js @@ -25,7 +25,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D(p) { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.p = p; } return D; diff --git a/tests/baselines/reference/outModuleConcatAmd.js b/tests/baselines/reference/outModuleConcatAmd.js index 8a478e675c6..5643875efd3 100644 --- a/tests/baselines/reference/outModuleConcatAmd.js +++ b/tests/baselines/reference/outModuleConcatAmd.js @@ -28,7 +28,8 @@ define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/outModuleConcatAmd.js.map b/tests/baselines/reference/outModuleConcatAmd.js.map index 7f9893b2346..25873d9cd07 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;YAAuB,kDAAC;;QAAG,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 ba7f1d93245..2fa35a323a0 100644 --- a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt @@ -92,34 +92,35 @@ 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); +>>> var _this = _super.apply(this, arguments) || this; 1->^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +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) +2 >Emitted(20, 63) Source(2, 25) + SourceIndex(1) --- +>>> return _this; >>> } 1 >^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> 1 > { 2 > } -1 >Emitted(21, 9) Source(2, 28) + SourceIndex(1) -2 >Emitted(21, 10) Source(2, 29) + SourceIndex(1) +1 >Emitted(22, 9) Source(2, 28) + SourceIndex(1) +2 >Emitted(22, 10) Source(2, 29) + SourceIndex(1) --- >>> return B; 1->^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(22, 9) Source(2, 28) + SourceIndex(1) -2 >Emitted(22, 17) Source(2, 29) + SourceIndex(1) +1->Emitted(23, 9) Source(2, 28) + SourceIndex(1) +2 >Emitted(23, 17) Source(2, 29) + SourceIndex(1) --- >>> }(a_1.A)); 1 >^^^^ @@ -135,20 +136,20 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(23, 5) Source(2, 28) + SourceIndex(1) -2 >Emitted(23, 6) Source(2, 29) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 7) Source(2, 24) + SourceIndex(1) -5 >Emitted(23, 12) Source(2, 25) + SourceIndex(1) -6 >Emitted(23, 15) Source(2, 29) + SourceIndex(1) +1 >Emitted(24, 5) Source(2, 28) + SourceIndex(1) +2 >Emitted(24, 6) Source(2, 29) + SourceIndex(1) +3 >Emitted(24, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(24, 7) Source(2, 24) + SourceIndex(1) +5 >Emitted(24, 12) Source(2, 25) + SourceIndex(1) +6 >Emitted(24, 15) Source(2, 29) + SourceIndex(1) --- >>> exports.B = B; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > export class B extends A { } -1->Emitted(24, 5) Source(2, 1) + SourceIndex(1) -2 >Emitted(24, 19) Source(2, 29) + SourceIndex(1) +1->Emitted(25, 5) Source(2, 1) + SourceIndex(1) +2 >Emitted(25, 19) Source(2, 29) + SourceIndex(1) --- >>>}); >>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatSystem.js b/tests/baselines/reference/outModuleConcatSystem.js index b23b73caf83..eecb4101958 100644 --- a/tests/baselines/reference/outModuleConcatSystem.js +++ b/tests/baselines/reference/outModuleConcatSystem.js @@ -44,7 +44,8 @@ System.register("b", ["ref/a"], function (exports_2, context_2) { B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/outModuleConcatSystem.js.map b/tests/baselines/reference/outModuleConcatSystem.js.map index 59ab70de531..f77bed44ffc 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;oBAAuB,kDAAC;;gBAAG,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 86573493e20..5287a760ac8 100644 --- a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt @@ -109,34 +109,35 @@ 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); +>>> var _this = _super.apply(this, arguments) || this; 1->^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +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) +2 >Emitted(36, 71) Source(2, 25) + SourceIndex(1) --- +>>> return _this; >>> } 1 >^^^^^^^^^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> 1 > { 2 > } -1 >Emitted(37, 17) Source(2, 28) + SourceIndex(1) -2 >Emitted(37, 18) Source(2, 29) + SourceIndex(1) +1 >Emitted(38, 17) Source(2, 28) + SourceIndex(1) +2 >Emitted(38, 18) Source(2, 29) + SourceIndex(1) --- >>> return B; 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(38, 17) Source(2, 28) + SourceIndex(1) -2 >Emitted(38, 25) Source(2, 29) + SourceIndex(1) +1->Emitted(39, 17) Source(2, 28) + SourceIndex(1) +2 >Emitted(39, 25) Source(2, 29) + SourceIndex(1) --- >>> }(a_1.A)); 1 >^^^^^^^^^^^^ @@ -152,12 +153,12 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(39, 13) Source(2, 28) + SourceIndex(1) -2 >Emitted(39, 14) Source(2, 29) + SourceIndex(1) -3 >Emitted(39, 14) Source(2, 1) + SourceIndex(1) -4 >Emitted(39, 15) Source(2, 24) + SourceIndex(1) -5 >Emitted(39, 20) Source(2, 25) + SourceIndex(1) -6 >Emitted(39, 23) Source(2, 29) + SourceIndex(1) +1 >Emitted(40, 13) Source(2, 28) + SourceIndex(1) +2 >Emitted(40, 14) Source(2, 29) + SourceIndex(1) +3 >Emitted(40, 14) Source(2, 1) + SourceIndex(1) +4 >Emitted(40, 15) Source(2, 24) + SourceIndex(1) +5 >Emitted(40, 20) Source(2, 25) + SourceIndex(1) +6 >Emitted(40, 23) Source(2, 29) + SourceIndex(1) --- >>> exports_2("B", B); >>> } @@ -165,8 +166,8 @@ sourceFile:tests/cases/compiler/b.ts 2 > ^ 1-> 2 > -1->Emitted(41, 9) Source(2, 29) + SourceIndex(1) -2 >Emitted(41, 10) Source(2, 30) + SourceIndex(1) +1->Emitted(42, 9) Source(2, 29) + SourceIndex(1) +2 >Emitted(42, 10) Source(2, 30) + SourceIndex(1) --- >>> }; >>>}); diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js b/tests/baselines/reference/outModuleTripleSlashRefs.js index 90f8feab7bc..ac2f2510b64 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.js +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js @@ -57,7 +57,8 @@ define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(a_1.A)); diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js.map b/tests/baselines/reference/outModuleTripleSlashRefs.js.map index c6e1aab6bc8..1cdbef49afa 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;YAAuB,kDAAC;;QAAG,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 8be43826419..e940429a74b 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt +++ b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt @@ -168,34 +168,35 @@ 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); +>>> var _this = _super.apply(this, arguments) || this; 1->^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +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) +2 >Emitted(27, 63) Source(2, 25) + SourceIndex(2) --- +>>> return _this; >>> } 1 >^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> 1 > { 2 > } -1 >Emitted(28, 9) Source(2, 28) + SourceIndex(2) -2 >Emitted(28, 10) Source(2, 29) + SourceIndex(2) +1 >Emitted(29, 9) Source(2, 28) + SourceIndex(2) +2 >Emitted(29, 10) Source(2, 29) + SourceIndex(2) --- >>> return B; 1->^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(29, 9) Source(2, 28) + SourceIndex(2) -2 >Emitted(29, 17) Source(2, 29) + SourceIndex(2) +1->Emitted(30, 9) Source(2, 28) + SourceIndex(2) +2 >Emitted(30, 17) Source(2, 29) + SourceIndex(2) --- >>> }(a_1.A)); 1 >^^^^ @@ -211,20 +212,20 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(30, 5) Source(2, 28) + SourceIndex(2) -2 >Emitted(30, 6) Source(2, 29) + SourceIndex(2) -3 >Emitted(30, 6) Source(2, 1) + SourceIndex(2) -4 >Emitted(30, 7) Source(2, 24) + SourceIndex(2) -5 >Emitted(30, 12) Source(2, 25) + SourceIndex(2) -6 >Emitted(30, 15) Source(2, 29) + SourceIndex(2) +1 >Emitted(31, 5) Source(2, 28) + SourceIndex(2) +2 >Emitted(31, 6) Source(2, 29) + SourceIndex(2) +3 >Emitted(31, 6) Source(2, 1) + SourceIndex(2) +4 >Emitted(31, 7) Source(2, 24) + SourceIndex(2) +5 >Emitted(31, 12) Source(2, 25) + SourceIndex(2) +6 >Emitted(31, 15) Source(2, 29) + SourceIndex(2) --- >>> exports.B = B; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > export class B extends A { } -1->Emitted(31, 5) Source(2, 1) + SourceIndex(2) -2 >Emitted(31, 19) Source(2, 29) + SourceIndex(2) +1->Emitted(32, 5) Source(2, 1) + SourceIndex(2) +2 >Emitted(32, 19) Source(2, 29) + SourceIndex(2) --- >>>}); >>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/overload1.js b/tests/baselines/reference/overload1.js index fd05873c647..d83c8aea7ad 100644 --- a/tests/baselines/reference/overload1.js +++ b/tests/baselines/reference/overload1.js @@ -56,7 +56,8 @@ var O; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -64,7 +65,8 @@ var O; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js index a3b7a329861..ad49f8e9d7a 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -37,7 +37,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -45,7 +46,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -53,7 +55,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.js b/tests/baselines/reference/overloadOnConstConstraintChecks2.js index efb57153b13..2b521b4baf5 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -25,14 +25,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.foo = function () { }; return C; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.js b/tests/baselines/reference/overloadOnConstConstraintChecks3.js index 181f9d8129c..df5e0065adb 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -27,14 +27,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.foo = function () { }; return C; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index d73c59863ad..6a750612395 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -27,7 +27,8 @@ var Z = (function () { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = 1; } return A; @@ -35,14 +36,16 @@ var A = (function (_super) { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C.prototype.foo = function () { }; return C; diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js index c98075c04a1..5d0546d0edc 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -26,7 +26,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -34,7 +35,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -42,7 +44,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/overloadResolution.js b/tests/baselines/reference/overloadResolution.js index 0d25322fdfc..c34d037b350 100644 --- a/tests/baselines/reference/overloadResolution.js +++ b/tests/baselines/reference/overloadResolution.js @@ -108,21 +108,24 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js index 9fa55fe1e95..0a899584c18 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.js +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -115,21 +115,24 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js index 12d8480eefb..42dceff061e 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.js +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -116,21 +116,24 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js index b261201be40..52d8a1b7abe 100644 --- a/tests/baselines/reference/overloadingOnConstants1.js +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -40,7 +40,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -48,7 +49,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -56,7 +58,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived3.prototype.biz = function () { }; return Derived3; diff --git a/tests/baselines/reference/overloadingOnConstants2.js b/tests/baselines/reference/overloadingOnConstants2.js index 977ae7ec5b9..85976ae7fcd 100644 --- a/tests/baselines/reference/overloadingOnConstants2.js +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -42,7 +42,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.js b/tests/baselines/reference/overridingPrivateStaticMembers.js index ddd9fae6429..b7ad5b66554 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.js +++ b/tests/baselines/reference/overridingPrivateStaticMembers.js @@ -21,7 +21,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/parseErrorInHeritageClause1.js b/tests/baselines/reference/parseErrorInHeritageClause1.js index e2f66bfadd7..0a29bdf2da0 100644 --- a/tests/baselines/reference/parseErrorInHeritageClause1.js +++ b/tests/baselines/reference/parseErrorInHeritageClause1.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parser509630.js b/tests/baselines/reference/parser509630.js index 4d94ea619ec..cdef63aa80f 100644 --- a/tests/baselines/reference/parser509630.js +++ b/tests/baselines/reference/parser509630.js @@ -21,7 +21,8 @@ var Type = (function () { var Any = (function (_super) { __extends(Any, _super); function Any() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Any; }(Type)); diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index 41f07380e97..6e6a423fe90 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -318,7 +318,8 @@ var c2 = (function () { var c3 = (function (_super) { __extends(c3, _super); function c3() { - _super.call(this, 10); + var _this; + _this = _super.call(this, 10) || this; this.p1 = _super.prototype.c2_p1; } /** c3 f1*/ @@ -362,7 +363,8 @@ c2_i.nc_f1(); var c4 = (function (_super) { __extends(c4, _super); function c4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return c4; }(c2)); @@ -404,7 +406,8 @@ var c5 = (function () { var c6 = (function (_super) { __extends(c6, _super); function c6() { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.d = _super.prototype.b; } return c6; diff --git a/tests/baselines/reference/parserClassDeclaration1.js b/tests/baselines/reference/parserClassDeclaration1.js index 41ecc9135c0..f91efad621e 100644 --- a/tests/baselines/reference/parserClassDeclaration1.js +++ b/tests/baselines/reference/parserClassDeclaration1.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration3.js b/tests/baselines/reference/parserClassDeclaration3.js index c375b4b5a21..9d51b0ed25e 100644 --- a/tests/baselines/reference/parserClassDeclaration3.js +++ b/tests/baselines/reference/parserClassDeclaration3.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/parserClassDeclaration4.js b/tests/baselines/reference/parserClassDeclaration4.js index f19ac06c35c..7c91281d05c 100644 --- a/tests/baselines/reference/parserClassDeclaration4.js +++ b/tests/baselines/reference/parserClassDeclaration4.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration5.js b/tests/baselines/reference/parserClassDeclaration5.js index 272edc89fb6..aeb7ce09190 100644 --- a/tests/baselines/reference/parserClassDeclaration5.js +++ b/tests/baselines/reference/parserClassDeclaration5.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration6.js b/tests/baselines/reference/parserClassDeclaration6.js index 88d8481d52a..b14257310c4 100644 --- a/tests/baselines/reference/parserClassDeclaration6.js +++ b/tests/baselines/reference/parserClassDeclaration6.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js index b53c41fb45c..c4a2fd29711 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js index 500f6d38c6d..ae9d5068e29 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js index 8c02a996ea5..8992706cd16 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.js b/tests/baselines/reference/parserGenericsInTypeContexts1.js index f6f4f39393f..0ec560c1306 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.js @@ -26,7 +26,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.js b/tests/baselines/reference/parserGenericsInTypeContexts2.js index 99e19586c52..d4c754fb0b1 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.js @@ -26,7 +26,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 255cad3ca21..429a388c894 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -826,7 +826,8 @@ var TypeScript; var NumberLiteralToken = (function (_super) { __extends(NumberLiteralToken, _super); function NumberLiteralToken(value, hasEmptyFraction) { - _super.call(this, TokenID.NumberLiteral); + var _this; + _this = _super.call(this, TokenID.NumberLiteral) || this; this.value = value; this.hasEmptyFraction = hasEmptyFraction; } @@ -842,7 +843,8 @@ var TypeScript; var StringLiteralToken = (function (_super) { __extends(StringLiteralToken, _super); function StringLiteralToken(value) { - _super.call(this, TokenID.StringLiteral); + var _this; + _this = _super.call(this, TokenID.StringLiteral) || this; this.value = value; } StringLiteralToken.prototype.getText = function () { @@ -857,7 +859,8 @@ var TypeScript; var IdentifierToken = (function (_super) { __extends(IdentifierToken, _super); function IdentifierToken(value, hasEscapeSequence) { - _super.call(this, TokenID.Identifier); + var _this; + _this = _super.call(this, TokenID.Identifier) || this; this.value = value; this.hasEscapeSequence = hasEscapeSequence; } @@ -873,7 +876,8 @@ var TypeScript; var WhitespaceToken = (function (_super) { __extends(WhitespaceToken, _super); function WhitespaceToken(tokenId, value) { - _super.call(this, tokenId); + var _this; + _this = _super.call(this, tokenId) || this; this.value = value; } WhitespaceToken.prototype.getText = function () { @@ -888,7 +892,8 @@ var TypeScript; var CommentToken = (function (_super) { __extends(CommentToken, _super); function CommentToken(tokenID, value, isBlock, startPos, line, endsLine) { - _super.call(this, tokenID); + var _this; + _this = _super.call(this, tokenID) || this; this.value = value; this.isBlock = isBlock; this.startPos = startPos; @@ -907,7 +912,8 @@ var TypeScript; var RegularExpressionLiteralToken = (function (_super) { __extends(RegularExpressionLiteralToken, _super); function RegularExpressionLiteralToken(regex) { - _super.call(this, TokenID.RegularExpressionLiteral); + var _this; + _this = _super.call(this, TokenID.RegularExpressionLiteral) || this; this.regex = regex; } RegularExpressionLiteralToken.prototype.getText = function () { diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index 0c1d1064255..4be1ed20767 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2386,7 +2386,8 @@ var TypeScript; var AST = (function (_super) { __extends(AST, _super); function AST(nodeType) { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.nodeType = nodeType; this.type = null; this.flags = ASTFlags.Writeable; @@ -2542,7 +2543,8 @@ var TypeScript; var IncompleteAST = (function (_super) { __extends(IncompleteAST, _super); function IncompleteAST(min, lim) { - _super.call(this, NodeType.Error); + var _this; + _this = _super.call(this, NodeType.Error) || this; this.minChar = min; this.limChar = lim; } @@ -2552,7 +2554,8 @@ var TypeScript; var ASTList = (function (_super) { __extends(ASTList, _super); function ASTList() { - _super.call(this, NodeType.List); + var _this; + _this = _super.call(this, NodeType.List) || this; this.enclosingScope = null; this.members = new AST[]; } @@ -2619,7 +2622,8 @@ 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); + var _this; + _this = _super.call(this, NodeType.Name) || this; this.actualText = actualText; this.hasEscapeSequence = hasEscapeSequence; this.sym = null; @@ -2663,7 +2667,8 @@ var TypeScript; var MissingIdentifier = (function (_super) { __extends(MissingIdentifier, _super); function MissingIdentifier() { - _super.call(this, "__missing"); + var _this; + _this = _super.call(this, "__missing") || this; } MissingIdentifier.prototype.isMissing = function () { return true; @@ -2677,7 +2682,8 @@ var TypeScript; var Label = (function (_super) { __extends(Label, _super); function Label(id) { - _super.call(this, NodeType.Label); + var _this; + _this = _super.call(this, NodeType.Label) || this; this.id = id; } Label.prototype.printLabel = function () { return this.id.actualText + ":"; }; @@ -2701,7 +2707,8 @@ var TypeScript; var Expression = (function (_super) { __extends(Expression, _super); function Expression(nodeType) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; } Expression.prototype.isExpression = function () { return true; }; Expression.prototype.isStatementOrExpression = function () { return true; }; @@ -2711,7 +2718,8 @@ var TypeScript; var UnaryExpression = (function (_super) { __extends(UnaryExpression, _super); function UnaryExpression(nodeType, operand) { - _super.call(this, nodeType); + var _this; + _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; @@ -2855,7 +2863,8 @@ var TypeScript; var CallExpression = (function (_super) { __extends(CallExpression, _super); function CallExpression(nodeType, target, arguments) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; this.target = target; this.arguments = arguments; this.signature = null; @@ -2887,7 +2896,8 @@ var TypeScript; var BinaryExpression = (function (_super) { __extends(BinaryExpression, _super); function BinaryExpression(nodeType, operand1, operand2) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; this.operand1 = operand1; this.operand2 = operand2; } @@ -3039,7 +3049,8 @@ var TypeScript; var ConditionalExpression = (function (_super) { __extends(ConditionalExpression, _super); function ConditionalExpression(operand1, operand2, operand3) { - _super.call(this, NodeType.ConditionalExpression); + var _this; + _this = _super.call(this, NodeType.ConditionalExpression) || this; this.operand1 = operand1; this.operand2 = operand2; this.operand3 = operand3; @@ -3064,7 +3075,8 @@ var TypeScript; var NumberLiteral = (function (_super) { __extends(NumberLiteral, _super); function NumberLiteral(value, hasEmptyFraction) { - _super.call(this, NodeType.NumberLit); + var _this; + _this = _super.call(this, NodeType.NumberLit) || this; this.value = value; this.hasEmptyFraction = hasEmptyFraction; this.isNegativeZero = false; @@ -3105,7 +3117,8 @@ var TypeScript; var RegexLiteral = (function (_super) { __extends(RegexLiteral, _super); function RegexLiteral(regex) { - _super.call(this, NodeType.Regex); + var _this; + _this = _super.call(this, NodeType.Regex) || this; this.regex = regex; } RegexLiteral.prototype.typeCheck = function (typeFlow) { @@ -3125,7 +3138,8 @@ var TypeScript; var StringLiteral = (function (_super) { __extends(StringLiteral, _super); function StringLiteral(text) { - _super.call(this, NodeType.QString); + var _this; + _this = _super.call(this, NodeType.QString) || this; this.text = text; } StringLiteral.prototype.emit = function (emitter, tokenId, startLine) { @@ -3151,7 +3165,8 @@ var TypeScript; var ModuleElement = (function (_super) { __extends(ModuleElement, _super); function ModuleElement(nodeType) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; } return ModuleElement; }(AST)); @@ -3159,7 +3174,8 @@ var TypeScript; var ImportDeclaration = (function (_super) { __extends(ImportDeclaration, _super); function ImportDeclaration(id, alias) { - _super.call(this, NodeType.ImportDeclaration); + var _this; + _this = _super.call(this, NodeType.ImportDeclaration) || this; this.id = id; this.alias = alias; this.varFlags = VarFlags.None; @@ -3218,7 +3234,8 @@ var TypeScript; var BoundDecl = (function (_super) { __extends(BoundDecl, _super); function BoundDecl(id, nodeType, nestingLevel) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; this.id = id; this.nestingLevel = nestingLevel; this.init = null; @@ -3242,7 +3259,8 @@ var TypeScript; var VarDecl = (function (_super) { __extends(VarDecl, _super); function VarDecl(id, nest) { - _super.call(this, id, NodeType.VarDecl, nest); + var _this; + _this = _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,7 +3277,8 @@ var TypeScript; var ArgDecl = (function (_super) { __extends(ArgDecl, _super); function ArgDecl(id) { - _super.call(this, id, NodeType.ArgDecl, 0); + var _this; + _this = _super.call(this, id, NodeType.ArgDecl, 0) || this; this.isOptional = false; this.parameterPropertySym = null; } @@ -3281,7 +3300,8 @@ var TypeScript; var FuncDecl = (function (_super) { __extends(FuncDecl, _super); function FuncDecl(name, bod, isConstructor, arguments, vars, scopes, statics, nodeType) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; this.name = name; this.bod = bod; this.isConstructor = isConstructor; @@ -3421,7 +3441,8 @@ 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); + var _this; + _this = _super.call(this, new Identifier("script"), null, false, null, vars, scopes, null, NodeType.Script) || this; this.locationInfo = null; this.referencedFiles = []; this.requiresGlobal = false; @@ -3490,7 +3511,8 @@ var TypeScript; var NamedDeclaration = (function (_super) { __extends(NamedDeclaration, _super); function NamedDeclaration(nodeType, name, members) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; this.name = name; this.members = members; this.leftCurlyCount = 0; @@ -3502,7 +3524,8 @@ var TypeScript; var ModuleDeclaration = (function (_super) { __extends(ModuleDeclaration, _super); function ModuleDeclaration(name, members, vars, scopes, endingToken) { - _super.call(this, NodeType.ModuleDeclaration, name, members); + var _this; + _this = _super.call(this, NodeType.ModuleDeclaration, name, members) || this; this.endingToken = endingToken; this.modFlags = ModuleFlags.ShouldEmitModuleDecl; this.amdDependencies = []; @@ -3537,7 +3560,8 @@ var TypeScript; var TypeDeclaration = (function (_super) { __extends(TypeDeclaration, _super); function TypeDeclaration(nodeType, name, extendsList, implementsList, members) { - _super.call(this, nodeType, name, members); + var _this; + _this = _super.call(this, nodeType, name, members) || this; this.extendsList = extendsList; this.implementsList = implementsList; this.varFlags = VarFlags.None; @@ -3554,7 +3578,8 @@ var TypeScript; var ClassDeclaration = (function (_super) { __extends(ClassDeclaration, _super); function ClassDeclaration(name, members, extendsList, implementsList) { - _super.call(this, NodeType.ClassDeclaration, name, extendsList, implementsList, members); + var _this; + _this = _super.call(this, NodeType.ClassDeclaration, name, extendsList, implementsList, members) || this; this.knownMemberNames = {}; this.constructorDecl = null; this.constructorNestingLevel = 0; @@ -3572,7 +3597,8 @@ var TypeScript; var InterfaceDeclaration = (function (_super) { __extends(InterfaceDeclaration, _super); function InterfaceDeclaration(name, members, extendsList, implementsList) { - _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members); + var _this; + _this = _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) || this; } InterfaceDeclaration.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckInterface(this); @@ -3585,7 +3611,8 @@ var TypeScript; var Statement = (function (_super) { __extends(Statement, _super); function Statement(nodeType) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; this.flags |= ASTFlags.IsStatement; } Statement.prototype.isLoop = function () { return false; }; @@ -3601,7 +3628,8 @@ var TypeScript; var LabeledStatement = (function (_super) { __extends(LabeledStatement, _super); function LabeledStatement(labels, stmt) { - _super.call(this, NodeType.LabeledStatement); + var _this; + _this = _super.call(this, NodeType.LabeledStatement) || this; this.labels = labels; this.stmt = stmt; } @@ -3635,7 +3663,8 @@ var TypeScript; var Block = (function (_super) { __extends(Block, _super); function Block(statements, isStatementBlock) { - _super.call(this, NodeType.Block); + var _this; + _this = _super.call(this, NodeType.Block) || this; this.statements = statements; this.isStatementBlock = isStatementBlock; } @@ -3690,7 +3719,8 @@ var TypeScript; var Jump = (function (_super) { __extends(Jump, _super); function Jump(nodeType) { - _super.call(this, nodeType); + var _this; + _this = _super.call(this, nodeType) || this; this.target = null; this.resolvedTarget = null; } @@ -3741,7 +3771,8 @@ var TypeScript; var WhileStatement = (function (_super) { __extends(WhileStatement, _super); function WhileStatement(cond) { - _super.call(this, NodeType.While); + var _this; + _this = _super.call(this, NodeType.While) || this; this.cond = cond; this.body = null; } @@ -3793,7 +3824,8 @@ var TypeScript; var DoWhileStatement = (function (_super) { __extends(DoWhileStatement, _super); function DoWhileStatement() { - _super.call(this, NodeType.DoWhile); + var _this; + _this = _super.call(this, NodeType.DoWhile) || this; this.body = null; this.whileAST = null; this.cond = null; @@ -3849,7 +3881,8 @@ var TypeScript; var IfStatement = (function (_super) { __extends(IfStatement, _super); function IfStatement(cond) { - _super.call(this, NodeType.If); + var _this; + _this = _super.call(this, NodeType.If) || this; this.cond = cond; this.elseBod = null; this.statement = new ASTSpan(); @@ -3927,7 +3960,8 @@ var TypeScript; var ReturnStatement = (function (_super) { __extends(ReturnStatement, _super); function ReturnStatement() { - _super.call(this, NodeType.Return); + var _this; + _this = _super.call(this, NodeType.Return) || this; this.returnExpression = null; } ReturnStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -3958,7 +3992,8 @@ var TypeScript; var EndCode = (function (_super) { __extends(EndCode, _super); function EndCode() { - _super.call(this, NodeType.EndCode); + var _this; + _this = _super.call(this, NodeType.EndCode) || this; } return EndCode; }(AST)); @@ -3966,7 +4001,8 @@ var TypeScript; var ForInStatement = (function (_super) { __extends(ForInStatement, _super); function ForInStatement(lval, obj) { - _super.call(this, NodeType.ForIn); + var _this; + _this = _super.call(this, NodeType.ForIn) || this; this.lval = lval; this.obj = obj; this.statement = new ASTSpan(); @@ -4081,7 +4117,8 @@ var TypeScript; var ForStatement = (function (_super) { __extends(ForStatement, _super); function ForStatement(init) { - _super.call(this, NodeType.For); + var _this; + _this = _super.call(this, NodeType.For) || this; this.init = init; } ForStatement.prototype.isLoop = function () { return true; }; @@ -4172,7 +4209,8 @@ var TypeScript; var WithStatement = (function (_super) { __extends(WithStatement, _super); function WithStatement(expr) { - _super.call(this, NodeType.With); + var _this; + _this = _super.call(this, NodeType.With) || this; this.expr = expr; this.withSym = null; } @@ -4198,7 +4236,8 @@ var TypeScript; var SwitchStatement = (function (_super) { __extends(SwitchStatement, _super); function SwitchStatement(val) { - _super.call(this, NodeType.Switch); + var _this; + _this = _super.call(this, NodeType.Switch) || this; this.val = val; this.defaultCase = null; this.statement = new ASTSpan(); @@ -4270,7 +4309,8 @@ var TypeScript; var CaseStatement = (function (_super) { __extends(CaseStatement, _super); function CaseStatement() { - _super.call(this, NodeType.Case); + var _this; + _this = _super.call(this, NodeType.Case) || this; this.expr = null; } CaseStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -4323,7 +4363,8 @@ var TypeScript; var TypeReference = (function (_super) { __extends(TypeReference, _super); function TypeReference(term, arrayCount) { - _super.call(this, NodeType.TypeRef); + var _this; + _this = _super.call(this, NodeType.TypeRef) || this; this.term = term; this.arrayCount = arrayCount; } @@ -4353,7 +4394,8 @@ var TypeScript; var TryFinally = (function (_super) { __extends(TryFinally, _super); function TryFinally(tryNode, finallyNode) { - _super.call(this, NodeType.TryFinally); + var _this; + _this = _super.call(this, NodeType.TryFinally) || this; this.tryNode = tryNode; this.finallyNode = finallyNode; } @@ -4398,7 +4440,8 @@ var TypeScript; var TryCatch = (function (_super) { __extends(TryCatch, _super); function TryCatch(tryNode, catchNode) { - _super.call(this, NodeType.TryCatch); + var _this; + _this = _super.call(this, NodeType.TryCatch) || this; this.tryNode = tryNode; this.catchNode = catchNode; } @@ -4448,7 +4491,8 @@ var TypeScript; var Try = (function (_super) { __extends(Try, _super); function Try(body) { - _super.call(this, NodeType.Try); + var _this; + _this = _super.call(this, NodeType.Try) || this; this.body = body; } Try.prototype.emit = function (emitter, tokenId, startLine) { @@ -4476,7 +4520,8 @@ var TypeScript; var Catch = (function (_super) { __extends(Catch, _super); function Catch(param, body) { - _super.call(this, NodeType.Catch); + var _this; + _this = _super.call(this, NodeType.Catch) || this; this.param = param; this.body = body; this.statement = new ASTSpan(); @@ -4549,7 +4594,8 @@ var TypeScript; var Finally = (function (_super) { __extends(Finally, _super); function Finally(body) { - _super.call(this, NodeType.Finally); + var _this; + _this = _super.call(this, NodeType.Finally) || this; this.body = body; } Finally.prototype.emit = function (emitter, tokenId, startLine) { @@ -4577,7 +4623,8 @@ var TypeScript; var Comment = (function (_super) { __extends(Comment, _super); function Comment(content, isBlockComment, endsLine) { - _super.call(this, NodeType.Comment); + var _this; + _this = _super.call(this, NodeType.Comment) || this; this.content = content; this.isBlockComment = isBlockComment; this.endsLine = endsLine; @@ -4603,7 +4650,8 @@ var TypeScript; var DebuggerStatement = (function (_super) { __extends(DebuggerStatement, _super); function DebuggerStatement() { - _super.call(this, NodeType.Debugger); + var _this; + _this = _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 1a525c49d19..3f7e05e7164 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2380,7 +2380,8 @@ var Harness; var TestCase = (function (_super) { __extends(TestCase, _super); function TestCase(description, block) { - _super.call(this, description, block); + var _this; + _this = _super.call(this, description, block) || this; this.description = description; this.block = block; } @@ -2414,7 +2415,8 @@ var Harness; var Scenario = (function (_super) { __extends(Scenario, _super); function Scenario(description, block) { - _super.call(this, description, block); + var _this; + _this = _super.call(this, description, block) || this; this.description = description; this.block = block; } @@ -2469,7 +2471,8 @@ var Harness; var Run = (function (_super) { __extends(Run, _super); function Run() { - _super.call(this, 'Test Run', null); + var _this; + _this = _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 caf41fe2708..5425696b133 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -63,7 +63,8 @@ var baz = (function () { var foo = (function (_super) { __extends(foo, _super); function foo() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } foo.prototype.bar = function () { return undefined; }; ; diff --git a/tests/baselines/reference/privacyClass.js b/tests/baselines/reference/privacyClass.js index a149aa26f75..8181d0612a8 100644 --- a/tests/baselines/reference/privacyClass.js +++ b/tests/baselines/reference/privacyClass.js @@ -152,21 +152,24 @@ var m1; var m1_C1_private = (function (_super) { __extends(m1_C1_private, _super); function m1_C1_private() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _this; } return m1_C3_public; }(m1_c_public)); @@ -174,7 +177,8 @@ var m1; var m1_C4_public = (function (_super) { __extends(m1_C4_public, _super); function m1_C4_public() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return m1_C4_public; }(m1_c_private)); @@ -204,21 +208,24 @@ var m1; var m1_C9_private = (function (_super) { __extends(m1_C9_private, _super); function m1_C9_private() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _this; } return m1_C11_public; }(m1_c_public)); @@ -226,7 +233,8 @@ var m1; var m1_C12_public = (function (_super) { __extends(m1_C12_public, _super); function m1_C12_public() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return m1_C12_public; }(m1_c_private)); @@ -250,21 +258,24 @@ var m2; var m2_C1_private = (function (_super) { __extends(m2_C1_private, _super); function m2_C1_private() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _this; } return m2_C3_public; }(m2_c_public)); @@ -272,7 +283,8 @@ var m2; var m2_C4_public = (function (_super) { __extends(m2_C4_public, _super); function m2_C4_public() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return m2_C4_public; }(m2_c_private)); @@ -302,21 +314,24 @@ var m2; var m2_C9_private = (function (_super) { __extends(m2_C9_private, _super); function m2_C9_private() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _this; } return m2_C11_public; }(m2_c_public)); @@ -324,7 +339,8 @@ var m2; var m2_C12_public = (function (_super) { __extends(m2_C12_public, _super); function m2_C12_public() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return m2_C12_public; }(m2_c_private)); @@ -346,21 +362,24 @@ var glo_c_private = (function () { var glo_C1_private = (function (_super) { __extends(glo_C1_private, _super); function glo_C1_private() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _this; } return glo_C3_public; }(glo_c_public)); @@ -368,7 +387,8 @@ 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); + var _this = _super.apply(this, arguments) || this; + return _this; } return glo_C4_public; }(glo_c_private)); @@ -398,21 +418,24 @@ 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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _this; } return glo_C11_public; }(glo_c_public)); @@ -420,7 +443,8 @@ 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); + var _this = _super.apply(this, arguments) || this; + return _this; } return glo_C12_public; }(glo_c_private)); diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js index e2bb58781de..fe3ae6ba6d0 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js @@ -122,21 +122,24 @@ var publicModule; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingPublicClassInModule; }(publicClassInPublicModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPublicClassInModule; }(publicClassInPublicModule)); @@ -144,7 +147,8 @@ var publicModule; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); @@ -152,14 +156,16 @@ var publicModule; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -183,21 +189,24 @@ var privateModule; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingPublicClassInModule; }(publicClassInPrivateModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPrivateModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPublicClassInModule; }(publicClassInPrivateModule)); @@ -205,7 +214,8 @@ var privateModule; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPrivateModule)); @@ -213,14 +223,16 @@ var privateModule; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -242,21 +254,24 @@ var privateClass = (function () { var privateClassExtendingPublicClass = (function (_super) { __extends(privateClassExtendingPublicClass, _super); function privateClassExtendingPublicClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingPublicClass; }(publicClass)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingPrivateClassInModule; }(privateClass)); var publicClassExtendingPublicClass = (function (_super) { __extends(publicClassExtendingPublicClass, _super); function publicClassExtendingPublicClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPublicClass; }(publicClass)); @@ -264,7 +279,8 @@ exports.publicClassExtendingPublicClass = publicClassExtendingPublicClass; var publicClassExtendingPrivateClass = (function (_super) { __extends(publicClassExtendingPrivateClass, _super); function publicClassExtendingPrivateClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPrivateClass; }(privateClass)); @@ -272,14 +288,16 @@ exports.publicClassExtendingPrivateClass = publicClassExtendingPrivateClass; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -308,21 +326,24 @@ var publicModuleInGlobal; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingPublicClassInModule; }(publicClassInPublicModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPublicClassInModule; }(publicClassInPublicModule)); @@ -330,7 +351,8 @@ var publicModuleInGlobal; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); @@ -344,7 +366,8 @@ var publicClassInGlobal = (function () { var publicClassExtendingPublicClassInGlobal = (function (_super) { __extends(publicClassExtendingPublicClassInGlobal, _super); function publicClassExtendingPublicClassInGlobal() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return publicClassExtendingPublicClassInGlobal; }(publicClassInGlobal)); diff --git a/tests/baselines/reference/privacyGloClass.js b/tests/baselines/reference/privacyGloClass.js index e8c8c447cf9..481a3921921 100644 --- a/tests/baselines/reference/privacyGloClass.js +++ b/tests/baselines/reference/privacyGloClass.js @@ -84,21 +84,24 @@ var m1; var m1_C1_private = (function (_super) { __extends(m1_C1_private, _super); function m1_C1_private() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _this; } return m1_C3_public; }(m1_c_public)); @@ -106,7 +109,8 @@ var m1; var m1_C4_public = (function (_super) { __extends(m1_C4_public, _super); function m1_C4_public() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return m1_C4_public; }(m1_c_private)); @@ -136,21 +140,24 @@ var m1; var m1_C9_private = (function (_super) { __extends(m1_C9_private, _super); function m1_C9_private() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _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); + var _this = _super.apply(this, arguments) || this; + return _this; } return m1_C11_public; }(m1_c_public)); @@ -158,7 +165,8 @@ var m1; var m1_C12_public = (function (_super) { __extends(m1_C12_public, _super); function m1_C12_public() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return m1_C12_public; }(m1_c_private)); @@ -174,7 +182,8 @@ var glo_c_public = (function () { var glo_C3_public = (function (_super) { __extends(glo_C3_public, _super); function glo_C3_public() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return glo_C3_public; }(glo_c_public)); @@ -186,7 +195,8 @@ var glo_C7_public = (function () { var glo_C11_public = (function (_super) { __extends(glo_C11_public, _super); function glo_C11_public() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return glo_C11_public; }(glo_c_public)); diff --git a/tests/baselines/reference/privateAccessInSubclass1.js b/tests/baselines/reference/privateAccessInSubclass1.js index 188c3149fd0..ca432ee7ab7 100644 --- a/tests/baselines/reference/privateAccessInSubclass1.js +++ b/tests/baselines/reference/privateAccessInSubclass1.js @@ -23,7 +23,8 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.myMethod = function () { this.options; diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index 8fbe5121136..cfdc137aedf 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -27,7 +27,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.x = _super.prototype.foo; // error this.z = _super.prototype.foo; // error } diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js index 058a6ba1b65..8b516a5a19c 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js @@ -40,7 +40,8 @@ var K = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 352256ac9bd..aad41d01b07 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -22,7 +22,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.bing = function () { return Base.foo; }; // error } return Derived; diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index 7ed6f3d6792..44adec751bf 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -29,7 +29,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 3b6e407d045..ed9768b06c2 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js @@ -14,7 +14,8 @@ var m2; var class1 = (function (_super) { __extends(class1, _super); function class1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class1; }(m2.mExported.me.class1)); @@ -27,7 +28,8 @@ var m2; var class2 = (function (_super) { __extends(class2, _super); function class2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class2; }(m2.mExported.me.class1)); @@ -40,7 +42,8 @@ var m2; var class3 = (function (_super) { __extends(class3, _super); function class3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class3; }(mNonExported.mne.class1)); @@ -53,7 +56,8 @@ var m2; var class4 = (function (_super) { __extends(class4, _super); function class4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 3b6e407d045..ed9768b06c2 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js @@ -14,7 +14,8 @@ var m2; var class1 = (function (_super) { __extends(class1, _super); function class1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class1; }(m2.mExported.me.class1)); @@ -27,7 +28,8 @@ var m2; var class2 = (function (_super) { __extends(class2, _super); function class2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class2; }(m2.mExported.me.class1)); @@ -40,7 +42,8 @@ var m2; var class3 = (function (_super) { __extends(class3, _super); function class3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class3; }(mNonExported.mne.class1)); @@ -53,7 +56,8 @@ var m2; var class4 = (function (_super) { __extends(class4, _super); function class4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 6a07c9a92ca..deb73448794 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -18,7 +18,8 @@ var m; var child = (function (_super) { __extends(child, _super); function child() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 6a07c9a92ca..deb73448794 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -18,7 +18,8 @@ var m; var child = (function (_super) { __extends(child, _super); function child() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 64a207a7cad..b5147a28919 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js @@ -7,7 +7,8 @@ var __extends = (this && this.__extends) || function (d, b) { var ClassC = (function (_super) { __extends(ClassC, _super); function ClassC() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 64a207a7cad..b5147a28919 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js @@ -7,7 +7,8 @@ var __extends = (this && this.__extends) || function (d, b) { var ClassC = (function (_super) { __extends(ClassC, _super); function ClassC() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ClassC; }(test.ClassA)); diff --git a/tests/baselines/reference/propertiesAndIndexers.js b/tests/baselines/reference/propertiesAndIndexers.js index 591c4760e58..a22f9663754 100644 --- a/tests/baselines/reference/propertiesAndIndexers.js +++ b/tests/baselines/reference/propertiesAndIndexers.js @@ -65,7 +65,8 @@ var P = (function () { var Q = (function (_super) { __extends(Q, _super); function Q() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Q; }(P)); diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index 2dbb316d848..31b90bcf7ac 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -164,7 +164,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index bbd2def2206..c570642a1ba 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -97,7 +97,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { return ''; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js index 76da06166d4..aebdc2c3ce3 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -72,7 +72,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { return ''; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js index c49153c59b0..442ae29e278 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -59,7 +59,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { return ''; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js index 255c05ac3ac..40a1365b7e1 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js @@ -52,7 +52,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(C.prototype, "y", { get: function () { return this.x; }, @@ -93,7 +94,8 @@ var C = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return E; }(C)); diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js index 02ad29bd312..e6c768a6759 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js @@ -147,7 +147,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.prototype.method1 = function () { var B = (function () { @@ -173,7 +174,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived2.prototype.method2 = function () { var C = (function () { @@ -199,7 +201,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived3.prototype.method3 = function () { var D = (function () { @@ -225,7 +228,8 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived4.prototype.method4 = function () { var E = (function () { diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js index a87f67e15f2..3f46b69ecf3 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js @@ -34,7 +34,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 05dc85e251e..44a4fbdf284 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js @@ -120,7 +120,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.prototype.method1 = function () { var b; @@ -139,7 +140,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived2.prototype.method2 = function () { var b; @@ -158,7 +160,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived3.prototype.method3 = function () { var b; @@ -177,7 +180,8 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived4.prototype.method4 = function () { var b; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js index 6675589226e..4cc09bac99d 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js @@ -30,7 +30,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 eba89aac28e..003e2f50e6f 100644 --- a/tests/baselines/reference/protectedInstanceMemberAccessibility.js +++ b/tests/baselines/reference/protectedInstanceMemberAccessibility.js @@ -61,7 +61,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.g = function () { var t1 = this.x; @@ -93,7 +94,8 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/protectedMembers.js b/tests/baselines/reference/protectedMembers.js index dcc68e0c946..984527b2c0d 100644 --- a/tests/baselines/reference/protectedMembers.js +++ b/tests/baselines/reference/protectedMembers.js @@ -137,7 +137,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C2.prototype.f = function () { return _super.prototype.f.call(this) + this.x; @@ -151,7 +152,8 @@ var C2 = (function (_super) { var C3 = (function (_super) { __extends(C3, _super); function C3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } C3.prototype.f = function () { return _super.prototype.f.call(this); @@ -187,14 +189,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 +212,8 @@ var C = (function (_super) { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -239,7 +244,8 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A2)); @@ -252,7 +258,8 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A3)); diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js index 323a5a2f2b6..a272ad42fa1 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js @@ -63,7 +63,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.staticMethod1 = function () { Base.x; // OK, accessed within a class derived from their declaring class @@ -76,7 +77,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived2.staticMethod2 = function () { Base.x; // OK, accessed within a class derived from their declaring class @@ -89,7 +91,8 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 1295dc7448e..2add5e7e154 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js @@ -38,7 +38,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.staticMethod1 = function () { this.x; // OK, accessed within a class derived from their declaring class @@ -49,7 +50,8 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 f396c2483e8..225acf74bbe 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,8 @@ var Alpha; var Beta = (function (_super) { __extends(Beta, _super); function Beta() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Beta; }(Alpha.x)); diff --git a/tests/baselines/reference/readonlyConstructorAssignment.js b/tests/baselines/reference/readonlyConstructorAssignment.js index 40c292e4ce8..1c1e2a94ff1 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.js +++ b/tests/baselines/reference/readonlyConstructorAssignment.js @@ -56,7 +56,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; // Fails, x is readonly this.x = 1; } @@ -67,7 +68,8 @@ 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); + var _this; + _this = _super.call(this, x) || this; this.x = x; this.x = 1; } @@ -84,7 +86,8 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E(x) { - _super.call(this, x); + var _this; + _this = _super.call(this, x) || this; this.x = x; this.x = 1; } diff --git a/tests/baselines/reference/recursiveBaseCheck3.js b/tests/baselines/reference/recursiveBaseCheck3.js index b032ce6774d..5b3e829d2e6 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.js +++ b/tests/baselines/reference/recursiveBaseCheck3.js @@ -13,14 +13,16 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return A; }(C)); var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/recursiveBaseCheck4.js b/tests/baselines/reference/recursiveBaseCheck4.js index 07ba40c68b1..b515c7ab318 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.js +++ b/tests/baselines/reference/recursiveBaseCheck4.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var M = (function (_super) { __extends(M, _super); function M() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return M; }(M)); diff --git a/tests/baselines/reference/recursiveBaseCheck6.js b/tests/baselines/reference/recursiveBaseCheck6.js index 5b880c294b7..1871eff20d4 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.js +++ b/tests/baselines/reference/recursiveBaseCheck6.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var S18 = (function (_super) { __extends(S18, _super); function S18() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return S18; }(S18)); diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index dd79ba068bb..c2f884aa8e4 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -21,7 +21,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(C1)); diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js index 62e5958715e..f84c7ad3dae 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js @@ -28,7 +28,8 @@ var TypeScript2; var MemberNameArray = (function (_super) { __extends(MemberNameArray, _super); function MemberNameArray() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MemberNameArray; }(MemberName)); diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index 3aa066d158d..2baa854e462 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -190,7 +190,8 @@ var Sample; var Mode = (function (_super) { __extends(Mode, _super); function Mode() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } // scenario 2 Mode.prototype.getInitialState = function () { diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index 7e0b27b82b4..56c0fc4e6eb 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;wBAA0B,kDAAY;;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 diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt index 7e9da7dddf3..9656c078343 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -1692,18 +1692,19 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> function Mode() { 1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(87, 21) Source(91, 2) + SourceIndex(0) --- ->>> _super.apply(this, arguments); +>>> var _this = _super.apply(this, arguments) || this; 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +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) +2 >Emitted(88, 75) Source(91, 40) + SourceIndex(0) --- +>>> return _this; >>> } 1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^ @@ -1718,8 +1719,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(89, 21) Source(99, 2) + SourceIndex(0) -2 >Emitted(89, 22) Source(99, 3) + SourceIndex(0) +1 >Emitted(90, 21) Source(99, 2) + SourceIndex(0) +2 >Emitted(90, 22) Source(99, 3) + SourceIndex(0) --- >>> // scenario 2 1->^^^^^^^^^^^^^^^^^^^^ @@ -1727,8 +1728,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > // scenario 2 -1->Emitted(90, 21) Source(93, 3) + SourceIndex(0) -2 >Emitted(90, 34) Source(93, 16) + SourceIndex(0) +1->Emitted(91, 21) Source(93, 3) + SourceIndex(0) +2 >Emitted(91, 34) Source(93, 16) + SourceIndex(0) --- >>> Mode.prototype.getInitialState = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1738,9 +1739,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getInitialState 3 > -1->Emitted(91, 21) Source(94, 10) + SourceIndex(0) -2 >Emitted(91, 51) Source(94, 25) + SourceIndex(0) -3 >Emitted(91, 54) Source(94, 3) + SourceIndex(0) +1->Emitted(92, 21) Source(94, 10) + SourceIndex(0) +2 >Emitted(92, 51) Source(94, 25) + SourceIndex(0) +3 >Emitted(92, 54) Source(94, 3) + SourceIndex(0) --- >>> return new State(self); 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1762,15 +1763,15 @@ sourceFile:recursiveClassReferenceTest.ts 7 > self 8 > ) 9 > ; -1 >Emitted(92, 25) Source(95, 4) + SourceIndex(0) -2 >Emitted(92, 31) Source(95, 10) + SourceIndex(0) -3 >Emitted(92, 32) Source(95, 11) + SourceIndex(0) -4 >Emitted(92, 36) Source(95, 15) + SourceIndex(0) -5 >Emitted(92, 41) Source(95, 20) + SourceIndex(0) -6 >Emitted(92, 42) Source(95, 21) + SourceIndex(0) -7 >Emitted(92, 46) Source(95, 25) + SourceIndex(0) -8 >Emitted(92, 47) Source(95, 26) + SourceIndex(0) -9 >Emitted(92, 48) Source(95, 27) + SourceIndex(0) +1 >Emitted(93, 25) Source(95, 4) + SourceIndex(0) +2 >Emitted(93, 31) Source(95, 10) + SourceIndex(0) +3 >Emitted(93, 32) Source(95, 11) + SourceIndex(0) +4 >Emitted(93, 36) Source(95, 15) + SourceIndex(0) +5 >Emitted(93, 41) Source(95, 20) + SourceIndex(0) +6 >Emitted(93, 42) Source(95, 21) + SourceIndex(0) +7 >Emitted(93, 46) Source(95, 25) + SourceIndex(0) +8 >Emitted(93, 47) Source(95, 26) + SourceIndex(0) +9 >Emitted(93, 48) Source(95, 27) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1779,8 +1780,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(93, 21) Source(96, 3) + SourceIndex(0) -2 >Emitted(93, 22) Source(96, 4) + SourceIndex(0) +1 >Emitted(94, 21) Source(96, 3) + SourceIndex(0) +2 >Emitted(94, 22) Source(96, 4) + SourceIndex(0) --- >>> return Mode; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1791,8 +1792,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(94, 21) Source(99, 2) + SourceIndex(0) -2 >Emitted(94, 32) Source(99, 3) + SourceIndex(0) +1->Emitted(95, 21) Source(99, 2) + SourceIndex(0) +2 >Emitted(95, 32) Source(99, 3) + SourceIndex(0) --- >>> }(AbstractMode)); 1->^^^^^^^^^^^^^^^^ @@ -1816,12 +1817,12 @@ sourceFile:recursiveClassReferenceTest.ts > > > } -1->Emitted(95, 17) Source(99, 2) + SourceIndex(0) -2 >Emitted(95, 18) Source(99, 3) + SourceIndex(0) -3 >Emitted(95, 18) Source(91, 2) + SourceIndex(0) -4 >Emitted(95, 19) Source(91, 28) + SourceIndex(0) -5 >Emitted(95, 31) Source(91, 40) + SourceIndex(0) -6 >Emitted(95, 34) Source(99, 3) + SourceIndex(0) +1->Emitted(96, 17) Source(99, 2) + SourceIndex(0) +2 >Emitted(96, 18) Source(99, 3) + SourceIndex(0) +3 >Emitted(96, 18) Source(91, 2) + SourceIndex(0) +4 >Emitted(96, 19) Source(91, 28) + SourceIndex(0) +5 >Emitted(96, 31) Source(91, 40) + SourceIndex(0) +6 >Emitted(96, 34) Source(99, 3) + SourceIndex(0) --- >>> PlainText.Mode = Mode; 1->^^^^^^^^^^^^^^^^ @@ -1841,10 +1842,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(96, 17) Source(91, 15) + SourceIndex(0) -2 >Emitted(96, 31) Source(91, 19) + SourceIndex(0) -3 >Emitted(96, 38) Source(99, 3) + SourceIndex(0) -4 >Emitted(96, 39) Source(99, 3) + SourceIndex(0) +1->Emitted(97, 17) Source(91, 15) + SourceIndex(0) +2 >Emitted(97, 31) Source(91, 19) + SourceIndex(0) +3 >Emitted(97, 38) Source(99, 3) + SourceIndex(0) +4 >Emitted(97, 39) Source(99, 3) + SourceIndex(0) --- >>> })(PlainText = Languages.PlainText || (Languages.PlainText = {})); 1->^^^^^^^^^^^^ @@ -1890,15 +1891,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(97, 13) Source(100, 1) + SourceIndex(0) -2 >Emitted(97, 14) Source(100, 2) + SourceIndex(0) -3 >Emitted(97, 16) Source(76, 31) + SourceIndex(0) -4 >Emitted(97, 25) Source(76, 40) + SourceIndex(0) -5 >Emitted(97, 28) Source(76, 31) + SourceIndex(0) -6 >Emitted(97, 47) Source(76, 40) + SourceIndex(0) -7 >Emitted(97, 52) Source(76, 31) + SourceIndex(0) -8 >Emitted(97, 71) Source(76, 40) + SourceIndex(0) -9 >Emitted(97, 79) Source(100, 2) + SourceIndex(0) +1->Emitted(98, 13) Source(100, 1) + SourceIndex(0) +2 >Emitted(98, 14) Source(100, 2) + SourceIndex(0) +3 >Emitted(98, 16) Source(76, 31) + SourceIndex(0) +4 >Emitted(98, 25) Source(76, 40) + SourceIndex(0) +5 >Emitted(98, 28) Source(76, 31) + SourceIndex(0) +6 >Emitted(98, 47) Source(76, 40) + SourceIndex(0) +7 >Emitted(98, 52) Source(76, 31) + SourceIndex(0) +8 >Emitted(98, 71) Source(76, 40) + SourceIndex(0) +9 >Emitted(98, 79) Source(100, 2) + SourceIndex(0) --- >>> })(Languages = Thing.Languages || (Thing.Languages = {})); 1 >^^^^^^^^ @@ -1943,15 +1944,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(98, 9) Source(100, 1) + SourceIndex(0) -2 >Emitted(98, 10) Source(100, 2) + SourceIndex(0) -3 >Emitted(98, 12) Source(76, 21) + SourceIndex(0) -4 >Emitted(98, 21) Source(76, 30) + SourceIndex(0) -5 >Emitted(98, 24) Source(76, 21) + SourceIndex(0) -6 >Emitted(98, 39) Source(76, 30) + SourceIndex(0) -7 >Emitted(98, 44) Source(76, 21) + SourceIndex(0) -8 >Emitted(98, 59) Source(76, 30) + SourceIndex(0) -9 >Emitted(98, 67) Source(100, 2) + SourceIndex(0) +1 >Emitted(99, 9) Source(100, 1) + SourceIndex(0) +2 >Emitted(99, 10) Source(100, 2) + SourceIndex(0) +3 >Emitted(99, 12) Source(76, 21) + SourceIndex(0) +4 >Emitted(99, 21) Source(76, 30) + SourceIndex(0) +5 >Emitted(99, 24) Source(76, 21) + SourceIndex(0) +6 >Emitted(99, 39) Source(76, 30) + SourceIndex(0) +7 >Emitted(99, 44) Source(76, 21) + SourceIndex(0) +8 >Emitted(99, 59) Source(76, 30) + SourceIndex(0) +9 >Emitted(99, 67) Source(100, 2) + SourceIndex(0) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -1996,15 +1997,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(99, 5) Source(100, 1) + SourceIndex(0) -2 >Emitted(99, 6) Source(100, 2) + SourceIndex(0) -3 >Emitted(99, 8) Source(76, 15) + SourceIndex(0) -4 >Emitted(99, 13) Source(76, 20) + SourceIndex(0) -5 >Emitted(99, 16) Source(76, 15) + SourceIndex(0) -6 >Emitted(99, 28) Source(76, 20) + SourceIndex(0) -7 >Emitted(99, 33) Source(76, 15) + SourceIndex(0) -8 >Emitted(99, 45) Source(76, 20) + SourceIndex(0) -9 >Emitted(99, 53) Source(100, 2) + SourceIndex(0) +1 >Emitted(100, 5) Source(100, 1) + SourceIndex(0) +2 >Emitted(100, 6) Source(100, 2) + SourceIndex(0) +3 >Emitted(100, 8) Source(76, 15) + SourceIndex(0) +4 >Emitted(100, 13) Source(76, 20) + SourceIndex(0) +5 >Emitted(100, 16) Source(76, 15) + SourceIndex(0) +6 >Emitted(100, 28) Source(76, 20) + SourceIndex(0) +7 >Emitted(100, 33) Source(76, 15) + SourceIndex(0) +8 >Emitted(100, 45) Source(76, 20) + SourceIndex(0) +9 >Emitted(100, 53) Source(100, 2) + SourceIndex(0) --- >>>})(Sample || (Sample = {})); 1 > @@ -2046,12 +2047,12 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(100, 1) Source(100, 1) + SourceIndex(0) -2 >Emitted(100, 2) Source(100, 2) + SourceIndex(0) -3 >Emitted(100, 4) Source(76, 8) + SourceIndex(0) -4 >Emitted(100, 10) Source(76, 14) + SourceIndex(0) -5 >Emitted(100, 15) Source(76, 8) + SourceIndex(0) -6 >Emitted(100, 21) Source(76, 14) + SourceIndex(0) -7 >Emitted(100, 29) Source(100, 2) + SourceIndex(0) +1 >Emitted(101, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(101, 2) Source(100, 2) + SourceIndex(0) +3 >Emitted(101, 4) Source(76, 8) + SourceIndex(0) +4 >Emitted(101, 10) Source(76, 14) + SourceIndex(0) +5 >Emitted(101, 15) Source(76, 8) + SourceIndex(0) +6 >Emitted(101, 21) Source(76, 14) + SourceIndex(0) +7 >Emitted(101, 29) Source(100, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=recursiveClassReferenceTest.js.map \ No newline at end of file diff --git a/tests/baselines/reference/recursiveComplicatedClasses.js b/tests/baselines/reference/recursiveComplicatedClasses.js index a5756024458..ea31184d856 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.js +++ b/tests/baselines/reference/recursiveComplicatedClasses.js @@ -51,21 +51,24 @@ var Symbol = (function () { var InferenceSymbol = (function (_super) { __extends(InferenceSymbol, _super); function InferenceSymbol() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return InferenceSymbol; }(Symbol)); var ParameterSymbol = (function (_super) { __extends(ParameterSymbol, _super); function ParameterSymbol() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ParameterSymbol; }(InferenceSymbol)); var TypeSymbol = (function (_super) { __extends(TypeSymbol, _super); function TypeSymbol() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return TypeSymbol; }(InferenceSymbol)); diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js index 92cc2f72cac..72c97c30966 100644 --- a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js @@ -52,7 +52,8 @@ var MsPortal; var ViewModel = (function (_super) { __extends(ViewModel, _super); function ViewModel() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ViewModel; }(ItemValue)); diff --git a/tests/baselines/reference/reexportClassDefinition.js b/tests/baselines/reference/reexportClassDefinition.js index a4b68115ac2..95ce777e446 100644 --- a/tests/baselines/reference/reexportClassDefinition.js +++ b/tests/baselines/reference/reexportClassDefinition.js @@ -42,7 +42,8 @@ var foo2 = require("./foo2"); var x = (function (_super) { __extends(x, _super); function x() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return x; }(foo2.x)); diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index 6e621a18805..d2ec8e168bf 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -1030,7 +1030,8 @@ var rionegrensis; var caniventer = (function (_super) { __extends(caniventer, _super); function caniventer() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } caniventer.prototype.salomonseni = function () { var _this = this; @@ -1068,7 +1069,8 @@ var rionegrensis; var veraecrucis = (function (_super) { __extends(veraecrucis, _super); function veraecrucis() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } veraecrucis.prototype.naso = function () { var _this = this; @@ -1247,7 +1249,8 @@ var julianae; var oralis = (function (_super) { __extends(oralis, _super); function oralis() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } oralis.prototype.cepapi = function () { var _this = this; @@ -1333,7 +1336,8 @@ var julianae; var sumatrana = (function (_super) { __extends(sumatrana, _super); function sumatrana() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } sumatrana.prototype.wolffsohni = function () { var _this = this; @@ -1533,7 +1537,8 @@ var julianae; var durangae = (function (_super) { __extends(durangae, _super); function durangae() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } durangae.prototype.Californium = function () { var _this = this; @@ -1607,7 +1612,8 @@ var Lanthanum; var nitidus = (function (_super) { __extends(nitidus, _super); function nitidus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } nitidus.prototype.granatensis = function () { var _this = this; @@ -1675,7 +1681,8 @@ var Lanthanum; var megalonyx = (function (_super) { __extends(megalonyx, _super); function megalonyx() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } megalonyx.prototype.phillipsii = function () { var _this = this; @@ -1824,7 +1831,8 @@ var rendalli; var zuluensis = (function (_super) { __extends(zuluensis, _super); function zuluensis() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } zuluensis.prototype.telfairi = function () { var _this = this; @@ -1982,7 +1990,8 @@ var rendalli; var crenulata = (function (_super) { __extends(crenulata, _super); function crenulata() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } crenulata.prototype.salvanius = function () { var _this = this; @@ -2065,7 +2074,8 @@ var trivirgatus; var mixtus = (function (_super) { __extends(mixtus, _super); function mixtus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } mixtus.prototype.ochrogaster = function () { var _this = this; @@ -2307,7 +2317,8 @@ var ruatanica; var americanus = (function (_super) { __extends(americanus, _super); function americanus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } americanus.prototype.nasoloi = function () { var _this = this; @@ -2342,7 +2353,8 @@ var lavali; var wilsoni = (function (_super) { __extends(wilsoni, _super); function wilsoni() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } wilsoni.prototype.setiger = function () { var _this = this; @@ -2434,7 +2446,8 @@ var lavali; var otion = (function (_super) { __extends(otion, _super); function otion() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } otion.prototype.bonaerensis = function () { var _this = this; @@ -2598,7 +2611,8 @@ var lavali; var thaeleri = (function (_super) { __extends(thaeleri, _super); function thaeleri() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } thaeleri.prototype.coromandra = function () { var _this = this; @@ -2654,7 +2668,8 @@ var lavali; var lepturus = (function (_super) { __extends(lepturus, _super); function lepturus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } lepturus.prototype.ferrumequinum = function () { var _this = this; @@ -2677,7 +2692,8 @@ var dogramacii; var robustulus = (function (_super) { __extends(robustulus, _super); function robustulus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } robustulus.prototype.fossor = function () { var _this = this; @@ -2892,7 +2908,8 @@ var lutreolus; var schlegeli = (function (_super) { __extends(schlegeli, _super); function schlegeli() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } schlegeli.prototype.mittendorfi = function () { var _this = this; @@ -3119,7 +3136,8 @@ var panglima; var amphibius = (function (_super) { __extends(amphibius, _super); function amphibius() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } amphibius.prototype.bottegi = function () { var _this = this; @@ -3163,7 +3181,8 @@ var panglima; var fundatus = (function (_super) { __extends(fundatus, _super); function fundatus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } fundatus.prototype.crassulus = function () { var _this = this; @@ -3189,7 +3208,8 @@ var panglima; var abidi = (function (_super) { __extends(abidi, _super); function abidi() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } abidi.prototype.greyii = function () { var _this = this; @@ -3281,7 +3301,8 @@ var minutus; var himalayana = (function (_super) { __extends(himalayana, _super); function himalayana() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } himalayana.prototype.simoni = function () { var _this = this; @@ -3364,7 +3385,8 @@ var caurinus; var mahaganus = (function (_super) { __extends(mahaganus, _super); function mahaganus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } mahaganus.prototype.martiniquensis = function () { var _this = this; @@ -3438,7 +3460,8 @@ var howi; var angulatus = (function (_super) { __extends(angulatus, _super); function angulatus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } angulatus.prototype.pennatus = function () { var _this = this; @@ -3521,7 +3544,8 @@ var sagitta; var walkeri = (function (_super) { __extends(walkeri, _super); function walkeri() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } walkeri.prototype.maracajuensis = function () { var _this = this; @@ -3538,7 +3562,8 @@ var minutus; var inez = (function (_super) { __extends(inez, _super); function inez() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } inez.prototype.vexillaris = function () { var _this = this; @@ -3555,7 +3580,8 @@ var macrorhinos; var konganensis = (function (_super) { __extends(konganensis, _super); function konganensis() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return konganensis; }(imperfecta.lasiurus)); @@ -3566,7 +3592,8 @@ var panamensis; var linulus = (function (_super) { __extends(linulus, _super); function linulus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } linulus.prototype.goslingi = function () { var _this = this; @@ -3718,7 +3745,8 @@ var samarensis; var pelurus = (function (_super) { __extends(pelurus, _super); function pelurus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } pelurus.prototype.Palladium = function () { var _this = this; @@ -3804,7 +3832,8 @@ var samarensis; var fuscus = (function (_super) { __extends(fuscus, _super); function fuscus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } fuscus.prototype.planifrons = function () { var _this = this; @@ -3965,7 +3994,8 @@ var sagitta; var leptoceros = (function (_super) { __extends(leptoceros, _super); function leptoceros() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } leptoceros.prototype.victus = function () { var _this = this; @@ -4006,7 +4036,8 @@ var daubentonii; var nigricans = (function (_super) { __extends(nigricans, _super); function nigricans() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } nigricans.prototype.woosnami = function () { var _this = this; @@ -4032,7 +4063,8 @@ var argurus; var pygmaea = (function (_super) { __extends(pygmaea, _super); function pygmaea() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } pygmaea.prototype.pajeros = function () { var _this = this; @@ -4061,7 +4093,8 @@ var chrysaeolus; var sarasinorum = (function (_super) { __extends(sarasinorum, _super); function sarasinorum() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } sarasinorum.prototype.belzebul = function () { var _this = this; @@ -4165,7 +4198,8 @@ var argurus; var oreas = (function (_super) { __extends(oreas, _super); function oreas() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } oreas.prototype.salamonis = function () { var _this = this; @@ -4392,7 +4426,8 @@ var provocax; var melanoleuca = (function (_super) { __extends(melanoleuca, _super); function melanoleuca() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } melanoleuca.prototype.Neodymium = function () { var _this = this; @@ -4436,7 +4471,8 @@ var howi; var marcanoi = (function (_super) { __extends(marcanoi, _super); function marcanoi() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } marcanoi.prototype.formosae = function () { var _this = this; @@ -4843,7 +4879,8 @@ var gabriellae; var klossii = (function (_super) { __extends(klossii, _super); function klossii() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return klossii; }(imperfecta.lasiurus)); @@ -5046,7 +5083,8 @@ var imperfecta; var ciliolabrum = (function (_super) { __extends(ciliolabrum, _super); function ciliolabrum() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } ciliolabrum.prototype.leschenaultii = function () { var _this = this; @@ -5108,7 +5146,8 @@ var petrophilus; var sodyi = (function (_super) { __extends(sodyi, _super); function sodyi() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } sodyi.prototype.saundersiae = function () { var _this = this; @@ -5173,7 +5212,8 @@ var caurinus; var megaphyllus = (function (_super) { __extends(megaphyllus, _super); function megaphyllus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } megaphyllus.prototype.montana = function () { var _this = this; @@ -5346,7 +5386,8 @@ var lutreolus; var cor = (function (_super) { __extends(cor, _super); function cor() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } cor.prototype.antinorii = function () { var _this = this; @@ -5438,7 +5479,8 @@ var argurus; var germaini = (function (_super) { __extends(germaini, _super); function germaini() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } germaini.prototype.sharpei = function () { var _this = this; @@ -5536,7 +5578,8 @@ var dammermani; var melanops = (function (_super) { __extends(melanops, _super); function melanops() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } melanops.prototype.blarina = function () { var _this = this; @@ -5625,7 +5668,8 @@ var argurus; var peninsulae = (function (_super) { __extends(peninsulae, _super); function peninsulae() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } peninsulae.prototype.aitkeni = function () { var _this = this; @@ -5771,7 +5815,8 @@ var ruatanica; var Praseodymium = (function (_super) { __extends(Praseodymium, _super); function Praseodymium() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Praseodymium.prototype.clara = function () { var _this = this; @@ -5860,7 +5905,8 @@ var caurinus; var johorensis = (function (_super) { __extends(johorensis, _super); function johorensis() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } johorensis.prototype.maini = function () { var _this = this; @@ -5988,7 +6034,8 @@ var caurinus; var psilurus = (function (_super) { __extends(psilurus, _super); function psilurus() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } psilurus.prototype.socialis = function () { var _this = this; diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index fab0fe8fe09..cd3a9f4c346 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -123,7 +123,8 @@ var G = (function () { var H = (function (_super) { __extends(H, _super); function H() { - _super.call(this); + var _this; + _this = _super.call(this) || this; return new G(); //error } return H; @@ -131,7 +132,8 @@ var H = (function (_super) { var I = (function (_super) { __extends(I, _super); function I() { - _super.call(this); + var _this; + _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 a543ad3bdda..659eea55689 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -48,7 +48,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js index 3833a5caf7a..02c81245445 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js @@ -22,7 +22,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.c = function () { v = 1; diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js index d5de584e779..781fd5ac6ee 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js @@ -22,7 +22,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.c = function () { v = 1; diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index 833e84ee5f3..e9394a64c9b 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -25,7 +25,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.v = 1; this.p = 1; C.s = 1; diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js index a1474a24777..d7e1b69e274 100644 --- a/tests/baselines/reference/shadowPrivateMembers.js +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -18,7 +18,8 @@ var base = (function () { var derived = (function (_super) { __extends(derived, _super); function derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } derived.prototype.n = function () { }; return derived; diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index 1d852127963..ea71fbc20c0 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -21,7 +21,8 @@ var AbstractGreeter = (function () { var Greeter = (function (_super) { __extends(Greeter, _super); function Greeter() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.a = 10; this.nameA = "Ten"; } diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map index 9c350133f2b..e36f2eaaf8e 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,UAGC;;QAFU,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 diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt index f3052384651..3da1d42edcd 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -77,11 +77,23 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts --- >>> function Greeter() { 1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(13, 5) Source(4, 1) + SourceIndex(0) --- ->>> _super.apply(this, arguments); +>>> var _this; +1->^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 > class Greeter extends AbstractGreeter { + > public a = 10; + > public nameA = "Ten"; + > } +1->Emitted(14, 9) Source(4, 1) + SourceIndex(0) +2 >Emitted(14, 19) Source(7, 2) + SourceIndex(0) +--- +>>> _this = _super.apply(this, arguments) || this; >>> this.a = 10; 1->^^^^^^^^ 2 > ^^^^^^ @@ -89,17 +101,16 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 4 > ^^ 5 > ^ 6 > ^^^^^^^^-> -1->class Greeter extends AbstractGreeter { - > public +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) +1->Emitted(16, 9) Source(5, 12) + SourceIndex(0) +2 >Emitted(16, 15) Source(5, 13) + SourceIndex(0) +3 >Emitted(16, 18) Source(5, 16) + SourceIndex(0) +4 >Emitted(16, 20) Source(5, 18) + SourceIndex(0) +5 >Emitted(16, 21) Source(5, 19) + SourceIndex(0) --- >>> this.nameA = "Ten"; 1->^^^^^^^^ @@ -113,11 +124,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 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) +1->Emitted(17, 9) Source(6, 12) + SourceIndex(0) +2 >Emitted(17, 19) Source(6, 17) + SourceIndex(0) +3 >Emitted(17, 22) Source(6, 20) + SourceIndex(0) +4 >Emitted(17, 27) Source(6, 25) + SourceIndex(0) +5 >Emitted(17, 28) Source(6, 26) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -126,8 +137,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 +146,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 +166,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 f521ba14838..4f14cb6db97 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -36,7 +36,8 @@ var Model = (function () { var MyView = (function (_super) { __extends(MyView, _super); function MyView() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyView; }(View)); diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js index 62688f7cb7e..3b909a80836 100644 --- a/tests/baselines/reference/specializedOverloadWithRestParameters.js +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -27,7 +27,8 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived1.prototype.bar = function () { }; return Derived1; diff --git a/tests/baselines/reference/staticFactory1.js b/tests/baselines/reference/staticFactory1.js index 6ccd30e37d1..d229c5330ba 100644 --- a/tests/baselines/reference/staticFactory1.js +++ b/tests/baselines/reference/staticFactory1.js @@ -31,7 +31,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Derived.prototype.foo = function () { return 2; }; return Derived; diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index 52868930792..8b4b8326cab 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -27,7 +27,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.p1 = doThing(A); // OK this.p2 = doThing(B); // OK } diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js index 1c76a251220..a07bea081a9 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js @@ -26,7 +26,8 @@ var SomeBase = (function () { var P = (function (_super) { __extends(P, _super); function P() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return P; }(SomeBase)); diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index c25c406746d..b2eea36eece 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -49,8 +49,9 @@ 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 B; }(A)); @@ -58,6 +59,7 @@ B.s = 9; var C = (function (_super) { __extends(C, _super); function C() { + var _this; this.p = 10; var x = 1; // should error } @@ -66,6 +68,7 @@ var C = (function (_super) { var D = (function (_super) { __extends(D, _super); function D() { + var _this; this.p = 11; var x = 1; // should error } @@ -74,6 +77,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { + var _this; this.p = 12; var x = 1; // should error } diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index 446fed5b76a..e40e0c45a59 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -74,8 +74,9 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; "use strict"; // No error - _super.call(this); + _this = _super.call(this) || this; this.s = 9; } return B; @@ -83,7 +84,8 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - _super.call(this); // No error + var _this; + _this = _super.call(this) || this; // No error this.s = 9; "use strict"; } @@ -92,9 +94,10 @@ var C = (function (_super) { var D = (function (_super) { __extends(D, _super); function D() { + var _this; this.s = 9; var x = 1; // Error - _super.call(this); + _this = _super.call(this) || this; "use strict"; } return D; @@ -102,8 +105,9 @@ var D = (function (_super) { var Bs = (function (_super) { __extends(Bs, _super); function Bs() { + var _this; "use strict"; // No error - _super.call(this); + _this = _super.call(this) || this; } return Bs; }(A)); @@ -111,7 +115,8 @@ Bs.s = 9; var Cs = (function (_super) { __extends(Cs, _super); function Cs() { - _super.call(this); // No error + var _this; + _this = _super.call(this) || this; // No error "use strict"; } return Cs; @@ -120,8 +125,9 @@ 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 Ds; diff --git a/tests/baselines/reference/strictModeReservedWord.js b/tests/baselines/reference/strictModeReservedWord.js index 210d9ec75be..af01ca1716f 100644 --- a/tests/baselines/reference/strictModeReservedWord.js +++ b/tests/baselines/reference/strictModeReservedWord.js @@ -48,7 +48,8 @@ function foo() { var myClass = (function (_super) { __extends(package, _super); function package() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return package; }(public)); diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js index 281b4ade5d6..300d83b9bbc 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js @@ -75,14 +75,16 @@ var F1 = (function () { var G = (function (_super) { __extends(G, _super); function G() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return G; }(package)); var H = (function (_super) { __extends(H, _super); function H() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return H; }(package.A)); diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js index 08a26230f37..eb5052f51d7 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -55,7 +55,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function () { return ''; }; return B; diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index 10d9e3e42ec..cbe42a510b3 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -120,7 +120,8 @@ var C3 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(C3)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js index 0753c52dc9e..56800248393 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js @@ -182,28 +182,32 @@ var C3 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(C3)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(C3)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D3; }(C3)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D4; }(C3)); @@ -213,21 +217,24 @@ var D4 = (function (_super) { var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D5; }(C3)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D6; }(C3)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D7; }(C3)); @@ -236,21 +243,24 @@ var D7 = (function (_super) { var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D8; }(C3)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D9; }(C3)); var D10 = (function (_super) { __extends(D10, _super); function D10() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D10; }(C3)); @@ -259,21 +269,24 @@ var D10 = (function (_super) { var D11 = (function (_super) { __extends(D11, _super); function D11() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D11; }(C3)); var D12 = (function (_super) { __extends(D12, _super); function D12() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D12; }(C3)); var D13 = (function (_super) { __extends(D13, _super); function D13() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D13; }(C3)); @@ -283,28 +296,32 @@ var D13 = (function (_super) { var D14 = (function (_super) { __extends(D14, _super); function D14() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D14; }(C3)); var D15 = (function (_super) { __extends(D15, _super); function D15() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D15; }(C3)); var D16 = (function (_super) { __extends(D16, _super); function D16() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D16; }(C3)); var D17 = (function (_super) { __extends(D17, _super); function D17() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D17; }(C3)); @@ -313,28 +330,32 @@ var D17 = (function (_super) { var D18 = (function (_super) { __extends(D18, _super); function D18() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D18; }(C3)); var D19 = (function (_super) { __extends(D19, _super); function D19() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D19; }(C3)); var D20 = (function (_super) { __extends(D20, _super); function D20() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D20; }(C3)); var D21 = (function (_super) { __extends(D21, _super); function D21() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D21; }(C3)); @@ -343,28 +364,32 @@ var D21 = (function (_super) { var D22 = (function (_super) { __extends(D22, _super); function D22() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D22; }(C3)); var D23 = (function (_super) { __extends(D23, _super); function D23() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D23; }(C3)); var D24 = (function (_super) { __extends(D24, _super); function D24() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D24; }(C3)); var D25 = (function (_super) { __extends(D25, _super); function D25() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D25; }(C3)); @@ -373,28 +398,32 @@ var D25 = (function (_super) { var D26 = (function (_super) { __extends(D26, _super); function D26() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D26; }(C3)); var D27 = (function (_super) { __extends(D27, _super); function D27() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D27; }(C3)); var D28 = (function (_super) { __extends(D28, _super); function D28() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D28; }(C3)); var D29 = (function (_super) { __extends(D29, _super); function D29() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D29; }(C3)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js index f388bd4e047..e4e35262d80 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js @@ -118,63 +118,72 @@ var B1 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(B1)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D3; }(B1)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D4; }(B1)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D5; }(B1)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D6; }(B1)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D7; }(B1)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D8; }(B1)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D9; }(B1)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js index cffda7d7f55..0d1347cd33c 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js @@ -217,63 +217,72 @@ var M1; var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(Base)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(Base)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D3; }(Base)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D4; }(Base)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D5; }(Base)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D6; }(Base)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D7; }(Base)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D8; }(Base)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D9; }(Base)); @@ -288,63 +297,72 @@ var M2; var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(Base2)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(Base2)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D3; }(Base2)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D4; }(Base2)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D5; }(Base2)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D6; }(Base2)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D7; }(Base2)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D8; }(Base2)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D9; }(Base2)); diff --git a/tests/baselines/reference/subtypingTransitivity.js b/tests/baselines/reference/subtypingTransitivity.js index 9d3df207a0c..9ba7ac52df5 100644 --- a/tests/baselines/reference/subtypingTransitivity.js +++ b/tests/baselines/reference/subtypingTransitivity.js @@ -33,14 +33,16 @@ var B = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(B)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(B)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index 014ce4a3003..d4cd66a5e0a 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -187,21 +187,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index 55f5fa60e71..93b1cbebd0a 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -136,21 +136,24 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.js b/tests/baselines/reference/subtypingWithCallSignatures4.js index b8839316e86..5cab9f1e7c4 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.js +++ b/tests/baselines/reference/subtypingWithCallSignatures4.js @@ -126,21 +126,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index c4168febf4e..ec551f5f58c 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -187,21 +187,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index 171e52505e0..ba833c31e7a 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -138,21 +138,24 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures4.js b/tests/baselines/reference/subtypingWithConstructSignatures4.js index 1152dde04dd..0b624fcbc51 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures4.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures4.js @@ -126,21 +126,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures5.js b/tests/baselines/reference/subtypingWithConstructSignatures5.js index 24a5ce77dd0..3d2d4d50d6e 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures5.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures5.js @@ -64,21 +64,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures6.js b/tests/baselines/reference/subtypingWithConstructSignatures6.js index 8778255dbd5..1cec204ff87 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures6.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures6.js @@ -67,21 +67,24 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.js b/tests/baselines/reference/subtypingWithNumericIndexer.js index cd447c116da..2aa4d834395 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer.js @@ -54,14 +54,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); @@ -75,28 +77,32 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B4; }(A)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.js b/tests/baselines/reference/subtypingWithNumericIndexer3.js index 104141b761d..60f463546c8 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.js @@ -58,14 +58,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); @@ -79,35 +81,40 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B4; }(A)); var B5 = (function (_super) { __extends(B5, _super); function B5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B5; }(A)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.js b/tests/baselines/reference/subtypingWithNumericIndexer4.js index 59f8cd95ad0..f40804bd55f 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.js @@ -42,7 +42,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -56,14 +57,16 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A)); diff --git a/tests/baselines/reference/subtypingWithObjectMembers.js b/tests/baselines/reference/subtypingWithObjectMembers.js index c3cef6601e6..420be798293 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.js +++ b/tests/baselines/reference/subtypingWithObjectMembers.js @@ -81,14 +81,16 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Derived)); @@ -102,7 +104,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -114,7 +117,8 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A2)); @@ -126,7 +130,8 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A3)); @@ -140,7 +145,8 @@ var TwoLevels; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -152,7 +158,8 @@ var TwoLevels; var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A2)); @@ -164,7 +171,8 @@ var TwoLevels; var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembers4.js b/tests/baselines/reference/subtypingWithObjectMembers4.js index d5c1107e45d..0bb50afe985 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers4.js +++ b/tests/baselines/reference/subtypingWithObjectMembers4.js @@ -48,7 +48,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -60,7 +61,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -72,7 +74,8 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A2)); @@ -84,7 +87,8 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js index 25faacad88e..ec3b8382eca 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js @@ -48,7 +48,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -60,7 +61,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -72,7 +74,8 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A2)); @@ -84,7 +87,8 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js index 7b0398143a2..24f36819ff6 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js @@ -76,7 +76,8 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived; }(Base)); @@ -90,7 +91,8 @@ var ExplicitPublic; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -102,7 +104,8 @@ var ExplicitPublic; var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A2)); @@ -114,7 +117,8 @@ var ExplicitPublic; var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A3)); @@ -129,7 +133,8 @@ var ImplicitPublic; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -141,7 +146,8 @@ var ImplicitPublic; var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A2)); @@ -153,7 +159,8 @@ var ImplicitPublic; var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer.js b/tests/baselines/reference/subtypingWithStringIndexer.js index 0740743a5d9..95a71a018d1 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.js +++ b/tests/baselines/reference/subtypingWithStringIndexer.js @@ -55,14 +55,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); @@ -76,28 +78,32 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B4; }(A)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.js b/tests/baselines/reference/subtypingWithStringIndexer3.js index 5ed44177d52..fd9b400cb3d 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.js +++ b/tests/baselines/reference/subtypingWithStringIndexer3.js @@ -58,14 +58,16 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); @@ -79,35 +81,40 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B4; }(A)); var B5 = (function (_super) { __extends(B5, _super); function B5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B5; }(A)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.js b/tests/baselines/reference/subtypingWithStringIndexer4.js index d6fb874c090..46178d1dc32 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.js +++ b/tests/baselines/reference/subtypingWithStringIndexer4.js @@ -42,7 +42,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); @@ -56,14 +57,16 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B3; }(A)); diff --git a/tests/baselines/reference/super.js b/tests/baselines/reference/super.js index 81d76aec62b..54afddcc119 100644 --- a/tests/baselines/reference/super.js +++ b/tests/baselines/reference/super.js @@ -58,7 +58,8 @@ var Base = (function () { var Sub1 = (function (_super) { __extends(Sub1, _super); function Sub1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Sub1.prototype.foo = function () { return "sub1" + _super.prototype.foo.call(this) + _super.prototype.bar.call(this); @@ -68,7 +69,8 @@ var Sub1 = (function (_super) { var SubSub1 = (function (_super) { __extends(SubSub1, _super); function SubSub1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 4179843b79a..8ef621cdf2b 100644 --- a/tests/baselines/reference/super1.js +++ b/tests/baselines/reference/super1.js @@ -84,7 +84,8 @@ var Base1 = (function () { var Sub1 = (function (_super) { __extends(Sub1, _super); function Sub1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Sub1.prototype.bar = function () { return "base"; @@ -94,7 +95,8 @@ var Sub1 = (function (_super) { var SubSub1 = (function (_super) { __extends(SubSub1, _super); function SubSub1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } SubSub1.prototype.bar = function () { return _super.prototype.super.foo; @@ -113,7 +115,8 @@ var Base2 = (function () { var SubE2 = (function (_super) { __extends(SubE2, _super); function SubE2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } SubE2.prototype.bar = function () { return _super.prototype.prototype.foo = null; @@ -132,7 +135,8 @@ var Base3 = (function () { var SubE3 = (function (_super) { __extends(SubE3, _super); function SubE3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } SubE3.prototype.bar = function () { return _super.prototype.bar.call(this); @@ -153,7 +157,8 @@ var Base4; var SubSub4 = (function (_super) { __extends(SubSub4, _super); function SubSub4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 979bdba84e4..80e26c36f7c 100644 --- a/tests/baselines/reference/super2.js +++ b/tests/baselines/reference/super2.js @@ -71,7 +71,8 @@ var Base5 = (function () { var Sub5 = (function (_super) { __extends(Sub5, _super); function Sub5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Sub5.prototype.x = function () { return "SubX"; @@ -81,7 +82,8 @@ var Sub5 = (function (_super) { var SubSub5 = (function (_super) { __extends(SubSub5, _super); function SubSub5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } SubSub5.prototype.x = function () { return _super.prototype.x.call(this); @@ -103,7 +105,8 @@ var Base6 = (function () { var Sub6 = (function (_super) { __extends(Sub6, _super); function Sub6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Sub6.prototype.y = function () { return "SubY"; @@ -113,7 +116,8 @@ var Sub6 = (function (_super) { var SubSub6 = (function (_super) { __extends(SubSub6, _super); function SubSub6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 6e5cd9aca44..8c9d93f3a36 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -30,7 +30,8 @@ MyBase.S1 = 5; var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 8de13b5ef51..ff711ca8d75 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -41,11 +41,11 @@ var Q = (function (_super) { __extends(Q, _super); // Super is not allowed in constructor args function Q(z, zz, zzz) { - var _this = this; + var _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 = _super.call(this) || this; this.z = z; this.xx = _super.prototype.; } diff --git a/tests/baselines/reference/superAccessInFatArrow1.js b/tests/baselines/reference/superAccessInFatArrow1.js index 3cd4e199c62..be97707b12a 100644 --- a/tests/baselines/reference/superAccessInFatArrow1.js +++ b/tests/baselines/reference/superAccessInFatArrow1.js @@ -34,7 +34,8 @@ var test; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.bar = function (callback) { }; diff --git a/tests/baselines/reference/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index 9dcdbda8e31..3dec9369dd4 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -40,9 +40,10 @@ 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"); + _this = _super.call(this, "hi") || this; var x = this.foo; } return T6; diff --git a/tests/baselines/reference/superCallAssignResult.js b/tests/baselines/reference/superCallAssignResult.js index 7002f94eb7d..4eeabdfa282 100644 --- a/tests/baselines/reference/superCallAssignResult.js +++ b/tests/baselines/reference/superCallAssignResult.js @@ -24,7 +24,8 @@ 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 H; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing1.js b/tests/baselines/reference/superCallBeforeThisAccessing1.js index 1fc7ab39c91..e70dde9fd8e 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing1.js @@ -30,7 +30,8 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this, i); + var _this; + _this = _super.call(this, i) || this; var s = { t: this._t }; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing2.js b/tests/baselines/reference/superCallBeforeThisAccessing2.js index e5acf06bbfd..8ab6c5f349c 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing2.js @@ -24,8 +24,8 @@ 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 + var _this; + _this = _super.call(this, function () { _this._t; }) || this; // no error. only check when this is directly accessing in constructor } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing3.js b/tests/baselines/reference/superCallBeforeThisAccessing3.js index 101d74e4bc7..1f4c8114913 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing3.js @@ -27,11 +27,11 @@ 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 = _super.call(this, undefined) || this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing4.js b/tests/baselines/reference/superCallBeforeThisAccessing4.js index 9c3c5ab60c4..2645eaa9795 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing4.js @@ -24,15 +24,17 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { + var _this; this._t; - _super.call(this); + _this = _super.call(this) || this; } return D; }(null)); var E = (function (_super) { __extends(E, _super); function E() { - _super.call(this); + var _this; + _this = _super.call(this) || this; this._t; } return E; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing5.js b/tests/baselines/reference/superCallBeforeThisAccessing5.js index 3281a3f8b55..df345ec5c26 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing5.js @@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { + var _this; this._t; // No error } return D; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing6.js b/tests/baselines/reference/superCallBeforeThisAccessing6.js index 746ce9f2791..d4e8c979552 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing6.js @@ -24,7 +24,8 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this, this); + var _this; + _this = _super.call(this, this) || this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing7.js b/tests/baselines/reference/superCallBeforeThisAccessing7.js index c3aa1655cf7..f6c41b144eb 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing7.js @@ -27,10 +27,11 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { + var _this; var x = { j: this._t }; - _super.call(this, undefined); + _this = _super.call(this, undefined) || this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing8.js b/tests/baselines/reference/superCallBeforeThisAccessing8.js index 0865c4305a5..7d09351621a 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing8.js @@ -27,8 +27,9 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { + var _this; var x = { - k: _super.call(this, undefined), + k: _this = _super.call(this, undefined) || this, j: this._t }; } diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js index 50830480b1a..6de41cb5188 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -20,7 +20,8 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index ef770985888..5ae8f8b3874 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -19,7 +19,8 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index ebb70023b53..bc85d74c4c8 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -25,7 +25,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { return String(value); }); + var _this; + _this = _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 d619343ba14..a1736bb45f0 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -25,7 +25,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { return String(value); }); + var _this; + _this = _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 e9ee84be152..c5beb5df5b5 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -25,7 +25,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.call(this, function (value) { return String(value); }); + var _this; + _this = _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 d793e9bb2ae..e4b358c9a0a 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 a7fcbaaeff0..7f34628c58a 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 9746ab6a9de..dcbebeaa452 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 3ff07edf4c9..6640a32be5a 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -66,8 +66,8 @@ var Doing = (function () { var Other = (function (_super) { __extends(Other, _super); function Other() { - var _this = this; - _super.call(this); + var _this; + _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); diff --git a/tests/baselines/reference/superCallInStaticMethod.js b/tests/baselines/reference/superCallInStaticMethod.js index 91558e47d3f..6cf9f79e7a4 100644 --- a/tests/baselines/reference/superCallInStaticMethod.js +++ b/tests/baselines/reference/superCallInStaticMethod.js @@ -62,7 +62,8 @@ var Doing = (function () { var Other = (function (_super) { __extends(Other, _super); function Other() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } // in static method Other.staticMethod = function () { diff --git a/tests/baselines/reference/superCallInsideClassDeclaration.js b/tests/baselines/reference/superCallInsideClassDeclaration.js index e677c426e02..f47b50d4915 100644 --- a/tests/baselines/reference/superCallInsideClassDeclaration.js +++ b/tests/baselines/reference/superCallInsideClassDeclaration.js @@ -35,10 +35,12 @@ 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); + var _this; + _this = _super.call(this) || this; } return D; }(C)); diff --git a/tests/baselines/reference/superCallInsideClassExpression.js b/tests/baselines/reference/superCallInsideClassExpression.js index ee373f69f46..b9e1f6c9786 100644 --- a/tests/baselines/reference/superCallInsideClassExpression.js +++ b/tests/baselines/reference/superCallInsideClassExpression.js @@ -35,10 +35,12 @@ 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); + var _this; + _this = _super.call(this) || this; } return class_1; }(C)); diff --git a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js index 3f9a0a9ce9c..68a9c19e819 100644 --- a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js +++ b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js @@ -28,8 +28,9 @@ 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 B; diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index 202ed531a10..fd91de4cc8e 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -37,13 +37,14 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); - this.x = _super.call(this); + var _this; + _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 D; diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index 5bfe3927a51..a311ce95fc7 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -28,7 +28,8 @@ 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()); }); + var _this; + _this = _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 539ecbed065..9439871f38c 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -27,7 +27,8 @@ 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()); }); + var _this; + _this = _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 d35a1707bb7..cfa3fd1c074 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -47,13 +47,14 @@ 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, { + _this = _super.call(this, { method: function (p) { p.length; } - }); + }) || this; // Should be okay. // 'p' should have type 'string'. _super.prototype.foo.call(this, { diff --git a/tests/baselines/reference/superCallWithMissingBaseClass.js b/tests/baselines/reference/superCallWithMissingBaseClass.js index 7758bcfd89d..561b7300fe4 100644 --- a/tests/baselines/reference/superCallWithMissingBaseClass.js +++ b/tests/baselines/reference/superCallWithMissingBaseClass.js @@ -18,7 +18,8 @@ var __extends = (this && this.__extends) || function (d, b) { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 ae8327ec200..96b0061f47e 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -47,10 +47,11 @@ var Derived = (function (_super) { __extends(Derived, _super); //super call in class constructor of derived type function Derived(q) { - _super.call(this, ''); + var _this; + _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 Derived; @@ -63,8 +64,9 @@ 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 OtherDerived; }(OtherBase)); diff --git a/tests/baselines/reference/superCallsInConstructor.js b/tests/baselines/reference/superCallsInConstructor.js index 434f730c76b..be34657a0c1 100644 --- a/tests/baselines/reference/superCallsInConstructor.js +++ b/tests/baselines/reference/superCallsInConstructor.js @@ -41,14 +41,15 @@ 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 Derived; diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index fd70114d0fd..f962876a391 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -76,7 +76,8 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.name = "Frank"; // super call in an inner function in a constructor function inner() { diff --git a/tests/baselines/reference/superInCatchBlock1.js b/tests/baselines/reference/superInCatchBlock1.js index 9d5cb1affdc..9eb7df62c1a 100644 --- a/tests/baselines/reference/superInCatchBlock1.js +++ b/tests/baselines/reference/superInCatchBlock1.js @@ -28,7 +28,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.m = function () { try { diff --git a/tests/baselines/reference/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index 3c6eb0bdad2..ab1744929a9 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -27,6 +27,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C(a) { + var _this; if (a === void 0) { a = _super.foo.call(this); } } return C; diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index b0940b1d538..f2c84cb7e64 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -85,8 +85,8 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - var _this = this; - _super.call(this); + var _this; + _this = _super.call(this) || this; this.name = "Frank"; // super call in a constructor _super.prototype.sayHello.call(this); @@ -105,8 +105,8 @@ var RegisteredUser = (function (_super) { var RegisteredUser2 = (function (_super) { __extends(RegisteredUser2, _super); function RegisteredUser2() { - var _this = this; - _super.call(this); + var _this; + _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); }; }; }; @@ -121,8 +121,8 @@ var RegisteredUser2 = (function (_super) { var RegisteredUser3 = (function (_super) { __extends(RegisteredUser3, _super); function RegisteredUser3() { - var _this = this; - _super.call(this); + var _this; + _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; }; }; }; @@ -137,8 +137,8 @@ var RegisteredUser3 = (function (_super) { var RegisteredUser4 = (function (_super) { __extends(RegisteredUser4, _super); function RegisteredUser4() { - var _this = this; - _super.call(this); + var _this; + _this = _super.call(this) || this; this.name = "Mark"; // super in a nested lambda in a constructor var x = function () { return function () { return _super.prototype.; }; }; diff --git a/tests/baselines/reference/superInObjectLiterals_ES5.js b/tests/baselines/reference/superInObjectLiterals_ES5.js index 5d1fed24b4f..adeda5835cb 100644 --- a/tests/baselines/reference/superInObjectLiterals_ES5.js +++ b/tests/baselines/reference/superInObjectLiterals_ES5.js @@ -100,7 +100,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } B.prototype.f = function () { var _this = this; diff --git a/tests/baselines/reference/superNewCall1.js b/tests/baselines/reference/superNewCall1.js index 01ae169b598..32c4da4d4e4 100644 --- a/tests/baselines/reference/superNewCall1.js +++ b/tests/baselines/reference/superNewCall1.js @@ -27,6 +27,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { + var _this; new _super.prototype(function (value) { return String(value); }); } return B; diff --git a/tests/baselines/reference/superPropertyAccess.js b/tests/baselines/reference/superPropertyAccess.js index 0e1e8783448..b1377eb9cde 100644 --- a/tests/baselines/reference/superPropertyAccess.js +++ b/tests/baselines/reference/superPropertyAccess.js @@ -61,7 +61,8 @@ var MyBase = (function () { var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 4df9398024c..86f059a2fb2 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -50,7 +50,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + var _this; + _this = _super.call(this) || this; _super.prototype.bar.call(this); _super.prototype.x; // error } diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index ec74a2ea069..be0c44b4081 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -50,7 +50,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + var _this; + _this = _super.call(this) || this; _super.prototype.bar.call(this); // error _super.prototype.x; // error } diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js index a91dfc76e3d..1397a0748ae 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js @@ -29,7 +29,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 df230ce3703..f7663eab6e0 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -99,7 +99,8 @@ var SomeBaseClass = (function () { var SomeDerivedClass = (function (_super) { __extends(SomeDerivedClass, _super); function SomeDerivedClass() { - _super.call(this); + var _this; + _this = _super.call(this) || this; var x = _super.prototype.func.call(this); var x; } diff --git a/tests/baselines/reference/superPropertyAccess_ES5.js b/tests/baselines/reference/superPropertyAccess_ES5.js index 63f5f6f316a..14492c2788a 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.js +++ b/tests/baselines/reference/superPropertyAccess_ES5.js @@ -49,7 +49,8 @@ var MyBase = (function () { var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - _super.call(this); + var _this; + _this = _super.call(this) || this; var f1 = _super.prototype.getValue.call(this); var f2 = _super.prototype.value; } @@ -71,7 +72,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(B.prototype, "property", { set: function (value) { diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.js b/tests/baselines/reference/superSymbolIndexedAccess5.js index 3acd26d2974..0796c912d8c 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.js +++ b/tests/baselines/reference/superSymbolIndexedAccess5.js @@ -31,7 +31,8 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _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 8b04075c411..ee376cec2cb 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.js +++ b/tests/baselines/reference/superSymbolIndexedAccess6.js @@ -31,7 +31,8 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Bar[symbol] = function () { return _super[symbol].call(this); diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index a54ee1bbcbc..499c0a6de1f 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -28,7 +28,8 @@ 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 + var _this; + _this = _super.call(this) || this; // uses the type parameter type of the base class, ie string } return D; }(C)); diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index b4fe56bee4c..471c7cd36ac 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -20,7 +20,8 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - _super.call(this); + var _this; + _this = _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index 766b5f7920e..a4acd321f50 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -23,6 +23,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { + var _this; _super.prototype..call(this); } return D; diff --git a/tests/baselines/reference/superWithTypeArgument2.js b/tests/baselines/reference/superWithTypeArgument2.js index e0d2a40633f..ca399c4de78 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -23,6 +23,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D(x) { + var _this; _super.prototype..call(this, x); } return D; diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index 586dc595b39..5a124586d0c 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -28,6 +28,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { + var _this; _super.prototype..call(this); } D.prototype.bar = function () { 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 db6db37ac8a..ed71cebe3c7 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,8 @@ var F = (function () { var SuperObjectTest = (function (_super) { __extends(SuperObjectTest, _super); function SuperObjectTest() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } SuperObjectTest.prototype.testing = function () { var test = { diff --git a/tests/baselines/reference/switchStatements.js b/tests/baselines/reference/switchStatements.js index 093a7fb2f2c..7aac6cb47e0 100644 --- a/tests/baselines/reference/switchStatements.js +++ b/tests/baselines/reference/switchStatements.js @@ -98,7 +98,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/systemModuleWithSuperClass.js b/tests/baselines/reference/systemModuleWithSuperClass.js index 31cd542d2e2..59aff947e5c 100644 --- a/tests/baselines/reference/systemModuleWithSuperClass.js +++ b/tests/baselines/reference/systemModuleWithSuperClass.js @@ -49,7 +49,8 @@ System.register(["./foo"], function (exports_1, context_1) { Bar = (function (_super) { __extends(Bar, _super); function Bar() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Bar; }(foo_1.Foo)); diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index d028c04d711..a9bbc34123f 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -35,7 +35,8 @@ 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; }); + var _this; + _this = _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 76eeef0139c..2a86b144ae5 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -70,7 +70,8 @@ var ClassWithNoInitializer = (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { - _super.call(this, this); // Error + var _this; + _this = _super.call(this, this) || this; // Error } return ClassWithNoInitializer; }(BaseErrClass)); @@ -78,7 +79,8 @@ var ClassWithInitializer = (function (_super) { __extends(ClassWithInitializer, _super); //'this' in required super call function ClassWithInitializer() { - _super.call(this, this); // Error + var _this; + _this = _super.call(this, this) || this; // Error this.t = 4; } return ClassWithInitializer; @@ -96,7 +98,8 @@ genericFunc(undefined); // Should be an error var ErrClass3 = (function (_super) { __extends(ErrClass3, _super); function ErrClass3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ErrClass3; }(this)); diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 634b5ef0a20..3748ebaa42f 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -71,7 +71,8 @@ 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 + var _this; + _this = _super.call(this, this) || this; // error: "super" has to be called before "this" accessing } return ClassWithNoInitializer; }(BaseErrClass)); @@ -79,7 +80,8 @@ var ClassWithInitializer = (function (_super) { __extends(ClassWithInitializer, _super); //'this' in required super call function ClassWithInitializer() { - _super.call(this, this); // Error + var _this; + _this = _super.call(this, this) || this; // Error this.t = 4; } return ClassWithInitializer; @@ -97,7 +99,8 @@ genericFunc(undefined); // Should be an error var ErrClass3 = (function (_super) { __extends(ErrClass3, _super); function ErrClass3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return ErrClass3; }(this)); diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index 827d101c95a..91e71522e4d 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -36,14 +36,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 + var _this; + _this = _super.call(this, this) || this; // error: "super" has to be called before "this" accessing } return Foo; }(Base)); var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - _super.call(this, this); // error + var _this; + _this = _super.call(this, this) || this; // error this.p = 0; } return Foo2; @@ -51,7 +53,8 @@ var Foo2 = (function (_super) { var Foo3 = (function (_super) { __extends(Foo3, _super); function Foo3(p) { - _super.call(this, this); // error + var _this; + _this = _super.call(this, this) || this; // error this.p = p; } return Foo3; diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index a1cfc196ac6..8e68c47eb27 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -24,7 +24,8 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x) { - _super.call(this, this); + var _this; + _this = _super.call(this, this) || this; this.x = x; } return Foo; diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index fdffdd27d6d..6771f15c99b 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -33,14 +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 + var _this; + _this = _super.call(this, this) || this; // error: "super" has to be called before "this" accessing } return Foo; }(Base)); var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - _super.call(this, this); // error + var _this; + _this = _super.call(this, this) || this; // error this.x = 0; } return Foo2; diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index 09ad6b705a9..4b6c1747d17 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -26,7 +26,8 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - _super.call(this, this); + var _this; + _this = _super.call(this, this) || this; this.x = 0; } return Foo; diff --git a/tests/baselines/reference/thisTypeInFunctions.js b/tests/baselines/reference/thisTypeInFunctions.js index cfe1706ae99..6eaaed5c497 100644 --- a/tests/baselines/reference/thisTypeInFunctions.js +++ b/tests/baselines/reference/thisTypeInFunctions.js @@ -227,7 +227,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D; }(C)); @@ -336,7 +337,8 @@ var Base1 = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived1; }(Base1)); @@ -350,7 +352,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.js b/tests/baselines/reference/thisTypeInFunctionsNegative.js index 4b40ca2e1e7..08e12f49dca 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.js +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.js @@ -296,7 +296,8 @@ var Base1 = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived1; }(Base1)); @@ -310,7 +311,8 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/tsxDynamicTagName5.js b/tests/baselines/reference/tsxDynamicTagName5.js index a8d154998e1..9a64ef6cee6 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.js +++ b/tests/baselines/reference/tsxDynamicTagName5.js @@ -30,7 +30,8 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this._tagName = 'div'; } Text.prototype.render = function () { diff --git a/tests/baselines/reference/tsxDynamicTagName7.js b/tests/baselines/reference/tsxDynamicTagName7.js index dbe171f9682..30500b37ce5 100644 --- a/tests/baselines/reference/tsxDynamicTagName7.js +++ b/tests/baselines/reference/tsxDynamicTagName7.js @@ -30,7 +30,8 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this._tagName = 'div'; } Text.prototype.render = function () { diff --git a/tests/baselines/reference/tsxDynamicTagName8.js b/tests/baselines/reference/tsxDynamicTagName8.js index e6f63b6a9bf..a6cf3bb45b8 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.js +++ b/tests/baselines/reference/tsxDynamicTagName8.js @@ -30,7 +30,8 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this._tagName = 'div'; } Text.prototype.render = function () { diff --git a/tests/baselines/reference/tsxDynamicTagName9.js b/tests/baselines/reference/tsxDynamicTagName9.js index 589cc7cd226..aa63e614d15 100644 --- a/tests/baselines/reference/tsxDynamicTagName9.js +++ b/tests/baselines/reference/tsxDynamicTagName9.js @@ -30,7 +30,8 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this._tagName = 'div'; } Text.prototype.render = function () { diff --git a/tests/baselines/reference/tsxExternalModuleEmit1.js b/tests/baselines/reference/tsxExternalModuleEmit1.js index 0d4e58d7008..0f6b8716ed0 100644 --- a/tests/baselines/reference/tsxExternalModuleEmit1.js +++ b/tests/baselines/reference/tsxExternalModuleEmit1.js @@ -42,7 +42,8 @@ var React = require("react"); var Button = (function (_super) { __extends(Button, _super); function Button() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Button.prototype.render = function () { return ; @@ -63,7 +64,8 @@ var button_1 = require("./button"); var App = (function (_super) { __extends(App, _super); function App() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } App.prototype.render = function () { return ; diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents2.js b/tests/baselines/reference/tsxStatelessFunctionComponents2.js index b93832567d5..f7ac96cff1f 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents2.js +++ b/tests/baselines/reference/tsxStatelessFunctionComponents2.js @@ -52,7 +52,8 @@ function Greet(x) { var BigGreeter = (function (_super) { __extends(BigGreeter, _super); function BigGreeter() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } BigGreeter.prototype.render = function () { return
; diff --git a/tests/baselines/reference/tsxUnionTypeComponent1.js b/tests/baselines/reference/tsxUnionTypeComponent1.js index 444542068be..56a6896f052 100644 --- a/tests/baselines/reference/tsxUnionTypeComponent1.js +++ b/tests/baselines/reference/tsxUnionTypeComponent1.js @@ -35,7 +35,8 @@ var React = require("react"); var MyComponent = (function (_super) { __extends(MyComponent, _super); function MyComponent() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } MyComponent.prototype.render = function () { var AnyComponent = this.props.AnyComponent; @@ -49,7 +50,8 @@ React.createElement(MyComponent, { AnyComponent: function () { return React.crea var MyButtonComponent = (function (_super) { __extends(MyButtonComponent, _super); function MyButtonComponent() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return MyButtonComponent; }(React.Component)); diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index 1d33fa927a7..083cb5e94b3 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -74,7 +74,8 @@ var SomeBase = (function () { var SomeDerived = (function (_super) { __extends(SomeDerived, _super); function SomeDerived() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return SomeDerived; }(SomeBase)); diff --git a/tests/baselines/reference/typeGuardFunction.js b/tests/baselines/reference/typeGuardFunction.js index fcd6435ca1d..45bf0853b13 100644 --- a/tests/baselines/reference/typeGuardFunction.js +++ b/tests/baselines/reference/typeGuardFunction.js @@ -102,7 +102,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionErrors.js b/tests/baselines/reference/typeGuardFunctionErrors.js index f3ff5ffab4a..727640ee8af 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.js +++ b/tests/baselines/reference/typeGuardFunctionErrors.js @@ -164,7 +164,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionGenerics.js b/tests/baselines/reference/typeGuardFunctionGenerics.js index 2b5bd5e8265..dad77edf232 100644 --- a/tests/baselines/reference/typeGuardFunctionGenerics.js +++ b/tests/baselines/reference/typeGuardFunctionGenerics.js @@ -52,7 +52,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThis.js b/tests/baselines/reference/typeGuardFunctionOfFormThis.js index ad85f679e0a..eec648976c6 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThis.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThis.js @@ -161,7 +161,8 @@ var RoyalGuard = (function () { var LeadGuard = (function (_super) { __extends(LeadGuard, _super); function LeadGuard() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } LeadGuard.prototype.lead = function () { }; ; @@ -170,7 +171,8 @@ var LeadGuard = (function (_super) { var FollowerGuard = (function (_super) { __extends(FollowerGuard, _super); function FollowerGuard() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } FollowerGuard.prototype.follow = function () { }; ; @@ -224,7 +226,8 @@ var ArrowGuard = (function () { var ArrowElite = (function (_super) { __extends(ArrowElite, _super); function ArrowElite() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } ArrowElite.prototype.defend = function () { }; return ArrowElite; @@ -232,7 +235,8 @@ var ArrowElite = (function (_super) { var ArrowMedic = (function (_super) { __extends(ArrowMedic, _super); function ArrowMedic() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } ArrowMedic.prototype.heal = function () { }; return ArrowMedic; @@ -266,7 +270,8 @@ var MimicGuard = (function () { var MimicLeader = (function (_super) { __extends(MimicLeader, _super); function MimicLeader() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } MimicLeader.prototype.lead = function () { }; return MimicLeader; @@ -274,7 +279,8 @@ var MimicLeader = (function (_super) { var MimicFollower = (function (_super) { __extends(MimicFollower, _super); function MimicFollower() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } MimicFollower.prototype.follow = function () { }; return MimicFollower; diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js index 73622bf60cc..a82d3d2527f 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js @@ -79,7 +79,8 @@ var RoyalGuard = (function () { var LeadGuard = (function (_super) { __extends(LeadGuard, _super); function LeadGuard() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } LeadGuard.prototype.lead = function () { }; ; @@ -88,7 +89,8 @@ var LeadGuard = (function (_super) { var FollowerGuard = (function (_super) { __extends(FollowerGuard, _super); function FollowerGuard() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } FollowerGuard.prototype.follow = function () { }; ; diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.js b/tests/baselines/reference/typeGuardOfFormInstanceOf.js index a6881cf3cea..a94d5fe93e7 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.js +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -91,7 +91,8 @@ var C2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(C1)); diff --git a/tests/baselines/reference/typeGuardOfFormIsType.js b/tests/baselines/reference/typeGuardOfFormIsType.js index 3f55b9d41ea..2d83a62ad3e 100644 --- a/tests/baselines/reference/typeGuardOfFormIsType.js +++ b/tests/baselines/reference/typeGuardOfFormIsType.js @@ -56,7 +56,8 @@ var C2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(C1)); diff --git a/tests/baselines/reference/typeGuardOfFormThisMember.js b/tests/baselines/reference/typeGuardOfFormThisMember.js index 9d71613ed8f..63c79ce4c91 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMember.js +++ b/tests/baselines/reference/typeGuardOfFormThisMember.js @@ -118,7 +118,8 @@ var Test; var File = (function (_super) { __extends(File, _super); function File(path, content) { - _super.call(this, path); + var _this; + _this = _super.call(this, path) || this; this.content = content; } return File; @@ -127,7 +128,8 @@ var Test; var Directory = (function (_super) { __extends(Directory, _super); function Directory() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Directory; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js index 5991fdd3169..5c28921a6a7 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js +++ b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js @@ -68,7 +68,8 @@ var Test; var File = (function (_super) { __extends(File, _super); function File(path, content) { - _super.call(this, path); + var _this; + _this = _super.call(this, path) || this; this.content = content; } return File; @@ -77,7 +78,8 @@ var Test; var Directory = (function (_super) { __extends(Directory, _super); function Directory() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Directory; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeMatch2.js b/tests/baselines/reference/typeMatch2.js index 57ba67752e2..03408c6196b 100644 --- a/tests/baselines/reference/typeMatch2.js +++ b/tests/baselines/reference/typeMatch2.js @@ -65,7 +65,8 @@ var Animal = (function () { var Giraffe = (function (_super) { __extends(Giraffe, _super); function Giraffe() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Giraffe; }(Animal)); diff --git a/tests/baselines/reference/typeOfSuperCall.js b/tests/baselines/reference/typeOfSuperCall.js index 94215d4ae1b..70ace4becb4 100644 --- a/tests/baselines/reference/typeOfSuperCall.js +++ b/tests/baselines/reference/typeOfSuperCall.js @@ -22,7 +22,8 @@ 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 D; }(C)); diff --git a/tests/baselines/reference/typeParameterAsBaseClass.js b/tests/baselines/reference/typeParameterAsBaseClass.js index a01b6a0cac2..d67259304c3 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.js +++ b/tests/baselines/reference/typeParameterAsBaseClass.js @@ -11,7 +11,8 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(T)); diff --git a/tests/baselines/reference/typeParameterAsBaseType.js b/tests/baselines/reference/typeParameterAsBaseType.js index 9c3a9bcfcd0..24f8789a82d 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.js +++ b/tests/baselines/reference/typeParameterAsBaseType.js @@ -21,14 +21,16 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(T)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(U)); diff --git a/tests/baselines/reference/typeParameterExtendingUnion1.js b/tests/baselines/reference/typeParameterExtendingUnion1.js index 75614f46d21..55bc51bbdbb 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion1.js +++ b/tests/baselines/reference/typeParameterExtendingUnion1.js @@ -27,14 +27,16 @@ var Animal = (function () { var Cat = (function (_super) { __extends(Cat, _super); function Cat() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Cat; }(Animal)); var Dog = (function (_super) { __extends(Dog, _super); function Dog() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Dog; }(Animal)); diff --git a/tests/baselines/reference/typeParameterExtendingUnion2.js b/tests/baselines/reference/typeParameterExtendingUnion2.js index b32c43bc5ec..75f62e94c67 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion2.js +++ b/tests/baselines/reference/typeParameterExtendingUnion2.js @@ -27,14 +27,16 @@ var Animal = (function () { var Cat = (function (_super) { __extends(Cat, _super); function Cat() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Cat; }(Animal)); var Dog = (function (_super) { __extends(Dog, _super); function Dog() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Dog; }(Animal)); diff --git a/tests/baselines/reference/typeRelationships.js b/tests/baselines/reference/typeRelationships.js index 6f8f1ccd4cc..43c1f7ee146 100644 --- a/tests/baselines/reference/typeRelationships.js +++ b/tests/baselines/reference/typeRelationships.js @@ -72,7 +72,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this; + _this = _super.apply(this, arguments) || this; this.self1 = this; this.self2 = this.self; this.self3 = this.foo(); diff --git a/tests/baselines/reference/typeValueConflict1.js b/tests/baselines/reference/typeValueConflict1.js index eaca97d31dd..a1ecef212da 100644 --- a/tests/baselines/reference/typeValueConflict1.js +++ b/tests/baselines/reference/typeValueConflict1.js @@ -33,7 +33,8 @@ var M2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(M1.A)); diff --git a/tests/baselines/reference/typeValueConflict2.js b/tests/baselines/reference/typeValueConflict2.js index d89ab0fd357..a0cfeda07ec 100644 --- a/tests/baselines/reference/typeValueConflict2.js +++ b/tests/baselines/reference/typeValueConflict2.js @@ -40,7 +40,8 @@ var M2; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(M1.A)); @@ -51,7 +52,8 @@ var M3; var B = (function (_super) { __extends(B, _super); function B() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return B; }(M1.A)); diff --git a/tests/baselines/reference/typeofClass2.js b/tests/baselines/reference/typeofClass2.js index a0c30c1b166..b3da31103df 100644 --- a/tests/baselines/reference/typeofClass2.js +++ b/tests/baselines/reference/typeofClass2.js @@ -37,7 +37,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.baz = function (x) { }; D.prototype.foo = function () { }; diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.js b/tests/baselines/reference/typesWithSpecializedCallSignatures.js index e83fd36ae62..853cb5eafd7 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.js @@ -56,14 +56,16 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js index 63d5e9bb5b2..99314597440 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js @@ -54,14 +54,16 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/undeclaredBase.js b/tests/baselines/reference/undeclaredBase.js index 3dd27a3dbfb..64117b1935a 100644 --- a/tests/baselines/reference/undeclaredBase.js +++ b/tests/baselines/reference/undeclaredBase.js @@ -14,7 +14,8 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C; }(M.I)); diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js index 513464daa85..451aec91aff 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -136,105 +136,120 @@ var Base = (function () { var D0 = (function (_super) { __extends(D0, _super); function D0() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D0; }(Base)); var DA = (function (_super) { __extends(DA, _super); function DA() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return DA; }(Base)); var D1 = (function (_super) { __extends(D1, _super); function D1() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1; }(Base)); var D1A = (function (_super) { __extends(D1A, _super); function D1A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D1A; }(Base)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2; }(Base)); var D2A = (function (_super) { __extends(D2A, _super); function D2A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D2A; }(Base)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D3; }(Base)); var D3A = (function (_super) { __extends(D3A, _super); function D3A() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D3A; }(Base)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D4; }(Base)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D5; }(Base)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D6; }(Base)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D7; }(Base)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D8; }(Base)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D9; }(Base)); var D10 = (function (_super) { __extends(D10, _super); function D10() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D10; }(Base)); @@ -245,7 +260,8 @@ var E; var D11 = (function (_super) { __extends(D11, _super); function D11() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D11; }(Base)); @@ -257,7 +273,8 @@ var f; var D12 = (function (_super) { __extends(D12, _super); function D12() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D12; }(Base)); @@ -273,21 +290,24 @@ var c; var D13 = (function (_super) { __extends(D13, _super); function D13() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D13; }(Base)); var D14 = (function (_super) { __extends(D14, _super); function D14() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D14; }(Base)); var D15 = (function (_super) { __extends(D15, _super); function D15() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D15; }(Base)); @@ -297,14 +317,16 @@ var D15 = (function (_super) { var D16 = (function (_super) { __extends(D16, _super); function D16() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D16; }(Base)); var D17 = (function (_super) { __extends(D17, _super); function D17() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return D17; }(Base)); diff --git a/tests/baselines/reference/underscoreMapFirst.js b/tests/baselines/reference/underscoreMapFirst.js index a615faea805..61f1bf2c9f9 100644 --- a/tests/baselines/reference/underscoreMapFirst.js +++ b/tests/baselines/reference/underscoreMapFirst.js @@ -57,7 +57,8 @@ var __extends = (this && this.__extends) || function (d, b) { var MyView = (function (_super) { __extends(MyView, _super); function MyView() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } MyView.prototype.getDataSeries = function () { var data = this.model.get("data"); diff --git a/tests/baselines/reference/unionTypeEquivalence.js b/tests/baselines/reference/unionTypeEquivalence.js index 1ff47f68e5f..b0be82122de 100644 --- a/tests/baselines/reference/unionTypeEquivalence.js +++ b/tests/baselines/reference/unionTypeEquivalence.js @@ -34,7 +34,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.foo = function () { }; return D; diff --git a/tests/baselines/reference/unionTypeFromArrayLiteral.js b/tests/baselines/reference/unionTypeFromArrayLiteral.js index 95dd9d39853..72cf61f72fd 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.js +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.js @@ -54,7 +54,8 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } E.prototype.foo3 = function () { }; return E; @@ -62,7 +63,8 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } F.prototype.foo4 = function () { }; return F; diff --git a/tests/baselines/reference/unionTypesAssignability.js b/tests/baselines/reference/unionTypesAssignability.js index c7105608004..fafc4ec85fa 100644 --- a/tests/baselines/reference/unionTypesAssignability.js +++ b/tests/baselines/reference/unionTypesAssignability.js @@ -88,7 +88,8 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } D.prototype.foo1 = function () { }; return D; @@ -96,7 +97,8 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } E.prototype.foo2 = function () { }; return E; diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 03ed4990c29..46ee4ed02d5 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -63,7 +63,8 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - _super.call(this, asdf); + var _this; + _this = _super.call(this, asdf) || this; } return C4; }(C3)); diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index 7b3938c7099..b2ea2cac9eb 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -169,7 +169,8 @@ var ts; var Type = (function (_super) { __extends(Type, _super); function Type() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Type.prototype.equals = function (that) { if (this === that) @@ -233,7 +234,8 @@ var ts; var Property = (function (_super) { __extends(Property, _super); function Property(name, type, flags) { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.name = name; this.type = type; this.flags = flags; @@ -253,7 +255,8 @@ var ts; var Signature = (function (_super) { __extends(Signature, _super); function Signature(typeParameters, parameters, returnType) { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.typeParameters = typeParameters; this.parameters = parameters; this.returnType = returnType; @@ -273,7 +276,8 @@ var ts; var Parameter = (function (_super) { __extends(Parameter, _super); function Parameter(name, type, flags) { - _super.call(this); + var _this; + _this = _super.call(this) || this; this.name = name; this.type = type; this.flags = flags; diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js index e991db69367..324dc784b67 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js @@ -70,7 +70,8 @@ var r4 = c2(); // should be an error var C2 = (function (_super) { __extends(C2, _super); function C2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return C2; }(Function)); // error diff --git a/tests/baselines/reference/unusedClassesinNamespace4.js b/tests/baselines/reference/unusedClassesinNamespace4.js index 65198c1c1aa..3c1dd16874e 100644 --- a/tests/baselines/reference/unusedClassesinNamespace4.js +++ b/tests/baselines/reference/unusedClassesinNamespace4.js @@ -36,7 +36,8 @@ var Validation; var c3 = (function (_super) { __extends(c3, _super); function c3() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return c3; }(c1)); diff --git a/tests/baselines/reference/unusedIdentifiersConsolidated1.js b/tests/baselines/reference/unusedIdentifiersConsolidated1.js index 521f17bf5ef..fd7d859ac37 100644 --- a/tests/baselines/reference/unusedIdentifiersConsolidated1.js +++ b/tests/baselines/reference/unusedIdentifiersConsolidated1.js @@ -168,7 +168,8 @@ var Greeter; var class2 = (function (_super) { __extends(class2, _super); function class2() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } return class2; }(class1)); diff --git a/tests/baselines/reference/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index 027ba254ae0..96802932f12 100644 --- a/tests/baselines/reference/validUseOfThisInSuper.js +++ b/tests/baselines/reference/validUseOfThisInSuper.js @@ -24,8 +24,8 @@ 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. + var _this; + _this = _super.call(this, (function () { return _this; })()) || 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; }(Base)); diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index db8f566702a..e892cc28a3c 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -41,7 +41,8 @@ define(["require", "exports"], function (require, exports) { var B = (function (_super) { __extends(B, _super); function B(element, url) { - _super.call(this, element); + var _this; + _this = _super.call(this, element) || this; this.p1 = element; this.p2 = url; } From d778e78f1ef118befdd2ae4866864bfd1465f389 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 2 Sep 2016 00:08:26 -0700 Subject: [PATCH 03/47] Transform other instances of 'this' to '_this' when in the constructor of a derived class. --- src/compiler/transformers/es6.ts | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index aab894dc4ff..5dd2b154c01 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -722,7 +722,10 @@ 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 savedUseCapturedThis = useCapturedThis; + useCapturedThis = true; + + const constructorFunction = createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -733,8 +736,13 @@ namespace ts { /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper), /*location*/ constructor || node - ) - ); + ); + + if (extendsClauseElement) { + setNodeEmitFlags(constructorFunction, NodeEmitFlags.CapturesThis); + } + useCapturedThis = savedUseCapturedThis; + statements.push(constructorFunction); } /** @@ -769,6 +777,7 @@ namespace ts { function transformConstructorBody(constructor: ConstructorDeclaration, node: ClassDeclaration | ClassExpression, extendsClauseElement: ExpressionWithTypeArguments, hasSynthesizedSuper: boolean) { const statements: Statement[] = []; startLexicalEnvironment(); + if (constructor) { declareOrCaptureThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement); addDefaultValueAssignmentsIfNeeded(statements, constructor); @@ -830,12 +839,14 @@ namespace ts { // 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) { + const actualThis = createThis(); + setNodeEmitFlags(actualThis, NodeEmitFlags.NoSubstitution); const superCall = createFunctionApply( createIdentifier("_super"), - createThis(), + actualThis, createIdentifier("arguments"), ); - const superReturnValueOrThis = createLogicalOr(superCall, createThis()); + const superReturnValueOrThis = createLogicalOr(superCall, actualThis); statements.push( createVariableStatement( @@ -2504,6 +2515,9 @@ namespace ts { // because we contain a SpreadElementExpression. const { target, thisArg } = createCallBinding(node.expression, hoistVariableDeclaration); + if (node.expression.kind === SyntaxKind.SuperKeyword) { + setNodeEmitFlags(thisArg, NodeEmitFlags.NoSubstitution); + } let resultingCall: CallExpression | BinaryExpression; if (node.transformFlags & TransformFlags.ContainsSpreadElementExpression) { // [source] @@ -2546,11 +2560,13 @@ namespace ts { } if (node.expression.kind === SyntaxKind.SuperKeyword) { + const actualThis = createThis(); + setNodeEmitFlags(actualThis, NodeEmitFlags.NoSubstitution); return createAssignment( createIdentifier("_this"), createLogicalOr( resultingCall, - createThis() + actualThis ) ); } From c21cc24c44689875f1a0104a366ac65ff5975361 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 2 Sep 2016 00:12:03 -0700 Subject: [PATCH 04/47] Accepted baselines for all tests apart from one with source map changes. --- tests/baselines/reference/abstractProperty.js | 4 +- .../reference/abstractPropertyNegative.js | 6 +- .../accessOverriddenBaseClassMember1.js | 2 +- ...aliasUsageInTypeArgumentOfExtendsClause.js | 2 +- tests/baselines/reference/autolift4.js | 2 +- tests/baselines/reference/baseCheck.js | 12 +- tests/baselines/reference/bases.js | 2 +- .../reference/bestCommonTypeOfTuple2.js | 2 +- .../checkSuperCallBeforeThisAccessing1.js | 6 +- .../checkSuperCallBeforeThisAccessing2.js | 6 +- .../checkSuperCallBeforeThisAccessing3.js | 4 +- .../checkSuperCallBeforeThisAccessing4.js | 4 +- .../checkSuperCallBeforeThisAccessing5.js | 2 +- .../checkSuperCallBeforeThisAccessing8.js | 2 +- .../classConstructorAccessibility2.js | 6 +- ...classConstructorParametersAccessibility.js | 2 +- ...lassConstructorParametersAccessibility2.js | 2 +- ...lassConstructorParametersAccessibility3.js | 4 +- tests/baselines/reference/classExpression3.js | 4 +- .../reference/classExtendingClassLikeType.js | 12 +- .../reference/classSideInheritance3.js | 2 +- tests/baselines/reference/classUpdateTests.js | 12 +- ...ollisionSuperAndLocalFunctionInProperty.js | 2 +- .../collisionSuperAndLocalVarInProperty.js | 4 +- .../reference/collisionSuperAndParameter.js | 2 +- ...perAndPropertyNameAsConstuctorParameter.js | 4 +- .../reference/computedPropertyNames30_ES5.js | 2 +- tests/baselines/reference/constructorArgs.js | 2 +- .../reference/declFileGenericType2.js | 2 +- ...derivedClassConstructorWithoutSuperCall.js | 2 +- .../derivedClassParameterProperties.js | 34 +- ...dClassSuperCallsInNonConstructorMembers.js | 2 +- .../derivedClassSuperCallsWithThisArg.js | 10 +- .../derivedClassWithoutExplicitConstructor.js | 8 +- ...derivedClassWithoutExplicitConstructor2.js | 8 +- ...derivedClassWithoutExplicitConstructor3.js | 16 +- ...BeforeEmitParameterPropertyDeclaration1.js | 2 +- ...SuperCallBeforeEmitPropertyDeclaration1.js | 2 +- ...arationAndParameterPropertyDeclaration1.js | 4 +- tests/baselines/reference/errorSuperCalls.js | 4 +- tests/baselines/reference/es6ClassTest.js | 12 +- ...ericRecursiveImplicitConstructorErrors3.js | 2 +- .../illegalSuperCallsInConstructor.js | 4 +- .../interfaceExtendsClassWithPrivate2.js | 6 +- ...objectCreationOfElementAccessExpression.js | 16 +- tests/baselines/reference/optionalMethods.js | 2 +- .../reference/optionalParameterProperty.js | 2 +- .../overloadOnConstConstraintChecks4.js | 2 +- tests/baselines/reference/parserAstSpans1.js | 4 +- .../baselines/reference/parserRealSource10.js | 24 +- .../baselines/reference/parserRealSource11.js | 308 +++++++++--------- tests/baselines/reference/parserharness.js | 8 +- .../privateInstanceMemberAccessibility.js | 4 +- .../privateStaticMemberAccessibility.js | 2 +- .../readonlyConstructorAssignment.js | 10 +- tests/baselines/reference/scopeTests.js | 4 +- .../baselines/reference/staticInheritance.js | 4 +- tests/baselines/reference/staticPropSuper.js | 6 +- .../reference/strictModeInConstructor.js | 6 +- tests/baselines/reference/superAccess2.js | 4 +- .../reference/superCallArgsMustMatch.js | 2 +- .../superCallBeforeThisAccessing1.js | 2 +- .../superCallBeforeThisAccessing3.js | 2 +- .../superCallBeforeThisAccessing4.js | 4 +- .../superCallBeforeThisAccessing5.js | 2 +- .../superCallBeforeThisAccessing6.js | 2 +- .../superCallBeforeThisAccessing7.js | 2 +- .../superCallBeforeThisAccessing8.js | 2 +- .../reference/superCallInNonStaticMethod.js | 6 +- .../reference/superCallOutsideConstructor.js | 4 +- .../superCallParameterContextualTyping3.js | 2 +- tests/baselines/reference/superCalls.js | 2 +- tests/baselines/reference/superErrors.js | 2 +- .../reference/superInConstructorParam1.js | 2 +- tests/baselines/reference/superInLambdas.js | 10 +- .../reference/superPropertyAccess1.js | 2 +- .../reference/superPropertyAccess2.js | 2 +- .../reference/superPropertyAccessNoError.js | 2 +- .../reference/superPropertyAccess_ES5.js | 2 +- .../reference/superWithTypeArgument.js | 2 +- .../reference/superWithTypeArgument2.js | 2 +- .../reference/superWithTypeArgument3.js | 2 +- .../reference/thisInInvalidContexts.js | 6 +- .../thisInInvalidContextsExternalModule.js | 6 +- tests/baselines/reference/thisInSuperCall.js | 10 +- tests/baselines/reference/thisInSuperCall1.js | 4 +- tests/baselines/reference/thisInSuperCall2.js | 6 +- tests/baselines/reference/thisInSuperCall3.js | 4 +- .../baselines/reference/tsxDynamicTagName5.js | 2 +- .../baselines/reference/tsxDynamicTagName7.js | 2 +- .../baselines/reference/tsxDynamicTagName8.js | 2 +- .../baselines/reference/tsxDynamicTagName9.js | 2 +- .../reference/typeGuardOfFormThisMember.js | 2 +- .../typeGuardOfFormThisMemberErrors.js | 2 +- .../baselines/reference/typeRelationships.js | 8 +- .../reference/unspecializedConstraints.js | 18 +- .../reference/varArgsOnConstructorTypes.js | 4 +- 97 files changed, 389 insertions(+), 389 deletions(-) diff --git a/tests/baselines/reference/abstractProperty.js b/tests/baselines/reference/abstractProperty.js index 803df9f1d56..d9bfd5eb05f 100644 --- a/tests/baselines/reference/abstractProperty.js +++ b/tests/baselines/reference/abstractProperty.js @@ -37,8 +37,8 @@ var C = (function (_super) { function C() { var _this; _this = _super.apply(this, arguments) || this; - this.raw = "edge"; - this.ro = "readonly please"; + _this.raw = "edge"; + _this.ro = "readonly please"; } Object.defineProperty(C.prototype, "prop", { get: function () { return "foo"; }, diff --git a/tests/baselines/reference/abstractPropertyNegative.js b/tests/baselines/reference/abstractPropertyNegative.js index d6e1ce1813f..e94d9492fdb 100644 --- a/tests/baselines/reference/abstractPropertyNegative.js +++ b/tests/baselines/reference/abstractPropertyNegative.js @@ -59,7 +59,7 @@ var C = (function (_super) { function C() { var _this; _this = _super.apply(this, arguments) || this; - this.ro = "readonly please"; + _this.ro = "readonly please"; } Object.defineProperty(C.prototype, "concreteWithNoBody", { get: function () { }, @@ -80,7 +80,7 @@ var WrongTypePropertyImpl = (function (_super) { function WrongTypePropertyImpl() { var _this; _this = _super.apply(this, arguments) || this; - this.num = "nope, wrong"; + _this.num = "nope, wrong"; } return WrongTypePropertyImpl; }(WrongTypeProperty)); @@ -107,7 +107,7 @@ var WrongTypeAccessorImpl2 = (function (_super) { function WrongTypeAccessorImpl2() { var _this; _this = _super.apply(this, arguments) || this; - this.num = "nope, wrong"; + _this.num = "nope, wrong"; } return WrongTypeAccessorImpl2; }(WrongTypeAccessor)); diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index d60f260a163..b4c269b1e3b 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -36,7 +36,7 @@ var ColoredPoint = (function (_super) { function ColoredPoint(x, y, color) { var _this; _this = _super.call(this, x, y) || this; - this.color = color; + _this.color = color; } ColoredPoint.prototype.toString = function () { return _super.prototype.toString.call(this) + " color=" + this.color; diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 1893f6586ee..462390d28f7 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -67,7 +67,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.apply(this, arguments) || this; - this.x = moduleA; + _this.x = moduleA; } return D; }(C)); diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index 85dd3725639..b6afd28d429 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -45,7 +45,7 @@ var Point3D = (function (_super) { function Point3D(x, y, z, m) { var _this; _this = _super.call(this, x, y) || this; - this.z = z; + _this.z = z; } 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/baseCheck.js b/tests/baselines/reference/baseCheck.js index 800742ff63b..c3a2731b45d 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -63,8 +63,8 @@ var D = (function (_super) { __extends(D, _super); function D(z) { var _this; - _this = _super.call(this, this.z) || this; - this.z = z; + _this = _super.call(this, _this.z) || this; + _this.z = z; } return D; }(C)); // too few params @@ -72,8 +72,8 @@ var E = (function (_super) { __extends(E, _super); function E(z) { var _this; - _this = _super.call(this, 0, this.z) || this; - this.z = z; + _this = _super.call(this, 0, _this.z) || this; + _this.z = z; } return E; }(C)); @@ -81,8 +81,8 @@ var F = (function (_super) { __extends(F, _super); function F(z) { var _this; - _this = _super.call(this, "hello", this.z) || this; - this.z = z; + _this = _super.call(this, "hello", _this.z) || this; + _this.z = z; } return F; }(C)); // first param type diff --git a/tests/baselines/reference/bases.js b/tests/baselines/reference/bases.js index fcf1d7fe124..ff6a3262d45 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -37,7 +37,7 @@ var C = (function (_super) { __extends(C, _super); function C() { var _this; - this.x; + _this.x; any; } return C; diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index 36232ad04b1..34deb346cbd 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -62,7 +62,7 @@ var D1 = (function (_super) { function D1() { var _this; _this = _super.apply(this, arguments) || this; - this.i = "bar"; + _this.i = "bar"; } return D1; }(C1)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js index dc70f3e8d08..35e00c36621 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js @@ -26,9 +26,9 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.call(this) || this; - this; - this.x = 10; - var that = this; + _this; + _this.x = 10; + var that = _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js index f1fcdb48dae..b49c1aab774 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js @@ -25,10 +25,10 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { var _this; - this.x = 100; + _this.x = 100; _this = _super.call(this) || this; - this.x = 10; - var that = this; + _this.x = 10; + var that = _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js index d2ede7d04b1..70600bb03a9 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js @@ -37,8 +37,8 @@ var Derived = (function (_super) { return innver; }()); _this = _super.call(this) || this; - this.x = 10; - var that = this; + _this.x = 10; + var that = _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js index c6eddf4ef48..95e0062b087 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js @@ -45,8 +45,8 @@ var Derived = (function (_super) { })(); _this = _super.call(this) || this; _this = _super.call(this) || this; - this.x = 10; - var that = this; + _this.x = 10; + var that = _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js index e58d55fd274..1c77b2e7c78 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -26,7 +26,7 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { var _this; - _this = _super.call(this, this.x) || this; + _this = _super.call(this, _this.x) || this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js index cf0da205d71..a280c0d6ca6 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js @@ -29,7 +29,7 @@ var Super = (function (_super) { __extends(Super, _super); function Super() { var _this; - var that = this; + var that = _this; _this = _super.call(this) || this; } return Super; diff --git a/tests/baselines/reference/classConstructorAccessibility2.js b/tests/baselines/reference/classConstructorAccessibility2.js index 95206681372..9d1ebdd9d9a 100644 --- a/tests/baselines/reference/classConstructorAccessibility2.js +++ b/tests/baselines/reference/classConstructorAccessibility2.js @@ -79,7 +79,7 @@ var DerivedA = (function (_super) { function DerivedA(x) { var _this; _this = _super.call(this, x) || this; - this.x = x; + _this.x = x; } DerivedA.prototype.createInstance = function () { new DerivedA(5); }; DerivedA.prototype.createBaseInstance = function () { new BaseA(6); }; @@ -91,7 +91,7 @@ var DerivedB = (function (_super) { function DerivedB(x) { var _this; _this = _super.call(this, x) || this; - this.x = x; + _this.x = x; } DerivedB.prototype.createInstance = function () { new DerivedB(7); }; DerivedB.prototype.createBaseInstance = function () { new BaseB(8); }; // ok @@ -103,7 +103,7 @@ var DerivedC = (function (_super) { function DerivedC(x) { var _this; _this = _super.call(this, x) || this; - this.x = x; + _this.x = x; } DerivedC.prototype.createInstance = function () { new DerivedC(9); }; DerivedC.prototype.createBaseInstance = function () { new BaseC(10); }; // error diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index 1f282ba7132..066c724b60f 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -61,7 +61,7 @@ var Derived = (function (_super) { function Derived(p) { var _this; _this = _super.call(this, p) || this; - this.p; // OK + _this.p; // OK } return Derived; }(C3)); diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 81ad696ddc8..b8050435171 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -61,7 +61,7 @@ var Derived = (function (_super) { function Derived(p) { var _this; _this = _super.call(this, p) || this; - this.p; // OK + _this.p; // OK } return Derived; }(C3)); diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index 95509867cc5..9e0c0264fd9 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -30,8 +30,8 @@ var Derived = (function (_super) { function Derived(p) { var _this; _this = _super.call(this, p) || this; - this.p = p; - this.p; // OK + _this.p = p; + _this.p; // OK } return Derived; }(Base)); diff --git a/tests/baselines/reference/classExpression3.js b/tests/baselines/reference/classExpression3.js index b91d5413611..e0ba9c349e7 100644 --- a/tests/baselines/reference/classExpression3.js +++ b/tests/baselines/reference/classExpression3.js @@ -17,7 +17,7 @@ var C = (function (_super) { function class_1() { var _this; _this = _super.apply(this, arguments) || this; - this.c = 3; + _this.c = 3; } return class_1; }((function (_super) { @@ -25,7 +25,7 @@ var C = (function (_super) { function class_2() { var _this; _this = _super.apply(this, arguments) || this; - this.b = 2; + _this.b = 2; } return class_2; }((function () { diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index 031253a19ad..2d91befc172 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -78,8 +78,8 @@ var D1 = (function (_super) { function D1() { var _this; _this = _super.call(this, "abc", "def") || this; - this.x = "x"; - this.y = "y"; + _this.x = "x"; + _this.y = "y"; } return D1; }(getBase())); @@ -89,8 +89,8 @@ var D2 = (function (_super) { var _this; _this = _super.call(this, 10) || this; _this = _super.call(this, 10, 20) || this; - this.x = 1; - this.y = 2; + _this.x = 1; + _this.y = 2; } return D2; }(getBase())); @@ -99,8 +99,8 @@ var D3 = (function (_super) { function D3() { var _this; _this = _super.call(this, "abc", 42) || this; - this.x = "x"; - this.y = 2; + _this.x = "x"; + _this.y = 2; } return D3; }(getBase())); diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index d9e4c3f1482..4751e0e8d6e 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -35,7 +35,7 @@ var B = (function (_super) { function B(x, data) { var _this; _this = _super.call(this, x) || this; - this.data = data; + _this.data = data; } return B; }(A)); diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 7b13fa1bf4c..d334e1c7f66 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -159,7 +159,7 @@ var E = (function (_super) { function E() { var _this; _this = _super.apply(this, arguments) || this; - this.p1 = 0; + _this.p1 = 0; } return E; }(D)); @@ -175,7 +175,7 @@ var G = (function (_super) { function G() { var _this; _this = _super.call(this) || this; - this.p1 = 0; + _this.p1 = 0; } // NO ERROR return G; }(D)); @@ -198,7 +198,7 @@ var J = (function (_super) { function J(p1) { var _this; _this = _super.call(this) || this; // NO ERROR - this.p1 = p1; + _this.p1 = p1; } return J; }(G)); @@ -206,7 +206,7 @@ var K = (function (_super) { __extends(K, _super); function K(p1) { var _this; - this.p1 = p1; + _this.p1 = p1; var i = 0; _this = _super.call(this) || this; } @@ -217,7 +217,7 @@ var L = (function (_super) { function L(p1) { var _this; _this = _super.call(this) || this; // NO ERROR - this.p1 = p1; + _this.p1 = p1; } return L; }(G)); @@ -225,7 +225,7 @@ var M = (function (_super) { __extends(M, _super); function M(p1) { var _this; - this.p1 = p1; + _this.p1 = p1; var i = 0; _this = _super.call(this) || this; } diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index da4175fe5c7..e3d834dd1d4 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -42,7 +42,7 @@ var b = (function (_super) { function b() { var _this; _this = _super.apply(this, arguments) || this; - this.prop2 = { + _this.prop2 = { doStuff: function () { function _super() { } diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index 598bb5b6e85..e7cb0e613cc 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -40,12 +40,12 @@ var b = (function (_super) { function b() { var _this; _this = _super.apply(this, arguments) || this; - this.prop2 = { + _this.prop2 = { doStuff: function () { var _super = 10; // Should be error } }; - this._super = 10; // No error + _this._super = 10; // No error } return b; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index 9909ca512ce..a60889888d6 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -96,7 +96,7 @@ var Foo2 = (function (_super) { function Foo2(_super) { var _this; _this = _super.call(this) || this; - this.prop4 = { + _this.prop4 = { doStuff: function (_super) { } }; diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index 6a8dd340a20..696f439a4b1 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -54,7 +54,7 @@ var b2 = (function (_super) { function b2(_super) { var _this; _this = _super.call(this) || this; - this._super = _super; + _this._super = _super; } return b2; }(a)); @@ -71,7 +71,7 @@ var b4 = (function (_super) { function b4(_super) { var _this; _this = _super.call(this) || this; - this._super = _super; + _this._super = _super; } return b4; }(a)); diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index c31d873ffb9..9fbe5f380ca 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -36,7 +36,7 @@ var C = (function (_super) { // Ideally, we would capture this. But the reference is // illegal, and not capturing this is consistent with //treatment of other similar violations. - _a[(_this = _super.call(_this) || _this, "prop")] = function () { }, + _a[(_this = _super.call(this) || this, "prop")] = function () { }, _a); var _a; }); diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index 3345708ddaa..2c2838c97f9 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -31,7 +31,7 @@ var Sub = (function (_super) { function Sub(options) { var _this; _this = _super.call(this, options.value) || this; - this.options = options; + _this.options = options; } return Sub; }(Super)); diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 4ccc090f4f2..50280b589b3 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -81,7 +81,7 @@ var templa; function AbstractCompositeElementController() { var _this; _this = _super.call(this) || this; - this._controllers = []; + _this._controllers = []; } return AbstractCompositeElementController; }(templa.dom.mvc.AbstractElementController)); diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index 75901c708b3..58903b2ba57 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -60,7 +60,7 @@ var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { var _this; - var r2 = function () { return _this = _super.call(_this) || _this; }; // error for misplaced super call (nested function) + var r2 = function () { return _this = _super.call(this) || this; }; // error for misplaced super call (nested function) } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index f7afd6529c0..658e56fb098 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -119,7 +119,7 @@ var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(y) { var _this; - this.y = y; + _this.y = y; var a = 1; _this = _super.call(this) || this; // error } @@ -130,7 +130,7 @@ var Derived3 = (function (_super) { function Derived3(y) { var _this; _this = _super.call(this) || this; // ok - this.y = y; + _this.y = y; var a = 1; } return Derived3; @@ -139,7 +139,7 @@ var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(y) { var _this; - this.a = 1; + _this.a = 1; var b = 2; _this = _super.call(this) || this; // error } @@ -150,7 +150,7 @@ var Derived5 = (function (_super) { function Derived5(y) { var _this; _this = _super.call(this) || this; // ok - this.a = 1; + _this.a = 1; var b = 2; } return Derived5; @@ -159,7 +159,7 @@ var Derived6 = (function (_super) { __extends(Derived6, _super); function Derived6(y) { var _this; - this.a = 1; + _this.a = 1; var b = 2; _this = _super.call(this) || this; // error: "super" has to be called before "this" accessing } @@ -169,9 +169,9 @@ var Derived7 = (function (_super) { __extends(Derived7, _super); function Derived7(y) { var _this; - this.a = 1; - this.a = 3; - this.b = 3; + _this.a = 1; + _this.a = 3; + _this.b = 3; _this = _super.call(this) || this; // error } return Derived7; @@ -181,9 +181,9 @@ var Derived8 = (function (_super) { function Derived8(y) { var _this; _this = _super.call(this) || this; // ok - this.a = 1; - this.a = 3; - this.b = 3; + _this.a = 1; + _this.a = 3; + _this.b = 3; } return Derived8; }(Base)); @@ -197,9 +197,9 @@ var Derived9 = (function (_super) { __extends(Derived9, _super); function Derived9(y) { var _this; - this.a = 1; - this.a = 3; - this.b = 3; + _this.a = 1; + _this.a = 3; + _this.b = 3; _this = _super.call(this) || this; // error } return Derived9; @@ -209,9 +209,9 @@ var Derived10 = (function (_super) { function Derived10(y) { var _this; _this = _super.call(this) || this; // ok - this.a = 1; - this.a = 3; - this.b = 3; + _this.a = 1; + _this.a = 3; + _this.b = 3; } return Derived10; }(Base2)); diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js index ad2dc22debf..6b06204b8e9 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js @@ -48,7 +48,7 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.apply(this, arguments) || this; - this.a = _this = _super.call(this) || this; + _this.a = _this = _super.call(this) || this; } Derived.prototype.b = function () { _this = _super.call(this) || this; diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index a464970fe50..e73d0041206 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -43,7 +43,7 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { var _this; - _this = _super.call(this, this) || this; // ok + _this = _super.call(this, _this) || this; // ok } return Derived; }(Base)); @@ -51,8 +51,8 @@ var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(a) { var _this; - _this = _super.call(this, this) || this; // error - this.a = a; + _this = _super.call(this, _this) || this; // error + _this.a = a; } return Derived2; }(Base)); @@ -61,7 +61,7 @@ var Derived3 = (function (_super) { function Derived3(a) { var _this; _this = _super.call(this, function () { return _this; }) || this; // error - this.a = a; + _this.a = a; } return Derived3; }(Base)); @@ -70,7 +70,7 @@ var Derived4 = (function (_super) { function Derived4(a) { var _this; _this = _super.call(this, function () { return this; }) || this; // ok - this.a = a; + _this.a = a; } return Derived4; }(Base)); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index 84028f1d3f2..cc260f09499 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -43,8 +43,8 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.apply(this, arguments) || this; - this.x = 1; - this.y = 'hello'; + _this.x = 1; + _this.y = 'hello'; } return Derived; }(Base)); @@ -61,8 +61,8 @@ var D = (function (_super) { function D() { var _this; _this = _super.apply(this, arguments) || this; - this.x = 2; - this.y = null; + _this.x = 2; + _this.y = null; } return D; }(Base2)); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index 6c3ce90d6f0..d3711ec27c0 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -51,8 +51,8 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.apply(this, arguments) || this; - this.x = 1; - this.y = 'hello'; + _this.x = 1; + _this.y = 'hello'; } return Derived; }(Base)); @@ -71,8 +71,8 @@ var D = (function (_super) { function D() { var _this; _this = _super.apply(this, arguments) || this; - this.x = 2; - this.y = null; + _this.x = 2; + _this.y = null; } return D; }(Base2)); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index 295fbac60e1..14f9fdf88af 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -65,8 +65,8 @@ var Derived = (function (_super) { function Derived(y, z) { var _this; _this = _super.call(this, 2) || this; - this.b = ''; - this.b = y; + _this.b = ''; + _this.b = y; } return Derived; }(Base)); @@ -75,8 +75,8 @@ var Derived2 = (function (_super) { function Derived2() { var _this; _this = _super.apply(this, arguments) || this; - this.x = 1; - this.y = 'hello'; + _this.x = 1; + _this.y = 'hello'; } return Derived2; }(Derived)); @@ -94,8 +94,8 @@ var D = (function (_super) { function D(y, z) { var _this; _this = _super.call(this, 2) || this; - this.b = null; - this.b = y; + _this.b = null; + _this.b = y; } return D; }(Base)); @@ -104,8 +104,8 @@ var D2 = (function (_super) { function D2() { var _this; _this = _super.apply(this, arguments) || this; - this.x = 2; - this.y = null; + _this.x = 2; + _this.y = null; } return D2; }(D)); diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index 4e07d5c8655..60fa8e32c1e 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -32,7 +32,7 @@ var B = (function (_super) { "use strict"; 'someStringForEgngInject'; _this = _super.call(this) || this; - this.x = x; + _this.x = x; } return B; }(A)); diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js index b6eabb2a418..abef8394924 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js @@ -34,7 +34,7 @@ var B = (function (_super) { "use strict"; 'someStringForEgngInject'; _this = _super.call(this) || this; - this.blub = 12; + _this.blub = 12; } return B; }(A)); diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js index 0e866e98f46..0f36d9d9115 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -32,8 +32,8 @@ var B = (function (_super) { "use strict"; 'someStringForEgngInject'; _this = _super.call(this) || this; - this.x = x; - this.blah = 2; + _this.x = x; + _this.blah = 2; } return B; }(A)); diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index 765fdf083b5..4f54781deb9 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -133,7 +133,7 @@ var Derived = (function (_super) { //super call with type arguments function Derived() { var _this; - _super.prototype..call(this); + _super.prototype..call(_this); _this = _super.call(this) || this; } return Derived; @@ -149,7 +149,7 @@ var OtherDerived = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; //super call in class member initializer of derived type - this.t = _this = _super.call(this) || this; + _this.t = _this = _super.call(this) || this; } OtherDerived.prototype.fn = function () { //super call in class member function of derived type diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index 0a6323630fb..4b2cb2c51b5 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -105,12 +105,12 @@ var Foo = (function (_super) { var _this; if (z === void 0) { z = 0; } _this = _super.call(this, x) || this; - this.y = y; - this.z = z; - this.gar = 0; - this.zoo = "zoo"; - this.x = x; - this.gar = 5; + _this.y = y; + _this.z = z; + _this.gar = 0; + _this.zoo = "zoo"; + _this.x = x; + _this.gar = 5; } Foo.prototype.bar = function () { return 0; }; Foo.prototype.boo = function (x) { return x; }; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index 226fede58b6..49109e1aa5a 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -61,7 +61,7 @@ var TypeScript; function PullTypeSymbol() { var _this; _this = _super.apply(this, arguments) || this; - this._elementType = null; + _this._elementType = null; } PullTypeSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { var s = this.getScopedNameEx(scopeSymbol, useConstraintInName).toString(); diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index e27a9789cb1..77f0a0a2b6b 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -35,8 +35,8 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { var _this; - var r2 = function () { return _this = _super.call(_this) || _this; }; - var r3 = function () { _this = _super.call(_this) || _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() { diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index 6f35c3f0e40..3f205640f59 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -41,8 +41,8 @@ var D = (function (_super) { function D() { var _this; _this = _super.apply(this, arguments) || this; - this.x = 2; - this.y = 3; + _this.x = 2; + _this.y = 3; } D.prototype.foo = function (x) { return x; }; D.prototype.other = function (x) { return x; }; @@ -54,7 +54,7 @@ var D2 = (function (_super) { function D2() { var _this; _this = _super.apply(this, arguments) || this; - this.x = ""; + _this.x = ""; } D2.prototype.foo = function (x) { return x; }; D2.prototype.other = function (x) { return x; }; diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index ddfbce8fc12..9543082fbd1 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -83,7 +83,7 @@ var MonsterFood = (function (_super) { function MonsterFood(name, flavor) { var _this; _this = _super.call(this, name) || this; - this.flavor = flavor; + _this.flavor = flavor; } return MonsterFood; }(Food)); @@ -92,7 +92,7 @@ var IceCream = (function (_super) { function IceCream(flavor) { var _this; _this = _super.call(this, "Ice Cream", flavor) || this; - this.flavor = flavor; + _this.flavor = flavor; } return IceCream; }(MonsterFood)); @@ -101,8 +101,8 @@ var Cookie = (function (_super) { function Cookie(flavor, isGlutenFree) { var _this; _this = _super.call(this, "Cookie", flavor) || this; - this.flavor = flavor; - this.isGlutenFree = isGlutenFree; + _this.flavor = flavor; + _this.isGlutenFree = isGlutenFree; } return Cookie; }(MonsterFood)); @@ -111,7 +111,7 @@ var PetFood = (function (_super) { function PetFood(name, whereToBuy) { var _this; _this = _super.call(this, name) || this; - this.whereToBuy = whereToBuy; + _this.whereToBuy = whereToBuy; } return PetFood; }(Food)); @@ -120,7 +120,7 @@ var ExpensiveOrganicDogFood = (function (_super) { function ExpensiveOrganicDogFood(whereToBuy) { var _this; _this = _super.call(this, "Origen", whereToBuy) || this; - this.whereToBuy = whereToBuy; + _this.whereToBuy = whereToBuy; } return ExpensiveOrganicDogFood; }(PetFood)); @@ -129,8 +129,8 @@ var ExpensiveOrganicCatFood = (function (_super) { function ExpensiveOrganicCatFood(whereToBuy, containsFish) { var _this; _this = _super.call(this, "Nature's Logic", whereToBuy) || this; - this.whereToBuy = whereToBuy; - this.containsFish = containsFish; + _this.whereToBuy = whereToBuy; + _this.containsFish = containsFish; } return ExpensiveOrganicCatFood; }(PetFood)); diff --git a/tests/baselines/reference/optionalMethods.js b/tests/baselines/reference/optionalMethods.js index 408f73b6533..1885c419fef 100644 --- a/tests/baselines/reference/optionalMethods.js +++ b/tests/baselines/reference/optionalMethods.js @@ -111,7 +111,7 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.apply(this, arguments) || this; - this.a = 1; + _this.a = 1; } Derived.prototype.f = function () { return 1; }; return Derived; diff --git a/tests/baselines/reference/optionalParameterProperty.js b/tests/baselines/reference/optionalParameterProperty.js index b23da97c790..44eb2a7aa56 100644 --- a/tests/baselines/reference/optionalParameterProperty.js +++ b/tests/baselines/reference/optionalParameterProperty.js @@ -27,7 +27,7 @@ var D = (function (_super) { function D(p) { var _this; _this = _super.call(this) || this; - this.p = p; + _this.p = p; } return D; }(C)); diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index 6a750612395..22bacbdb0b4 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -29,7 +29,7 @@ var A = (function (_super) { function A() { var _this; _this = _super.apply(this, arguments) || this; - this.x = 1; + _this.x = 1; } return A; }(Z)); diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index 6e6a423fe90..365e640c150 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -320,7 +320,7 @@ var c3 = (function (_super) { function c3() { var _this; _this = _super.call(this, 10) || this; - this.p1 = _super.prototype.c2_p1; + _this.p1 = _super.prototype.c2_p1; } /** c3 f1*/ c3.prototype.f1 = function () { @@ -408,7 +408,7 @@ var c6 = (function (_super) { function c6() { var _this; _this = _super.call(this) || this; - this.d = _super.prototype.b; + _this.d = _super.prototype.b; } return c6; }(c5)); diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 429a388c894..c9f011704d0 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -828,8 +828,8 @@ var TypeScript; function NumberLiteralToken(value, hasEmptyFraction) { var _this; _this = _super.call(this, TokenID.NumberLiteral) || this; - this.value = value; - this.hasEmptyFraction = hasEmptyFraction; + _this.value = value; + _this.hasEmptyFraction = hasEmptyFraction; } NumberLiteralToken.prototype.getText = function () { return this.hasEmptyFraction ? this.value.toString() + ".0" : this.value.toString(); @@ -845,7 +845,7 @@ var TypeScript; function StringLiteralToken(value) { var _this; _this = _super.call(this, TokenID.StringLiteral) || this; - this.value = value; + _this.value = value; } StringLiteralToken.prototype.getText = function () { return this.value; @@ -861,8 +861,8 @@ var TypeScript; function IdentifierToken(value, hasEscapeSequence) { var _this; _this = _super.call(this, TokenID.Identifier) || this; - this.value = value; - this.hasEscapeSequence = hasEscapeSequence; + _this.value = value; + _this.hasEscapeSequence = hasEscapeSequence; } IdentifierToken.prototype.getText = function () { return this.value; @@ -878,7 +878,7 @@ var TypeScript; function WhitespaceToken(tokenId, value) { var _this; _this = _super.call(this, tokenId) || this; - this.value = value; + _this.value = value; } WhitespaceToken.prototype.getText = function () { return this.value; @@ -894,11 +894,11 @@ var TypeScript; function CommentToken(tokenID, value, isBlock, startPos, line, endsLine) { var _this; _this = _super.call(this, tokenID) || this; - this.value = value; - this.isBlock = isBlock; - this.startPos = startPos; - this.line = line; - this.endsLine = endsLine; + _this.value = value; + _this.isBlock = isBlock; + _this.startPos = startPos; + _this.line = line; + _this.endsLine = endsLine; } CommentToken.prototype.getText = function () { return this.value; @@ -914,7 +914,7 @@ var TypeScript; function RegularExpressionLiteralToken(regex) { var _this; _this = _super.call(this, TokenID.RegularExpressionLiteral) || this; - this.regex = regex; + _this.regex = regex; } RegularExpressionLiteralToken.prototype.getText = function () { return this.regex.toString(); diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index 4be1ed20767..054608e9d19 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2388,14 +2388,14 @@ var TypeScript; function AST(nodeType) { var _this; _this = _super.call(this) || this; - this.nodeType = nodeType; - this.type = null; - this.flags = ASTFlags.Writeable; + _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; } AST.prototype.isExpression = function () { return false; }; AST.prototype.isStatementOrExpression = function () { return false; }; @@ -2545,8 +2545,8 @@ var TypeScript; function IncompleteAST(min, lim) { var _this; _this = _super.call(this, NodeType.Error) || this; - this.minChar = min; - this.limChar = lim; + _this.minChar = min; + _this.limChar = lim; } return IncompleteAST; }(AST)); @@ -2556,8 +2556,8 @@ var TypeScript; function ASTList() { var _this; _this = _super.call(this, NodeType.List) || this; - this.enclosingScope = null; - this.members = new AST[]; + _this.enclosingScope = null; + _this.members = new AST[]; } ASTList.prototype.addToControlFlow = function (context) { var len = this.members.length; @@ -2624,11 +2624,11 @@ var TypeScript; function Identifier(actualText, hasEscapeSequence) { var _this; _this = _super.call(this, NodeType.Name) || this; - this.actualText = actualText; - this.hasEscapeSequence = hasEscapeSequence; - this.sym = null; - this.cloId = -1; - this.setText(actualText, hasEscapeSequence); + _this.actualText = actualText; + _this.hasEscapeSequence = hasEscapeSequence; + _this.sym = null; + _this.cloId = -1; + _this.setText(actualText, hasEscapeSequence); } Identifier.prototype.setText = function (actualText, hasEscapeSequence) { this.actualText = actualText; @@ -2684,7 +2684,7 @@ var TypeScript; function Label(id) { var _this; _this = _super.call(this, NodeType.Label) || this; - this.id = id; + _this.id = id; } Label.prototype.printLabel = function () { return this.id.actualText + ":"; }; Label.prototype.typeCheck = function (typeFlow) { @@ -2720,9 +2720,9 @@ var TypeScript; function UnaryExpression(nodeType, operand) { var _this; _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; + _this.operand = operand; + _this.targetType = null; // Target type for an object literal (null if no target type) + _this.castTerm = null; } UnaryExpression.prototype.addToControlFlow = function (context) { _super.prototype.addToControlFlow.call(this, context); @@ -2865,10 +2865,10 @@ var TypeScript; function CallExpression(nodeType, target, arguments) { var _this; _this = _super.call(this, nodeType) || this; - this.target = target; - this.arguments = arguments; - this.signature = null; - this.minChar = this.target.minChar; + _this.target = target; + _this.arguments = arguments; + _this.signature = null; + _this.minChar = _this.target.minChar; } CallExpression.prototype.typeCheck = function (typeFlow) { if (this.nodeType == NodeType.New) { @@ -2898,8 +2898,8 @@ var TypeScript; function BinaryExpression(nodeType, operand1, operand2) { var _this; _this = _super.call(this, nodeType) || this; - this.operand1 = operand1; - this.operand2 = operand2; + _this.operand1 = operand1; + _this.operand2 = operand2; } BinaryExpression.prototype.typeCheck = function (typeFlow) { switch (this.nodeType) { @@ -3051,9 +3051,9 @@ var TypeScript; function ConditionalExpression(operand1, operand2, operand3) { var _this; _this = _super.call(this, NodeType.ConditionalExpression) || this; - this.operand1 = operand1; - this.operand2 = operand2; - this.operand3 = operand3; + _this.operand1 = operand1; + _this.operand2 = operand2; + _this.operand3 = operand3; } ConditionalExpression.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckQMark(this); @@ -3077,9 +3077,9 @@ var TypeScript; function NumberLiteral(value, hasEmptyFraction) { var _this; _this = _super.call(this, NodeType.NumberLit) || this; - this.value = value; - this.hasEmptyFraction = hasEmptyFraction; - this.isNegativeZero = false; + _this.value = value; + _this.hasEmptyFraction = hasEmptyFraction; + _this.isNegativeZero = false; } NumberLiteral.prototype.typeCheck = function (typeFlow) { this.type = typeFlow.doubleType; @@ -3119,7 +3119,7 @@ var TypeScript; function RegexLiteral(regex) { var _this; _this = _super.call(this, NodeType.Regex) || this; - this.regex = regex; + _this.regex = regex; } RegexLiteral.prototype.typeCheck = function (typeFlow) { this.type = typeFlow.regexType; @@ -3140,7 +3140,7 @@ var TypeScript; function StringLiteral(text) { var _this; _this = _super.call(this, NodeType.QString) || this; - this.text = text; + _this.text = text; } StringLiteral.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3176,10 +3176,10 @@ var TypeScript; function ImportDeclaration(id, alias) { var _this; _this = _super.call(this, NodeType.ImportDeclaration) || this; - this.id = id; - this.alias = alias; - this.varFlags = VarFlags.None; - this.isDynamicImport = false; + _this.id = id; + _this.alias = alias; + _this.varFlags = VarFlags.None; + _this.isDynamicImport = false; } ImportDeclaration.prototype.isStatementOrExpression = function () { return true; }; ImportDeclaration.prototype.emit = function (emitter, tokenId, startLine) { @@ -3236,12 +3236,12 @@ var TypeScript; function BoundDecl(id, nodeType, nestingLevel) { var _this; _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; + _this.id = id; + _this.nestingLevel = nestingLevel; + _this.init = null; + _this.typeExpr = null; + _this.varFlags = VarFlags.None; + _this.sym = null; } BoundDecl.prototype.isStatementOrExpression = function () { return true; }; BoundDecl.prototype.isPrivate = function () { return hasFlag(this.varFlags, VarFlags.Private); }; @@ -3279,8 +3279,8 @@ var TypeScript; function ArgDecl(id) { var _this; _this = _super.call(this, id, NodeType.ArgDecl, 0) || this; - this.isOptional = false; - this.parameterPropertySym = null; + _this.isOptional = false; + _this.parameterPropertySym = null; } ArgDecl.prototype.isOptionalArg = function () { return this.isOptional || this.init; }; ArgDecl.prototype.treeViewLabel = function () { @@ -3302,35 +3302,35 @@ var TypeScript; function FuncDecl(name, bod, isConstructor, arguments, vars, scopes, statics, nodeType) { var _this; _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; + _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; } FuncDecl.prototype.internalName = function () { if (this.internalNameCache == null) { @@ -3443,21 +3443,21 @@ var TypeScript; function Script(vars, scopes) { var _this; _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; + _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; } Script.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckScript(this); @@ -3513,10 +3513,10 @@ var TypeScript; function NamedDeclaration(nodeType, name, members) { var _this; _this = _super.call(this, nodeType) || this; - this.name = name; - this.members = members; - this.leftCurlyCount = 0; - this.rightCurlyCount = 0; + _this.name = name; + _this.members = members; + _this.leftCurlyCount = 0; + _this.rightCurlyCount = 0; } return NamedDeclaration; }(ModuleElement)); @@ -3526,15 +3526,15 @@ var TypeScript; function ModuleDeclaration(name, members, vars, scopes, endingToken) { var _this; _this = _super.call(this, NodeType.ModuleDeclaration, name, members) || this; - this.endingToken = endingToken; - this.modFlags = ModuleFlags.ShouldEmitModuleDecl; - this.amdDependencies = []; + _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; } ModuleDeclaration.prototype.isExported = function () { return hasFlag(this.modFlags, ModuleFlags.Exported); }; ModuleDeclaration.prototype.isAmbient = function () { return hasFlag(this.modFlags, ModuleFlags.Ambient); }; @@ -3562,9 +3562,9 @@ var TypeScript; function TypeDeclaration(nodeType, name, extendsList, implementsList, members) { var _this; _this = _super.call(this, nodeType, name, members) || this; - this.extendsList = extendsList; - this.implementsList = implementsList; - this.varFlags = VarFlags.None; + _this.extendsList = extendsList; + _this.implementsList = implementsList; + _this.varFlags = VarFlags.None; } TypeDeclaration.prototype.isExported = function () { return hasFlag(this.varFlags, VarFlags.Exported); @@ -3580,10 +3580,10 @@ var TypeScript; function ClassDeclaration(name, members, extendsList, implementsList) { var _this; _this = _super.call(this, NodeType.ClassDeclaration, name, extendsList, implementsList, members) || this; - this.knownMemberNames = {}; - this.constructorDecl = null; - this.constructorNestingLevel = 0; - this.endingToken = null; + _this.knownMemberNames = {}; + _this.constructorDecl = null; + _this.constructorNestingLevel = 0; + _this.endingToken = null; } ClassDeclaration.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckClass(this); @@ -3613,7 +3613,7 @@ var TypeScript; function Statement(nodeType) { var _this; _this = _super.call(this, nodeType) || this; - this.flags |= ASTFlags.IsStatement; + _this.flags |= ASTFlags.IsStatement; } Statement.prototype.isLoop = function () { return false; }; Statement.prototype.isStatementOrExpression = function () { return true; }; @@ -3630,8 +3630,8 @@ var TypeScript; function LabeledStatement(labels, stmt) { var _this; _this = _super.call(this, NodeType.LabeledStatement) || this; - this.labels = labels; - this.stmt = stmt; + _this.labels = labels; + _this.stmt = stmt; } LabeledStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3665,8 +3665,8 @@ var TypeScript; function Block(statements, isStatementBlock) { var _this; _this = _super.call(this, NodeType.Block) || this; - this.statements = statements; - this.isStatementBlock = isStatementBlock; + _this.statements = statements; + _this.isStatementBlock = isStatementBlock; } Block.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3721,8 +3721,8 @@ var TypeScript; function Jump(nodeType) { var _this; _this = _super.call(this, nodeType) || this; - this.target = null; - this.resolvedTarget = null; + _this.target = null; + _this.resolvedTarget = null; } Jump.prototype.hasExplicitTarget = function () { return (this.target); }; Jump.prototype.setResolvedTarget = function (parser, stmt) { @@ -3773,8 +3773,8 @@ var TypeScript; function WhileStatement(cond) { var _this; _this = _super.call(this, NodeType.While) || this; - this.cond = cond; - this.body = null; + _this.cond = cond; + _this.body = null; } WhileStatement.prototype.isLoop = function () { return true; }; WhileStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -3826,9 +3826,9 @@ var TypeScript; function DoWhileStatement() { var _this; _this = _super.call(this, NodeType.DoWhile) || this; - this.body = null; - this.whileAST = null; - this.cond = null; + _this.body = null; + _this.whileAST = null; + _this.cond = null; } DoWhileStatement.prototype.isLoop = function () { return true; }; DoWhileStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -3883,9 +3883,9 @@ var TypeScript; function IfStatement(cond) { var _this; _this = _super.call(this, NodeType.If) || this; - this.cond = cond; - this.elseBod = null; - this.statement = new ASTSpan(); + _this.cond = cond; + _this.elseBod = null; + _this.statement = new ASTSpan(); } IfStatement.prototype.isCompoundStatement = function () { return true; }; IfStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -3962,7 +3962,7 @@ var TypeScript; function ReturnStatement() { var _this; _this = _super.call(this, NodeType.Return) || this; - this.returnExpression = null; + _this.returnExpression = null; } ReturnStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4003,11 +4003,11 @@ var TypeScript; function ForInStatement(lval, obj) { var _this; _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; + _this.lval = lval; + _this.obj = obj; + _this.statement = new ASTSpan(); + if (_this.lval && (_this.lval.nodeType == NodeType.VarDecl)) { + _this.lval.varFlags |= VarFlags.AutoInit; } } ForInStatement.prototype.isLoop = function () { return true; }; @@ -4119,7 +4119,7 @@ var TypeScript; function ForStatement(init) { var _this; _this = _super.call(this, NodeType.For) || this; - this.init = init; + _this.init = init; } ForStatement.prototype.isLoop = function () { return true; }; ForStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -4211,8 +4211,8 @@ var TypeScript; function WithStatement(expr) { var _this; _this = _super.call(this, NodeType.With) || this; - this.expr = expr; - this.withSym = null; + _this.expr = expr; + _this.withSym = null; } WithStatement.prototype.isCompoundStatement = function () { return true; }; WithStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -4238,9 +4238,9 @@ var TypeScript; function SwitchStatement(val) { var _this; _this = _super.call(this, NodeType.Switch) || this; - this.val = val; - this.defaultCase = null; - this.statement = new ASTSpan(); + _this.val = val; + _this.defaultCase = null; + _this.statement = new ASTSpan(); } SwitchStatement.prototype.isCompoundStatement = function () { return true; }; SwitchStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -4311,7 +4311,7 @@ var TypeScript; function CaseStatement() { var _this; _this = _super.call(this, NodeType.Case) || this; - this.expr = null; + _this.expr = null; } CaseStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4365,8 +4365,8 @@ var TypeScript; function TypeReference(term, arrayCount) { var _this; _this = _super.call(this, NodeType.TypeRef) || this; - this.term = term; - this.arrayCount = arrayCount; + _this.term = term; + _this.arrayCount = arrayCount; } TypeReference.prototype.emit = function (emitter, tokenId, startLine) { throw new Error("should not emit a type ref"); @@ -4396,8 +4396,8 @@ var TypeScript; function TryFinally(tryNode, finallyNode) { var _this; _this = _super.call(this, NodeType.TryFinally) || this; - this.tryNode = tryNode; - this.finallyNode = finallyNode; + _this.tryNode = tryNode; + _this.finallyNode = finallyNode; } TryFinally.prototype.isCompoundStatement = function () { return true; }; TryFinally.prototype.emit = function (emitter, tokenId, startLine) { @@ -4442,8 +4442,8 @@ var TypeScript; function TryCatch(tryNode, catchNode) { var _this; _this = _super.call(this, NodeType.TryCatch) || this; - this.tryNode = tryNode; - this.catchNode = catchNode; + _this.tryNode = tryNode; + _this.catchNode = catchNode; } TryCatch.prototype.isCompoundStatement = function () { return true; }; TryCatch.prototype.emit = function (emitter, tokenId, startLine) { @@ -4493,7 +4493,7 @@ var TypeScript; function Try(body) { var _this; _this = _super.call(this, NodeType.Try) || this; - this.body = body; + _this.body = body; } Try.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4522,12 +4522,12 @@ var TypeScript; function Catch(param, body) { var _this; _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; + _this.param = param; + _this.body = body; + _this.statement = new ASTSpan(); + _this.containedScope = null; + if (_this.param) { + _this.param.varFlags |= VarFlags.AutoInit; } } Catch.prototype.emit = function (emitter, tokenId, startLine) { @@ -4596,7 +4596,7 @@ var TypeScript; function Finally(body) { var _this; _this = _super.call(this, NodeType.Finally) || this; - this.body = body; + _this.body = body; } Finally.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4625,10 +4625,10 @@ var TypeScript; function Comment(content, isBlockComment, endsLine) { var _this; _this = _super.call(this, NodeType.Comment) || this; - this.content = content; - this.isBlockComment = isBlockComment; - this.endsLine = endsLine; - this.text = null; + _this.content = content; + _this.isBlockComment = isBlockComment; + _this.endsLine = endsLine; + _this.text = null; } Comment.prototype.getText = function () { if (this.text == null) { diff --git a/tests/baselines/reference/parserharness.js b/tests/baselines/reference/parserharness.js index 3f7e05e7164..f0db6078832 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2382,8 +2382,8 @@ var Harness; function TestCase(description, block) { var _this; _this = _super.call(this, description, block) || this; - this.description = description; - this.block = block; + _this.description = description; + _this.block = block; } TestCase.prototype.addChild = function (child) { throw new Error("Testcases may not be nested inside other testcases"); @@ -2417,8 +2417,8 @@ var Harness; function Scenario(description, block) { var _this; _this = _super.call(this, description, block) || this; - this.description = description; - this.block = block; + _this.description = description; + _this.block = block; } /** Run the block, and if the block doesn't raise an error, run the children. */ Scenario.prototype.run = function (done) { diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index cfdc137aedf..618c38b89d5 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -29,8 +29,8 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.apply(this, arguments) || this; - this.x = _super.prototype.foo; // error - this.z = _super.prototype.foo; // error + _this.x = _super.prototype.foo; // error + _this.z = _super.prototype.foo; // error } Derived.prototype.y = function () { return _super.prototype.foo; // error diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index aad41d01b07..e953198290b 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -24,7 +24,7 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.apply(this, arguments) || this; - this.bing = function () { return Base.foo; }; // error + _this.bing = function () { return Base.foo; }; // error } return Derived; }(Base)); diff --git a/tests/baselines/reference/readonlyConstructorAssignment.js b/tests/baselines/reference/readonlyConstructorAssignment.js index 1c1e2a94ff1..f1b69ecc00b 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.js +++ b/tests/baselines/reference/readonlyConstructorAssignment.js @@ -59,7 +59,7 @@ var B = (function (_super) { var _this; _this = _super.call(this, x) || this; // Fails, x is readonly - this.x = 1; + _this.x = 1; } return B; }(A)); @@ -70,8 +70,8 @@ var C = (function (_super) { function C(x) { var _this; _this = _super.call(this, x) || this; - this.x = x; - this.x = 1; + _this.x = x; + _this.x = 1; } return C; }(A)); @@ -88,8 +88,8 @@ var E = (function (_super) { function E(x) { var _this; _this = _super.call(this, x) || this; - this.x = x; - this.x = 1; + _this.x = x; + _this.x = 1; } return E; }(D)); diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index e9394a64c9b..3fd9018e945 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -27,8 +27,8 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this) || this; - this.v = 1; - this.p = 1; + _this.v = 1; + _this.p = 1; C.s = 1; } return D; diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index 8b4b8326cab..462f2382f3c 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -29,8 +29,8 @@ var B = (function (_super) { function B() { var _this; _this = _super.apply(this, arguments) || this; - this.p1 = doThing(A); // OK - this.p2 = doThing(B); // OK + _this.p1 = doThing(A); // OK + _this.p2 = doThing(B); // OK } return B; }(A)); diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index b2eea36eece..f5bac0135af 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -60,7 +60,7 @@ var C = (function (_super) { __extends(C, _super); function C() { var _this; - this.p = 10; + _this.p = 10; var x = 1; // should error } return C; @@ -69,7 +69,7 @@ var D = (function (_super) { __extends(D, _super); function D() { var _this; - this.p = 11; + _this.p = 11; var x = 1; // should error } return D; @@ -78,7 +78,7 @@ var E = (function (_super) { __extends(E, _super); function E() { var _this; - this.p = 12; + _this.p = 12; var x = 1; // should error } return E; diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index e40e0c45a59..1af13b1ce7a 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -77,7 +77,7 @@ var B = (function (_super) { var _this; "use strict"; // No error _this = _super.call(this) || this; - this.s = 9; + _this.s = 9; } return B; }(A)); @@ -86,7 +86,7 @@ var C = (function (_super) { function C() { var _this; _this = _super.call(this) || this; // No error - this.s = 9; + _this.s = 9; "use strict"; } return C; @@ -95,7 +95,7 @@ var D = (function (_super) { __extends(D, _super); function D() { var _this; - this.s = 9; + _this.s = 9; var x = 1; // Error _this = _super.call(this) || this; "use strict"; diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index ff711ca8d75..807347e1d16 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -46,8 +46,8 @@ var Q = (function (_super) { if (zz === void 0) { zz = _super.; } if (zzz === void 0) { zzz = function () { return _super.; }; } _this = _super.call(this) || this; - this.z = z; - this.xx = _super.prototype.; + _this.z = z; + _this.xx = _super.prototype.; } Q.prototype.foo = function (zz) { if (zz === void 0) { zz = _super.prototype.; } diff --git a/tests/baselines/reference/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index 3dec9369dd4..770cb0bf79f 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -44,7 +44,7 @@ var T6 = (function (_super) { // Should error; base constructor has type T for first arg, // which is instantiated with 'number' in the extends clause _this = _super.call(this, "hi") || this; - var x = this.foo; + var x = _this.foo; } return T6; }(T5)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing1.js b/tests/baselines/reference/superCallBeforeThisAccessing1.js index e70dde9fd8e..6af4482f371 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing1.js @@ -33,7 +33,7 @@ var D = (function (_super) { var _this; _this = _super.call(this, i) || this; var s = { - t: this._t + t: _this._t }; var i = Factory.create(s); } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing3.js b/tests/baselines/reference/superCallBeforeThisAccessing3.js index 1f4c8114913..f77cb964179 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing3.js @@ -30,7 +30,7 @@ var D = (function (_super) { 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 + _this._t; // error _this = _super.call(this, undefined) || this; } return D; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing4.js b/tests/baselines/reference/superCallBeforeThisAccessing4.js index 2645eaa9795..c147b0d84cc 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing4.js @@ -25,7 +25,7 @@ var D = (function (_super) { __extends(D, _super); function D() { var _this; - this._t; + _this._t; _this = _super.call(this) || this; } return D; @@ -35,7 +35,7 @@ var E = (function (_super) { function E() { var _this; _this = _super.call(this) || this; - this._t; + _this._t; } return E; }(null)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing5.js b/tests/baselines/reference/superCallBeforeThisAccessing5.js index df345ec5c26..8fff8068ec0 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing5.js @@ -17,7 +17,7 @@ var D = (function (_super) { __extends(D, _super); function D() { var _this; - this._t; // No error + _this._t; // No error } return D; }(null)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing6.js b/tests/baselines/reference/superCallBeforeThisAccessing6.js index d4e8c979552..843a1d3b2cf 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing6.js @@ -25,7 +25,7 @@ var D = (function (_super) { __extends(D, _super); function D() { var _this; - _this = _super.call(this, this) || this; + _this = _super.call(this, _this) || this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing7.js b/tests/baselines/reference/superCallBeforeThisAccessing7.js index f6c41b144eb..d6ad948a08c 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing7.js @@ -29,7 +29,7 @@ var D = (function (_super) { function D() { var _this; var x = { - j: this._t + j: _this._t }; _this = _super.call(this, undefined) || this; } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing8.js b/tests/baselines/reference/superCallBeforeThisAccessing8.js index 7d09351621a..cbf0236c4cc 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing8.js @@ -30,7 +30,7 @@ var D = (function (_super) { var _this; var x = { k: _this = _super.call(this, undefined) || this, - j: this._t + j: _this._t }; } return D; diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index 6640a32be5a..1dd120eeb5c 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -68,9 +68,9 @@ var Other = (function (_super) { function Other() { var _this; _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); + _this.propertyInitializer = _super.prototype.instanceMethod.call(_this); + _this.functionProperty = function () { _super.prototype.instanceMethod.call(_this); }; + _super.prototype.instanceMethod.call(_this); } // in instance method Other.prototype.instanceMethod = function () { diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index fd91de4cc8e..774dde72340 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -39,9 +39,9 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this) || this; - this.x = _this = _super.call(this) || this; + _this.x = _this = _super.call(this) || this; var y = function () { - _this = _super.call(_this) || _this; + _this = _super.call(this) || this; }; var y2 = function () { _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superCallParameterContextualTyping3.js b/tests/baselines/reference/superCallParameterContextualTyping3.js index cfa3fd1c074..d77df52ddd6 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -57,7 +57,7 @@ var C = (function (_super) { }) || this; // Should be okay. // 'p' should have type 'string'. - _super.prototype.foo.call(this, { + _super.prototype.foo.call(_this, { method: function (p) { p.length; } diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index 96b0061f47e..33127da6437 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -49,7 +49,7 @@ var Derived = (function (_super) { function Derived(q) { var _this; _this = _super.call(this, '') || this; - this.q = q; + _this.q = q; //type of super call expression is void var p = _this = _super.call(this, '') || this; var p = v(); diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index f962876a391..2e68370fc32 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -78,7 +78,7 @@ var RegisteredUser = (function (_super) { function RegisteredUser() { var _this; _this = _super.call(this) || this; - this.name = "Frank"; + _this.name = "Frank"; // super call in an inner function in a constructor function inner() { _super.sayHello.call(this); diff --git a/tests/baselines/reference/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index ab1744929a9..56e40b65e10 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -28,7 +28,7 @@ var C = (function (_super) { __extends(C, _super); function C(a) { var _this; - if (a === void 0) { a = _super.foo.call(this); } + if (a === void 0) { a = _super.foo.call(_this); } } return C; }(B)); diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index f2c84cb7e64..5a1f48f3826 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -87,9 +87,9 @@ var RegisteredUser = (function (_super) { function RegisteredUser() { var _this; _this = _super.call(this) || this; - this.name = "Frank"; + _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); }; } @@ -107,7 +107,7 @@ var RegisteredUser2 = (function (_super) { function RegisteredUser2() { var _this; _this = _super.call(this) || this; - this.name = "Joe"; + _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); }; }; }; } @@ -123,7 +123,7 @@ var RegisteredUser3 = (function (_super) { function RegisteredUser3() { var _this; _this = _super.call(this) || this; - this.name = "Sam"; + _this.name = "Sam"; // super property in a nested lambda in a constructor var superName = function () { return function () { return function () { return _super.prototype.name; }; }; }; } @@ -139,7 +139,7 @@ var RegisteredUser4 = (function (_super) { function RegisteredUser4() { var _this; _this = _super.call(this) || this; - this.name = "Mark"; + _this.name = "Mark"; // super in a nested lambda in a constructor var x = function () { return function () { return _super.prototype.; }; }; } diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index 86f059a2fb2..c9865806570 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -52,7 +52,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this) || this; - _super.prototype.bar.call(this); + _super.prototype.bar.call(_this); _super.prototype.x; // error } D.prototype.foo = function () { diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index be0c44b4081..df6e08177cb 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -52,7 +52,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this) || this; - _super.prototype.bar.call(this); // error + _super.prototype.bar.call(_this); // error _super.prototype.x; // error } D.foo = function () { diff --git a/tests/baselines/reference/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index f7663eab6e0..d8dda26288c 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -101,7 +101,7 @@ var SomeDerivedClass = (function (_super) { function SomeDerivedClass() { var _this; _this = _super.call(this) || this; - var x = _super.prototype.func.call(this); + var x = _super.prototype.func.call(_this); var x; } SomeDerivedClass.prototype.fn = function () { diff --git a/tests/baselines/reference/superPropertyAccess_ES5.js b/tests/baselines/reference/superPropertyAccess_ES5.js index 14492c2788a..1d2ab4c2a3f 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.js +++ b/tests/baselines/reference/superPropertyAccess_ES5.js @@ -51,7 +51,7 @@ var MyDerived = (function (_super) { function MyDerived() { var _this; _this = _super.call(this) || this; - var f1 = _super.prototype.getValue.call(this); + var f1 = _super.prototype.getValue.call(_this); var f2 = _super.prototype.value; } return MyDerived; diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index a4acd321f50..cc46fa96896 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -24,7 +24,7 @@ var D = (function (_super) { __extends(D, _super); function D() { var _this; - _super.prototype..call(this); + _super.prototype..call(_this); } return D; }(C)); diff --git a/tests/baselines/reference/superWithTypeArgument2.js b/tests/baselines/reference/superWithTypeArgument2.js index ca399c4de78..4b5176bed96 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -24,7 +24,7 @@ var D = (function (_super) { __extends(D, _super); function D(x) { var _this; - _super.prototype..call(this, x); + _super.prototype..call(_this, x); } return D; }(C)); diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index 5a124586d0c..aa70803de4d 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -29,7 +29,7 @@ var D = (function (_super) { __extends(D, _super); function D() { var _this; - _super.prototype..call(this); + _super.prototype..call(_this); } D.prototype.bar = function () { _super.prototype.bar.call(this, null); diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 2a86b144ae5..218ebfb1686 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -71,7 +71,7 @@ var ClassWithNoInitializer = (function (_super) { //'this' in optional super call function ClassWithNoInitializer() { var _this; - _this = _super.call(this, this) || this; // Error + _this = _super.call(this, _this) || this; // Error } return ClassWithNoInitializer; }(BaseErrClass)); @@ -80,8 +80,8 @@ var ClassWithInitializer = (function (_super) { //'this' in required super call function ClassWithInitializer() { var _this; - _this = _super.call(this, this) || this; // Error - this.t = 4; + _this = _super.call(this, _this) || this; // Error + _this.t = 4; } return ClassWithInitializer; }(BaseErrClass)); diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 3748ebaa42f..c14f71ac0b6 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -72,7 +72,7 @@ var ClassWithNoInitializer = (function (_super) { //'this' in optional super call function ClassWithNoInitializer() { var _this; - _this = _super.call(this, this) || this; // error: "super" has to be called before "this" accessing + _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing } return ClassWithNoInitializer; }(BaseErrClass)); @@ -81,8 +81,8 @@ var ClassWithInitializer = (function (_super) { //'this' in required super call function ClassWithInitializer() { var _this; - _this = _super.call(this, this) || this; // Error - this.t = 4; + _this = _super.call(this, _this) || this; // Error + _this.t = 4; } return ClassWithInitializer; }(BaseErrClass)); diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index 91e71522e4d..cf64eebced1 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -37,7 +37,7 @@ var Foo = (function (_super) { __extends(Foo, _super); function Foo() { var _this; - _this = _super.call(this, this) || this; // error: "super" has to be called before "this" accessing + _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing } return Foo; }(Base)); @@ -45,8 +45,8 @@ var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { var _this; - _this = _super.call(this, this) || this; // error - this.p = 0; + _this = _super.call(this, _this) || this; // error + _this.p = 0; } return Foo2; }(Base)); @@ -54,8 +54,8 @@ var Foo3 = (function (_super) { __extends(Foo3, _super); function Foo3(p) { var _this; - _this = _super.call(this, this) || this; // error - this.p = p; + _this = _super.call(this, _this) || this; // error + _this.p = p; } return Foo3; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index 8e68c47eb27..eba933d9893 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -25,8 +25,8 @@ var Foo = (function (_super) { __extends(Foo, _super); function Foo(x) { var _this; - _this = _super.call(this, this) || this; - this.x = x; + _this = _super.call(this, _this) || this; + _this.x = x; } return Foo; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index 6771f15c99b..ed6baabb408 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -34,7 +34,7 @@ var Foo = (function (_super) { __extends(Foo, _super); function Foo() { var _this; - _this = _super.call(this, this) || this; // error: "super" has to be called before "this" accessing + _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing } return Foo; }(Base)); @@ -42,8 +42,8 @@ var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { var _this; - _this = _super.call(this, this) || this; // error - this.x = 0; + _this = _super.call(this, _this) || this; // error + _this.x = 0; } return Foo2; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index 4b6c1747d17..d705d5fa7e0 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -27,8 +27,8 @@ var Foo = (function (_super) { __extends(Foo, _super); function Foo() { var _this; - _this = _super.call(this, this) || this; - this.x = 0; + _this = _super.call(this, _this) || this; + _this.x = 0; } return Foo; }(Base)); diff --git a/tests/baselines/reference/tsxDynamicTagName5.js b/tests/baselines/reference/tsxDynamicTagName5.js index 9a64ef6cee6..76b79dbc7dc 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.js +++ b/tests/baselines/reference/tsxDynamicTagName5.js @@ -32,7 +32,7 @@ var Text = (function (_super) { function Text() { var _this; _this = _super.apply(this, arguments) || this; - this._tagName = 'div'; + _this._tagName = 'div'; } Text.prototype.render = function () { return (); diff --git a/tests/baselines/reference/tsxDynamicTagName7.js b/tests/baselines/reference/tsxDynamicTagName7.js index 30500b37ce5..c55ceb100ea 100644 --- a/tests/baselines/reference/tsxDynamicTagName7.js +++ b/tests/baselines/reference/tsxDynamicTagName7.js @@ -32,7 +32,7 @@ var Text = (function (_super) { function Text() { var _this; _this = _super.apply(this, arguments) || this; - this._tagName = 'div'; + _this._tagName = 'div'; } 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 a6cf3bb45b8..57ce2becbad 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.js +++ b/tests/baselines/reference/tsxDynamicTagName8.js @@ -32,7 +32,7 @@ var Text = (function (_super) { function Text() { var _this; _this = _super.apply(this, arguments) || this; - this._tagName = 'div'; + _this._tagName = 'div'; } Text.prototype.render = function () { return ( Hello world ); diff --git a/tests/baselines/reference/tsxDynamicTagName9.js b/tests/baselines/reference/tsxDynamicTagName9.js index aa63e614d15..1bc14eb32ee 100644 --- a/tests/baselines/reference/tsxDynamicTagName9.js +++ b/tests/baselines/reference/tsxDynamicTagName9.js @@ -32,7 +32,7 @@ var Text = (function (_super) { function Text() { var _this; _this = _super.apply(this, arguments) || this; - this._tagName = 'div'; + _this._tagName = 'div'; } Text.prototype.render = function () { return ( Hello world ); diff --git a/tests/baselines/reference/typeGuardOfFormThisMember.js b/tests/baselines/reference/typeGuardOfFormThisMember.js index 63c79ce4c91..fefb1e7ff38 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMember.js +++ b/tests/baselines/reference/typeGuardOfFormThisMember.js @@ -120,7 +120,7 @@ var Test; function File(path, content) { var _this; _this = _super.call(this, path) || this; - this.content = content; + _this.content = content; } return File; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js index 5c28921a6a7..ed53a308808 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js +++ b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js @@ -70,7 +70,7 @@ var Test; function File(path, content) { var _this; _this = _super.call(this, path) || this; - this.content = content; + _this.content = content; } return File; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeRelationships.js b/tests/baselines/reference/typeRelationships.js index 43c1f7ee146..87f0f60c53f 100644 --- a/tests/baselines/reference/typeRelationships.js +++ b/tests/baselines/reference/typeRelationships.js @@ -74,10 +74,10 @@ var D = (function (_super) { function D() { var _this; _this = _super.apply(this, arguments) || this; - this.self1 = this; - this.self2 = this.self; - this.self3 = this.foo(); - this.d = new D(); + _this.self1 = _this; + _this.self2 = _this.self; + _this.self3 = _this.foo(); + _this.d = new D(); } D.prototype.bar = function () { this.self = this.self1; diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index b2ea2cac9eb..06d2c4bd6a5 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -236,9 +236,9 @@ var ts; function Property(name, type, flags) { var _this; _this = _super.call(this) || this; - this.name = name; - this.type = type; - this.flags = flags; + _this.name = name; + _this.type = type; + _this.flags = flags; } Property.prototype.equals = function (other) { return this.name === other.name && @@ -257,9 +257,9 @@ var ts; function Signature(typeParameters, parameters, returnType) { var _this; _this = _super.call(this) || this; - this.typeParameters = typeParameters; - this.parameters = parameters; - this.returnType = returnType; + _this.typeParameters = typeParameters; + _this.parameters = parameters; + _this.returnType = returnType; } Signature.prototype.equalsNoReturn = function (other) { return this.parameters.length === other.parameters.length && @@ -278,9 +278,9 @@ var ts; function Parameter(name, type, flags) { var _this; _this = _super.call(this) || this; - this.name = name; - this.type = type; - this.flags = flags; + _this.name = name; + _this.type = type; + _this.flags = flags; } Parameter.prototype.equals = function (other) { return this.name === other.name && diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index e892cc28a3c..04eaa58a196 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -43,8 +43,8 @@ define(["require", "exports"], function (require, exports) { function B(element, url) { var _this; _this = _super.call(this, element) || this; - this.p1 = element; - this.p2 = url; + _this.p1 = element; + _this.p2 = url; } return B; }(A)); From 9c6e148d6e4d4e5f5d33127209343e58ef701f61 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 2 Sep 2016 00:12:32 -0700 Subject: [PATCH 05/47] Accepted baselines for sourcemap test. --- ...sWithDefaultConstructorAndExtendsClause.js | 4 +- ...hDefaultConstructorAndExtendsClause.js.map | 2 +- ...tConstructorAndExtendsClause.sourcemap.txt | 50 +++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index ea71fbc20c0..29da6d52a38 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -23,8 +23,8 @@ var Greeter = (function (_super) { function Greeter() { var _this; _this = _super.apply(this, arguments) || this; - this.a = 10; - this.nameA = "Ten"; + _this.a = 10; + _this.nameA = "Ten"; } return Greeter; }(AbstractGreeter)); diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map index e36f2eaaf8e..3a75f3d3b66 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;QAAA,UAGC;;QAFU,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,UAGC;;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 3da1d42edcd..7c05c1b4d84 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -94,41 +94,41 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 2 >Emitted(14, 19) Source(7, 2) + SourceIndex(0) --- >>> _this = _super.apply(this, arguments) || this; ->>> this.a = 10; +>>> _this.a = 10; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> +2 > ^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> 1-> 2 > a -3 > = -4 > 10 -5 > ; +3 > = +4 > 10 +5 > ; 1->Emitted(16, 9) Source(5, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(5, 13) + SourceIndex(0) -3 >Emitted(16, 18) Source(5, 16) + SourceIndex(0) -4 >Emitted(16, 20) Source(5, 18) + SourceIndex(0) -5 >Emitted(16, 21) Source(5, 19) + SourceIndex(0) +2 >Emitted(16, 16) Source(5, 13) + SourceIndex(0) +3 >Emitted(16, 19) Source(5, 16) + SourceIndex(0) +4 >Emitted(16, 21) Source(5, 18) + SourceIndex(0) +5 >Emitted(16, 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(17, 9) Source(6, 12) + SourceIndex(0) -2 >Emitted(17, 19) Source(6, 17) + SourceIndex(0) -3 >Emitted(17, 22) Source(6, 20) + SourceIndex(0) -4 >Emitted(17, 27) Source(6, 25) + SourceIndex(0) -5 >Emitted(17, 28) Source(6, 26) + SourceIndex(0) +2 >Emitted(17, 20) Source(6, 17) + SourceIndex(0) +3 >Emitted(17, 23) Source(6, 20) + SourceIndex(0) +4 >Emitted(17, 28) Source(6, 25) + SourceIndex(0) +5 >Emitted(17, 29) Source(6, 26) + SourceIndex(0) --- >>> } 1 >^^^^ From cd5e76b23c6ffcb7c57ba8cf31660eb4826a86a8 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 2 Sep 2016 00:30:15 -0700 Subject: [PATCH 06/47] Always tack on a return statement for '_this' in derived classes. --- src/compiler/transformers/es6.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 5dd2b154c01..886ee1b8e40 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -790,7 +790,7 @@ namespace ts { const body = saveStateAndInvoke(constructor, hasSynthesizedSuper ? transformConstructorBodyWithSynthesizedSuper : transformConstructorBodyWithoutSynthesizedSuper); addRange(statements, body); } - if (constructor ? hasSynthesizedSuper : extendsClauseElement) { + if (extendsClauseElement) { statements.push( createReturn( createIdentifier("_this") From 30ec599c13d99378d8f1a0c27d783e25ed10723d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 2 Sep 2016 11:52:13 -0700 Subject: [PATCH 07/47] Accepted baselines. --- tests/baselines/reference/abstractProperty.js | 1 + .../reference/abstractPropertyNegative.js | 3 ++ .../accessOverriddenBaseClassMember1.js | 1 + ...aliasUsageInTypeArgumentOfExtendsClause.js | 1 + .../reference/arrowFunctionContexts.js | 2 + .../reference/assignmentLHSIsValue.js | 1 + tests/baselines/reference/autolift4.js | 1 + tests/baselines/reference/baseCheck.js | 5 ++ tests/baselines/reference/bases.js | 1 + .../reference/bestCommonTypeOfTuple2.js | 1 + tests/baselines/reference/callWithSpread.js | 1 + .../reference/captureThisInSuperCall.js | 1 + .../reference/checkForObjectTooStrict.js | 2 + .../checkSuperCallBeforeThisAccessing1.js | 1 + .../checkSuperCallBeforeThisAccessing2.js | 1 + .../checkSuperCallBeforeThisAccessing3.js | 1 + .../checkSuperCallBeforeThisAccessing4.js | 1 + .../checkSuperCallBeforeThisAccessing5.js | 1 + .../checkSuperCallBeforeThisAccessing6.js | 1 + .../checkSuperCallBeforeThisAccessing7.js | 1 + .../checkSuperCallBeforeThisAccessing8.js | 1 + .../classConstructorAccessibility2.js | 3 ++ ...classConstructorParametersAccessibility.js | 1 + ...lassConstructorParametersAccessibility2.js | 1 + ...lassConstructorParametersAccessibility3.js | 1 + tests/baselines/reference/classExpression3.js | 2 + .../reference/classExtendingClassLikeType.js | 3 ++ tests/baselines/reference/classExtendsNull.js | 2 + .../reference/classSideInheritance2.js | 1 + .../reference/classSideInheritance3.js | 2 + tests/baselines/reference/classUpdateTests.js | 8 ++++ ...isionSuperAndLocalFunctionInConstructor.js | 2 + ...ollisionSuperAndLocalFunctionInProperty.js | 1 + .../collisionSuperAndLocalVarInConstructor.js | 2 + .../collisionSuperAndLocalVarInProperty.js | 1 + .../reference/collisionSuperAndParameter.js | 2 + ...perAndPropertyNameAsConstuctorParameter.js | 4 ++ .../reference/commentsInheritance.js | 1 + .../reference/compoundAssignmentLHSIsValue.js | 1 + ...poundExponentiationAssignmentLHSIsValue.js | 1 + .../reference/computedPropertyNames28_ES5.js | 1 + .../reference/computedPropertyNames30_ES5.js | 1 + tests/baselines/reference/constructorArgs.js | 1 + ...ctorFunctionTypeIsAssignableToBaseType2.js | 2 + .../reference/constructorOverloads2.js | 1 + .../reference/constructorOverloads3.js | 1 + .../reference/declFileGenericType2.js | 2 + .../reference/decoratorOnClassConstructor2.js | 1 + .../reference/decoratorOnClassConstructor3.js | 1 + ...derivedClassConstructorWithoutSuperCall.js | 4 ++ .../derivedClassOverridesPrivateFunction1.js | 1 + .../derivedClassOverridesProtectedMembers.js | 1 + .../derivedClassOverridesProtectedMembers2.js | 1 + .../derivedClassOverridesProtectedMembers3.js | 10 ++++ .../derivedClassOverridesPublicMembers.js | 1 + .../derivedClassParameterProperties.js | 10 ++++ ...dClassSuperCallsInNonConstructorMembers.js | 1 + .../derivedClassSuperCallsWithThisArg.js | 4 ++ .../derivedClassWithoutExplicitConstructor.js | 2 + ...derivedClassWithoutExplicitConstructor2.js | 2 + ...derivedClassWithoutExplicitConstructor3.js | 4 ++ .../destructuringParameterDeclaration5.js | 2 + ...BeforeEmitParameterPropertyDeclaration1.js | 1 + ...SuperCallBeforeEmitPropertyDeclaration1.js | 1 + ...arationAndParameterPropertyDeclaration1.js | 1 + tests/baselines/reference/errorSuperCalls.js | 2 + .../reference/errorSuperPropertyAccess.js | 2 + .../reference/es6ClassSuperCodegenBug.js | 1 + tests/baselines/reference/es6ClassTest.js | 1 + tests/baselines/reference/es6ClassTest2.js | 1 + ...cClassPropertyInheritanceSpecialization.js | 1 + ...genericConstraintOnExtendedBuiltinTypes.js | 1 + ...enericConstraintOnExtendedBuiltinTypes2.js | 1 + ...ericRecursiveImplicitConstructorErrors3.js | 1 + .../reference/genericTypeConstraints.js | 1 + .../illegalSuperCallsInConstructor.js | 1 + .../interfaceExtendsClassWithPrivate2.js | 2 + tests/baselines/reference/lift.js | 1 + .../missingPropertiesOfClassExpression.js | 1 + ...objectCreationOfElementAccessExpression.js | 6 +++ tests/baselines/reference/optionalMethods.js | 1 + .../reference/optionalParamArgsTest.js | 1 + .../reference/optionalParameterProperty.js | 1 + .../overloadOnConstConstraintChecks4.js | 1 + tests/baselines/reference/parserAstSpans1.js | 2 + .../baselines/reference/parserRealSource10.js | 6 +++ .../baselines/reference/parserRealSource11.js | 48 +++++++++++++++++++ tests/baselines/reference/parserharness.js | 3 ++ .../privateInstanceMemberAccessibility.js | 1 + .../privateStaticMemberAccessibility.js | 1 + .../readonlyConstructorAssignment.js | 3 ++ .../reference/returnInConstructor1.js | 2 + tests/baselines/reference/scopeTests.js | 1 + ...sWithDefaultConstructorAndExtendsClause.js | 1 + ...hDefaultConstructorAndExtendsClause.js.map | 2 +- ...tConstructorAndExtendsClause.sourcemap.txt | 21 ++++---- .../baselines/reference/staticInheritance.js | 1 + tests/baselines/reference/staticPropSuper.js | 4 ++ .../reference/strictModeInConstructor.js | 6 +++ tests/baselines/reference/superAccess2.js | 1 + .../reference/superCallArgsMustMatch.js | 1 + .../reference/superCallAssignResult.js | 1 + .../superCallBeforeThisAccessing1.js | 1 + .../superCallBeforeThisAccessing2.js | 1 + .../superCallBeforeThisAccessing3.js | 1 + .../superCallBeforeThisAccessing4.js | 2 + .../superCallBeforeThisAccessing5.js | 1 + .../superCallBeforeThisAccessing6.js | 1 + .../superCallBeforeThisAccessing7.js | 1 + .../superCallBeforeThisAccessing8.js | 1 + ...allFromClassThatDerivesFromGenericType1.js | 1 + ...allFromClassThatDerivesFromGenericType2.js | 1 + ...eButWithIncorrectNumberOfTypeArguments1.js | 1 + ...sFromGenericTypeButWithNoTypeArguments1.js | 1 + ...ivesNonGenericTypeButWithTypeArguments1.js | 1 + .../reference/superCallInNonStaticMethod.js | 1 + .../superCallInsideClassDeclaration.js | 2 + .../superCallInsideClassExpression.js | 2 + .../superCallInsideObjectLiteralExpression.js | 1 + .../reference/superCallOutsideConstructor.js | 1 + .../superCallParameterContextualTyping1.js | 1 + .../superCallParameterContextualTyping2.js | 1 + .../superCallParameterContextualTyping3.js | 1 + tests/baselines/reference/superCalls.js | 2 + .../reference/superCallsInConstructor.js | 1 + tests/baselines/reference/superErrors.js | 1 + .../reference/superInConstructorParam1.js | 1 + tests/baselines/reference/superInLambdas.js | 4 ++ tests/baselines/reference/superNewCall1.js | 1 + .../reference/superPropertyAccess1.js | 1 + .../reference/superPropertyAccess2.js | 1 + .../reference/superPropertyAccessNoError.js | 1 + .../reference/superPropertyAccess_ES5.js | 1 + .../superWithGenericSpecialization.js | 1 + .../baselines/reference/superWithGenerics.js | 1 + .../reference/superWithTypeArgument.js | 1 + .../reference/superWithTypeArgument2.js | 1 + .../reference/superWithTypeArgument3.js | 1 + .../reference/targetTypeBaseCalls.js | 1 + .../reference/thisInInvalidContexts.js | 2 + .../thisInInvalidContextsExternalModule.js | 2 + tests/baselines/reference/thisInSuperCall.js | 3 ++ tests/baselines/reference/thisInSuperCall1.js | 1 + tests/baselines/reference/thisInSuperCall2.js | 2 + tests/baselines/reference/thisInSuperCall3.js | 1 + .../baselines/reference/tsxDynamicTagName5.js | 1 + .../baselines/reference/tsxDynamicTagName7.js | 1 + .../baselines/reference/tsxDynamicTagName8.js | 1 + .../baselines/reference/tsxDynamicTagName9.js | 1 + .../reference/typeGuardOfFormThisMember.js | 1 + .../typeGuardOfFormThisMemberErrors.js | 1 + tests/baselines/reference/typeOfSuperCall.js | 1 + .../baselines/reference/typeRelationships.js | 1 + tests/baselines/reference/unknownSymbols1.js | 1 + .../reference/unspecializedConstraints.js | 3 ++ .../reference/validUseOfThisInSuper.js | 1 + .../reference/varArgsOnConstructorTypes.js | 1 + 157 files changed, 315 insertions(+), 11 deletions(-) diff --git a/tests/baselines/reference/abstractProperty.js b/tests/baselines/reference/abstractProperty.js index d9bfd5eb05f..292213ead53 100644 --- a/tests/baselines/reference/abstractProperty.js +++ b/tests/baselines/reference/abstractProperty.js @@ -39,6 +39,7 @@ var C = (function (_super) { _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 e94d9492fdb..28ada310ef4 100644 --- a/tests/baselines/reference/abstractPropertyNegative.js +++ b/tests/baselines/reference/abstractPropertyNegative.js @@ -60,6 +60,7 @@ var C = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.ro = "readonly please"; + return _this; } Object.defineProperty(C.prototype, "concreteWithNoBody", { get: function () { }, @@ -81,6 +82,7 @@ var WrongTypePropertyImpl = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.num = "nope, wrong"; + return _this; } return WrongTypePropertyImpl; }(WrongTypeProperty)); @@ -108,6 +110,7 @@ var WrongTypeAccessorImpl2 = (function (_super) { var _this; _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 b4c269b1e3b..65431a2f778 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -37,6 +37,7 @@ var ColoredPoint = (function (_super) { var _this; _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/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 462390d28f7..8af9c702654 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -68,6 +68,7 @@ var D = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.x = moduleA; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index bfd49be6bbf..660208cb0c1 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -118,6 +118,7 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.call(this, function () { return _this; }) || this; + return _this; } return Derived; }(Base)); @@ -160,6 +161,7 @@ var M2; function Derived() { var _this; _this = _super.call(this, function () { return _this; }) || this; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 070c151ee51..52d14cbe536 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -121,6 +121,7 @@ var Derived = (function (_super) { var _this; _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/autolift4.js b/tests/baselines/reference/autolift4.js index b6afd28d429..0638efab0b3 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -46,6 +46,7 @@ var Point3D = (function (_super) { var _this; _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/baseCheck.js b/tests/baselines/reference/baseCheck.js index c3a2731b45d..832830ae864 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -45,6 +45,7 @@ var ELoc = (function (_super) { function ELoc(x) { var _this; _this = _super.call(this, 0, x) || this; + return _this; } return ELoc; }(C)); @@ -53,6 +54,7 @@ var ELocVar = (function (_super) { function ELocVar(x) { var _this; _this = _super.call(this, 0, loc) || this; + return _this; } ELocVar.prototype.m = function () { var loc = 10; @@ -65,6 +67,7 @@ var D = (function (_super) { var _this; _this = _super.call(this, _this.z) || this; _this.z = z; + return _this; } return D; }(C)); // too few params @@ -74,6 +77,7 @@ var E = (function (_super) { var _this; _this = _super.call(this, 0, _this.z) || this; _this.z = z; + return _this; } return E; }(C)); @@ -83,6 +87,7 @@ var F = (function (_super) { var _this; _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/bases.js b/tests/baselines/reference/bases.js index ff6a3262d45..6b73eb9556b 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -39,6 +39,7 @@ var C = (function (_super) { var _this; _this.x; any; + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index 34deb346cbd..8213733b753 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -63,6 +63,7 @@ var D1 = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.i = "bar"; + return _this; } return D1; }(C1)); diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index 2149db744b0..48af58edf65 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -102,6 +102,7 @@ var D = (function (_super) { var _this; _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 0c36877d9dc..2d39722548d 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -24,6 +24,7 @@ var B = (function (_super) { function B() { var _this; _this = _super.call(this, { test: function () { return _this.someMethod(); } }) || this; + return _this; } B.prototype.someMethod = function () { }; return B; diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index 48825a01a67..8c0cfc104d2 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -51,6 +51,7 @@ var Bar = (function (_super) { function Bar() { var _this; _this = _super.call(this) || this; + return _this; } return Bar; }(Foo.Object)); @@ -59,6 +60,7 @@ var Baz = (function (_super) { function Baz() { var _this; _this = _super.call(this) || this; + return _this; } return Baz; }(Object)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js index 35e00c36621..a54f82ab9fa 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js @@ -29,6 +29,7 @@ var Derived = (function (_super) { _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 b49c1aab774..95b34f27b68 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js @@ -29,6 +29,7 @@ var Derived = (function (_super) { _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 70600bb03a9..0e882f71fdb 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js @@ -39,6 +39,7 @@ var Derived = (function (_super) { _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 95e0062b087..00f2ed22fbf 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js @@ -47,6 +47,7 @@ var Derived = (function (_super) { _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 1c77b2e7c78..e365678ee0c 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -27,6 +27,7 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.call(this, _this.x) || this; + return _this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js index 15fcbff4c89..cc8912230ab 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js @@ -31,6 +31,7 @@ var Super = (function (_super) { var _this; (function () { return _this; }); // No Error _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 0cade04664d..7ba43de005b 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js @@ -25,6 +25,7 @@ var Super = (function (_super) { function Super() { var _this; _this = _super.call(this, (function () { return _this; })) || this; // No error + return _this; } return Super; }(Base)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js index a280c0d6ca6..25a480b9b57 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js @@ -31,6 +31,7 @@ var Super = (function (_super) { var _this; var that = _this; _this = _super.call(this) || this; + return _this; } return Super; }(Base)); diff --git a/tests/baselines/reference/classConstructorAccessibility2.js b/tests/baselines/reference/classConstructorAccessibility2.js index 9d1ebdd9d9a..8a81d469fb8 100644 --- a/tests/baselines/reference/classConstructorAccessibility2.js +++ b/tests/baselines/reference/classConstructorAccessibility2.js @@ -80,6 +80,7 @@ var DerivedA = (function (_super) { var _this; _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); }; @@ -92,6 +93,7 @@ var DerivedB = (function (_super) { var _this; _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 @@ -104,6 +106,7 @@ var DerivedC = (function (_super) { var _this; _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/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index 066c724b60f..214815f4976 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -62,6 +62,7 @@ var Derived = (function (_super) { var _this; _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 b8050435171..7c714aa4c03 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -62,6 +62,7 @@ var Derived = (function (_super) { var _this; _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 9e0c0264fd9..275f3920538 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -32,6 +32,7 @@ var Derived = (function (_super) { _this = _super.call(this, p) || this; _this.p = p; _this.p; // OK + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/classExpression3.js b/tests/baselines/reference/classExpression3.js index e0ba9c349e7..3c53d728233 100644 --- a/tests/baselines/reference/classExpression3.js +++ b/tests/baselines/reference/classExpression3.js @@ -18,6 +18,7 @@ var C = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.c = 3; + return _this; } return class_1; }((function (_super) { @@ -26,6 +27,7 @@ var C = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.b = 2; + return _this; } return class_2; }((function () { diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index 2d91befc172..32d7fff0cbd 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -80,6 +80,7 @@ var D1 = (function (_super) { _this = _super.call(this, "abc", "def") || this; _this.x = "x"; _this.y = "y"; + return _this; } return D1; }(getBase())); @@ -91,6 +92,7 @@ var D2 = (function (_super) { _this = _super.call(this, 10, 20) || this; _this.x = 1; _this.y = 2; + return _this; } return D2; }(getBase())); @@ -101,6 +103,7 @@ var D3 = (function (_super) { _this = _super.call(this, "abc", 42) || this; _this.x = "x"; _this.y = 2; + return _this; } return D3; }(getBase())); diff --git a/tests/baselines/reference/classExtendsNull.js b/tests/baselines/reference/classExtendsNull.js index 3ff1c92a56e..301dee7f705 100644 --- a/tests/baselines/reference/classExtendsNull.js +++ b/tests/baselines/reference/classExtendsNull.js @@ -24,6 +24,7 @@ var C = (function (_super) { var _this; _this = _super.call(this) || this; return Object.create(null); + return _this; } return C; }(null)); @@ -32,6 +33,7 @@ var D = (function (_super) { function D() { var _this; return Object.create(null); + return _this; } return D; }(null)); diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index c5c506d1af6..1af6b6f846c 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -31,6 +31,7 @@ var SubText = (function (_super) { function SubText(text, span) { var _this; _this = _super.call(this) || this; + return _this; } return SubText; }(TextBase)); diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index 4751e0e8d6e..fda7b0b0848 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -36,6 +36,7 @@ var B = (function (_super) { var _this; _this = _super.call(this, x) || this; _this.data = data; + return _this; } return B; }(A)); @@ -44,6 +45,7 @@ var C = (function (_super) { function C(x) { var _this; _this = _super.call(this, x) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index d334e1c7f66..2d7ecc3c190 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -160,6 +160,7 @@ var E = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.p1 = 0; + return _this; } return E; }(D)); @@ -167,6 +168,7 @@ var F = (function (_super) { __extends(F, _super); function F() { var _this; + return _this; } // ERROR - super call required return F; }(E)); @@ -176,6 +178,7 @@ var G = (function (_super) { var _this; _this = _super.call(this) || this; _this.p1 = 0; + return _this; } // NO ERROR return G; }(D)); @@ -190,6 +193,7 @@ var I = (function (_super) { function I() { var _this; _this = _super.call(this) || this; + return _this; } // ERROR - no super call allowed return I; }(Object)); @@ -199,6 +203,7 @@ var J = (function (_super) { var _this; _this = _super.call(this) || this; // NO ERROR _this.p1 = p1; + return _this; } return J; }(G)); @@ -209,6 +214,7 @@ var K = (function (_super) { _this.p1 = p1; var i = 0; _this = _super.call(this) || this; + return _this; } return K; }(G)); @@ -218,6 +224,7 @@ var L = (function (_super) { var _this; _this = _super.call(this) || this; // NO ERROR _this.p1 = p1; + return _this; } return L; }(G)); @@ -228,6 +235,7 @@ var M = (function (_super) { _this.p1 = p1; var i = 0; _this = _super.call(this) || this; + return _this; } return M; }(G)); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index b961b8fa4a5..5f2a5e89301 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -46,6 +46,7 @@ var b = (function (_super) { _this = _super.call(this) || this; function _super() { } + return _this; } return b; }(Foo)); @@ -58,6 +59,7 @@ var c = (function (_super) { function _super() { } }; + return _this; } return c; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index e3d834dd1d4..a6893c6a57a 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -48,6 +48,7 @@ var b = (function (_super) { } } }; + return _this; } return b; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index b3ef3000762..d799c783503 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -39,6 +39,7 @@ var b = (function (_super) { var _this; _this = _super.call(this) || this; var _super = 10; // Should be error + return _this; } return b; }(Foo)); @@ -50,6 +51,7 @@ var c = (function (_super) { var x = function () { var _super = 10; // Should be error }; + return _this; } return c; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index e7cb0e613cc..4bb4f6a5a8b 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -46,6 +46,7 @@ var b = (function (_super) { } }; _this._super = 10; // No error + return _this; } return b; }(Foo)); diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index a60889888d6..6ed47a1b3c1 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -100,6 +100,7 @@ var Foo2 = (function (_super) { doStuff: function (_super) { } }; + return _this; } Foo2.prototype.x = function () { var _this = this; @@ -126,6 +127,7 @@ var Foo4 = (function (_super) { function Foo4(_super) { var _this; _this = _super.call(this) || this; + return _this; } Foo4.prototype.y = function (_super) { var _this = this; diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index 696f439a4b1..2d3709fa878 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -46,6 +46,7 @@ var b1 = (function (_super) { function b1(_super) { var _this; _this = _super.call(this) || this; + return _this; } return b1; }(a)); @@ -55,6 +56,7 @@ var b2 = (function (_super) { var _this; _this = _super.call(this) || this; _this._super = _super; + return _this; } return b2; }(a)); @@ -63,6 +65,7 @@ var b3 = (function (_super) { function b3(_super) { var _this; _this = _super.call(this) || this; + return _this; } return b3; }(a)); @@ -72,6 +75,7 @@ var b4 = (function (_super) { var _this; _this = _super.call(this) || this; _this._super = _super; + return _this; } return b4; }(a)); diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index 860c0b90e48..370ee0d246c 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -229,6 +229,7 @@ var c3 = (function (_super) { function c3() { var _this; _this = _super.call(this, 10) || this; + return _this; } /** c3 f1*/ c3.prototype.f1 = function () { diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index 2057d63b38f..dfbdf31c3d1 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -201,6 +201,7 @@ var Derived = (function (_super) { _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 ef29163eda6..da670472b47 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -143,6 +143,7 @@ var Derived = (function (_super) { _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/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index aaac258504c..8152394cbf8 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -29,6 +29,7 @@ var C = (function (_super) { var obj = (_a = {}, _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 9fbe5f380ca..9f4a4ab51f9 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -40,6 +40,7 @@ var C = (function (_super) { _a); var _a; }); + return _this; } return C; }(Base)); diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index 2c2838c97f9..c7939472a96 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -32,6 +32,7 @@ var Sub = (function (_super) { var _this; _this = _super.call(this, options.value) || this; _this.options = options; + return _this; } return Sub; }(Super)); diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index a235e2555f3..4f70c7d7f35 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -49,6 +49,7 @@ var Derived = (function (_super) { function Derived(x) { var _this; _this = _super.call(this, x) || this; + return _this; } return Derived; }(Base)); @@ -59,6 +60,7 @@ var Derived2 = (function (_super) { var _this; _this = _super.call(this, x) || this; return 1; + return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index a0ed6d890d4..0041acb489e 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -42,6 +42,7 @@ var Foo = (function (_super) { function Foo(x, y) { var _this; _this = _super.call(this, x) || this; + return _this; } Foo.prototype.bar1 = function () { }; return Foo; diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js index 7bc7989f7a3..c0ae9b452f9 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -32,6 +32,7 @@ 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/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 50280b589b3..0e5351e69ea 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -60,6 +60,7 @@ var templa; function AbstractElementController() { var _this; _this = _super.call(this) || this; + return _this; } return AbstractElementController; }(templa.mvc.AbstractController)); @@ -82,6 +83,7 @@ var templa; var _this; _this = _super.call(this) || this; _this._controllers = []; + return _this; } return AbstractCompositeElementController; }(templa.dom.mvc.AbstractElementController)); diff --git a/tests/baselines/reference/decoratorOnClassConstructor2.js b/tests/baselines/reference/decoratorOnClassConstructor2.js index d50912fbeac..1f0b9b0d517 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor2.js +++ b/tests/baselines/reference/decoratorOnClassConstructor2.js @@ -47,6 +47,7 @@ var C = (function (_super) { function C(prop) { var _this; _this = _super.call(this) || this; + return _this; } return C; }(_0_ts_1.base)); diff --git a/tests/baselines/reference/decoratorOnClassConstructor3.js b/tests/baselines/reference/decoratorOnClassConstructor3.js index 6f37ad9dea1..9182cce66f4 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor3.js +++ b/tests/baselines/reference/decoratorOnClassConstructor3.js @@ -50,6 +50,7 @@ var C = (function (_super) { function C(prop) { var _this; _this = _super.call(this) || this; + return _this; } return C; }(_0_1.base)); diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index 58903b2ba57..e76f3445c8e 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -48,6 +48,7 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { var _this; + return _this; } return Derived; }(Base)); @@ -61,6 +62,7 @@ var Derived2 = (function (_super) { function Derived2() { var _this; var r2 = function () { return _this = _super.call(this) || this; }; // error for misplaced super call (nested function) + return _this; } return Derived2; }(Base2)); @@ -69,6 +71,7 @@ var Derived3 = (function (_super) { function Derived3() { var _this; var r = function () { _this = _super.call(this) || this; }; // error + return _this; } return Derived3; }(Base2)); @@ -77,6 +80,7 @@ var Derived4 = (function (_super) { function Derived4() { var _this; var r = _this = _super.call(this) || this; // ok + return _this; } return Derived4; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index 605ad6afa45..fd601ff2211 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -34,6 +34,7 @@ var DerivedClass = (function (_super) { function DerivedClass() { var _this; _this = _super.call(this) || this; + return _this; } DerivedClass.prototype._init = function () { }; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index d3e3fe5d4c9..12344c19915 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -68,6 +68,7 @@ var Derived = (function (_super) { function Derived(a) { var _this; _this = _super.call(this, x) || this; + return _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 1f43469596a..37be9e209ac 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -96,6 +96,7 @@ var Derived = (function (_super) { function Derived(a) { var _this; _this = _super.call(this, a) || this; + return _this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index d678f5ce59f..0836c9d7f41 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -105,6 +105,7 @@ var Derived1 = (function (_super) { function Derived1(a) { var _this; _this = _super.call(this, a) || this; + return _this; } return Derived1; }(Base)); @@ -113,6 +114,7 @@ var Derived2 = (function (_super) { function Derived2(a) { var _this; _this = _super.call(this, a) || this; + return _this; } Derived2.prototype.b = function (a) { }; return Derived2; @@ -122,6 +124,7 @@ var Derived3 = (function (_super) { function Derived3(a) { var _this; _this = _super.call(this, a) || this; + return _this; } Object.defineProperty(Derived3.prototype, "c", { get: function () { return x; }, @@ -135,6 +138,7 @@ var Derived4 = (function (_super) { function Derived4(a) { var _this; _this = _super.call(this, a) || this; + return _this; } Object.defineProperty(Derived4.prototype, "c", { set: function (v) { }, @@ -148,6 +152,7 @@ var Derived5 = (function (_super) { function Derived5(a) { var _this; _this = _super.call(this, a) || this; + return _this; } return Derived5; }(Base)); @@ -156,6 +161,7 @@ var Derived6 = (function (_super) { function Derived6(a) { var _this; _this = _super.call(this, a) || this; + return _this; } return Derived6; }(Base)); @@ -164,6 +170,7 @@ var Derived7 = (function (_super) { function Derived7(a) { var _this; _this = _super.call(this, a) || this; + return _this; } Derived7.s = function (a) { }; return Derived7; @@ -173,6 +180,7 @@ var Derived8 = (function (_super) { function Derived8(a) { var _this; _this = _super.call(this, a) || this; + return _this; } Object.defineProperty(Derived8, "t", { get: function () { return x; }, @@ -186,6 +194,7 @@ var Derived9 = (function (_super) { function Derived9(a) { var _this; _this = _super.call(this, a) || this; + return _this; } Object.defineProperty(Derived9, "t", { set: function (v) { }, @@ -199,6 +208,7 @@ var Derived10 = (function (_super) { function Derived10(a) { var _this; _this = _super.call(this, a) || this; + return _this; } return Derived10; }(Base)); diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index 7839398551d..8d0375ab13a 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -94,6 +94,7 @@ var Derived = (function (_super) { function Derived(a) { var _this; _this = _super.call(this, x) || this; + return _this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index 658e56fb098..f623653d6fa 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -112,6 +112,7 @@ var Derived = (function (_super) { var _this; var a = 1; _this = _super.call(this) || this; // ok + return _this; } return Derived; }(Base)); @@ -122,6 +123,7 @@ var Derived2 = (function (_super) { _this.y = y; var a = 1; _this = _super.call(this) || this; // error + return _this; } return Derived2; }(Base)); @@ -132,6 +134,7 @@ var Derived3 = (function (_super) { _this = _super.call(this) || this; // ok _this.y = y; var a = 1; + return _this; } return Derived3; }(Base)); @@ -142,6 +145,7 @@ var Derived4 = (function (_super) { _this.a = 1; var b = 2; _this = _super.call(this) || this; // error + return _this; } return Derived4; }(Base)); @@ -152,6 +156,7 @@ var Derived5 = (function (_super) { _this = _super.call(this) || this; // ok _this.a = 1; var b = 2; + return _this; } return Derived5; }(Base)); @@ -162,6 +167,7 @@ var Derived6 = (function (_super) { _this.a = 1; var b = 2; _this = _super.call(this) || this; // error: "super" has to be called before "this" accessing + return _this; } return Derived6; }(Base)); @@ -173,6 +179,7 @@ var Derived7 = (function (_super) { _this.a = 3; _this.b = 3; _this = _super.call(this) || this; // error + return _this; } return Derived7; }(Base)); @@ -184,6 +191,7 @@ var Derived8 = (function (_super) { _this.a = 1; _this.a = 3; _this.b = 3; + return _this; } return Derived8; }(Base)); @@ -201,6 +209,7 @@ var Derived9 = (function (_super) { _this.a = 3; _this.b = 3; _this = _super.call(this) || this; // error + return _this; } return Derived9; }(Base2)); @@ -212,6 +221,7 @@ var Derived10 = (function (_super) { _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 6b06204b8e9..e3bbf2699c5 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js @@ -49,6 +49,7 @@ var Derived = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.a = _this = _super.call(this) || this; + return _this; } Derived.prototype.b = function () { _this = _super.call(this) || this; diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index e73d0041206..102944889bd 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -44,6 +44,7 @@ var Derived = (function (_super) { function Derived() { var _this; _this = _super.call(this, _this) || this; // ok + return _this; } return Derived; }(Base)); @@ -53,6 +54,7 @@ var Derived2 = (function (_super) { var _this; _this = _super.call(this, _this) || this; // error _this.a = a; + return _this; } return Derived2; }(Base)); @@ -62,6 +64,7 @@ var Derived3 = (function (_super) { var _this; _this = _super.call(this, function () { return _this; }) || this; // error _this.a = a; + return _this; } return Derived3; }(Base)); @@ -71,6 +74,7 @@ var Derived4 = (function (_super) { var _this; _this = _super.call(this, function () { return this; }) || this; // ok _this.a = a; + return _this; } return Derived4; }(Base)); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index cc260f09499..f5eb3d22360 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -45,6 +45,7 @@ var Derived = (function (_super) { _this = _super.apply(this, arguments) || this; _this.x = 1; _this.y = 'hello'; + return _this; } return Derived; }(Base)); @@ -63,6 +64,7 @@ var D = (function (_super) { _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 d3711ec27c0..5ad20389230 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -53,6 +53,7 @@ var Derived = (function (_super) { _this = _super.apply(this, arguments) || this; _this.x = 1; _this.y = 'hello'; + return _this; } return Derived; }(Base)); @@ -73,6 +74,7 @@ var D = (function (_super) { _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 14f9fdf88af..d0e5f22d4f3 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -67,6 +67,7 @@ var Derived = (function (_super) { _this = _super.call(this, 2) || this; _this.b = ''; _this.b = y; + return _this; } return Derived; }(Base)); @@ -77,6 +78,7 @@ var Derived2 = (function (_super) { _this = _super.apply(this, arguments) || this; _this.x = 1; _this.y = 'hello'; + return _this; } return Derived2; }(Derived)); @@ -96,6 +98,7 @@ var D = (function (_super) { _this = _super.call(this, 2) || this; _this.b = null; _this.b = y; + return _this; } return D; }(Base)); @@ -106,6 +109,7 @@ var D2 = (function (_super) { _this = _super.apply(this, arguments) || this; _this.x = 2; _this.y = null; + return _this; } return D2; }(D)); diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js index a1f109ed49e..8c35b9044a1 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -67,6 +67,7 @@ var SubClass = (function (_super) { function SubClass() { var _this; _this = _super.call(this) || this; + return _this; } return SubClass; }(Class)); @@ -80,6 +81,7 @@ var SubD = (function (_super) { function SubD() { var _this; _this = _super.call(this) || this; + return _this; } return SubD; }(D)); diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index 60fa8e32c1e..b95263464a7 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -33,6 +33,7 @@ var B = (function (_super) { 'someStringForEgngInject'; _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 abef8394924..f078c448b75 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js @@ -35,6 +35,7 @@ var B = (function (_super) { 'someStringForEgngInject'; _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 0f36d9d9115..e64af9ef862 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -34,6 +34,7 @@ var B = (function (_super) { _this = _super.call(this) || this; _this.x = x; _this.blah = 2; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index 4f54781deb9..864bc19a344 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -135,6 +135,7 @@ var Derived = (function (_super) { var _this; _super.prototype..call(_this); _this = _super.call(this) || this; + return _this; } return Derived; }(Base)); @@ -150,6 +151,7 @@ var OtherDerived = (function (_super) { _this = _super.apply(this, arguments) || this; //super call in class member initializer of derived type _this.t = _this = _super.call(this) || this; + return _this; } OtherDerived.prototype.fn = function () { //super call in class member function of derived type diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index 18c98868e93..1b7c9a418fc 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -189,6 +189,7 @@ var SomeDerived1 = (function (_super) { var _this; _this = _super.call(this) || this; _super.prototype.publicMember = 1; + return _this; } SomeDerived1.prototype.fn = function () { var x = _super.prototype.publicMember; @@ -223,6 +224,7 @@ var SomeDerived2 = (function (_super) { var _this; _this = _super.call(this) || this; _super.prototype.privateMember = 1; + return _this; } SomeDerived2.prototype.fn = function () { var x = _super.prototype.privateMember; diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.js b/tests/baselines/reference/es6ClassSuperCodegenBug.js index 88000a12bbe..2eec250211e 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.js +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -35,6 +35,7 @@ var B = (function (_super) { else { _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 4b2cb2c51b5..705915812be 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -111,6 +111,7 @@ var Foo = (function (_super) { _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 ebf779f7bba..eec5d830e01 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -269,6 +269,7 @@ var SuperChild = (function (_super) { function SuperChild() { var _this; _this = _super.call(this, 1) || this; + return _this; } SuperChild.prototype.b = function () { _super.prototype.b.call(this, 'str'); diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index 0cc1f5867a2..ccbac1d22b5 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -111,6 +111,7 @@ var PortalFx; function Validator(message) { var _this; _this = _super.call(this, message) || this; + return _this; } return Validator; }(Portal.Controls.Validators.Validator)); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index 4581ecc31ec..246b9b76e3c 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -54,6 +54,7 @@ var EndGate; function NumberTween(from) { var _this; _this = _super.call(this, from) || this; + return _this; } return NumberTween; }(Tweening.Tween)); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index 8f1e9c8365f..e7744b28833 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -53,6 +53,7 @@ var EndGate; function NumberTween(from) { var _this; _this = _super.call(this, from) || this; + return _this; } return NumberTween; }(Tweening.Tween)); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index 49109e1aa5a..d22823b9f81 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -62,6 +62,7 @@ var TypeScript; var _this; _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/genericTypeConstraints.js b/tests/baselines/reference/genericTypeConstraints.js index 761220ae11a..48ff00e5ac2 100644 --- a/tests/baselines/reference/genericTypeConstraints.js +++ b/tests/baselines/reference/genericTypeConstraints.js @@ -40,6 +40,7 @@ var BarExtended = (function (_super) { function BarExtended() { var _this; _this = _super.call(this) || this; + return _this; } return BarExtended; }(Bar)); diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index 77f0a0a2b6b..868d53daad5 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -47,6 +47,7 @@ var Derived = (function (_super) { _this = _super.call(this) || this; } }; + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index 3f205640f59..51c64f48f6c 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -43,6 +43,7 @@ var D = (function (_super) { _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; }; @@ -55,6 +56,7 @@ var D2 = (function (_super) { var _this; _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/lift.js b/tests/baselines/reference/lift.js index bfbf75b1731..a71f1c9065a 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -36,6 +36,7 @@ var C = (function (_super) { _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/missingPropertiesOfClassExpression.js b/tests/baselines/reference/missingPropertiesOfClassExpression.js index c1f4480241c..20252f37e61 100644 --- a/tests/baselines/reference/missingPropertiesOfClassExpression.js +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.js @@ -17,6 +17,7 @@ var George = (function (_super) { function George() { var _this; _this = _super.call(this) || this; + return _this; } return George; }((function () { diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index 9543082fbd1..760454dd9a4 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -84,6 +84,7 @@ var MonsterFood = (function (_super) { var _this; _this = _super.call(this, name) || this; _this.flavor = flavor; + return _this; } return MonsterFood; }(Food)); @@ -93,6 +94,7 @@ var IceCream = (function (_super) { var _this; _this = _super.call(this, "Ice Cream", flavor) || this; _this.flavor = flavor; + return _this; } return IceCream; }(MonsterFood)); @@ -103,6 +105,7 @@ var Cookie = (function (_super) { _this = _super.call(this, "Cookie", flavor) || this; _this.flavor = flavor; _this.isGlutenFree = isGlutenFree; + return _this; } return Cookie; }(MonsterFood)); @@ -112,6 +115,7 @@ var PetFood = (function (_super) { var _this; _this = _super.call(this, name) || this; _this.whereToBuy = whereToBuy; + return _this; } return PetFood; }(Food)); @@ -121,6 +125,7 @@ var ExpensiveOrganicDogFood = (function (_super) { var _this; _this = _super.call(this, "Origen", whereToBuy) || this; _this.whereToBuy = whereToBuy; + return _this; } return ExpensiveOrganicDogFood; }(PetFood)); @@ -131,6 +136,7 @@ var ExpensiveOrganicCatFood = (function (_super) { _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/optionalMethods.js b/tests/baselines/reference/optionalMethods.js index 1885c419fef..72df561227f 100644 --- a/tests/baselines/reference/optionalMethods.js +++ b/tests/baselines/reference/optionalMethods.js @@ -112,6 +112,7 @@ var Derived = (function (_super) { var _this; _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 f53f0c74a54..258f05cbc85 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -164,6 +164,7 @@ var C2 = (function (_super) { var _this; if (v2 === void 0) { v2 = 6; } _this = _super.call(this, v2) || this; + return _this; } return C2; }(C1)); diff --git a/tests/baselines/reference/optionalParameterProperty.js b/tests/baselines/reference/optionalParameterProperty.js index 44eb2a7aa56..ca78ad7286e 100644 --- a/tests/baselines/reference/optionalParameterProperty.js +++ b/tests/baselines/reference/optionalParameterProperty.js @@ -28,6 +28,7 @@ var D = (function (_super) { var _this; _this = _super.call(this) || this; _this.p = p; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index 22bacbdb0b4..360b38ce70c 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -30,6 +30,7 @@ var A = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.x = 1; + return _this; } return A; }(Z)); diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index 365e640c150..799a17d47de 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -321,6 +321,7 @@ var c3 = (function (_super) { var _this; _this = _super.call(this, 10) || this; _this.p1 = _super.prototype.c2_p1; + return _this; } /** c3 f1*/ c3.prototype.f1 = function () { @@ -409,6 +410,7 @@ var c6 = (function (_super) { var _this; _this = _super.call(this) || this; _this.d = _super.prototype.b; + return _this; } return c6; }(c5)); diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index c9f011704d0..88516c9a692 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -830,6 +830,7 @@ var TypeScript; _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(); @@ -846,6 +847,7 @@ var TypeScript; var _this; _this = _super.call(this, TokenID.StringLiteral) || this; _this.value = value; + return _this; } StringLiteralToken.prototype.getText = function () { return this.value; @@ -863,6 +865,7 @@ var TypeScript; _this = _super.call(this, TokenID.Identifier) || this; _this.value = value; _this.hasEscapeSequence = hasEscapeSequence; + return _this; } IdentifierToken.prototype.getText = function () { return this.value; @@ -879,6 +882,7 @@ var TypeScript; var _this; _this = _super.call(this, tokenId) || this; _this.value = value; + return _this; } WhitespaceToken.prototype.getText = function () { return this.value; @@ -899,6 +903,7 @@ var TypeScript; _this.startPos = startPos; _this.line = line; _this.endsLine = endsLine; + return _this; } CommentToken.prototype.getText = function () { return this.value; @@ -915,6 +920,7 @@ var TypeScript; var _this; _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 054608e9d19..fa112e51dad 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2396,6 +2396,7 @@ var TypeScript; _this.preComments = null; _this.postComments = null; _this.isParenthesized = false; + return _this; } AST.prototype.isExpression = function () { return false; }; AST.prototype.isStatementOrExpression = function () { return false; }; @@ -2547,6 +2548,7 @@ var TypeScript; _this = _super.call(this, NodeType.Error) || this; _this.minChar = min; _this.limChar = lim; + return _this; } return IncompleteAST; }(AST)); @@ -2558,6 +2560,7 @@ var TypeScript; _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; @@ -2629,6 +2632,7 @@ var TypeScript; _this.sym = null; _this.cloId = -1; _this.setText(actualText, hasEscapeSequence); + return _this; } Identifier.prototype.setText = function (actualText, hasEscapeSequence) { this.actualText = actualText; @@ -2669,6 +2673,7 @@ var TypeScript; function MissingIdentifier() { var _this; _this = _super.call(this, "__missing") || this; + return _this; } MissingIdentifier.prototype.isMissing = function () { return true; @@ -2685,6 +2690,7 @@ var TypeScript; var _this; _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) { @@ -2709,6 +2715,7 @@ var TypeScript; function Expression(nodeType) { var _this; _this = _super.call(this, nodeType) || this; + return _this; } Expression.prototype.isExpression = function () { return true; }; Expression.prototype.isStatementOrExpression = function () { return true; }; @@ -2723,6 +2730,7 @@ var TypeScript; _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); @@ -2869,6 +2877,7 @@ var TypeScript; _this.arguments = arguments; _this.signature = null; _this.minChar = _this.target.minChar; + return _this; } CallExpression.prototype.typeCheck = function (typeFlow) { if (this.nodeType == NodeType.New) { @@ -2900,6 +2909,7 @@ var TypeScript; _this = _super.call(this, nodeType) || this; _this.operand1 = operand1; _this.operand2 = operand2; + return _this; } BinaryExpression.prototype.typeCheck = function (typeFlow) { switch (this.nodeType) { @@ -3054,6 +3064,7 @@ var TypeScript; _this.operand1 = operand1; _this.operand2 = operand2; _this.operand3 = operand3; + return _this; } ConditionalExpression.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckQMark(this); @@ -3080,6 +3091,7 @@ var TypeScript; _this.value = value; _this.hasEmptyFraction = hasEmptyFraction; _this.isNegativeZero = false; + return _this; } NumberLiteral.prototype.typeCheck = function (typeFlow) { this.type = typeFlow.doubleType; @@ -3120,6 +3132,7 @@ var TypeScript; var _this; _this = _super.call(this, NodeType.Regex) || this; _this.regex = regex; + return _this; } RegexLiteral.prototype.typeCheck = function (typeFlow) { this.type = typeFlow.regexType; @@ -3141,6 +3154,7 @@ var TypeScript; var _this; _this = _super.call(this, NodeType.QString) || this; _this.text = text; + return _this; } StringLiteral.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3167,6 +3181,7 @@ var TypeScript; function ModuleElement(nodeType) { var _this; _this = _super.call(this, nodeType) || this; + return _this; } return ModuleElement; }(AST)); @@ -3180,6 +3195,7 @@ var TypeScript; _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) { @@ -3242,6 +3258,7 @@ var TypeScript; _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); }; @@ -3261,6 +3278,7 @@ var TypeScript; function VarDecl(id, nest) { var _this; _this = _super.call(this, id, NodeType.VarDecl, nest) || this; + return _this; } VarDecl.prototype.isAmbient = function () { return hasFlag(this.varFlags, VarFlags.Ambient); }; VarDecl.prototype.isExported = function () { return hasFlag(this.varFlags, VarFlags.Exported); }; @@ -3281,6 +3299,7 @@ var TypeScript; _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 () { @@ -3331,6 +3350,7 @@ var TypeScript; _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) { @@ -3458,6 +3478,7 @@ var TypeScript; _this.containsUnicodeCharInComment = false; _this.vars = vars; _this.scopes = scopes; + return _this; } Script.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckScript(this); @@ -3517,6 +3538,7 @@ var TypeScript; _this.members = members; _this.leftCurlyCount = 0; _this.rightCurlyCount = 0; + return _this; } return NamedDeclaration; }(ModuleElement)); @@ -3535,6 +3557,7 @@ var TypeScript; _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); }; @@ -3565,6 +3588,7 @@ var TypeScript; _this.extendsList = extendsList; _this.implementsList = implementsList; _this.varFlags = VarFlags.None; + return _this; } TypeDeclaration.prototype.isExported = function () { return hasFlag(this.varFlags, VarFlags.Exported); @@ -3584,6 +3608,7 @@ var TypeScript; _this.constructorDecl = null; _this.constructorNestingLevel = 0; _this.endingToken = null; + return _this; } ClassDeclaration.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckClass(this); @@ -3599,6 +3624,7 @@ var TypeScript; function InterfaceDeclaration(name, members, extendsList, implementsList) { var _this; _this = _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) || this; + return _this; } InterfaceDeclaration.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckInterface(this); @@ -3614,6 +3640,7 @@ var TypeScript; var _this; _this = _super.call(this, nodeType) || this; _this.flags |= ASTFlags.IsStatement; + return _this; } Statement.prototype.isLoop = function () { return false; }; Statement.prototype.isStatementOrExpression = function () { return true; }; @@ -3632,6 +3659,7 @@ var TypeScript; _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); @@ -3667,6 +3695,7 @@ var TypeScript; _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); @@ -3723,6 +3752,7 @@ var TypeScript; _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) { @@ -3775,6 +3805,7 @@ var TypeScript; _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) { @@ -3829,6 +3860,7 @@ var TypeScript; _this.body = null; _this.whileAST = null; _this.cond = null; + return _this; } DoWhileStatement.prototype.isLoop = function () { return true; }; DoWhileStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -3886,6 +3918,7 @@ var TypeScript; _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) { @@ -3963,6 +3996,7 @@ var TypeScript; var _this; _this = _super.call(this, NodeType.Return) || this; _this.returnExpression = null; + return _this; } ReturnStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3994,6 +4028,7 @@ var TypeScript; function EndCode() { var _this; _this = _super.call(this, NodeType.EndCode) || this; + return _this; } return EndCode; }(AST)); @@ -4009,6 +4044,7 @@ var TypeScript; 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 () { @@ -4120,6 +4156,7 @@ var TypeScript; var _this; _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) { @@ -4213,6 +4250,7 @@ var TypeScript; _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) { @@ -4241,6 +4279,7 @@ var TypeScript; _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) { @@ -4312,6 +4351,7 @@ var TypeScript; var _this; _this = _super.call(this, NodeType.Case) || this; _this.expr = null; + return _this; } CaseStatement.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4367,6 +4407,7 @@ var TypeScript; _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"); @@ -4398,6 +4439,7 @@ var TypeScript; _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) { @@ -4444,6 +4486,7 @@ var TypeScript; _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) { @@ -4494,6 +4537,7 @@ var TypeScript; var _this; _this = _super.call(this, NodeType.Try) || this; _this.body = body; + return _this; } Try.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4529,6 +4573,7 @@ var TypeScript; if (_this.param) { _this.param.varFlags |= VarFlags.AutoInit; } + return _this; } Catch.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4597,6 +4642,7 @@ var TypeScript; var _this; _this = _super.call(this, NodeType.Finally) || this; _this.body = body; + return _this; } Finally.prototype.emit = function (emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4629,6 +4675,7 @@ var TypeScript; _this.isBlockComment = isBlockComment; _this.endsLine = endsLine; _this.text = null; + return _this; } Comment.prototype.getText = function () { if (this.text == null) { @@ -4652,6 +4699,7 @@ var TypeScript; function DebuggerStatement() { var _this; _this = _super.call(this, NodeType.Debugger) || this; + return _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 f0db6078832..2d219c63e6a 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2384,6 +2384,7 @@ var Harness; _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"); @@ -2419,6 +2420,7 @@ var Harness; _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) { @@ -2473,6 +2475,7 @@ var Harness; function Run() { var _this; _this = _super.call(this, 'Test Run', null) || this; + return _this; } Run.prototype.run = function () { emitLog('start'); diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index 618c38b89d5..c07238dff5e 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -31,6 +31,7 @@ var Derived = (function (_super) { _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/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index e953198290b..0d4cfefb63b 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -25,6 +25,7 @@ var Derived = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this.bing = function () { return Base.foo; }; // error + return _this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/readonlyConstructorAssignment.js b/tests/baselines/reference/readonlyConstructorAssignment.js index f1b69ecc00b..581b110298a 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.js +++ b/tests/baselines/reference/readonlyConstructorAssignment.js @@ -60,6 +60,7 @@ var B = (function (_super) { _this = _super.call(this, x) || this; // Fails, x is readonly _this.x = 1; + return _this; } return B; }(A)); @@ -72,6 +73,7 @@ var C = (function (_super) { _this = _super.call(this, x) || this; _this.x = x; _this.x = 1; + return _this; } return C; }(A)); @@ -90,6 +92,7 @@ var E = (function (_super) { _this = _super.call(this, x) || this; _this.x = x; _this.x = 1; + return _this; } return E; }(D)); diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index cd3a9f4c346..0ee301758cf 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -126,6 +126,7 @@ var H = (function (_super) { var _this; _this = _super.call(this) || this; return new G(); //error + return _this; } return H; }(F)); @@ -135,6 +136,7 @@ var I = (function (_super) { var _this; _this = _super.call(this) || this; return new G(); + return _this; } return I; }(G)); diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index 3fd9018e945..9436043094e 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -30,6 +30,7 @@ var D = (function (_super) { _this.v = 1; _this.p = 1; C.s = 1; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index 29da6d52a38..7fef0a42010 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -25,6 +25,7 @@ var Greeter = (function (_super) { _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 3a75f3d3b66..14f7f65f050 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;QAAA,UAGC;;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 +{"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,UAGC;;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 7c05c1b4d84..e1adf2f7a29 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -130,6 +130,7 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 4 >Emitted(17, 28) Source(6, 25) + SourceIndex(0) 5 >Emitted(17, 29) Source(6, 26) + SourceIndex(0) --- +>>> return _this; >>> } 1 >^^^^ 2 > ^ @@ -137,8 +138,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1 > > 2 > } -1 >Emitted(18, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(18, 6) Source(7, 2) + SourceIndex(0) +1 >Emitted(19, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(19, 6) Source(7, 2) + SourceIndex(0) --- >>> return Greeter; 1->^^^^ @@ -146,8 +147,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > ^^^-> 1-> 2 > } -1->Emitted(19, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(19, 19) Source(7, 2) + SourceIndex(0) +1->Emitted(20, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(20, 19) Source(7, 2) + SourceIndex(0) --- >>>}(AbstractGreeter)); 1-> @@ -166,11 +167,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts > public a = 10; > public nameA = "Ten"; > } -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) +1->Emitted(21, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(21, 2) Source(7, 2) + SourceIndex(0) +3 >Emitted(21, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(21, 3) Source(4, 23) + SourceIndex(0) +5 >Emitted(21, 18) Source(4, 38) + SourceIndex(0) +6 >Emitted(21, 21) Source(7, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map \ No newline at end of file diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index 462f2382f3c..5e769cab563 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -31,6 +31,7 @@ var B = (function (_super) { _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/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index f5bac0135af..6240f8c454f 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -52,6 +52,7 @@ var B = (function (_super) { var _this; var x = 1; // should not error _this = _super.call(this) || this; + return _this; } return B; }(A)); @@ -62,6 +63,7 @@ var C = (function (_super) { var _this; _this.p = 10; var x = 1; // should error + return _this; } return C; }(A)); @@ -71,6 +73,7 @@ var D = (function (_super) { var _this; _this.p = 11; var x = 1; // should error + return _this; } return D; }(A)); @@ -80,6 +83,7 @@ var E = (function (_super) { 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 1af13b1ce7a..4e1c483f1c1 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -78,6 +78,7 @@ var B = (function (_super) { "use strict"; // No error _this = _super.call(this) || this; _this.s = 9; + return _this; } return B; }(A)); @@ -88,6 +89,7 @@ var C = (function (_super) { _this = _super.call(this) || this; // No error _this.s = 9; "use strict"; + return _this; } return C; }(A)); @@ -99,6 +101,7 @@ var D = (function (_super) { var x = 1; // Error _this = _super.call(this) || this; "use strict"; + return _this; } return D; }(A)); @@ -108,6 +111,7 @@ var Bs = (function (_super) { var _this; "use strict"; // No error _this = _super.call(this) || this; + return _this; } return Bs; }(A)); @@ -118,6 +122,7 @@ var Cs = (function (_super) { var _this; _this = _super.call(this) || this; // No error "use strict"; + return _this; } return Cs; }(A)); @@ -129,6 +134,7 @@ var Ds = (function (_super) { var x = 1; // no Error _this = _super.call(this) || this; "use strict"; + return _this; } return Ds; }(A)); diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index 807347e1d16..408f9051bad 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -48,6 +48,7 @@ var Q = (function (_super) { _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/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index 770cb0bf79f..dc450147f88 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -45,6 +45,7 @@ var T6 = (function (_super) { // which is instantiated with 'number' in the extends clause _this = _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 4eeabdfa282..6e30cc64052 100644 --- a/tests/baselines/reference/superCallAssignResult.js +++ b/tests/baselines/reference/superCallAssignResult.js @@ -27,6 +27,7 @@ var H = (function (_super) { 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 6af4482f371..a5d6ec18ce3 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing1.js @@ -36,6 +36,7 @@ var D = (function (_super) { 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 8ab6c5f349c..c7a206dbbbe 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing2.js @@ -26,6 +26,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this, function () { _this._t; }) || this; // no error. only check when this is directly accessing in constructor + return _this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing3.js b/tests/baselines/reference/superCallBeforeThisAccessing3.js index f77cb964179..185767fefb6 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing3.js @@ -32,6 +32,7 @@ var D = (function (_super) { x(); // no error; we only check super is called before this when the container is a constructor _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 c147b0d84cc..311b7ca2183 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing4.js @@ -27,6 +27,7 @@ var D = (function (_super) { var _this; _this._t; _this = _super.call(this) || this; + return _this; } return D; }(null)); @@ -36,6 +37,7 @@ var E = (function (_super) { var _this; _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 8fff8068ec0..57228538faf 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing5.js @@ -18,6 +18,7 @@ var D = (function (_super) { function D() { 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 843a1d3b2cf..e630d539f14 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing6.js @@ -26,6 +26,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this, _this) || this; + return _this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing7.js b/tests/baselines/reference/superCallBeforeThisAccessing7.js index d6ad948a08c..9cfe8736774 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing7.js @@ -32,6 +32,7 @@ var D = (function (_super) { j: _this._t }; _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 cbf0236c4cc..fe459b5e031 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing8.js @@ -32,6 +32,7 @@ var D = (function (_super) { 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 6de41cb5188..2cfc0bfcbd4 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -22,6 +22,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this) || this; + return _this; } return D; }(B)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index 5ae8f8b3874..f9eeadc98e6 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -21,6 +21,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this) || this; + return _this; } return D; }(B)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index bc85d74c4c8..02bec67d7aa 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -27,6 +27,7 @@ var B = (function (_super) { function B() { var _this; _this = _super.call(this, function (value) { return String(value); }) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js index a1736bb45f0..55c6ee6f445 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -27,6 +27,7 @@ var B = (function (_super) { function B() { var _this; _this = _super.call(this, function (value) { return String(value); }) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js index c5beb5df5b5..977377e41d4 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -27,6 +27,7 @@ var B = (function (_super) { function B() { var _this; _this = _super.call(this, function (value) { return String(value); }) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index 1dd120eeb5c..503aee2dcc6 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -71,6 +71,7 @@ var Other = (function (_super) { _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/superCallInsideClassDeclaration.js b/tests/baselines/reference/superCallInsideClassDeclaration.js index f47b50d4915..326662abdac 100644 --- a/tests/baselines/reference/superCallInsideClassDeclaration.js +++ b/tests/baselines/reference/superCallInsideClassDeclaration.js @@ -41,9 +41,11 @@ var B = (function (_super) { function D() { var _this; _this = _super.call(this) || this; + return _this; } return D; }(C)); + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallInsideClassExpression.js b/tests/baselines/reference/superCallInsideClassExpression.js index b9e1f6c9786..5797085726d 100644 --- a/tests/baselines/reference/superCallInsideClassExpression.js +++ b/tests/baselines/reference/superCallInsideClassExpression.js @@ -41,9 +41,11 @@ var B = (function (_super) { function class_1() { var _this; _this = _super.call(this) || this; + return _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 68a9c19e819..636b03c227f 100644 --- a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js +++ b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js @@ -32,6 +32,7 @@ var B = (function (_super) { var x = { 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 774dde72340..65a8b435166 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -46,6 +46,7 @@ var D = (function (_super) { var y2 = function () { _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 a311ce95fc7..4e4ae47967a 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -30,6 +30,7 @@ var B = (function (_super) { function B() { var _this; _this = _super.call(this, function (value) { return String(value.toExponential()); }) || this; + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.js b/tests/baselines/reference/superCallParameterContextualTyping2.js index 9439871f38c..f3a246c6389 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -29,6 +29,7 @@ var C = (function (_super) { function C() { var _this; _this = _super.call(this, function (value) { return String(value()); }) || this; + return _this; } return C; }(A)); diff --git a/tests/baselines/reference/superCallParameterContextualTyping3.js b/tests/baselines/reference/superCallParameterContextualTyping3.js index d77df52ddd6..e7b8b355108 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -62,6 +62,7 @@ var C = (function (_super) { p.length; } }); + return _this; } return C; }(CBase)); diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index 33127da6437..2fe7712ce68 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -53,6 +53,7 @@ var Derived = (function (_super) { //type of super call expression is void var p = _this = _super.call(this, '') || this; var p = v(); + return _this; } return Derived; }(Base)); @@ -67,6 +68,7 @@ var OtherDerived = (function (_super) { var _this; var p = ''; _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 be34657a0c1..48b79acadf4 100644 --- a/tests/baselines/reference/superCallsInConstructor.js +++ b/tests/baselines/reference/superCallsInConstructor.js @@ -51,6 +51,7 @@ var Derived = (function (_super) { catch (e) { _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 2e68370fc32..93676c5d8f3 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -93,6 +93,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/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index 56e40b65e10..7519a8253ec 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -29,6 +29,7 @@ var C = (function (_super) { function C(a) { var _this; if (a === void 0) { a = _super.foo.call(_this); } + return _this; } return C; }(B)); diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index 5a1f48f3826..9b4d956dc5a 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -92,6 +92,7 @@ var RegisteredUser = (function (_super) { _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; @@ -110,6 +111,7 @@ var RegisteredUser2 = (function (_super) { _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; @@ -126,6 +128,7 @@ var RegisteredUser3 = (function (_super) { _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; @@ -142,6 +145,7 @@ var RegisteredUser4 = (function (_super) { _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/superNewCall1.js b/tests/baselines/reference/superNewCall1.js index 32c4da4d4e4..30b07308bb2 100644 --- a/tests/baselines/reference/superNewCall1.js +++ b/tests/baselines/reference/superNewCall1.js @@ -29,6 +29,7 @@ var B = (function (_super) { function B() { var _this; new _super.prototype(function (value) { return String(value); }); + return _this; } return B; }(A)); diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index c9865806570..b6559a63a98 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -54,6 +54,7 @@ var D = (function (_super) { _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 df6e08177cb..eded4e74a7f 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -54,6 +54,7 @@ var D = (function (_super) { _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/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index d8dda26288c..2ba460d18f7 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -103,6 +103,7 @@ var SomeDerivedClass = (function (_super) { _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 1d2ab4c2a3f..011c5129e9f 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.js +++ b/tests/baselines/reference/superPropertyAccess_ES5.js @@ -53,6 +53,7 @@ var MyDerived = (function (_super) { _this = _super.call(this) || this; var f1 = _super.prototype.getValue.call(_this); var f2 = _super.prototype.value; + return _this; } return MyDerived; }(MyBase)); diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index 499c0a6de1f..1152399e6eb 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -30,6 +30,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this) || this; // uses the type parameter type of the base class, ie string + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index 471c7cd36ac..f2580d30c5f 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -22,6 +22,7 @@ var D = (function (_super) { function D() { var _this; _this = _super.call(this) || this; + return _this; } return D; }(B)); diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index cc46fa96896..a1c04975404 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -25,6 +25,7 @@ var D = (function (_super) { function D() { 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 4b5176bed96..42a0e46d4c0 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -25,6 +25,7 @@ var D = (function (_super) { function D(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 aa70803de4d..803e5c264c2 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -30,6 +30,7 @@ var D = (function (_super) { function D() { var _this; _super.prototype..call(_this); + return _this; } D.prototype.bar = function () { _super.prototype.bar.call(this, null); diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index a9bbc34123f..a08380b173f 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -37,6 +37,7 @@ var Bar = (function (_super) { function Bar() { var _this; _this = _super.call(this, function (s) { s = 5; }) || this; + return _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 218ebfb1686..10629d579ba 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -72,6 +72,7 @@ var ClassWithNoInitializer = (function (_super) { function ClassWithNoInitializer() { var _this; _this = _super.call(this, _this) || this; // Error + return _this; } return ClassWithNoInitializer; }(BaseErrClass)); @@ -82,6 +83,7 @@ var ClassWithInitializer = (function (_super) { var _this; _this = _super.call(this, _this) || this; // Error _this.t = 4; + return _this; } return ClassWithInitializer; }(BaseErrClass)); diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index c14f71ac0b6..444952fea3f 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -73,6 +73,7 @@ var ClassWithNoInitializer = (function (_super) { function ClassWithNoInitializer() { var _this; _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing + return _this; } return ClassWithNoInitializer; }(BaseErrClass)); @@ -83,6 +84,7 @@ var ClassWithInitializer = (function (_super) { var _this; _this = _super.call(this, _this) || this; // Error _this.t = 4; + return _this; } return ClassWithInitializer; }(BaseErrClass)); diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index cf64eebced1..f9d9f8694c9 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -38,6 +38,7 @@ var Foo = (function (_super) { function Foo() { var _this; _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing + return _this; } return Foo; }(Base)); @@ -47,6 +48,7 @@ var Foo2 = (function (_super) { var _this; _this = _super.call(this, _this) || this; // error _this.p = 0; + return _this; } return Foo2; }(Base)); @@ -56,6 +58,7 @@ var Foo3 = (function (_super) { var _this; _this = _super.call(this, _this) || this; // error _this.p = p; + return _this; } return Foo3; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index eba933d9893..3185e42dab6 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -27,6 +27,7 @@ var Foo = (function (_super) { var _this; _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 ed6baabb408..b9f7571868a 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -35,6 +35,7 @@ var Foo = (function (_super) { function Foo() { var _this; _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing + return _this; } return Foo; }(Base)); @@ -44,6 +45,7 @@ var Foo2 = (function (_super) { var _this; _this = _super.call(this, _this) || this; // error _this.x = 0; + return _this; } return Foo2; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index d705d5fa7e0..309ebf93407 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -29,6 +29,7 @@ var Foo = (function (_super) { var _this; _this = _super.call(this, _this) || this; _this.x = 0; + return _this; } return Foo; }(Base)); diff --git a/tests/baselines/reference/tsxDynamicTagName5.js b/tests/baselines/reference/tsxDynamicTagName5.js index 76b79dbc7dc..307cd0fca93 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.js +++ b/tests/baselines/reference/tsxDynamicTagName5.js @@ -33,6 +33,7 @@ var Text = (function (_super) { var _this; _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 c55ceb100ea..39e30b6ba38 100644 --- a/tests/baselines/reference/tsxDynamicTagName7.js +++ b/tests/baselines/reference/tsxDynamicTagName7.js @@ -33,6 +33,7 @@ var Text = (function (_super) { var _this; _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 57ce2becbad..77423709347 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.js +++ b/tests/baselines/reference/tsxDynamicTagName8.js @@ -33,6 +33,7 @@ var Text = (function (_super) { var _this; _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 1bc14eb32ee..6b5d130c0b4 100644 --- a/tests/baselines/reference/tsxDynamicTagName9.js +++ b/tests/baselines/reference/tsxDynamicTagName9.js @@ -33,6 +33,7 @@ var Text = (function (_super) { var _this; _this = _super.apply(this, arguments) || this; _this._tagName = 'div'; + return _this; } Text.prototype.render = function () { return ( Hello world ); diff --git a/tests/baselines/reference/typeGuardOfFormThisMember.js b/tests/baselines/reference/typeGuardOfFormThisMember.js index fefb1e7ff38..3995ffd447c 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMember.js +++ b/tests/baselines/reference/typeGuardOfFormThisMember.js @@ -121,6 +121,7 @@ var Test; var _this; _this = _super.call(this, path) || this; _this.content = content; + return _this; } return File; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js index ed53a308808..14807ddd88c 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js +++ b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js @@ -71,6 +71,7 @@ var Test; var _this; _this = _super.call(this, path) || this; _this.content = content; + return _this; } return File; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeOfSuperCall.js b/tests/baselines/reference/typeOfSuperCall.js index 70ace4becb4..179e981b8d1 100644 --- a/tests/baselines/reference/typeOfSuperCall.js +++ b/tests/baselines/reference/typeOfSuperCall.js @@ -24,6 +24,7 @@ var D = (function (_super) { function D() { var _this; var x = _this = _super.call(this) || this; + return _this; } return D; }(C)); diff --git a/tests/baselines/reference/typeRelationships.js b/tests/baselines/reference/typeRelationships.js index 87f0f60c53f..eee99568638 100644 --- a/tests/baselines/reference/typeRelationships.js +++ b/tests/baselines/reference/typeRelationships.js @@ -78,6 +78,7 @@ var D = (function (_super) { _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/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 46ee4ed02d5..2c2b3ded1b5 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -65,6 +65,7 @@ var C4 = (function (_super) { function C4() { var _this; _this = _super.call(this, asdf) || this; + return _this; } return C4; }(C3)); diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index 06d2c4bd6a5..02927bf558d 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -239,6 +239,7 @@ var ts; _this.name = name; _this.type = type; _this.flags = flags; + return _this; } Property.prototype.equals = function (other) { return this.name === other.name && @@ -260,6 +261,7 @@ var ts; _this.typeParameters = typeParameters; _this.parameters = parameters; _this.returnType = returnType; + return _this; } Signature.prototype.equalsNoReturn = function (other) { return this.parameters.length === other.parameters.length && @@ -281,6 +283,7 @@ var ts; _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/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index 96802932f12..3a05ff12ee8 100644 --- a/tests/baselines/reference/validUseOfThisInSuper.js +++ b/tests/baselines/reference/validUseOfThisInSuper.js @@ -26,6 +26,7 @@ var Super = (function (_super) { function Super() { var _this; _this = _super.call(this, (function () { return _this; })()) || this; // ok since this is not the case: The constructor declares parameter properties or the containing class declares instance member variables with initializers. + return _this; } return Super; }(Base)); diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index 04eaa58a196..9c1c8f8c29d 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -45,6 +45,7 @@ define(["require", "exports"], function (require, exports) { _this = _super.call(this, element) || this; _this.p1 = element; _this.p2 = url; + return _this; } return B; }(A)); From bab6d6fbb23f28831b4b990ad4c2cc9755240374 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 2 Sep 2016 13:03:46 -0700 Subject: [PATCH 08/47] Ensure prologue directives occur first. --- src/compiler/transformers/es6.ts | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 886ee1b8e40..8890ac60173 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -774,10 +774,22 @@ 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) { declareOrCaptureThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement); addDefaultValueAssignmentsIfNeeded(statements, constructor); @@ -787,9 +799,11 @@ namespace ts { addDefaultSuperCallIfNeeded(statements, constructor, extendsClauseElement, hasSynthesizedSuper); if (constructor) { - const body = saveStateAndInvoke(constructor, hasSynthesizedSuper ? transformConstructorBodyWithSynthesizedSuper : transformConstructorBodyWithoutSynthesizedSuper); + Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); + const body = saveStateAndInvoke(constructor, makeTransformerForConstructorBodyAtOffset(statementOffset)); addRange(statements, body); } + if (extendsClauseElement) { statements.push( createReturn( @@ -815,12 +829,8 @@ namespace ts { return block; } - function transformConstructorBodyWithSynthesizedSuper(node: ConstructorDeclaration) { - return visitNodes(node.body.statements, visitor, isStatement, /*start*/ 1); - } - - function transformConstructorBodyWithoutSynthesizedSuper(node: ConstructorDeclaration) { - return visitNodes(node.body.statements, visitor, isStatement, /*start*/ 0); + function makeTransformerForConstructorBodyAtOffset(offset: number): (c: ConstructorDeclaration) => NodeArray { + return constructor => visitNodes(constructor.body.statements, visitor, isStatement, /*start*/ offset); } /** From ce953ceb4569f0c93cda7dc55c46fe4867233bdc Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 2 Sep 2016 13:04:14 -0700 Subject: [PATCH 09/47] Accepted baselines. --- .../emitSuperCallBeforeEmitParameterPropertyDeclaration1.js | 2 +- .../reference/emitSuperCallBeforeEmitPropertyDeclaration1.js | 2 +- ...EmitPropertyDeclarationAndParameterPropertyDeclaration1.js | 2 +- tests/baselines/reference/strictModeInConstructor.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index b95263464a7..efed8e66a15 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -28,9 +28,9 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x) { - var _this; "use strict"; 'someStringForEgngInject'; + var _this; _this = _super.call(this) || this; _this.x = x; return _this; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js index f078c448b75..6e3d3bfaa1b 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js @@ -30,9 +30,9 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this; "use strict"; 'someStringForEgngInject'; + var _this; _this = _super.call(this) || this; _this.blub = 12; return _this; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js index e64af9ef862..6559569fe79 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -28,9 +28,9 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x) { - var _this; "use strict"; 'someStringForEgngInject'; + var _this; _this = _super.call(this) || this; _this.x = x; _this.blah = 2; diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index 4e1c483f1c1..1c33f16a3c6 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -74,8 +74,8 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this; "use strict"; // No error + var _this; _this = _super.call(this) || this; _this.s = 9; return _this; @@ -108,8 +108,8 @@ var D = (function (_super) { var Bs = (function (_super) { __extends(Bs, _super); function Bs() { - var _this; "use strict"; // No error + var _this; _this = _super.call(this) || this; return _this; } From d6e548b02e3546b70c656fb79e364b1e0cb77bdf Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 2 Sep 2016 20:04:43 -0700 Subject: [PATCH 10/47] Consolidate '_this' declaration and assignments for first statements in constructors. --- src/compiler/transformers/es6.ts | 68 +++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 8890ac60173..9b703e5ddc4 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -791,7 +791,8 @@ namespace ts { } if (constructor) { - declareOrCaptureThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement); + Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); + statementOffset = declareOrCaptureThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, statementOffset); addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); } @@ -799,7 +800,6 @@ namespace ts { addDefaultSuperCallIfNeeded(statements, constructor, extendsClauseElement, hasSynthesizedSuper); if (constructor) { - Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); const body = saveStateAndInvoke(constructor, makeTransformerForConstructorBodyAtOffset(statementOffset)); addRange(statements, body); } @@ -1118,13 +1118,49 @@ namespace ts { statements.push(forStatement); } - function declareOrCaptureThisForConstructorIfNeeded(statements: Statement[], ctor: ConstructorDeclaration, hasExtendsClause: boolean) { + /** + * Declares a `_this` variable for derived classes and for when arrow functions capture `this`. + * + * @returns The new statement offset into the `statements` array. + */ + function declareOrCaptureThisForConstructorIfNeeded(statements: Statement[], ctor: ConstructorDeclaration, hasExtendsClause: boolean, firstNonPrologue: number) { if (hasExtendsClause) { - captureThisForNode(statements, ctor, /*initializer*/ undefined); + // 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(); + // + // instead of + // + // var _this = super(); + // + let initializer: Expression = undefined; + let firstStatement: Statement; + if (firstNonPrologue < ctor.body.statements.length) { + firstStatement = ctor.body.statements[firstNonPrologue]; + + if (firstStatement.kind === SyntaxKind.ExpressionStatement && isSuperCallExpression((firstStatement as ExpressionStatement).expression)) { + initializer = setOriginalNode( + visitImmediateSuperCallInBody(((firstStatement as ExpressionStatement).expression as CallExpression)), + (firstStatement as ExpressionStatement).expression + ); + } + } + captureThisForNode(statements, ctor, /*initializer*/ initializer, firstStatement); + + // We're actually skipping an extra statement. Signal this to the caller. + if (initializer) { + return firstNonPrologue + 1; + } } else { addCaptureThisForNodeIfNeeded(statements, ctor); } + + return firstNonPrologue; } /** @@ -1139,7 +1175,9 @@ namespace ts { } } - function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined) { + function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined): void; + function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined, originalStatement: Statement): void; + function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined, originalStatement?: Statement): void { enableSubstitutionsForCapturedThis(); const captureThisStatement = createVariableStatement( /*modifiers*/ undefined, @@ -1149,7 +1187,8 @@ namespace ts { /*type*/ undefined, initializer ) - ]) + ]), + originalStatement ); setNodeEmitFlags(captureThisStatement, NodeEmitFlags.NoComments | NodeEmitFlags.CustomPrologue); @@ -2520,7 +2559,15 @@ namespace ts { * * @param node a CallExpression. */ - function visitCallExpression(node: CallExpression): CallExpression | BinaryExpression { + 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. @@ -2572,13 +2619,14 @@ namespace ts { if (node.expression.kind === SyntaxKind.SuperKeyword) { const actualThis = createThis(); setNodeEmitFlags(actualThis, NodeEmitFlags.NoSubstitution); - return createAssignment( - createIdentifier("_this"), + const initializer = createLogicalOr( resultingCall, actualThis ) - ); + return assignToCapturedThis + ? createAssignment(createIdentifier("_this"), initializer) + : initializer } return resultingCall; } From 11bc6c470f5dd09dc83fbf8ac269f0c8bc023ad0 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 3 Sep 2016 00:16:43 -0700 Subject: [PATCH 11/47] Fixed issue where last function context & parent node wasn't being preserved. This came up when a `super()` call was nested in another constructor body. Current logic in the transform says that if the last containing non-arrow function body is non-static, and the current parent isn't a call expression, the call target of a `super` call will become `_super.prototype` instead of `super`. If the state is not saved, the containing arrow function and parent are not saved, and the information for this check won't be accurate. --- src/compiler/transformers/es6.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 9b703e5ddc4..85838112fc3 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -1143,9 +1143,10 @@ namespace ts { firstStatement = ctor.body.statements[firstNonPrologue]; if (firstStatement.kind === SyntaxKind.ExpressionStatement && isSuperCallExpression((firstStatement as ExpressionStatement).expression)) { + const superCall = (firstStatement as ExpressionStatement).expression as CallExpression; initializer = setOriginalNode( - visitImmediateSuperCallInBody(((firstStatement as ExpressionStatement).expression as CallExpression)), - (firstStatement as ExpressionStatement).expression + saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), + superCall ); } } From d8846dd495d03697ee598d6c887f55eac61789ef Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 3 Sep 2016 00:26:02 -0700 Subject: [PATCH 12/47] Accepted baselines. --- tests/baselines/reference/abstractProperty.js | 3 +- .../reference/abstractPropertyNegative.js | 9 +- .../accessOverriddenBaseClassMember1.js | 3 +- ...aliasUsageInTypeArgumentOfExtendsClause.js | 3 +- .../reference/arrowFunctionContexts.js | 6 +- .../reference/assignmentLHSIsValue.js | 3 +- tests/baselines/reference/autolift4.js | 3 +- tests/baselines/reference/baseCheck.js | 15 +- .../reference/bestCommonTypeOfTuple2.js | 3 +- tests/baselines/reference/callWithSpread.js | 3 +- .../reference/captureThisInSuperCall.js | 3 +- .../reference/checkForObjectTooStrict.js | 6 +- .../checkSuperCallBeforeThisAccessing1.js | 3 +- .../checkSuperCallBeforeThisAccessing5.js | 3 +- .../checkSuperCallBeforeThisAccessing7.js | 3 +- .../classConstructorAccessibility2.js | 9 +- ...classConstructorParametersAccessibility.js | 3 +- ...lassConstructorParametersAccessibility2.js | 3 +- ...lassConstructorParametersAccessibility3.js | 3 +- tests/baselines/reference/classExpression3.js | 6 +- .../reference/classExtendingClassLikeType.js | 9 +- tests/baselines/reference/classExtendsNull.js | 3 +- .../reference/classSideInheritance2.js | 3 +- .../reference/classSideInheritance3.js | 6 +- tests/baselines/reference/classUpdateTests.js | 15 +- ...isionSuperAndLocalFunctionInConstructor.js | 6 +- ...ollisionSuperAndLocalFunctionInProperty.js | 3 +- .../collisionSuperAndLocalVarInConstructor.js | 6 +- .../collisionSuperAndLocalVarInProperty.js | 3 +- .../reference/collisionSuperAndParameter.js | 6 +- ...perAndPropertyNameAsConstuctorParameter.js | 12 +- .../reference/commentsInheritance.js | 3 +- .../reference/compoundAssignmentLHSIsValue.js | 3 +- ...poundExponentiationAssignmentLHSIsValue.js | 3 +- .../reference/computedPropertyNames28_ES5.js | 3 +- .../reference/computedPropertyNames30_ES5.js | 3 +- tests/baselines/reference/constructorArgs.js | 3 +- ...ctorFunctionTypeIsAssignableToBaseType2.js | 6 +- .../reference/constructorOverloads2.js | 3 +- .../reference/declFileGenericType2.js | 6 +- .../reference/decoratorOnClassConstructor2.js | 3 +- .../reference/decoratorOnClassConstructor3.js | 3 +- .../derivedClassOverridesPrivateFunction1.js | 3 +- .../derivedClassOverridesProtectedMembers.js | 3 +- .../derivedClassOverridesProtectedMembers2.js | 3 +- .../derivedClassOverridesProtectedMembers3.js | 30 ++-- .../derivedClassOverridesPublicMembers.js | 3 +- .../derivedClassParameterProperties.js | 12 +- ...dClassSuperCallsInNonConstructorMembers.js | 3 +- .../derivedClassSuperCallsWithThisArg.js | 12 +- .../derivedClassWithoutExplicitConstructor.js | 6 +- ...derivedClassWithoutExplicitConstructor2.js | 6 +- ...derivedClassWithoutExplicitConstructor3.js | 12 +- .../destructuringParameterDeclaration5.js | 6 +- ...BeforeEmitParameterPropertyDeclaration1.js | 3 +- ...SuperCallBeforeEmitPropertyDeclaration1.js | 3 +- ...arationAndParameterPropertyDeclaration1.js | 3 +- tests/baselines/reference/errorSuperCalls.js | 3 +- .../reference/errorSuperPropertyAccess.js | 6 +- tests/baselines/reference/es6ClassTest.js | 3 +- tests/baselines/reference/es6ClassTest2.js | 3 +- ...cClassPropertyInheritanceSpecialization.js | 3 +- ...genericConstraintOnExtendedBuiltinTypes.js | 3 +- ...enericConstraintOnExtendedBuiltinTypes2.js | 3 +- ...ericRecursiveImplicitConstructorErrors3.js | 3 +- .../reference/genericTypeConstraints.js | 3 +- .../interfaceExtendsClassWithPrivate2.js | 6 +- tests/baselines/reference/lift.js | 3 +- .../missingPropertiesOfClassExpression.js | 3 +- ...objectCreationOfElementAccessExpression.js | 18 +-- tests/baselines/reference/optionalMethods.js | 3 +- .../reference/optionalParamArgsTest.js | 3 +- .../reference/optionalParameterProperty.js | 3 +- .../overloadOnConstConstraintChecks4.js | 3 +- tests/baselines/reference/parserAstSpans1.js | 6 +- .../baselines/reference/parserRealSource10.js | 18 +-- .../baselines/reference/parserRealSource11.js | 144 ++++++------------ tests/baselines/reference/parserharness.js | 9 +- .../privateInstanceMemberAccessibility.js | 3 +- .../privateStaticMemberAccessibility.js | 3 +- .../readonlyConstructorAssignment.js | 9 +- .../reference/returnInConstructor1.js | 6 +- tests/baselines/reference/scopeTests.js | 3 +- ...sWithDefaultConstructorAndExtendsClause.js | 3 +- ...hDefaultConstructorAndExtendsClause.js.map | 2 +- ...tConstructorAndExtendsClause.sourcemap.txt | 54 ++++--- .../baselines/reference/staticInheritance.js | 3 +- .../reference/strictModeInConstructor.js | 12 +- tests/baselines/reference/superAccess2.js | 3 +- .../reference/superCallArgsMustMatch.js | 4 +- .../superCallBeforeThisAccessing1.js | 3 +- .../superCallBeforeThisAccessing2.js | 3 +- .../superCallBeforeThisAccessing4.js | 3 +- .../superCallBeforeThisAccessing6.js | 3 +- ...allFromClassThatDerivesFromGenericType1.js | 3 +- ...allFromClassThatDerivesFromGenericType2.js | 3 +- ...eButWithIncorrectNumberOfTypeArguments1.js | 3 +- ...sFromGenericTypeButWithNoTypeArguments1.js | 3 +- ...ivesNonGenericTypeButWithTypeArguments1.js | 3 +- .../reference/superCallInNonStaticMethod.js | 3 +- .../superCallInsideClassDeclaration.js | 3 +- .../superCallInsideClassExpression.js | 3 +- .../reference/superCallOutsideConstructor.js | 3 +- .../superCallParameterContextualTyping1.js | 3 +- .../superCallParameterContextualTyping2.js | 3 +- .../superCallParameterContextualTyping3.js | 4 +- tests/baselines/reference/superCalls.js | 3 +- tests/baselines/reference/superErrors.js | 3 +- tests/baselines/reference/superInLambdas.js | 12 +- .../reference/superPropertyAccess1.js | 3 +- .../reference/superPropertyAccess2.js | 3 +- .../reference/superPropertyAccessNoError.js | 3 +- .../reference/superPropertyAccess_ES5.js | 3 +- .../superWithGenericSpecialization.js | 3 +- .../baselines/reference/superWithGenerics.js | 3 +- .../reference/targetTypeBaseCalls.js | 3 +- .../reference/thisInInvalidContexts.js | 6 +- .../thisInInvalidContextsExternalModule.js | 6 +- tests/baselines/reference/thisInSuperCall.js | 9 +- tests/baselines/reference/thisInSuperCall1.js | 3 +- tests/baselines/reference/thisInSuperCall2.js | 6 +- tests/baselines/reference/thisInSuperCall3.js | 3 +- .../baselines/reference/tsxDynamicTagName5.js | 3 +- .../baselines/reference/tsxDynamicTagName7.js | 3 +- .../baselines/reference/tsxDynamicTagName8.js | 3 +- .../baselines/reference/tsxDynamicTagName9.js | 3 +- .../reference/typeGuardOfFormThisMember.js | 3 +- .../typeGuardOfFormThisMemberErrors.js | 3 +- .../baselines/reference/typeRelationships.js | 3 +- tests/baselines/reference/unknownSymbols1.js | 3 +- .../reference/unspecializedConstraints.js | 9 +- .../reference/validUseOfThisInSuper.js | 3 +- .../reference/varArgsOnConstructorTypes.js | 3 +- 133 files changed, 285 insertions(+), 541 deletions(-) diff --git a/tests/baselines/reference/abstractProperty.js b/tests/baselines/reference/abstractProperty.js index 292213ead53..fb7deaa09dd 100644 --- a/tests/baselines/reference/abstractProperty.js +++ b/tests/baselines/reference/abstractProperty.js @@ -35,8 +35,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.raw = "edge"; _this.ro = "readonly please"; return _this; diff --git a/tests/baselines/reference/abstractPropertyNegative.js b/tests/baselines/reference/abstractPropertyNegative.js index 28ada310ef4..5a4c24fe233 100644 --- a/tests/baselines/reference/abstractPropertyNegative.js +++ b/tests/baselines/reference/abstractPropertyNegative.js @@ -57,8 +57,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.ro = "readonly please"; return _this; } @@ -79,8 +78,7 @@ var WrongTypeProperty = (function () { var WrongTypePropertyImpl = (function (_super) { __extends(WrongTypePropertyImpl, _super); function WrongTypePropertyImpl() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.num = "nope, wrong"; return _this; } @@ -107,8 +105,7 @@ var WrongTypeAccessorImpl = (function (_super) { var WrongTypeAccessorImpl2 = (function (_super) { __extends(WrongTypeAccessorImpl2, _super); function WrongTypeAccessorImpl2() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.num = "nope, wrong"; return _this; } diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index 65431a2f778..02d092dfd39 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -34,8 +34,7 @@ var Point = (function () { var ColoredPoint = (function (_super) { __extends(ColoredPoint, _super); function ColoredPoint(x, y, color) { - var _this; - _this = _super.call(this, x, y) || this; + var _this = _super.call(this, x, y) || this; _this.color = color; return _this; } diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 8af9c702654..91c6ca2c53f 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -65,8 +65,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = moduleA; return _this; } diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index 660208cb0c1..1af0797b41f 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; }) || this; + var _this = _super.call(this, function () { return _this; }) || this; return _this; } return Derived; @@ -159,8 +158,7 @@ var M2; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.call(this, function () { return _this; }) || this; + var _this = _super.call(this, function () { return _this; }) || this; return _this; } return Derived; diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 52d14cbe536..ab3f80eff21 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -118,8 +118,7 @@ value; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _super.prototype. = value; return _this; } diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index 0638efab0b3..1c29bfeeff7 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -43,8 +43,7 @@ Point.origin = new Point(0, 0); var Point3D = (function (_super) { __extends(Point3D, _super); function Point3D(x, y, z, m) { - var _this; - _this = _super.call(this, x, y) || this; + var _this = _super.call(this, x, y) || this; _this.z = z; return _this; } diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index 832830ae864..623cd152b9a 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -43,8 +43,7 @@ var C = (function () { var ELoc = (function (_super) { __extends(ELoc, _super); function ELoc(x) { - var _this; - _this = _super.call(this, 0, x) || this; + var _this = _super.call(this, 0, x) || this; return _this; } return ELoc; @@ -52,8 +51,7 @@ var ELoc = (function (_super) { var ELocVar = (function (_super) { __extends(ELocVar, _super); function ELocVar(x) { - var _this; - _this = _super.call(this, 0, loc) || this; + var _this = _super.call(this, 0, loc) || this; return _this; } ELocVar.prototype.m = function () { @@ -64,8 +62,7 @@ var ELocVar = (function (_super) { var D = (function (_super) { __extends(D, _super); function D(z) { - var _this; - _this = _super.call(this, _this.z) || this; + var _this = _super.call(this, _this.z) || this; _this.z = z; return _this; } @@ -74,8 +71,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E(z) { - var _this; - _this = _super.call(this, 0, _this.z) || this; + var _this = _super.call(this, 0, _this.z) || this; _this.z = z; return _this; } @@ -84,8 +80,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F(z) { - var _this; - _this = _super.call(this, "hello", _this.z) || this; + var _this = _super.call(this, "hello", _this.z) || this; _this.z = z; return _this; } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index 8213733b753..d71b6f17abf 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -60,8 +60,7 @@ var C1 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.i = "bar"; return _this; } diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index 48af58edf65..161eb36dbcf 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -99,8 +99,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this, 1, 2) || this; + var _this = _super.call(this, 1, 2) || this; _this = _super.apply(this, [1, 2].concat(a)) || this; return _this; } diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index 2d39722548d..069871f598e 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(); } }) || this; + var _this = _super.call(this, { test: function () { return _this.someMethod(); } }) || this; return _this; } B.prototype.someMethod = function () { }; diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index 8c0cfc104d2..156608bd6b5 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -49,8 +49,7 @@ var Foo; var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return Bar; @@ -58,8 +57,7 @@ var Bar = (function (_super) { var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return Baz; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js index a54f82ab9fa..8ced6fce500 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js @@ -24,8 +24,7 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this; _this.x = 10; var that = _this; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js index e365678ee0c..3174bebd11d 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -25,8 +25,7 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.call(this, _this.x) || this; + var _this = _super.call(this, _this.x) || this; return _this; } return Derived; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js index 7ba43de005b..364aed4d4b0 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; })) || this; // No error + var _this = _super.call(this, (function () { return _this; })) || this; return _this; } return Super; diff --git a/tests/baselines/reference/classConstructorAccessibility2.js b/tests/baselines/reference/classConstructorAccessibility2.js index 8a81d469fb8..ef637611e8d 100644 --- a/tests/baselines/reference/classConstructorAccessibility2.js +++ b/tests/baselines/reference/classConstructorAccessibility2.js @@ -77,8 +77,7 @@ var BaseC = (function () { var DerivedA = (function (_super) { __extends(DerivedA, _super); function DerivedA(x) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; _this.x = x; return _this; } @@ -90,8 +89,7 @@ var DerivedA = (function (_super) { var DerivedB = (function (_super) { __extends(DerivedB, _super); function DerivedB(x) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; _this.x = x; return _this; } @@ -103,8 +101,7 @@ var DerivedB = (function (_super) { var DerivedC = (function (_super) { __extends(DerivedC, _super); function DerivedC(x) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; _this.x = x; return _this; } diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index 214815f4976..e0e75bcfeeb 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -59,8 +59,7 @@ c3.p; // protected, error var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - var _this; - _this = _super.call(this, p) || this; + var _this = _super.call(this, p) || this; _this.p; // OK return _this; } diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 7c714aa4c03..84da66c3e3c 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -59,8 +59,7 @@ c3.p; // protected, error var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - var _this; - _this = _super.call(this, p) || this; + var _this = _super.call(this, p) || this; _this.p; // OK return _this; } diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index 275f3920538..db9f94cf0fb 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -28,8 +28,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(p) { - var _this; - _this = _super.call(this, p) || this; + var _this = _super.call(this, p) || this; _this.p = p; _this.p; // OK return _this; diff --git a/tests/baselines/reference/classExpression3.js b/tests/baselines/reference/classExpression3.js index 3c53d728233..c0376c54c27 100644 --- a/tests/baselines/reference/classExpression3.js +++ b/tests/baselines/reference/classExpression3.js @@ -15,8 +15,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(class_1, _super); function class_1() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.c = 3; return _this; } @@ -24,8 +23,7 @@ var C = (function (_super) { }((function (_super) { __extends(class_2, _super); function class_2() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.b = 2; return _this; } diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index 32d7fff0cbd..fdda53a381f 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -76,8 +76,7 @@ var D0 = (function (_super) { var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this; - _this = _super.call(this, "abc", "def") || this; + var _this = _super.call(this, "abc", "def") || this; _this.x = "x"; _this.y = "y"; return _this; @@ -87,8 +86,7 @@ var D1 = (function (_super) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this; - _this = _super.call(this, 10) || this; + var _this = _super.call(this, 10) || this; _this = _super.call(this, 10, 20) || this; _this.x = 1; _this.y = 2; @@ -99,8 +97,7 @@ var D2 = (function (_super) { var D3 = (function (_super) { __extends(D3, _super); function D3() { - var _this; - _this = _super.call(this, "abc", 42) || this; + var _this = _super.call(this, "abc", 42) || this; _this.x = "x"; _this.y = 2; return _this; diff --git a/tests/baselines/reference/classExtendsNull.js b/tests/baselines/reference/classExtendsNull.js index 301dee7f705..a820b525aab 100644 --- a/tests/baselines/reference/classExtendsNull.js +++ b/tests/baselines/reference/classExtendsNull.js @@ -21,8 +21,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return Object.create(null); return _this; } diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index 1af6b6f846c..475f9bd4ceb 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -29,8 +29,7 @@ var __extends = (this && this.__extends) || function (d, b) { var SubText = (function (_super) { __extends(SubText, _super); function SubText(text, span) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return SubText; diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index fda7b0b0848..361378c3ff5 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -33,8 +33,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x, data) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; _this.data = data; return _this; } @@ -43,8 +42,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C(x) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; return _this; } return C; diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 2d7ecc3c190..9809966c4c2 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -157,8 +157,7 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.p1 = 0; return _this; } @@ -175,8 +174,7 @@ var F = (function (_super) { var G = (function (_super) { __extends(G, _super); function G() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.p1 = 0; return _this; } // NO ERROR @@ -191,8 +189,7 @@ var H = (function () { var I = (function (_super) { __extends(I, _super); function I() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } // ERROR - no super call allowed return I; @@ -200,8 +197,7 @@ var I = (function (_super) { var J = (function (_super) { __extends(J, _super); function J(p1) { - var _this; - _this = _super.call(this) || this; // NO ERROR + var _this = _super.call(this) || this; _this.p1 = p1; return _this; } @@ -221,8 +217,7 @@ var K = (function (_super) { var L = (function (_super) { __extends(L, _super); function L(p1) { - var _this; - _this = _super.call(this) || this; // NO ERROR + var _this = _super.call(this) || this; _this.p1 = p1; return _this; } diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index 5f2a5e89301..d4a22b731f2 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -42,8 +42,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; function _super() { } return _this; @@ -53,8 +52,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; var x = function () { function _super() { } diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index a6893c6a57a..67b7f0e3991 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -40,8 +40,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.prop2 = { doStuff: function () { function _super() { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index d799c783503..e3069352c08 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -36,8 +36,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; var _super = 10; // Should be error return _this; } @@ -46,8 +45,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; var x = function () { var _super = 10; // Should be error }; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index 4bb4f6a5a8b..d793e022c6b 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -38,8 +38,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.prop2 = { doStuff: function () { var _super = 10; // Should be error diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index 6ed47a1b3c1..750ae15ef0a 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -94,8 +94,7 @@ var Foo = (function () { var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2(_super) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.prop4 = { doStuff: function (_super) { } @@ -125,8 +124,7 @@ var Foo2 = (function (_super) { var Foo4 = (function (_super) { __extends(Foo4, _super); function Foo4(_super) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } Foo4.prototype.y = function (_super) { diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index 2d3709fa878..269881b3b90 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -44,8 +44,7 @@ var a = (function () { var b1 = (function (_super) { __extends(b1, _super); function b1(_super) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return b1; @@ -53,8 +52,7 @@ var b1 = (function (_super) { var b2 = (function (_super) { __extends(b2, _super); function b2(_super) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this._super = _super; return _this; } @@ -63,8 +61,7 @@ var b2 = (function (_super) { var b3 = (function (_super) { __extends(b3, _super); function b3(_super) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return b3; @@ -72,8 +69,7 @@ var b3 = (function (_super) { var b4 = (function (_super) { __extends(b4, _super); function b4(_super) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this._super = _super; return _this; } diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index 370ee0d246c..294f3a33690 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -227,8 +227,7 @@ var c2 = (function () { var c3 = (function (_super) { __extends(c3, _super); function c3() { - var _this; - _this = _super.call(this, 10) || this; + var _this = _super.call(this, 10) || this; return _this; } /** c3 f1*/ diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index dfbdf31c3d1..bfea11911bf 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -197,8 +197,7 @@ value; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _super.prototype. *= value; _super.prototype. += value; return _this; diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js index da670472b47..c8fb8c6a222 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -139,8 +139,7 @@ _a = Math.pow(['', ''], value), '' = _a[0], '' = _a[1]; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; (_a = _super.prototype). = Math.pow(_a., value); var _a; return _this; diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index 8152394cbf8..ab765c56dd7 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -24,8 +24,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; var obj = (_a = {}, _a[(_this = _super.call(this) || this, "prop")] = function () { }, _a); diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index 9f4a4ab51f9..c2c7cddd971 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -29,8 +29,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; (function () { var obj = (_a = {}, // Ideally, we would capture this. But the reference is diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index c7939472a96..6bbea0fddf7 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -29,8 +29,7 @@ var Super = (function () { var Sub = (function (_super) { __extends(Sub, _super); function Sub(options) { - var _this; - _this = _super.call(this, options.value) || this; + var _this = _super.call(this, options.value) || this; _this.options = options; return _this; } diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index 4f70c7d7f35..1ae239430c7 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -47,8 +47,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(x) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; return _this; } return Derived; @@ -57,8 +56,7 @@ var Derived2 = (function (_super) { __extends(Derived2, _super); // ok, not enforcing assignability relation on this function Derived2(x) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; return 1; return _this; } diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index 0041acb489e..c26d031656f 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -40,8 +40,7 @@ var FooBase = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; return _this; } Foo.prototype.bar1 = function () { }; diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 0e5351e69ea..328ab0cd949 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -58,8 +58,7 @@ var templa; var AbstractElementController = (function (_super) { __extends(AbstractElementController, _super); function AbstractElementController() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return AbstractElementController; @@ -80,8 +79,7 @@ var templa; var AbstractCompositeElementController = (function (_super) { __extends(AbstractCompositeElementController, _super); function AbstractCompositeElementController() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this._controllers = []; return _this; } diff --git a/tests/baselines/reference/decoratorOnClassConstructor2.js b/tests/baselines/reference/decoratorOnClassConstructor2.js index 1f0b9b0d517..44bde0a171d 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor2.js +++ b/tests/baselines/reference/decoratorOnClassConstructor2.js @@ -45,8 +45,7 @@ var _0_ts_2 = require("./0.ts"); var C = (function (_super) { __extends(C, _super); function C(prop) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return C; diff --git a/tests/baselines/reference/decoratorOnClassConstructor3.js b/tests/baselines/reference/decoratorOnClassConstructor3.js index 9182cce66f4..5130986b1f7 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor3.js +++ b/tests/baselines/reference/decoratorOnClassConstructor3.js @@ -48,8 +48,7 @@ var _0_2 = require("./0"); var C = (function (_super) { __extends(C, _super); function C(prop) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return C; diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index fd601ff2211..a0b1559d430 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -32,8 +32,7 @@ var BaseClass = (function () { var DerivedClass = (function (_super) { __extends(DerivedClass, _super); function DerivedClass() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } DerivedClass.prototype._init = function () { diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index 12344c19915..e86806d31d2 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -66,8 +66,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; return _this; } Derived.prototype.b = function (a) { }; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js index 37be9e209ac..3035b2cb56f 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -94,8 +94,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } Derived.prototype.b = function (a) { }; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index 0836c9d7f41..0e0c1c1ff01 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -103,8 +103,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } return Derived1; @@ -112,8 +111,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } Derived2.prototype.b = function (a) { }; @@ -122,8 +120,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } Object.defineProperty(Derived3.prototype, "c", { @@ -136,8 +133,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } Object.defineProperty(Derived4.prototype, "c", { @@ -150,8 +146,7 @@ var Derived4 = (function (_super) { var Derived5 = (function (_super) { __extends(Derived5, _super); function Derived5(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } return Derived5; @@ -159,8 +154,7 @@ var Derived5 = (function (_super) { var Derived6 = (function (_super) { __extends(Derived6, _super); function Derived6(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } return Derived6; @@ -168,8 +162,7 @@ var Derived6 = (function (_super) { var Derived7 = (function (_super) { __extends(Derived7, _super); function Derived7(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } Derived7.s = function (a) { }; @@ -178,8 +171,7 @@ var Derived7 = (function (_super) { var Derived8 = (function (_super) { __extends(Derived8, _super); function Derived8(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } Object.defineProperty(Derived8, "t", { @@ -192,8 +184,7 @@ var Derived8 = (function (_super) { var Derived9 = (function (_super) { __extends(Derived9, _super); function Derived9(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } Object.defineProperty(Derived9, "t", { @@ -206,8 +197,7 @@ var Derived9 = (function (_super) { var Derived10 = (function (_super) { __extends(Derived10, _super); function Derived10(a) { - var _this; - _this = _super.call(this, a) || this; + var _this = _super.call(this, a) || this; return _this; } return Derived10; diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index 8d0375ab13a..703f1d4a833 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -92,8 +92,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; return _this; } Derived.prototype.b = function (a) { }; diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index f623653d6fa..27dcc4b7d5d 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -130,8 +130,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(y) { - var _this; - _this = _super.call(this) || this; // ok + var _this = _super.call(this) || this; _this.y = y; var a = 1; return _this; @@ -152,8 +151,7 @@ var Derived4 = (function (_super) { var Derived5 = (function (_super) { __extends(Derived5, _super); function Derived5(y) { - var _this; - _this = _super.call(this) || this; // ok + var _this = _super.call(this) || this; _this.a = 1; var b = 2; return _this; @@ -186,8 +184,7 @@ var Derived7 = (function (_super) { var Derived8 = (function (_super) { __extends(Derived8, _super); function Derived8(y) { - var _this; - _this = _super.call(this) || this; // ok + var _this = _super.call(this) || this; _this.a = 1; _this.a = 3; _this.b = 3; @@ -216,8 +213,7 @@ var Derived9 = (function (_super) { var Derived10 = (function (_super) { __extends(Derived10, _super); function Derived10(y) { - var _this; - _this = _super.call(this) || this; // ok + var _this = _super.call(this) || this; _this.a = 1; _this.a = 3; _this.b = 3; diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js index e3bbf2699c5..b778d7bbca2 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js @@ -46,8 +46,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.a = _this = _super.call(this) || this; return _this; } diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index 102944889bd..039e25919f8 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -42,8 +42,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.call(this, _this) || this; // ok + var _this = _super.call(this, _this) || this; return _this; } return Derived; @@ -51,8 +50,7 @@ var Derived = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(a) { - var _this; - _this = _super.call(this, _this) || this; // error + var _this = _super.call(this, _this) || this; _this.a = a; return _this; } @@ -61,8 +59,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(a) { - var _this; - _this = _super.call(this, function () { return _this; }) || this; // error + var _this = _super.call(this, function () { return _this; }) || this; _this.a = a; return _this; } @@ -71,8 +68,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(a) { - var _this; - _this = _super.call(this, function () { return this; }) || this; // ok + var _this = _super.call(this, function () { return this; }) || this; _this.a = a; return _this; } diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index f5eb3d22360..7a6a7ecbb63 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -41,8 +41,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = 1; _this.y = 'hello'; return _this; @@ -60,8 +59,7 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = 2; _this.y = null; return _this; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index 5ad20389230..62beb4bf28f 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -49,8 +49,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = 1; _this.y = 'hello'; return _this; @@ -70,8 +69,7 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = 2; _this.y = null; return _this; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index d0e5f22d4f3..c96d0c96723 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -63,8 +63,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(y, z) { - var _this; - _this = _super.call(this, 2) || this; + var _this = _super.call(this, 2) || this; _this.b = ''; _this.b = y; return _this; @@ -74,8 +73,7 @@ var Derived = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = 1; _this.y = 'hello'; return _this; @@ -94,8 +92,7 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D(y, z) { - var _this; - _this = _super.call(this, 2) || this; + var _this = _super.call(this, 2) || this; _this.b = null; _this.b = y; return _this; @@ -105,8 +102,7 @@ var D = (function (_super) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = 2; _this.y = null; return _this; diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js index 8c35b9044a1..8781671853f 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -65,8 +65,7 @@ var Class = (function () { var SubClass = (function (_super) { __extends(SubClass, _super); function SubClass() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return SubClass; @@ -79,8 +78,7 @@ var D = (function () { var SubD = (function (_super) { __extends(SubD, _super); function SubD() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return SubD; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index efed8e66a15..05b061116d3 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -30,8 +30,7 @@ var B = (function (_super) { function B(x) { "use strict"; 'someStringForEgngInject'; - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.x = x; return _this; } diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js index 6e3d3bfaa1b..2cf2cb02073 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js @@ -32,8 +32,7 @@ var B = (function (_super) { function B() { "use strict"; 'someStringForEgngInject'; - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.blub = 12; return _this; } diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js index 6559569fe79..eaa52e39285 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -30,8 +30,7 @@ var B = (function (_super) { function B(x) { "use strict"; 'someStringForEgngInject'; - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.x = x; _this.blah = 2; return _this; diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index 864bc19a344..720894e50c0 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -147,8 +147,7 @@ var OtherBase = (function () { var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; //super call in class member initializer of derived type _this.t = _this = _super.call(this) || this; return _this; diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index 1b7c9a418fc..0fef86493f1 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -186,8 +186,7 @@ SomeBase.publicStaticMember = 0; var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _super.prototype.publicMember = 1; return _this; } @@ -221,8 +220,7 @@ var SomeDerived1 = (function (_super) { var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _super.prototype.privateMember = 1; return _this; } diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index 705915812be..d0879152544 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -102,9 +102,8 @@ var Bar = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y, z) { - var _this; + var _this = _super.call(this, x) || this; if (z === void 0) { z = 0; } - _this = _super.call(this, x) || this; _this.y = y; _this.z = z; _this.gar = 0; diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index eec5d830e01..9217f890377 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -267,8 +267,7 @@ var SuperParent = (function () { var SuperChild = (function (_super) { __extends(SuperChild, _super); function SuperChild() { - var _this; - _this = _super.call(this, 1) || this; + var _this = _super.call(this, 1) || this; return _this; } SuperChild.prototype.b = function () { diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index ccbac1d22b5..86410aaf10e 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -109,8 +109,7 @@ var PortalFx; var Validator = (function (_super) { __extends(Validator, _super); function Validator(message) { - var _this; - _this = _super.call(this, message) || this; + var _this = _super.call(this, message) || this; return _this; } return Validator; diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index 246b9b76e3c..582937e7c0a 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -52,8 +52,7 @@ var EndGate; var NumberTween = (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { - var _this; - _this = _super.call(this, from) || this; + var _this = _super.call(this, from) || this; return _this; } return NumberTween; diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index e7744b28833..88173a4cbe3 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -51,8 +51,7 @@ var EndGate; var NumberTween = (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { - var _this; - _this = _super.call(this, from) || this; + var _this = _super.call(this, from) || this; return _this; } return NumberTween; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index d22823b9f81..5a02ceb0ff4 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -59,8 +59,7 @@ var TypeScript; var PullTypeSymbol = (function (_super) { __extends(PullTypeSymbol, _super); function PullTypeSymbol() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this._elementType = null; return _this; } diff --git a/tests/baselines/reference/genericTypeConstraints.js b/tests/baselines/reference/genericTypeConstraints.js index 48ff00e5ac2..b82e261a14f 100644 --- a/tests/baselines/reference/genericTypeConstraints.js +++ b/tests/baselines/reference/genericTypeConstraints.js @@ -38,8 +38,7 @@ var Bar = (function () { var BarExtended = (function (_super) { __extends(BarExtended, _super); function BarExtended() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return BarExtended; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index 51c64f48f6c..49b5efbd012 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -39,8 +39,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = 2; _this.y = 3; return _this; @@ -53,8 +52,7 @@ var D = (function (_super) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = ""; return _this; } diff --git a/tests/baselines/reference/lift.js b/tests/baselines/reference/lift.js index a71f1c9065a..364d52d9385 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -32,8 +32,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C(y, z, w) { - var _this; - _this = _super.call(this, y) || this; + var _this = _super.call(this, y) || this; var x = 10 + w; var ll = x * w; return _this; diff --git a/tests/baselines/reference/missingPropertiesOfClassExpression.js b/tests/baselines/reference/missingPropertiesOfClassExpression.js index 20252f37e61..34b60940aa9 100644 --- a/tests/baselines/reference/missingPropertiesOfClassExpression.js +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.js @@ -15,8 +15,7 @@ var __extends = (this && this.__extends) || function (d, b) { var George = (function (_super) { __extends(George, _super); function George() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return George; diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index 760454dd9a4..a1739ce0d8e 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -81,8 +81,7 @@ var Food = (function () { var MonsterFood = (function (_super) { __extends(MonsterFood, _super); function MonsterFood(name, flavor) { - var _this; - _this = _super.call(this, name) || this; + var _this = _super.call(this, name) || this; _this.flavor = flavor; return _this; } @@ -91,8 +90,7 @@ var MonsterFood = (function (_super) { var IceCream = (function (_super) { __extends(IceCream, _super); function IceCream(flavor) { - var _this; - _this = _super.call(this, "Ice Cream", flavor) || this; + var _this = _super.call(this, "Ice Cream", flavor) || this; _this.flavor = flavor; return _this; } @@ -101,8 +99,7 @@ var IceCream = (function (_super) { var Cookie = (function (_super) { __extends(Cookie, _super); function Cookie(flavor, isGlutenFree) { - var _this; - _this = _super.call(this, "Cookie", flavor) || this; + var _this = _super.call(this, "Cookie", flavor) || this; _this.flavor = flavor; _this.isGlutenFree = isGlutenFree; return _this; @@ -112,8 +109,7 @@ var Cookie = (function (_super) { var PetFood = (function (_super) { __extends(PetFood, _super); function PetFood(name, whereToBuy) { - var _this; - _this = _super.call(this, name) || this; + var _this = _super.call(this, name) || this; _this.whereToBuy = whereToBuy; return _this; } @@ -122,8 +118,7 @@ var PetFood = (function (_super) { var ExpensiveOrganicDogFood = (function (_super) { __extends(ExpensiveOrganicDogFood, _super); function ExpensiveOrganicDogFood(whereToBuy) { - var _this; - _this = _super.call(this, "Origen", whereToBuy) || this; + var _this = _super.call(this, "Origen", whereToBuy) || this; _this.whereToBuy = whereToBuy; return _this; } @@ -132,8 +127,7 @@ var ExpensiveOrganicDogFood = (function (_super) { var ExpensiveOrganicCatFood = (function (_super) { __extends(ExpensiveOrganicCatFood, _super); function ExpensiveOrganicCatFood(whereToBuy, containsFish) { - var _this; - _this = _super.call(this, "Nature's Logic", whereToBuy) || this; + var _this = _super.call(this, "Nature's Logic", whereToBuy) || this; _this.whereToBuy = whereToBuy; _this.containsFish = containsFish; return _this; diff --git a/tests/baselines/reference/optionalMethods.js b/tests/baselines/reference/optionalMethods.js index 72df561227f..8b999b45d71 100644 --- a/tests/baselines/reference/optionalMethods.js +++ b/tests/baselines/reference/optionalMethods.js @@ -109,8 +109,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.a = 1; return _this; } diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 258f05cbc85..e93058d71d2 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -161,9 +161,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2(v2) { - var _this; + var _this = _super.call(this, v2) || this; if (v2 === void 0) { v2 = 6; } - _this = _super.call(this, v2) || this; return _this; } return C2; diff --git a/tests/baselines/reference/optionalParameterProperty.js b/tests/baselines/reference/optionalParameterProperty.js index ca78ad7286e..f9b9ecaf990 100644 --- a/tests/baselines/reference/optionalParameterProperty.js +++ b/tests/baselines/reference/optionalParameterProperty.js @@ -25,8 +25,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D(p) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.p = p; return _this; } diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index 360b38ce70c..49d96b97b74 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -27,8 +27,7 @@ var Z = (function () { var A = (function (_super) { __extends(A, _super); function A() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = 1; return _this; } diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index 799a17d47de..c7bdb90775e 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -318,8 +318,7 @@ var c2 = (function () { var c3 = (function (_super) { __extends(c3, _super); function c3() { - var _this; - _this = _super.call(this, 10) || this; + var _this = _super.call(this, 10) || this; _this.p1 = _super.prototype.c2_p1; return _this; } @@ -407,8 +406,7 @@ var c5 = (function () { var c6 = (function (_super) { __extends(c6, _super); function c6() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.d = _super.prototype.b; return _this; } diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 88516c9a692..253f856a990 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -826,8 +826,7 @@ var TypeScript; var NumberLiteralToken = (function (_super) { __extends(NumberLiteralToken, _super); function NumberLiteralToken(value, hasEmptyFraction) { - var _this; - _this = _super.call(this, TokenID.NumberLiteral) || this; + var _this = _super.call(this, TokenID.NumberLiteral) || this; _this.value = value; _this.hasEmptyFraction = hasEmptyFraction; return _this; @@ -844,8 +843,7 @@ var TypeScript; var StringLiteralToken = (function (_super) { __extends(StringLiteralToken, _super); function StringLiteralToken(value) { - var _this; - _this = _super.call(this, TokenID.StringLiteral) || this; + var _this = _super.call(this, TokenID.StringLiteral) || this; _this.value = value; return _this; } @@ -861,8 +859,7 @@ var TypeScript; var IdentifierToken = (function (_super) { __extends(IdentifierToken, _super); function IdentifierToken(value, hasEscapeSequence) { - var _this; - _this = _super.call(this, TokenID.Identifier) || this; + var _this = _super.call(this, TokenID.Identifier) || this; _this.value = value; _this.hasEscapeSequence = hasEscapeSequence; return _this; @@ -879,8 +876,7 @@ var TypeScript; var WhitespaceToken = (function (_super) { __extends(WhitespaceToken, _super); function WhitespaceToken(tokenId, value) { - var _this; - _this = _super.call(this, tokenId) || this; + var _this = _super.call(this, tokenId) || this; _this.value = value; return _this; } @@ -896,8 +892,7 @@ var TypeScript; var CommentToken = (function (_super) { __extends(CommentToken, _super); function CommentToken(tokenID, value, isBlock, startPos, line, endsLine) { - var _this; - _this = _super.call(this, tokenID) || this; + var _this = _super.call(this, tokenID) || this; _this.value = value; _this.isBlock = isBlock; _this.startPos = startPos; @@ -917,8 +912,7 @@ var TypeScript; var RegularExpressionLiteralToken = (function (_super) { __extends(RegularExpressionLiteralToken, _super); function RegularExpressionLiteralToken(regex) { - var _this; - _this = _super.call(this, TokenID.RegularExpressionLiteral) || this; + var _this = _super.call(this, TokenID.RegularExpressionLiteral) || this; _this.regex = regex; return _this; } diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index fa112e51dad..fd2c017b637 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2386,8 +2386,7 @@ var TypeScript; var AST = (function (_super) { __extends(AST, _super); function AST(nodeType) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.nodeType = nodeType; _this.type = null; _this.flags = ASTFlags.Writeable; @@ -2544,8 +2543,7 @@ var TypeScript; var IncompleteAST = (function (_super) { __extends(IncompleteAST, _super); function IncompleteAST(min, lim) { - var _this; - _this = _super.call(this, NodeType.Error) || this; + var _this = _super.call(this, NodeType.Error) || this; _this.minChar = min; _this.limChar = lim; return _this; @@ -2556,8 +2554,7 @@ var TypeScript; var ASTList = (function (_super) { __extends(ASTList, _super); function ASTList() { - var _this; - _this = _super.call(this, NodeType.List) || this; + var _this = _super.call(this, NodeType.List) || this; _this.enclosingScope = null; _this.members = new AST[]; return _this; @@ -2625,8 +2622,7 @@ 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) { - var _this; - _this = _super.call(this, NodeType.Name) || this; + var _this = _super.call(this, NodeType.Name) || this; _this.actualText = actualText; _this.hasEscapeSequence = hasEscapeSequence; _this.sym = null; @@ -2671,8 +2667,7 @@ var TypeScript; var MissingIdentifier = (function (_super) { __extends(MissingIdentifier, _super); function MissingIdentifier() { - var _this; - _this = _super.call(this, "__missing") || this; + var _this = _super.call(this, "__missing") || this; return _this; } MissingIdentifier.prototype.isMissing = function () { @@ -2687,8 +2682,7 @@ var TypeScript; var Label = (function (_super) { __extends(Label, _super); function Label(id) { - var _this; - _this = _super.call(this, NodeType.Label) || this; + var _this = _super.call(this, NodeType.Label) || this; _this.id = id; return _this; } @@ -2713,8 +2707,7 @@ var TypeScript; var Expression = (function (_super) { __extends(Expression, _super); function Expression(nodeType) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; return _this; } Expression.prototype.isExpression = function () { return true; }; @@ -2725,8 +2718,7 @@ var TypeScript; var UnaryExpression = (function (_super) { __extends(UnaryExpression, _super); function UnaryExpression(nodeType, operand) { - var _this; - _this = _super.call(this, nodeType) || this; + 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; @@ -2871,8 +2863,7 @@ var TypeScript; var CallExpression = (function (_super) { __extends(CallExpression, _super); function CallExpression(nodeType, target, arguments) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; _this.target = target; _this.arguments = arguments; _this.signature = null; @@ -2905,8 +2896,7 @@ var TypeScript; var BinaryExpression = (function (_super) { __extends(BinaryExpression, _super); function BinaryExpression(nodeType, operand1, operand2) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; _this.operand1 = operand1; _this.operand2 = operand2; return _this; @@ -3059,8 +3049,7 @@ var TypeScript; var ConditionalExpression = (function (_super) { __extends(ConditionalExpression, _super); function ConditionalExpression(operand1, operand2, operand3) { - var _this; - _this = _super.call(this, NodeType.ConditionalExpression) || this; + var _this = _super.call(this, NodeType.ConditionalExpression) || this; _this.operand1 = operand1; _this.operand2 = operand2; _this.operand3 = operand3; @@ -3086,8 +3075,7 @@ var TypeScript; var NumberLiteral = (function (_super) { __extends(NumberLiteral, _super); function NumberLiteral(value, hasEmptyFraction) { - var _this; - _this = _super.call(this, NodeType.NumberLit) || this; + var _this = _super.call(this, NodeType.NumberLit) || this; _this.value = value; _this.hasEmptyFraction = hasEmptyFraction; _this.isNegativeZero = false; @@ -3129,8 +3117,7 @@ var TypeScript; var RegexLiteral = (function (_super) { __extends(RegexLiteral, _super); function RegexLiteral(regex) { - var _this; - _this = _super.call(this, NodeType.Regex) || this; + var _this = _super.call(this, NodeType.Regex) || this; _this.regex = regex; return _this; } @@ -3151,8 +3138,7 @@ var TypeScript; var StringLiteral = (function (_super) { __extends(StringLiteral, _super); function StringLiteral(text) { - var _this; - _this = _super.call(this, NodeType.QString) || this; + var _this = _super.call(this, NodeType.QString) || this; _this.text = text; return _this; } @@ -3179,8 +3165,7 @@ var TypeScript; var ModuleElement = (function (_super) { __extends(ModuleElement, _super); function ModuleElement(nodeType) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; return _this; } return ModuleElement; @@ -3189,8 +3174,7 @@ var TypeScript; var ImportDeclaration = (function (_super) { __extends(ImportDeclaration, _super); function ImportDeclaration(id, alias) { - var _this; - _this = _super.call(this, NodeType.ImportDeclaration) || this; + var _this = _super.call(this, NodeType.ImportDeclaration) || this; _this.id = id; _this.alias = alias; _this.varFlags = VarFlags.None; @@ -3250,8 +3234,7 @@ var TypeScript; var BoundDecl = (function (_super) { __extends(BoundDecl, _super); function BoundDecl(id, nodeType, nestingLevel) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; _this.id = id; _this.nestingLevel = nestingLevel; _this.init = null; @@ -3276,8 +3259,7 @@ var TypeScript; var VarDecl = (function (_super) { __extends(VarDecl, _super); function VarDecl(id, nest) { - var _this; - _this = _super.call(this, id, NodeType.VarDecl, nest) || this; + var _this = _super.call(this, id, NodeType.VarDecl, nest) || this; return _this; } VarDecl.prototype.isAmbient = function () { return hasFlag(this.varFlags, VarFlags.Ambient); }; @@ -3295,8 +3277,7 @@ var TypeScript; var ArgDecl = (function (_super) { __extends(ArgDecl, _super); function ArgDecl(id) { - var _this; - _this = _super.call(this, id, NodeType.ArgDecl, 0) || this; + var _this = _super.call(this, id, NodeType.ArgDecl, 0) || this; _this.isOptional = false; _this.parameterPropertySym = null; return _this; @@ -3319,8 +3300,7 @@ var TypeScript; var FuncDecl = (function (_super) { __extends(FuncDecl, _super); function FuncDecl(name, bod, isConstructor, arguments, vars, scopes, statics, nodeType) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; _this.name = name; _this.bod = bod; _this.isConstructor = isConstructor; @@ -3461,8 +3441,7 @@ var TypeScript; var Script = (function (_super) { __extends(Script, _super); function Script(vars, scopes) { - var _this; - _this = _super.call(this, new Identifier("script"), null, false, null, vars, scopes, null, NodeType.Script) || this; + 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; @@ -3532,8 +3511,7 @@ var TypeScript; var NamedDeclaration = (function (_super) { __extends(NamedDeclaration, _super); function NamedDeclaration(nodeType, name, members) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; _this.name = name; _this.members = members; _this.leftCurlyCount = 0; @@ -3546,8 +3524,7 @@ var TypeScript; var ModuleDeclaration = (function (_super) { __extends(ModuleDeclaration, _super); function ModuleDeclaration(name, members, vars, scopes, endingToken) { - var _this; - _this = _super.call(this, NodeType.ModuleDeclaration, name, members) || this; + var _this = _super.call(this, NodeType.ModuleDeclaration, name, members) || this; _this.endingToken = endingToken; _this.modFlags = ModuleFlags.ShouldEmitModuleDecl; _this.amdDependencies = []; @@ -3583,8 +3560,7 @@ var TypeScript; var TypeDeclaration = (function (_super) { __extends(TypeDeclaration, _super); function TypeDeclaration(nodeType, name, extendsList, implementsList, members) { - var _this; - _this = _super.call(this, nodeType, name, members) || this; + var _this = _super.call(this, nodeType, name, members) || this; _this.extendsList = extendsList; _this.implementsList = implementsList; _this.varFlags = VarFlags.None; @@ -3602,8 +3578,7 @@ var TypeScript; var ClassDeclaration = (function (_super) { __extends(ClassDeclaration, _super); function ClassDeclaration(name, members, extendsList, implementsList) { - var _this; - _this = _super.call(this, NodeType.ClassDeclaration, name, extendsList, implementsList, members) || this; + var _this = _super.call(this, NodeType.ClassDeclaration, name, extendsList, implementsList, members) || this; _this.knownMemberNames = {}; _this.constructorDecl = null; _this.constructorNestingLevel = 0; @@ -3622,8 +3597,7 @@ var TypeScript; var InterfaceDeclaration = (function (_super) { __extends(InterfaceDeclaration, _super); function InterfaceDeclaration(name, members, extendsList, implementsList) { - var _this; - _this = _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) || this; + var _this = _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) || this; return _this; } InterfaceDeclaration.prototype.typeCheck = function (typeFlow) { @@ -3637,8 +3611,7 @@ var TypeScript; var Statement = (function (_super) { __extends(Statement, _super); function Statement(nodeType) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; _this.flags |= ASTFlags.IsStatement; return _this; } @@ -3655,8 +3628,7 @@ var TypeScript; var LabeledStatement = (function (_super) { __extends(LabeledStatement, _super); function LabeledStatement(labels, stmt) { - var _this; - _this = _super.call(this, NodeType.LabeledStatement) || this; + var _this = _super.call(this, NodeType.LabeledStatement) || this; _this.labels = labels; _this.stmt = stmt; return _this; @@ -3691,8 +3663,7 @@ var TypeScript; var Block = (function (_super) { __extends(Block, _super); function Block(statements, isStatementBlock) { - var _this; - _this = _super.call(this, NodeType.Block) || this; + var _this = _super.call(this, NodeType.Block) || this; _this.statements = statements; _this.isStatementBlock = isStatementBlock; return _this; @@ -3748,8 +3719,7 @@ var TypeScript; var Jump = (function (_super) { __extends(Jump, _super); function Jump(nodeType) { - var _this; - _this = _super.call(this, nodeType) || this; + var _this = _super.call(this, nodeType) || this; _this.target = null; _this.resolvedTarget = null; return _this; @@ -3801,8 +3771,7 @@ var TypeScript; var WhileStatement = (function (_super) { __extends(WhileStatement, _super); function WhileStatement(cond) { - var _this; - _this = _super.call(this, NodeType.While) || this; + var _this = _super.call(this, NodeType.While) || this; _this.cond = cond; _this.body = null; return _this; @@ -3855,8 +3824,7 @@ var TypeScript; var DoWhileStatement = (function (_super) { __extends(DoWhileStatement, _super); function DoWhileStatement() { - var _this; - _this = _super.call(this, NodeType.DoWhile) || this; + var _this = _super.call(this, NodeType.DoWhile) || this; _this.body = null; _this.whileAST = null; _this.cond = null; @@ -3913,8 +3881,7 @@ var TypeScript; var IfStatement = (function (_super) { __extends(IfStatement, _super); function IfStatement(cond) { - var _this; - _this = _super.call(this, NodeType.If) || this; + var _this = _super.call(this, NodeType.If) || this; _this.cond = cond; _this.elseBod = null; _this.statement = new ASTSpan(); @@ -3993,8 +3960,7 @@ var TypeScript; var ReturnStatement = (function (_super) { __extends(ReturnStatement, _super); function ReturnStatement() { - var _this; - _this = _super.call(this, NodeType.Return) || this; + var _this = _super.call(this, NodeType.Return) || this; _this.returnExpression = null; return _this; } @@ -4026,8 +3992,7 @@ var TypeScript; var EndCode = (function (_super) { __extends(EndCode, _super); function EndCode() { - var _this; - _this = _super.call(this, NodeType.EndCode) || this; + var _this = _super.call(this, NodeType.EndCode) || this; return _this; } return EndCode; @@ -4036,8 +4001,7 @@ var TypeScript; var ForInStatement = (function (_super) { __extends(ForInStatement, _super); function ForInStatement(lval, obj) { - var _this; - _this = _super.call(this, NodeType.ForIn) || this; + var _this = _super.call(this, NodeType.ForIn) || this; _this.lval = lval; _this.obj = obj; _this.statement = new ASTSpan(); @@ -4153,8 +4117,7 @@ var TypeScript; var ForStatement = (function (_super) { __extends(ForStatement, _super); function ForStatement(init) { - var _this; - _this = _super.call(this, NodeType.For) || this; + var _this = _super.call(this, NodeType.For) || this; _this.init = init; return _this; } @@ -4246,8 +4209,7 @@ var TypeScript; var WithStatement = (function (_super) { __extends(WithStatement, _super); function WithStatement(expr) { - var _this; - _this = _super.call(this, NodeType.With) || this; + var _this = _super.call(this, NodeType.With) || this; _this.expr = expr; _this.withSym = null; return _this; @@ -4274,8 +4236,7 @@ var TypeScript; var SwitchStatement = (function (_super) { __extends(SwitchStatement, _super); function SwitchStatement(val) { - var _this; - _this = _super.call(this, NodeType.Switch) || this; + var _this = _super.call(this, NodeType.Switch) || this; _this.val = val; _this.defaultCase = null; _this.statement = new ASTSpan(); @@ -4348,8 +4309,7 @@ var TypeScript; var CaseStatement = (function (_super) { __extends(CaseStatement, _super); function CaseStatement() { - var _this; - _this = _super.call(this, NodeType.Case) || this; + var _this = _super.call(this, NodeType.Case) || this; _this.expr = null; return _this; } @@ -4403,8 +4363,7 @@ var TypeScript; var TypeReference = (function (_super) { __extends(TypeReference, _super); function TypeReference(term, arrayCount) { - var _this; - _this = _super.call(this, NodeType.TypeRef) || this; + var _this = _super.call(this, NodeType.TypeRef) || this; _this.term = term; _this.arrayCount = arrayCount; return _this; @@ -4435,8 +4394,7 @@ var TypeScript; var TryFinally = (function (_super) { __extends(TryFinally, _super); function TryFinally(tryNode, finallyNode) { - var _this; - _this = _super.call(this, NodeType.TryFinally) || this; + var _this = _super.call(this, NodeType.TryFinally) || this; _this.tryNode = tryNode; _this.finallyNode = finallyNode; return _this; @@ -4482,8 +4440,7 @@ var TypeScript; var TryCatch = (function (_super) { __extends(TryCatch, _super); function TryCatch(tryNode, catchNode) { - var _this; - _this = _super.call(this, NodeType.TryCatch) || this; + var _this = _super.call(this, NodeType.TryCatch) || this; _this.tryNode = tryNode; _this.catchNode = catchNode; return _this; @@ -4534,8 +4491,7 @@ var TypeScript; var Try = (function (_super) { __extends(Try, _super); function Try(body) { - var _this; - _this = _super.call(this, NodeType.Try) || this; + var _this = _super.call(this, NodeType.Try) || this; _this.body = body; return _this; } @@ -4564,8 +4520,7 @@ var TypeScript; var Catch = (function (_super) { __extends(Catch, _super); function Catch(param, body) { - var _this; - _this = _super.call(this, NodeType.Catch) || this; + var _this = _super.call(this, NodeType.Catch) || this; _this.param = param; _this.body = body; _this.statement = new ASTSpan(); @@ -4639,8 +4594,7 @@ var TypeScript; var Finally = (function (_super) { __extends(Finally, _super); function Finally(body) { - var _this; - _this = _super.call(this, NodeType.Finally) || this; + var _this = _super.call(this, NodeType.Finally) || this; _this.body = body; return _this; } @@ -4669,8 +4623,7 @@ var TypeScript; var Comment = (function (_super) { __extends(Comment, _super); function Comment(content, isBlockComment, endsLine) { - var _this; - _this = _super.call(this, NodeType.Comment) || this; + var _this = _super.call(this, NodeType.Comment) || this; _this.content = content; _this.isBlockComment = isBlockComment; _this.endsLine = endsLine; @@ -4697,8 +4650,7 @@ var TypeScript; var DebuggerStatement = (function (_super) { __extends(DebuggerStatement, _super); function DebuggerStatement() { - var _this; - _this = _super.call(this, NodeType.Debugger) || this; + var _this = _super.call(this, NodeType.Debugger) || this; return _this; } DebuggerStatement.prototype.emit = function (emitter, tokenId, startLine) { diff --git a/tests/baselines/reference/parserharness.js b/tests/baselines/reference/parserharness.js index 2d219c63e6a..059ac2efd8e 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2380,8 +2380,7 @@ var Harness; var TestCase = (function (_super) { __extends(TestCase, _super); function TestCase(description, block) { - var _this; - _this = _super.call(this, description, block) || this; + var _this = _super.call(this, description, block) || this; _this.description = description; _this.block = block; return _this; @@ -2416,8 +2415,7 @@ var Harness; var Scenario = (function (_super) { __extends(Scenario, _super); function Scenario(description, block) { - var _this; - _this = _super.call(this, description, block) || this; + var _this = _super.call(this, description, block) || this; _this.description = description; _this.block = block; return _this; @@ -2473,8 +2471,7 @@ var Harness; var Run = (function (_super) { __extends(Run, _super); function Run() { - var _this; - _this = _super.call(this, 'Test Run', null) || this; + var _this = _super.call(this, 'Test Run', null) || this; return _this; } Run.prototype.run = function () { diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index c07238dff5e..6fa05178f91 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -27,8 +27,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.x = _super.prototype.foo; // error _this.z = _super.prototype.foo; // error return _this; diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index 0d4cfefb63b..c1897e8503a 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -22,8 +22,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.bing = function () { return Base.foo; }; // error return _this; } diff --git a/tests/baselines/reference/readonlyConstructorAssignment.js b/tests/baselines/reference/readonlyConstructorAssignment.js index 581b110298a..872c00486c0 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.js +++ b/tests/baselines/reference/readonlyConstructorAssignment.js @@ -56,8 +56,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B(x) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; // Fails, x is readonly _this.x = 1; return _this; @@ -69,8 +68,7 @@ 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) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; _this.x = x; _this.x = 1; return _this; @@ -88,8 +86,7 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E(x) { - var _this; - _this = _super.call(this, x) || this; + var _this = _super.call(this, x) || this; _this.x = x; _this.x = 1; return _this; diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index 0ee301758cf..6c678db2358 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -123,8 +123,7 @@ var G = (function () { var H = (function (_super) { __extends(H, _super); function H() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return new G(); //error return _this; } @@ -133,8 +132,7 @@ var H = (function (_super) { var I = (function (_super) { __extends(I, _super); function I() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return new G(); return _this; } diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index 9436043094e..48863404a8e 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -25,8 +25,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.v = 1; _this.p = 1; C.s = 1; diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index 7fef0a42010..4bac0210c85 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -21,8 +21,7 @@ var AbstractGreeter = (function () { var Greeter = (function (_super) { __extends(Greeter, _super); function Greeter() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.a = 10; _this.nameA = "Ten"; return _this; diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map index 14f7f65f050..6b18a783dfa 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;QAAA,UAGC;;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 +{"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 e1adf2f7a29..91e284fd063 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -77,40 +77,38 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts --- >>> function Greeter() { 1 >^^^^ -2 > ^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(13, 5) Source(4, 1) + SourceIndex(0) --- ->>> var _this; +>>> var _this = _super.apply(this, arguments) || this; 1->^^^^^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +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, 19) Source(7, 2) + SourceIndex(0) +2 >Emitted(14, 59) Source(7, 2) + SourceIndex(0) --- ->>> _this = _super.apply(this, arguments) || this; >>> _this.a = 10; -1->^^^^^^^^ +1 >^^^^^^^^ 2 > ^^^^^^^ 3 > ^^^ 4 > ^^ 5 > ^ 6 > ^^^^^^^^-> -1-> +1 > 2 > a 3 > = 4 > 10 5 > ; -1->Emitted(16, 9) Source(5, 12) + SourceIndex(0) -2 >Emitted(16, 16) Source(5, 13) + SourceIndex(0) -3 >Emitted(16, 19) Source(5, 16) + SourceIndex(0) -4 >Emitted(16, 21) Source(5, 18) + SourceIndex(0) -5 >Emitted(16, 22) Source(5, 19) + SourceIndex(0) +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"; 1->^^^^^^^^ @@ -124,11 +122,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > = 4 > "Ten" 5 > ; -1->Emitted(17, 9) Source(6, 12) + SourceIndex(0) -2 >Emitted(17, 20) Source(6, 17) + SourceIndex(0) -3 >Emitted(17, 23) Source(6, 20) + SourceIndex(0) -4 >Emitted(17, 28) Source(6, 25) + SourceIndex(0) -5 >Emitted(17, 29) Source(6, 26) + SourceIndex(0) +1->Emitted(16, 9) Source(6, 12) + 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; >>> } @@ -138,8 +136,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1 > > 2 > } -1 >Emitted(19, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(19, 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->^^^^ @@ -147,8 +145,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > ^^^-> 1-> 2 > } -1->Emitted(20, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(20, 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-> @@ -167,11 +165,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts > public a = 10; > public nameA = "Ten"; > } -1->Emitted(21, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(21, 2) Source(7, 2) + SourceIndex(0) -3 >Emitted(21, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(21, 3) Source(4, 23) + SourceIndex(0) -5 >Emitted(21, 18) Source(4, 38) + SourceIndex(0) -6 >Emitted(21, 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/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index 5e769cab563..d204c1aed47 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -27,8 +27,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.p1 = doThing(A); // OK _this.p2 = doThing(B); // OK return _this; diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index 1c33f16a3c6..ecd6bacd20a 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -75,8 +75,7 @@ var B = (function (_super) { __extends(B, _super); function B() { "use strict"; // No error - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.s = 9; return _this; } @@ -85,8 +84,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - var _this; - _this = _super.call(this) || this; // No error + var _this = _super.call(this) || this; _this.s = 9; "use strict"; return _this; @@ -109,8 +107,7 @@ var Bs = (function (_super) { __extends(Bs, _super); function Bs() { "use strict"; // No error - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return Bs; @@ -119,8 +116,7 @@ Bs.s = 9; var Cs = (function (_super) { __extends(Cs, _super); function Cs() { - var _this; - _this = _super.call(this) || this; // No error + var _this = _super.call(this) || this; "use strict"; return _this; } diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index 408f9051bad..54c59978151 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -41,11 +41,10 @@ var Q = (function (_super) { __extends(Q, _super); // Super is not allowed in constructor args function Q(z, zz, zzz) { - var _this; + var _this = _super.call(this) || this; if (z === void 0) { z = _super.; } if (zz === void 0) { zz = _super.; } if (zzz === void 0) { zzz = function () { return _super.; }; } - _this = _super.call(this) || this; _this.z = z; _this.xx = _super.prototype.; return _this; diff --git a/tests/baselines/reference/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index dc450147f88..106d7433bf5 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -40,10 +40,10 @@ var T5 = (function () { var T6 = (function (_super) { __extends(T6, _super); function T6() { - var _this; + var _this = // Should error; base constructor has type T for first arg, // which is instantiated with 'number' in the extends clause - _this = _super.call(this, "hi") || this; + _super.call(this, "hi") || this; var x = _this.foo; return _this; } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing1.js b/tests/baselines/reference/superCallBeforeThisAccessing1.js index a5d6ec18ce3..e3aed9e40e9 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing1.js @@ -30,8 +30,7 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this, i) || this; + var _this = _super.call(this, i) || this; var s = { t: _this._t }; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing2.js b/tests/baselines/reference/superCallBeforeThisAccessing2.js index c7a206dbbbe..91cc3d28dd6 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; }) || this; // no error. only check when this is directly accessing in constructor + var _this = _super.call(this, function () { _this._t; }) || this; return _this; } return D; diff --git a/tests/baselines/reference/superCallBeforeThisAccessing4.js b/tests/baselines/reference/superCallBeforeThisAccessing4.js index 311b7ca2183..91acb88ce22 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing4.js @@ -34,8 +34,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this._t; return _this; } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing6.js b/tests/baselines/reference/superCallBeforeThisAccessing6.js index e630d539f14..4eb8e5266c2 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing6.js @@ -24,8 +24,7 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this, _this) || this; + var _this = _super.call(this, _this) || this; return _this; } return D; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js index 2cfc0bfcbd4..27f3db51453 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -20,8 +20,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return D; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index f9eeadc98e6..a8d5e8008ac 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -19,8 +19,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return D; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index 02bec67d7aa..b12a3eef6d4 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -25,8 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this; - _this = _super.call(this, function (value) { return String(value); }) || this; + var _this = _super.call(this, function (value) { return String(value); }) || this; return _this; } return B; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js index 55c6ee6f445..c78e6693f16 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -25,8 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this; - _this = _super.call(this, function (value) { return String(value); }) || this; + var _this = _super.call(this, function (value) { return String(value); }) || this; return _this; } return B; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js index 977377e41d4..32d2065dd3f 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -25,8 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this; - _this = _super.call(this, function (value) { return String(value); }) || this; + var _this = _super.call(this, function (value) { return String(value); }) || this; return _this; } return B; diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index 503aee2dcc6..cd84052ca3c 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -66,8 +66,7 @@ var Doing = (function () { var Other = (function (_super) { __extends(Other, _super); function Other() { - var _this; - _this = _super.call(this) || 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); diff --git a/tests/baselines/reference/superCallInsideClassDeclaration.js b/tests/baselines/reference/superCallInsideClassDeclaration.js index 326662abdac..b696b4a302f 100644 --- a/tests/baselines/reference/superCallInsideClassDeclaration.js +++ b/tests/baselines/reference/superCallInsideClassDeclaration.js @@ -39,8 +39,7 @@ var B = (function (_super) { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return D; diff --git a/tests/baselines/reference/superCallInsideClassExpression.js b/tests/baselines/reference/superCallInsideClassExpression.js index 5797085726d..829311f237c 100644 --- a/tests/baselines/reference/superCallInsideClassExpression.js +++ b/tests/baselines/reference/superCallInsideClassExpression.js @@ -39,8 +39,7 @@ var B = (function (_super) { var D = (function (_super) { __extends(class_1, _super); function class_1() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return class_1; diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index 65a8b435166..e32bfc66050 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -37,8 +37,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.x = _this = _super.call(this) || this; var y = function () { _this = _super.call(this) || this; diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index 4e4ae47967a..0fe27f493e8 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -28,8 +28,7 @@ var B = (function (_super) { __extends(B, _super); // Ensure 'value' is of type 'number (and not '{}') by using its 'toExponential()' method. function B() { - var _this; - _this = _super.call(this, function (value) { return String(value.toExponential()); }) || this; + var _this = _super.call(this, function (value) { return String(value.toExponential()); }) || this; return _this; } return B; diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.js b/tests/baselines/reference/superCallParameterContextualTyping2.js index f3a246c6389..f970be44aff 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -27,8 +27,7 @@ var C = (function (_super) { __extends(C, _super); // Ensure 'value' is not of type 'any' by invoking it with type arguments. function C() { - var _this; - _this = _super.call(this, function (value) { return String(value()); }) || this; + var _this = _super.call(this, function (value) { return String(value()); }) || this; return _this; } return C; diff --git a/tests/baselines/reference/superCallParameterContextualTyping3.js b/tests/baselines/reference/superCallParameterContextualTyping3.js index e7b8b355108..6a43d58c471 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -47,10 +47,10 @@ var CBase = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this; + var _this = // Should be okay. // 'p' should have type 'string'. - _this = _super.call(this, { + _super.call(this, { method: function (p) { p.length; } diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index 2fe7712ce68..99a3b78752c 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -47,8 +47,7 @@ var Derived = (function (_super) { __extends(Derived, _super); //super call in class constructor of derived type function Derived(q) { - var _this; - _this = _super.call(this, '') || this; + var _this = _super.call(this, '') || this; _this.q = q; //type of super call expression is void var p = _this = _super.call(this, '') || this; diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index 93676c5d8f3..19f0d74f677 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -76,8 +76,7 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.name = "Frank"; // super call in an inner function in a constructor function inner() { diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index 9b4d956dc5a..73ca53c3b5c 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -85,8 +85,7 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.name = "Frank"; // super call in a constructor _super.prototype.sayHello.call(_this); @@ -106,8 +105,7 @@ var RegisteredUser = (function (_super) { var RegisteredUser2 = (function (_super) { __extends(RegisteredUser2, _super); function RegisteredUser2() { - var _this; - _this = _super.call(this) || this; + 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); }; }; }; @@ -123,8 +121,7 @@ var RegisteredUser2 = (function (_super) { var RegisteredUser3 = (function (_super) { __extends(RegisteredUser3, _super); function RegisteredUser3() { - var _this; - _this = _super.call(this) || this; + 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; }; }; }; @@ -140,8 +137,7 @@ var RegisteredUser3 = (function (_super) { var RegisteredUser4 = (function (_super) { __extends(RegisteredUser4, _super); function RegisteredUser4() { - var _this; - _this = _super.call(this) || this; + 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.; }; }; diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index b6559a63a98..0b1e4fc280f 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -50,8 +50,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _super.prototype.bar.call(_this); _super.prototype.x; // error return _this; diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index eded4e74a7f..7c72ad5d1bb 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -50,8 +50,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _super.prototype.bar.call(_this); // error _super.prototype.x; // error return _this; diff --git a/tests/baselines/reference/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index 2ba460d18f7..88a5da8b8fb 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -99,8 +99,7 @@ var SomeBaseClass = (function () { var SomeDerivedClass = (function (_super) { __extends(SomeDerivedClass, _super); function SomeDerivedClass() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; var x = _super.prototype.func.call(_this); var x; return _this; diff --git a/tests/baselines/reference/superPropertyAccess_ES5.js b/tests/baselines/reference/superPropertyAccess_ES5.js index 011c5129e9f..4e817b7bbf1 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.js +++ b/tests/baselines/reference/superPropertyAccess_ES5.js @@ -49,8 +49,7 @@ var MyBase = (function () { var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; var f1 = _super.prototype.getValue.call(_this); var f2 = _super.prototype.value; return _this; diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index 1152399e6eb..96303dab4ed 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -28,8 +28,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; // uses the type parameter type of the base class, ie string + var _this = _super.call(this) || this; return _this; } return D; diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index f2580d30c5f..36b48554871 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -20,8 +20,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; return _this; } return D; diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index a08380b173f..8581526c1b6 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -35,8 +35,7 @@ new Foo(function (s) { s = 5; }); // error, if types are applied correctly var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this; - _this = _super.call(this, function (s) { s = 5; }) || this; + var _this = _super.call(this, function (s) { s = 5; }) || this; return _this; } return Bar; diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 10629d579ba..7872aa121ed 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -70,8 +70,7 @@ var ClassWithNoInitializer = (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { - var _this; - _this = _super.call(this, _this) || this; // Error + var _this = _super.call(this, _this) || this; return _this; } return ClassWithNoInitializer; @@ -80,8 +79,7 @@ var ClassWithInitializer = (function (_super) { __extends(ClassWithInitializer, _super); //'this' in required super call function ClassWithInitializer() { - var _this; - _this = _super.call(this, _this) || this; // Error + var _this = _super.call(this, _this) || this; _this.t = 4; return _this; } diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 444952fea3f..e656824ae66 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -71,8 +71,7 @@ var ClassWithNoInitializer = (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { - var _this; - _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing + var _this = _super.call(this, _this) || this; return _this; } return ClassWithNoInitializer; @@ -81,8 +80,7 @@ var ClassWithInitializer = (function (_super) { __extends(ClassWithInitializer, _super); //'this' in required super call function ClassWithInitializer() { - var _this; - _this = _super.call(this, _this) || this; // Error + var _this = _super.call(this, _this) || this; _this.t = 4; return _this; } diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index f9d9f8694c9..1c1f11ffbc8 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -36,8 +36,7 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - var _this; - _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing + var _this = _super.call(this, _this) || this; return _this; } return Foo; @@ -45,8 +44,7 @@ var Foo = (function (_super) { var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - var _this; - _this = _super.call(this, _this) || this; // error + var _this = _super.call(this, _this) || this; _this.p = 0; return _this; } @@ -55,8 +53,7 @@ var Foo2 = (function (_super) { var Foo3 = (function (_super) { __extends(Foo3, _super); function Foo3(p) { - var _this; - _this = _super.call(this, _this) || this; // error + var _this = _super.call(this, _this) || this; _this.p = p; return _this; } diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index 3185e42dab6..e3eea1fb91d 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -24,8 +24,7 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x) { - var _this; - _this = _super.call(this, _this) || this; + var _this = _super.call(this, _this) || this; _this.x = x; return _this; } diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index b9f7571868a..6288082ed64 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -33,8 +33,7 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - var _this; - _this = _super.call(this, _this) || this; // error: "super" has to be called before "this" accessing + var _this = _super.call(this, _this) || this; return _this; } return Foo; @@ -42,8 +41,7 @@ var Foo = (function (_super) { var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - var _this; - _this = _super.call(this, _this) || this; // error + var _this = _super.call(this, _this) || this; _this.x = 0; return _this; } diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index 309ebf93407..6a72f17248f 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -26,8 +26,7 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - var _this; - _this = _super.call(this, _this) || this; + var _this = _super.call(this, _this) || this; _this.x = 0; return _this; } diff --git a/tests/baselines/reference/tsxDynamicTagName5.js b/tests/baselines/reference/tsxDynamicTagName5.js index 307cd0fca93..d3bb404ceea 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.js +++ b/tests/baselines/reference/tsxDynamicTagName5.js @@ -30,8 +30,7 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this._tagName = 'div'; return _this; } diff --git a/tests/baselines/reference/tsxDynamicTagName7.js b/tests/baselines/reference/tsxDynamicTagName7.js index 39e30b6ba38..84debfd3e71 100644 --- a/tests/baselines/reference/tsxDynamicTagName7.js +++ b/tests/baselines/reference/tsxDynamicTagName7.js @@ -30,8 +30,7 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this._tagName = 'div'; return _this; } diff --git a/tests/baselines/reference/tsxDynamicTagName8.js b/tests/baselines/reference/tsxDynamicTagName8.js index 77423709347..6166b99f4ac 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.js +++ b/tests/baselines/reference/tsxDynamicTagName8.js @@ -30,8 +30,7 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this._tagName = 'div'; return _this; } diff --git a/tests/baselines/reference/tsxDynamicTagName9.js b/tests/baselines/reference/tsxDynamicTagName9.js index 6b5d130c0b4..928649264c8 100644 --- a/tests/baselines/reference/tsxDynamicTagName9.js +++ b/tests/baselines/reference/tsxDynamicTagName9.js @@ -30,8 +30,7 @@ var React = require("react"); var Text = (function (_super) { __extends(Text, _super); function Text() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this._tagName = 'div'; return _this; } diff --git a/tests/baselines/reference/typeGuardOfFormThisMember.js b/tests/baselines/reference/typeGuardOfFormThisMember.js index 3995ffd447c..541c03dd4b4 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMember.js +++ b/tests/baselines/reference/typeGuardOfFormThisMember.js @@ -118,8 +118,7 @@ var Test; var File = (function (_super) { __extends(File, _super); function File(path, content) { - var _this; - _this = _super.call(this, path) || this; + var _this = _super.call(this, path) || this; _this.content = content; return _this; } diff --git a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js index 14807ddd88c..b61676b40c3 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js +++ b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js @@ -68,8 +68,7 @@ var Test; var File = (function (_super) { __extends(File, _super); function File(path, content) { - var _this; - _this = _super.call(this, path) || this; + var _this = _super.call(this, path) || this; _this.content = content; return _this; } diff --git a/tests/baselines/reference/typeRelationships.js b/tests/baselines/reference/typeRelationships.js index eee99568638..2f97f4b0d1c 100644 --- a/tests/baselines/reference/typeRelationships.js +++ b/tests/baselines/reference/typeRelationships.js @@ -72,8 +72,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this; - _this = _super.apply(this, arguments) || this; + var _this = _super.apply(this, arguments) || this; _this.self1 = _this; _this.self2 = _this.self; _this.self3 = _this.foo(); diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 2c2b3ded1b5..5e2bb509a23 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -63,8 +63,7 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this; - _this = _super.call(this, asdf) || this; + var _this = _super.call(this, asdf) || this; return _this; } return C4; diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index 02927bf558d..7d5a4b9deed 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -234,8 +234,7 @@ var ts; var Property = (function (_super) { __extends(Property, _super); function Property(name, type, flags) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.name = name; _this.type = type; _this.flags = flags; @@ -256,8 +255,7 @@ var ts; var Signature = (function (_super) { __extends(Signature, _super); function Signature(typeParameters, parameters, returnType) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.typeParameters = typeParameters; _this.parameters = parameters; _this.returnType = returnType; @@ -278,8 +276,7 @@ var ts; var Parameter = (function (_super) { __extends(Parameter, _super); function Parameter(name, type, flags) { - var _this; - _this = _super.call(this) || this; + var _this = _super.call(this) || this; _this.name = name; _this.type = type; _this.flags = flags; diff --git a/tests/baselines/reference/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index 3a05ff12ee8..bbd564db366 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; })()) || this; // ok since this is not the case: The constructor declares parameter properties or the containing class declares instance member variables with initializers. + var _this = _super.call(this, (function () { return _this; })()) || this; return _this; } return Super; diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index 9c1c8f8c29d..0875f2ba1dd 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -41,8 +41,7 @@ define(["require", "exports"], function (require, exports) { var B = (function (_super) { __extends(B, _super); function B(element, url) { - var _this; - _this = _super.call(this, element) || this; + var _this = _super.call(this, element) || this; _this.p1 = element; _this.p2 = url; return _this; From 86088d0e7e9b7d31b04f4e4fb4327bb121e42def Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 3 Sep 2016 00:30:40 -0700 Subject: [PATCH 13/47] Always perform `this` captures after default & rest parameters. --- src/compiler/transformers/es6.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 85838112fc3..44089326f7f 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -791,10 +791,10 @@ namespace ts { } if (constructor) { - Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); - statementOffset = declareOrCaptureThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, statementOffset); addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); + Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); + statementOffset = declareOrCaptureThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, statementOffset); } addDefaultSuperCallIfNeeded(statements, constructor, extendsClauseElement, hasSynthesizedSuper); From dd27139f39795fd0d83e8189c7a932364afe8044 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 3 Sep 2016 00:31:09 -0700 Subject: [PATCH 14/47] Accepted baselines. --- tests/baselines/reference/es6ClassTest.js | 2 +- tests/baselines/reference/optionalParamArgsTest.js | 2 +- tests/baselines/reference/superAccess2.js | 2 +- tests/baselines/reference/superInConstructorParam1.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index d0879152544..067e57c2581 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -102,8 +102,8 @@ var Bar = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y, z) { - var _this = _super.call(this, x) || this; if (z === void 0) { z = 0; } + var _this = _super.call(this, x) || this; _this.y = y; _this.z = z; _this.gar = 0; diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index e93058d71d2..374b0956509 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -161,8 +161,8 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2(v2) { - var _this = _super.call(this, v2) || this; if (v2 === void 0) { v2 = 6; } + var _this = _super.call(this, v2) || this; return _this; } return C2; diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index 54c59978151..da19770584a 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -41,10 +41,10 @@ var Q = (function (_super) { __extends(Q, _super); // Super is not allowed in constructor args function Q(z, zz, zzz) { - var _this = _super.call(this) || this; if (z === void 0) { z = _super.; } if (zz === void 0) { zz = _super.; } if (zzz === void 0) { zzz = function () { return _super.; }; } + var _this = _super.call(this) || this; _this.z = z; _this.xx = _super.prototype.; return _this; diff --git a/tests/baselines/reference/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index 7519a8253ec..8c99b649917 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -27,8 +27,8 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C(a) { - var _this; if (a === void 0) { a = _super.foo.call(_this); } + var _this; return _this; } return C; From f3dcaae0f02d597a6f0918488fde203d08570686 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 3 Sep 2016 01:09:28 -0700 Subject: [PATCH 15/47] Added a test for branched returns at the end of a constructor. --- ...edClassConstructorWithExplicitReturns01.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts diff --git a/tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts b/tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts new file mode 100644 index 00000000000..2475eac0bb2 --- /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 From 1be4cee0c6fd9e19869e332d57672d74bc5f2dbd Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 3 Sep 2016 01:10:07 -0700 Subject: [PATCH 16/47] Accepted baselines. --- ...edClassConstructorWithExplicitReturns01.js | 76 +++ ...assConstructorWithExplicitReturns01.js.map | 2 + ...tructorWithExplicitReturns01.sourcemap.txt | 583 ++++++++++++++++++ ...ssConstructorWithExplicitReturns01.symbols | 66 ++ ...lassConstructorWithExplicitReturns01.types | 85 +++ 5 files changed, 812 insertions(+) create mode 100644 tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js create mode 100644 tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map create mode 100644 tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt create mode 100644 tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.symbols create mode 100644 tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js new file mode 100644 index 00000000000..de1e409b55f --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js @@ -0,0 +1,76 @@ +//// [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 _this; + } + 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 00000000000..dd7aedd1a98 --- /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 00000000000..5f41ab56300 --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt @@ -0,0 +1,583 @@ +=================================================================== +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) +--- +>>> return _this; +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(36, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(36, 6) Source(33, 6) + SourceIndex(0) +--- +>>> return D; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(37, 5) Source(34, 1) + SourceIndex(0) +2 >Emitted(37, 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(38, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(34, 2) + SourceIndex(0) +3 >Emitted(38, 2) Source(17, 1) + SourceIndex(0) +4 >Emitted(38, 3) Source(17, 17) + SourceIndex(0) +5 >Emitted(38, 4) Source(17, 18) + SourceIndex(0) +6 >Emitted(38, 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 00000000000..ee043fcfe71 --- /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 00000000000..aa3b1ec7fbf --- /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 : number + + foo() { return "this never gets used."; } +>foo : () => string +>"this never gets used." : string + + 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." : string + } + } + } +} + +class D extends C { +>D : D +>C : C + + dProp = () => this; +>dProp : () => this +>() => this : () => this +>this : this + + constructor(a = 100) { +>a : number +>100 : number + + 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 : number + + "You win!" +>"You win!" : string + + return { +>{ cProp: 1, dProp: () => this, foo() { return "You win!!!!!" } } : { cProp: number; dProp: () => this; foo(): string; } + + cProp: 1, +>cProp : number +>1 : number + + dProp: () => this, +>dProp : () => this +>() => this : () => this +>this : this + + foo() { return "You win!!!!!" } +>foo : () => string +>"You win!!!!!" : string + + }; + } + else + return null; +>null : null + } +} From c87a773a462daba914c05fcb28617d632847a02c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 3 Sep 2016 01:10:38 -0700 Subject: [PATCH 17/47] Don't emit a return statement at the end in most useful cases. --- src/compiler/transformers/es6.ts | 34 +++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 44089326f7f..aa62af361db 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -804,7 +804,9 @@ namespace ts { addRange(statements, body); } - if (extendsClauseElement) { + // 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 && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { statements.push( createReturn( createIdentifier("_this") @@ -833,6 +835,36 @@ namespace ts { return constructor => visitNodes(constructor.body.statements, visitor, isStatement, /*start*/ offset); } + /** + * We want to try to avoid emitting a return statement in certain cases if a user already returned something. + * It would be pointless and generate 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; + } + } + + return false; + } + /** * Adds a synthesized call to `_super` if it is needed. * From d144665b4f6637b8184725c74a7b60e894b81617 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 3 Sep 2016 01:13:58 -0700 Subject: [PATCH 18/47] Accepted baselines. --- tests/baselines/reference/classExtendsNull.js | 2 -- ...ctorFunctionTypeIsAssignableToBaseType2.js | 1 - ...edClassConstructorWithExplicitReturns01.js | 1 - ...assConstructorWithExplicitReturns01.js.map | 2 +- ...tructorWithExplicitReturns01.sourcemap.txt | 21 +++++++++---------- .../reference/returnInConstructor1.js | 2 -- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/tests/baselines/reference/classExtendsNull.js b/tests/baselines/reference/classExtendsNull.js index a820b525aab..1eeb5172cad 100644 --- a/tests/baselines/reference/classExtendsNull.js +++ b/tests/baselines/reference/classExtendsNull.js @@ -23,7 +23,6 @@ var C = (function (_super) { function C() { var _this = _super.call(this) || this; return Object.create(null); - return _this; } return C; }(null)); @@ -32,7 +31,6 @@ var D = (function (_super) { function D() { var _this; return Object.create(null); - return _this; } return D; }(null)); diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index 1ae239430c7..a60eb4de056 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -58,7 +58,6 @@ var Derived2 = (function (_super) { function Derived2(x) { var _this = _super.call(this, x) || this; return 1; - return _this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js index de1e409b55f..4ab447d8e32 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js @@ -69,7 +69,6 @@ var D = (function (_super) { } else return null; - return _this; } return D; }(C)); diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map index dd7aedd1a98..8b9037e40c9 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map @@ -1,2 +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 +{"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 index 5f41ab56300..d452115ceb7 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt @@ -522,7 +522,6 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 4 >Emitted(34, 24) Source(32, 24) + SourceIndex(0) 5 >Emitted(34, 25) Source(32, 25) + SourceIndex(0) --- ->>> return _this; >>> } 1 >^^^^ 2 > ^ @@ -530,8 +529,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1 > > 2 > } -1 >Emitted(36, 5) Source(33, 5) + SourceIndex(0) -2 >Emitted(36, 6) Source(33, 6) + SourceIndex(0) +1 >Emitted(35, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(35, 6) Source(33, 6) + SourceIndex(0) --- >>> return D; 1->^^^^ @@ -539,8 +538,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1-> > 2 > } -1->Emitted(37, 5) Source(34, 1) + SourceIndex(0) -2 >Emitted(37, 13) Source(34, 2) + SourceIndex(0) +1->Emitted(36, 5) Source(34, 1) + SourceIndex(0) +2 >Emitted(36, 13) Source(34, 2) + SourceIndex(0) --- >>>}(C)); 1 > @@ -573,11 +572,11 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > return null; > } > } -1 >Emitted(38, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(38, 2) Source(34, 2) + SourceIndex(0) -3 >Emitted(38, 2) Source(17, 1) + SourceIndex(0) -4 >Emitted(38, 3) Source(17, 17) + SourceIndex(0) -5 >Emitted(38, 4) Source(17, 18) + SourceIndex(0) -6 >Emitted(38, 7) Source(34, 2) + SourceIndex(0) +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/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index 6c678db2358..a47fa7ed513 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -125,7 +125,6 @@ var H = (function (_super) { function H() { var _this = _super.call(this) || this; return new G(); //error - return _this; } return H; }(F)); @@ -134,7 +133,6 @@ var I = (function (_super) { function I() { var _this = _super.call(this) || this; return new G(); - return _this; } return I; }(G)); From b476815f76eac2cbc3704fa91be5e22ef76fff8b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 6 Sep 2016 11:31:20 -0700 Subject: [PATCH 19/47] Added test for '_this'. --- .../underscoreThisInDerivedClass01.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/cases/compiler/underscoreThisInDerivedClass01.ts diff --git a/tests/cases/compiler/underscoreThisInDerivedClass01.ts b/tests/cases/compiler/underscoreThisInDerivedClass01.ts new file mode 100644 index 00000000000..0d3f5849cb1 --- /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 From 230737fb95db3af9d3c686328cbf5130f7529992 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 6 Sep 2016 11:33:40 -0700 Subject: [PATCH 20/47] Accepted baselines. --- .../underscoreThisInDerivedClass01.js | 56 +++++++++++++++++++ .../underscoreThisInDerivedClass01.symbols | 32 +++++++++++ .../underscoreThisInDerivedClass01.types | 35 ++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 tests/baselines/reference/underscoreThisInDerivedClass01.js create mode 100644 tests/baselines/reference/underscoreThisInDerivedClass01.symbols create mode 100644 tests/baselines/reference/underscoreThisInDerivedClass01.types diff --git a/tests/baselines/reference/underscoreThisInDerivedClass01.js b/tests/baselines/reference/underscoreThisInDerivedClass01.js new file mode 100644 index 00000000000..000176c213f --- /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 00000000000..c05cd4f6fc3 --- /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 00000000000..b07f3e0efbf --- /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 + } +} From b11db57c3209f75feca0f98473ec24296b039e29 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 7 Sep 2016 12:23:06 -0700 Subject: [PATCH 21/47] Mark constructors as this-capturing if they are defined in a derived class. --- src/compiler/checker.ts | 6 +++++- src/compiler/utilities.ts | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 81f22e2f192..9cb18f7c488 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9215,14 +9215,18 @@ 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; } } + if (languageVersion < ScriptTarget.ES6 && container && container.kind === SyntaxKind.Constructor) { + needToCaptureLexicalThis = needToCaptureLexicalThis || !!getClassExtendsHeritageClauseElement(getContainingClass(container)); + } + const canUseSuperExpression = isLegalUsageOfSuperExpression(container); let nodeCheckFlag: NodeCheckFlags = 0; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 030a3a33871..5d10c3c4c67 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1032,11 +1032,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 { From 3a5fb0cec6e7db434a12043909bc12bc5866a5ec Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 7 Sep 2016 17:10:49 -0700 Subject: [PATCH 22/47] Accepted baselines. --- .../noImplicitAnyMissingGetAccessor.js | 3 +- .../noImplicitAnyMissingSetAccessor.js | 3 +- .../underscoreThisInDerivedClass01.errors.txt | 29 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/underscoreThisInDerivedClass01.errors.txt diff --git a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js index 69d98d4b0c6..d0e87aba25b 100644 --- a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js @@ -26,7 +26,8 @@ var Parent = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(Child.prototype, "message", { set: function (str) { diff --git a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js index 7ad703fd3b7..1b4119227bc 100644 --- a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js @@ -25,7 +25,8 @@ var Parent = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - _super.apply(this, arguments); + var _this = _super.apply(this, arguments) || this; + return _this; } Object.defineProperty(Child.prototype, "message", { get: function () { diff --git a/tests/baselines/reference/underscoreThisInDerivedClass01.errors.txt b/tests/baselines/reference/underscoreThisInDerivedClass01.errors.txt new file mode 100644 index 00000000000..3828825cb6b --- /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 From f11c64648adb5f51decca90c2882d80ffbf93cf2 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 7 Sep 2016 17:30:51 -0700 Subject: [PATCH 23/47] Added missing semicolons. --- src/compiler/transformers/es6.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index aa62af361db..a419170769b 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -2656,10 +2656,10 @@ namespace ts { createLogicalOr( resultingCall, actualThis - ) + ); return assignToCapturedThis ? createAssignment(createIdentifier("_this"), initializer) - : initializer + : initializer; } return resultingCall; } From 138e18c3c905c85b13a16e85f7f69e5c3a4d9e3e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 19 Sep 2016 18:30:35 +0300 Subject: [PATCH 24/47] Accepted baselines. --- ...edClassConstructorWithExplicitReturns01.types | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types index aa3b1ec7fbf..d361e783ef0 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types @@ -5,11 +5,11 @@ class C { cProp = 10; >cProp : number ->10 : number +>10 : 10 foo() { return "this never gets used."; } >foo : () => string ->"this never gets used." : string +>"this never gets used." : "this never gets used." constructor(value: number) { >value : number @@ -25,7 +25,7 @@ class C { >foo : () => string return "well this looks kinda C-ish."; ->"well this looks kinda C-ish." : string +>"well this looks kinda C-ish." : "well this looks kinda C-ish." } } } @@ -42,7 +42,7 @@ class D extends C { constructor(a = 100) { >a : number ->100 : number +>100 : 100 super(a); >super(a) : void @@ -55,17 +55,17 @@ class D extends C { >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 "You win!" ->"You win!" : string +>"You win!" : "You win!" return { >{ cProp: 1, dProp: () => this, foo() { return "You win!!!!!" } } : { cProp: number; dProp: () => this; foo(): string; } cProp: 1, >cProp : number ->1 : number +>1 : 1 dProp: () => this, >dProp : () => this @@ -74,7 +74,7 @@ class D extends C { foo() { return "You win!!!!!" } >foo : () => string ->"You win!!!!!" : string +>"You win!!!!!" : "You win!!!!!" }; } From da298132048f58942a809561325a4bdd1d965aa1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 19 Sep 2016 18:01:32 +0300 Subject: [PATCH 25/47] Added test and comment. --- src/compiler/checker.ts | 1 + .../compiler/underscoreThisInDerivedClass02.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/cases/compiler/underscoreThisInDerivedClass02.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7d007950c93..20fb56870da 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9322,6 +9322,7 @@ namespace ts { } } + // Even if 'super' isn't ever actually called, we may need to capture 'this' for a derived class. if (languageVersion < ScriptTarget.ES6 && container && container.kind === SyntaxKind.Constructor) { needToCaptureLexicalThis = needToCaptureLexicalThis || !!getClassExtendsHeritageClauseElement(getContainingClass(container)); } diff --git a/tests/cases/compiler/underscoreThisInDerivedClass02.ts b/tests/cases/compiler/underscoreThisInDerivedClass02.ts new file mode 100644 index 00000000000..da197258a73 --- /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 From 60bcd7e0d009090170a7fa48580359cfb14e80c7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 19 Sep 2016 18:05:34 +0300 Subject: [PATCH 26/47] Accepted baselines. --- .../underscoreThisInDerivedClass02.errors.txt | 25 +++++++++++ .../underscoreThisInDerivedClass02.js | 44 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt create mode 100644 tests/baselines/reference/underscoreThisInDerivedClass02.js diff --git a/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt b/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt new file mode 100644 index 00000000000..f7e0494c884 --- /dev/null +++ b/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt @@ -0,0 +1,25 @@ +tests/cases/compiler/underscoreThisInDerivedClass02.ts(14,5): error TS2377: Constructors for derived classes must contain a 'super' call. + + +==== tests/cases/compiler/underscoreThisInDerivedClass02.ts (1 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 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 00000000000..c1e9494376b --- /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)); From 5b3a93db2fca4f8197dee1b979a3e22b282da697 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 19 Sep 2016 18:29:15 +0300 Subject: [PATCH 27/47] Always mark derived constructors as 'this'-capturing. --- src/compiler/checker.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 20fb56870da..29270628fb0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9322,11 +9322,6 @@ namespace ts { } } - // Even if 'super' isn't ever actually called, we may need to capture 'this' for a derived class. - if (languageVersion < ScriptTarget.ES6 && container && container.kind === SyntaxKind.Constructor) { - needToCaptureLexicalThis = needToCaptureLexicalThis || !!getClassExtendsHeritageClauseElement(getContainingClass(container)); - } - const canUseSuperExpression = isLegalUsageOfSuperExpression(container); let nodeCheckFlag: NodeCheckFlags = 0; @@ -14312,6 +14307,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) { From bc4cf6d3c06a7dbb6d5bffa728de163788c3d83f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 19 Sep 2016 18:30:15 +0300 Subject: [PATCH 28/47] Accepted baselines. --- .../reference/underscoreThisInDerivedClass02.errors.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt b/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt index f7e0494c884..5569ebf1af6 100644 --- a/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt +++ b/tests/baselines/reference/underscoreThisInDerivedClass02.errors.txt @@ -1,7 +1,8 @@ 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 (1 errors) ==== +==== tests/cases/compiler/underscoreThisInDerivedClass02.ts (2 errors) ==== // @target es5 // Original test intent: @@ -19,6 +20,8 @@ tests/cases/compiler/underscoreThisInDerivedClass02.ts(14,5): error TS2377: Cons ~~~~~~~~~~~~~~~ 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. From dc58fb5558a29794cea65b0c5e6e684f2354a75e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 20 Sep 2016 12:29:13 -0400 Subject: [PATCH 29/47] Immediately return the result of super calls when they are the first & last statement in a constructor. --- src/compiler/transformers/es6.ts | 123 +++++++++++++++++++++---------- 1 file changed, 85 insertions(+), 38 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 535e9162a3a..5748739cb23 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, @@ -814,6 +838,7 @@ namespace ts { startLexicalEnvironment(); let statementOffset = -1; + let thisCaptureStatus: SuperCaptureResult | undefined; if (hasSynthesizedSuper) { // If a super call has already been synthesized, // we're going to assume that we should just transform everything after that. @@ -829,7 +854,11 @@ namespace ts { addDefaultValueAssignmentsIfNeeded(statements, constructor); addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); - statementOffset = declareOrCaptureThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, statementOffset); + + thisCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, statementOffset); + if (thisCaptureStatus === SuperCaptureResult.ReplaceSuperCapture || thisCaptureStatus === SuperCaptureResult.ReplaceWithReturn) { + statementOffset++; + } } addDefaultSuperCallIfNeeded(statements, constructor, extendsClauseElement, hasSynthesizedSuper); @@ -841,7 +870,9 @@ namespace ts { // 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 && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { + if (extendsClauseElement + && thisCaptureStatus !== SuperCaptureResult.ReplaceWithReturn + && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { statements.push( createReturn( createIdentifier("_this") @@ -1190,45 +1221,61 @@ namespace ts { * * @returns The new statement offset into the `statements` array. */ - function declareOrCaptureThisForConstructorIfNeeded(statements: Statement[], ctor: ConstructorDeclaration, hasExtendsClause: boolean, firstNonPrologue: number) { - if (hasExtendsClause) { - // 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(); - // - // instead of - // - // var _this = super(); - // - let initializer: Expression = undefined; - let firstStatement: Statement; - if (firstNonPrologue < ctor.body.statements.length) { - firstStatement = ctor.body.statements[firstNonPrologue]; - - if (firstStatement.kind === SyntaxKind.ExpressionStatement && isSuperCallExpression((firstStatement as ExpressionStatement).expression)) { - const superCall = (firstStatement as ExpressionStatement).expression as CallExpression; - initializer = setOriginalNode( - saveStateAndInvoke(superCall, visitImmediateSuperCallInBody), - superCall - ); - } - } - captureThisForNode(statements, ctor, /*initializer*/ initializer, firstStatement); - - // We're actually skipping an extra statement. Signal this to the caller. - if (initializer) { - return firstNonPrologue + 1; - } - } - else { + function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements: Statement[], ctor: ConstructorDeclaration, hasExtendsClause: boolean, statementOffset: number) { + // If this isn't a derived class, just capture 'this' for arrow functions if necessary. + if (!hasExtendsClause) { addCaptureThisForNodeIfNeeded(statements, ctor); + return SuperCaptureResult.NoReplacement; } - return firstNonPrologue; + // 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; } /** From cd787cc1c2effa78d5877dd7d642e03a9d2484c3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 20 Sep 2016 12:29:32 -0400 Subject: [PATCH 30/47] Accepted baselines. --- .../reference/arrowFunctionContexts.js | 6 ++-- tests/baselines/reference/baseCheck.js | 6 ++-- .../reference/captureThisInSuperCall.js | 3 +- .../reference/checkForObjectTooStrict.js | 6 ++-- .../checkSuperCallBeforeThisAccessing5.js | 3 +- .../checkSuperCallBeforeThisAccessing7.js | 3 +- .../reference/classSideInheritance2.js | 3 +- .../reference/classSideInheritance3.js | 3 +- tests/baselines/reference/classUpdateTests.js | 3 +- .../reference/collisionSuperAndParameter.js | 3 +- ...perAndPropertyNameAsConstuctorParameter.js | 6 ++-- .../reference/commentsInheritance.js | 3 +- ...ctorFunctionTypeIsAssignableToBaseType2.js | 3 +- .../reference/constructorOverloads2.js | 3 +- .../reference/declFileGenericType2.js | 3 +- .../reference/decoratorOnClassConstructor2.js | 3 +- .../reference/decoratorOnClassConstructor3.js | 3 +- .../derivedClassOverridesPrivateFunction1.js | 3 +- .../derivedClassOverridesProtectedMembers.js | 3 +- .../derivedClassOverridesProtectedMembers2.js | 3 +- .../derivedClassOverridesProtectedMembers3.js | 30 +++++++------------ .../derivedClassOverridesPublicMembers.js | 3 +- .../derivedClassSuperCallsWithThisArg.js | 3 +- .../destructuringParameterDeclaration5.js | 6 ++-- tests/baselines/reference/es6ClassTest2.js | 3 +- ...cClassPropertyInheritanceSpecialization.js | 3 +- ...genericConstraintOnExtendedBuiltinTypes.js | 3 +- ...enericConstraintOnExtendedBuiltinTypes2.js | 3 +- .../reference/genericTypeConstraints.js | 3 +- .../missingPropertiesOfClassExpression.js | 3 +- .../reference/optionalParamArgsTest.js | 3 +- .../baselines/reference/parserRealSource11.js | 21 +++++-------- tests/baselines/reference/parserharness.js | 3 +- .../reference/strictModeInConstructor.js | 3 +- .../superCallBeforeThisAccessing2.js | 3 +- .../superCallBeforeThisAccessing6.js | 3 +- ...allFromClassThatDerivesFromGenericType1.js | 3 +- ...allFromClassThatDerivesFromGenericType2.js | 3 +- ...eButWithIncorrectNumberOfTypeArguments1.js | 3 +- ...sFromGenericTypeButWithNoTypeArguments1.js | 3 +- ...ivesNonGenericTypeButWithTypeArguments1.js | 3 +- .../superCallInsideClassDeclaration.js | 3 +- .../superCallInsideClassExpression.js | 3 +- .../superCallParameterContextualTyping1.js | 3 +- .../superCallParameterContextualTyping2.js | 3 +- .../superWithGenericSpecialization.js | 3 +- .../baselines/reference/superWithGenerics.js | 3 +- .../reference/targetTypeBaseCalls.js | 3 +- .../reference/thisInInvalidContexts.js | 3 +- .../thisInInvalidContextsExternalModule.js | 3 +- tests/baselines/reference/thisInSuperCall.js | 3 +- tests/baselines/reference/thisInSuperCall2.js | 3 +- tests/baselines/reference/unknownSymbols1.js | 3 +- .../reference/validUseOfThisInSuper.js | 3 +- 54 files changed, 74 insertions(+), 148 deletions(-) diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index 1af0797b41f..64727398f72 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 = _super.call(this, function () { return _this; }) || this; - 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 = _super.call(this, function () { return _this; }) || this; - return _this; + return _super.call(this, function () { return _this; }) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index 623cd152b9a..870f811c09f 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -43,16 +43,14 @@ var C = (function () { var ELoc = (function (_super) { __extends(ELoc, _super); function ELoc(x) { - var _this = _super.call(this, 0, x) || this; - return _this; + return _super.call(this, 0, x) || this; } return ELoc; }(C)); var ELocVar = (function (_super) { __extends(ELocVar, _super); function ELocVar(x) { - var _this = _super.call(this, 0, loc) || this; - return _this; + return _super.call(this, 0, loc) || this; } ELocVar.prototype.m = function () { var loc = 10; diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index 069871f598e..2c4df5db961 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 = _super.call(this, { test: function () { return _this.someMethod(); } }) || this; - return _this; + return _super.call(this, { test: function () { return _this.someMethod(); } }) || this; } B.prototype.someMethod = function () { }; return B; diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index 156608bd6b5..ade99e9319b 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -49,16 +49,14 @@ var Foo; var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return Bar; }(Foo.Object)); var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return Baz; }(Object)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js index 3174bebd11d..8c7f18b77f6 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -25,8 +25,7 @@ var Based = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.call(this, _this.x) || this; - return _this; + return _super.call(this, this.x) || this; } return Derived; }(Based)); diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js index 364aed4d4b0..ca12c16e047 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 = _super.call(this, (function () { return _this; })) || this; - return _this; + return _super.call(this, (function () { return _this; })) || this; } return Super; }(Base)); diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index 475f9bd4ceb..67ee666749b 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -29,8 +29,7 @@ var __extends = (this && this.__extends) || function (d, b) { var SubText = (function (_super) { __extends(SubText, _super); function SubText(text, span) { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return SubText; }(TextBase)); diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index 361378c3ff5..589dd81c5c6 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -42,8 +42,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C(x) { - var _this = _super.call(this, x) || this; - return _this; + return _super.call(this, x) || this; } return C; }(A)); diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 9809966c4c2..53ef71d0e4b 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -189,8 +189,7 @@ var H = (function () { var I = (function (_super) { __extends(I, _super); function I() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } // ERROR - no super call allowed return I; }(Object)); diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index 750ae15ef0a..f5765043c55 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -124,8 +124,7 @@ var Foo2 = (function (_super) { var Foo4 = (function (_super) { __extends(Foo4, _super); function Foo4(_super) { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } Foo4.prototype.y = function (_super) { var _this = this; diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index 269881b3b90..5fa7fe29091 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -44,8 +44,7 @@ var a = (function () { var b1 = (function (_super) { __extends(b1, _super); function b1(_super) { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return b1; }(a)); @@ -61,8 +60,7 @@ var b2 = (function (_super) { var b3 = (function (_super) { __extends(b3, _super); function b3(_super) { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return b3; }(a)); diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index 294f3a33690..a8a8d5fa889 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -227,8 +227,7 @@ var c2 = (function () { var c3 = (function (_super) { __extends(c3, _super); function c3() { - var _this = _super.call(this, 10) || this; - return _this; + return _super.call(this, 10) || this; } /** c3 f1*/ c3.prototype.f1 = function () { diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index a60eb4de056..c5e27748f52 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -47,8 +47,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(x) { - var _this = _super.call(this, x) || this; - return _this; + return _super.call(this, x) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index c26d031656f..2d26194f2e7 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -40,8 +40,7 @@ var FooBase = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y) { - var _this = _super.call(this, x) || this; - return _this; + return _super.call(this, x) || this; } Foo.prototype.bar1 = function () { }; return Foo; diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 328ab0cd949..a51254122ed 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -58,8 +58,7 @@ var templa; var AbstractElementController = (function (_super) { __extends(AbstractElementController, _super); function AbstractElementController() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return AbstractElementController; }(templa.mvc.AbstractController)); diff --git a/tests/baselines/reference/decoratorOnClassConstructor2.js b/tests/baselines/reference/decoratorOnClassConstructor2.js index 44bde0a171d..ce323e8ed1e 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor2.js +++ b/tests/baselines/reference/decoratorOnClassConstructor2.js @@ -45,8 +45,7 @@ var _0_ts_2 = require("./0.ts"); var C = (function (_super) { __extends(C, _super); function C(prop) { - var _this = _super.call(this) || this; - return _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 5130986b1f7..f06bf80b21d 100644 --- a/tests/baselines/reference/decoratorOnClassConstructor3.js +++ b/tests/baselines/reference/decoratorOnClassConstructor3.js @@ -48,8 +48,7 @@ var _0_2 = require("./0"); var C = (function (_super) { __extends(C, _super); function C(prop) { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return C; }(_0_1.base)); diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index a0b1559d430..981c072d47c 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -32,8 +32,7 @@ var BaseClass = (function () { var DerivedClass = (function (_super) { __extends(DerivedClass, _super); function DerivedClass() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } DerivedClass.prototype._init = function () { }; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index e86806d31d2..b8997769eb7 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -66,8 +66,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - var _this = _super.call(this, x) || this; - return _this; + 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 3035b2cb56f..ac9b401a45c 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -94,8 +94,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index 0e0c1c1ff01..d0d9d8fa0f5 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -103,16 +103,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } Derived2.prototype.b = function (a) { }; return Derived2; @@ -120,8 +118,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } Object.defineProperty(Derived3.prototype, "c", { get: function () { return x; }, @@ -133,8 +130,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } Object.defineProperty(Derived4.prototype, "c", { set: function (v) { }, @@ -146,24 +142,21 @@ var Derived4 = (function (_super) { var Derived5 = (function (_super) { __extends(Derived5, _super); function Derived5(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } return Derived5; }(Base)); var Derived6 = (function (_super) { __extends(Derived6, _super); function Derived6(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } return Derived6; }(Base)); var Derived7 = (function (_super) { __extends(Derived7, _super); function Derived7(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } Derived7.s = function (a) { }; return Derived7; @@ -171,8 +164,7 @@ var Derived7 = (function (_super) { var Derived8 = (function (_super) { __extends(Derived8, _super); function Derived8(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } Object.defineProperty(Derived8, "t", { get: function () { return x; }, @@ -184,8 +176,7 @@ var Derived8 = (function (_super) { var Derived9 = (function (_super) { __extends(Derived9, _super); function Derived9(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } Object.defineProperty(Derived9, "t", { set: function (v) { }, @@ -197,8 +188,7 @@ var Derived9 = (function (_super) { var Derived10 = (function (_super) { __extends(Derived10, _super); function Derived10(a) { - var _this = _super.call(this, a) || this; - return _this; + return _super.call(this, a) || this; } return Derived10; }(Base)); diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index 703f1d4a833..92fbc07e774 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -92,8 +92,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived(a) { - var _this = _super.call(this, x) || this; - return _this; + return _super.call(this, x) || this; } Derived.prototype.b = function (a) { }; Object.defineProperty(Derived.prototype, "c", { diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index 039e25919f8..504d414a608 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -42,8 +42,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.call(this, _this) || this; - return _this; + return _super.call(this, _this) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js index 8781671853f..7ba178823df 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -65,8 +65,7 @@ var Class = (function () { var SubClass = (function (_super) { __extends(SubClass, _super); function SubClass() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return SubClass; }(Class)); @@ -78,8 +77,7 @@ var D = (function () { var SubD = (function (_super) { __extends(SubD, _super); function SubD() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return SubD; }(D)); diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index 9217f890377..b3787405ff7 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -267,8 +267,7 @@ var SuperParent = (function () { var SuperChild = (function (_super) { __extends(SuperChild, _super); function SuperChild() { - var _this = _super.call(this, 1) || this; - return _this; + return _super.call(this, 1) || this; } SuperChild.prototype.b = function () { _super.prototype.b.call(this, 'str'); diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index 86410aaf10e..28eaf464968 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -109,8 +109,7 @@ var PortalFx; var Validator = (function (_super) { __extends(Validator, _super); function Validator(message) { - var _this = _super.call(this, message) || this; - return _this; + return _super.call(this, message) || this; } return Validator; }(Portal.Controls.Validators.Validator)); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index 582937e7c0a..b0974c26ede 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -52,8 +52,7 @@ var EndGate; var NumberTween = (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { - var _this = _super.call(this, from) || this; - return _this; + 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 88173a4cbe3..a403c0de0b3 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -51,8 +51,7 @@ var EndGate; var NumberTween = (function (_super) { __extends(NumberTween, _super); function NumberTween(from) { - var _this = _super.call(this, from) || this; - return _this; + return _super.call(this, from) || this; } return NumberTween; }(Tweening.Tween)); diff --git a/tests/baselines/reference/genericTypeConstraints.js b/tests/baselines/reference/genericTypeConstraints.js index b82e261a14f..67303166aa3 100644 --- a/tests/baselines/reference/genericTypeConstraints.js +++ b/tests/baselines/reference/genericTypeConstraints.js @@ -38,8 +38,7 @@ var Bar = (function () { var BarExtended = (function (_super) { __extends(BarExtended, _super); function BarExtended() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return BarExtended; }(Bar)); diff --git a/tests/baselines/reference/missingPropertiesOfClassExpression.js b/tests/baselines/reference/missingPropertiesOfClassExpression.js index 34b60940aa9..c7b30882b14 100644 --- a/tests/baselines/reference/missingPropertiesOfClassExpression.js +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.js @@ -15,8 +15,7 @@ var __extends = (this && this.__extends) || function (d, b) { var George = (function (_super) { __extends(George, _super); function George() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return George; }((function () { diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 374b0956509..1b603898aa6 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -162,8 +162,7 @@ var C2 = (function (_super) { __extends(C2, _super); function C2(v2) { if (v2 === void 0) { v2 = 6; } - var _this = _super.call(this, v2) || this; - return _this; + return _super.call(this, v2) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index fd2c017b637..eb05d13f4ed 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2667,8 +2667,7 @@ var TypeScript; var MissingIdentifier = (function (_super) { __extends(MissingIdentifier, _super); function MissingIdentifier() { - var _this = _super.call(this, "__missing") || this; - return _this; + return _super.call(this, "__missing") || this; } MissingIdentifier.prototype.isMissing = function () { return true; @@ -2707,8 +2706,7 @@ var TypeScript; var Expression = (function (_super) { __extends(Expression, _super); function Expression(nodeType) { - var _this = _super.call(this, nodeType) || this; - return _this; + return _super.call(this, nodeType) || this; } Expression.prototype.isExpression = function () { return true; }; Expression.prototype.isStatementOrExpression = function () { return true; }; @@ -3165,8 +3163,7 @@ var TypeScript; var ModuleElement = (function (_super) { __extends(ModuleElement, _super); function ModuleElement(nodeType) { - var _this = _super.call(this, nodeType) || this; - return _this; + return _super.call(this, nodeType) || this; } return ModuleElement; }(AST)); @@ -3259,8 +3256,7 @@ var TypeScript; var VarDecl = (function (_super) { __extends(VarDecl, _super); function VarDecl(id, nest) { - var _this = _super.call(this, id, NodeType.VarDecl, nest) || this; - return _this; + 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); }; @@ -3597,8 +3593,7 @@ var TypeScript; var InterfaceDeclaration = (function (_super) { __extends(InterfaceDeclaration, _super); function InterfaceDeclaration(name, members, extendsList, implementsList) { - var _this = _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) || this; - return _this; + return _super.call(this, NodeType.InterfaceDeclaration, name, extendsList, implementsList, members) || this; } InterfaceDeclaration.prototype.typeCheck = function (typeFlow) { return typeFlow.typeCheckInterface(this); @@ -3992,8 +3987,7 @@ var TypeScript; var EndCode = (function (_super) { __extends(EndCode, _super); function EndCode() { - var _this = _super.call(this, NodeType.EndCode) || this; - return _this; + return _super.call(this, NodeType.EndCode) || this; } return EndCode; }(AST)); @@ -4650,8 +4644,7 @@ var TypeScript; var DebuggerStatement = (function (_super) { __extends(DebuggerStatement, _super); function DebuggerStatement() { - var _this = _super.call(this, NodeType.Debugger) || this; - return _this; + 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 059ac2efd8e..14ce4338176 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2471,8 +2471,7 @@ var Harness; var Run = (function (_super) { __extends(Run, _super); function Run() { - var _this = _super.call(this, 'Test Run', null) || this; - return _this; + return _super.call(this, 'Test Run', null) || this; } Run.prototype.run = function () { emitLog('start'); diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index ecd6bacd20a..da45bda5c6e 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -107,8 +107,7 @@ var Bs = (function (_super) { __extends(Bs, _super); function Bs() { "use strict"; // No error - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return Bs; }(A)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing2.js b/tests/baselines/reference/superCallBeforeThisAccessing2.js index 91cc3d28dd6..7331718a9ed 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 = _super.call(this, function () { _this._t; }) || this; - return _this; + return _super.call(this, function () { _this._t; }) || this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallBeforeThisAccessing6.js b/tests/baselines/reference/superCallBeforeThisAccessing6.js index 4eb8e5266c2..e4dfb3f714a 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing6.js @@ -24,8 +24,7 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.call(this, _this) || this; - return _this; + return _super.call(this, this) || this; } return D; }(Base)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js index 27f3db51453..bc196299bf9 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -20,8 +20,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index a8d5e8008ac..8a0ef085590 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -19,8 +19,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index b12a3eef6d4..0529d5e3dc2 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -25,8 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.call(this, function (value) { return String(value); }) || this; - return _this; + 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 c78e6693f16..fb08ec28902 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -25,8 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.call(this, function (value) { return String(value); }) || this; - return _this; + 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 32d2065dd3f..50153391f62 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -25,8 +25,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.call(this, function (value) { return String(value); }) || this; - return _this; + return _super.call(this, function (value) { return String(value); }) || this; } return B; }(A)); diff --git a/tests/baselines/reference/superCallInsideClassDeclaration.js b/tests/baselines/reference/superCallInsideClassDeclaration.js index b696b4a302f..05e44119608 100644 --- a/tests/baselines/reference/superCallInsideClassDeclaration.js +++ b/tests/baselines/reference/superCallInsideClassDeclaration.js @@ -39,8 +39,7 @@ var B = (function (_super) { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return D; }(C)); diff --git a/tests/baselines/reference/superCallInsideClassExpression.js b/tests/baselines/reference/superCallInsideClassExpression.js index 829311f237c..3d55fe11cff 100644 --- a/tests/baselines/reference/superCallInsideClassExpression.js +++ b/tests/baselines/reference/superCallInsideClassExpression.js @@ -39,8 +39,7 @@ var B = (function (_super) { var D = (function (_super) { __extends(class_1, _super); function class_1() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return class_1; }(C)); diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index 0fe27f493e8..d8491b4ee83 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -28,8 +28,7 @@ var B = (function (_super) { __extends(B, _super); // Ensure 'value' is of type 'number (and not '{}') by using its 'toExponential()' method. function B() { - var _this = _super.call(this, function (value) { return String(value.toExponential()); }) || this; - return _this; + 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 f970be44aff..9868a7db124 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -27,8 +27,7 @@ var C = (function (_super) { __extends(C, _super); // Ensure 'value' is not of type 'any' by invoking it with type arguments. function C() { - var _this = _super.call(this, function (value) { return String(value()); }) || this; - return _this; + return _super.call(this, function (value) { return String(value()); }) || this; } return C; }(A)); diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index 96303dab4ed..a0381d0b944 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -28,8 +28,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return D; }(C)); diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index 36b48554871..803f229bd4b 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -20,8 +20,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.call(this) || this; - return _this; + return _super.call(this) || this; } return D; }(B)); diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index 8581526c1b6..cac93023a00 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -35,8 +35,7 @@ new Foo(function (s) { s = 5; }); // error, if types are applied correctly var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.call(this, function (s) { s = 5; }) || this; - return _this; + 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 7872aa121ed..7fcfaf9d317 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -70,8 +70,7 @@ var ClassWithNoInitializer = (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { - var _this = _super.call(this, _this) || this; - return _this; + return _super.call(this, _this) || this; } return ClassWithNoInitializer; }(BaseErrClass)); diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index e656824ae66..546863b5216 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -71,8 +71,7 @@ var ClassWithNoInitializer = (function (_super) { __extends(ClassWithNoInitializer, _super); //'this' in optional super call function ClassWithNoInitializer() { - var _this = _super.call(this, _this) || this; - return _this; + return _super.call(this, _this) || this; } return ClassWithNoInitializer; }(BaseErrClass)); diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index 1c1f11ffbc8..2a4d15973ab 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -36,8 +36,7 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - var _this = _super.call(this, _this) || this; - return _this; + return _super.call(this, _this) || this; } return Foo; }(Base)); diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index 6288082ed64..eabfa9d562c 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -33,8 +33,7 @@ var Base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - var _this = _super.call(this, _this) || this; - return _this; + return _super.call(this, _this) || this; } return Foo; }(Base)); diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 5e2bb509a23..832868c4b8f 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -63,8 +63,7 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this = _super.call(this, asdf) || this; - return _this; + return _super.call(this, asdf) || this; } return C4; }(C3)); diff --git a/tests/baselines/reference/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index bbd564db366..483e905b48a 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 = _super.call(this, (function () { return _this; })()) || this; - return _this; + return _super.call(this, (function () { return _this; })()) || this; } return Super; }(Base)); From 6580262c950626b9e14f4a1de90a8c420d6c5069 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 20 Sep 2016 12:30:33 -0400 Subject: [PATCH 31/47] Initialize instead of letting the value be potentially undefined. --- src/compiler/transformers/es6.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 5748739cb23..a69dcdfbe6a 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -838,7 +838,7 @@ namespace ts { startLexicalEnvironment(); let statementOffset = -1; - let thisCaptureStatus: SuperCaptureResult | undefined; + let thisCaptureStatus = SuperCaptureResult.NoReplacement; if (hasSynthesizedSuper) { // If a super call has already been synthesized, // we're going to assume that we should just transform everything after that. From f2de4508dfcb72ca33964d6cb4daea1065051214 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 26 Sep 2016 11:20:24 -0700 Subject: [PATCH 32/47] Extract emit-specific properties into EmitNode --- src/compiler/binder.ts | 6 +- src/compiler/comments.ts | 20 +- src/compiler/core.ts | 67 +++- src/compiler/emitter.ts | 151 +++++--- src/compiler/factory.ts | 34 +- src/compiler/transformer.ts | 413 +++++++-------------- src/compiler/transformers/destructuring.ts | 12 +- src/compiler/transformers/es6.ts | 109 +++--- src/compiler/transformers/es7.ts | 4 + src/compiler/transformers/generators.ts | 15 +- src/compiler/transformers/jsx.ts | 4 + src/compiler/transformers/module/es6.ts | 4 + src/compiler/transformers/module/module.ts | 39 +- src/compiler/transformers/module/system.ts | 24 +- src/compiler/transformers/ts.ts | 74 ++-- src/compiler/types.ts | 16 +- 16 files changed, 492 insertions(+), 500 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 49434e80aba..e2d31162127 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2592,7 +2592,7 @@ namespace ts { } // Currently, we only support generators that were originally async function bodies. - if (asteriskToken && node.emitFlags & NodeEmitFlags.AsyncFunctionBody) { + if (asteriskToken && getEmitFlags(node) & EmitFlags.AsyncFunctionBody) { transformFlags |= TransformFlags.AssertGenerator; } @@ -2667,7 +2667,7 @@ namespace ts { // down-level generator. // Currently we do not support transforming any other generator fucntions // down level. - if (asteriskToken && node.emitFlags & NodeEmitFlags.AsyncFunctionBody) { + if (asteriskToken && getEmitFlags(node) & EmitFlags.AsyncFunctionBody) { transformFlags |= TransformFlags.AssertGenerator; } } @@ -2698,7 +2698,7 @@ namespace ts { // down-level generator. // Currently we do not support transforming any other generator fucntions // down level. - if (asteriskToken && node.emitFlags & NodeEmitFlags.AsyncFunctionBody) { + if (asteriskToken && getEmitFlags(node) & EmitFlags.AsyncFunctionBody) { transformFlags |= TransformFlags.AssertGenerator; } diff --git a/src/compiler/comments.ts b/src/compiler/comments.ts index 1bca13a4bdb..f9f8e74d4ca 100644 --- a/src/compiler/comments.ts +++ b/src/compiler/comments.ts @@ -41,11 +41,11 @@ namespace ts { } if (node) { - const { pos, end } = node.commentRange || node; - const emitFlags = node.emitFlags; + const { pos, end } = getCommentRange(node); + const emitFlags = getEmitFlags(node); if ((pos < 0 && end < 0) || (pos === end)) { // Both pos and end are synthesized, so just emit the node without comments. - if (emitFlags & NodeEmitFlags.NoNestedComments) { + if (emitFlags & EmitFlags.NoNestedComments) { disableCommentsAndEmit(node, emitCallback); } else { @@ -58,8 +58,8 @@ namespace ts { } const isEmittedNode = node.kind !== SyntaxKind.NotEmittedStatement; - const skipLeadingComments = pos < 0 || (emitFlags & NodeEmitFlags.NoLeadingComments) !== 0; - const skipTrailingComments = end < 0 || (emitFlags & NodeEmitFlags.NoTrailingComments) !== 0; + const skipLeadingComments = pos < 0 || (emitFlags & EmitFlags.NoLeadingComments) !== 0; + const skipTrailingComments = end < 0 || (emitFlags & EmitFlags.NoTrailingComments) !== 0; // Emit leading comments if the position is not synthesized and the node // has not opted out from emitting leading comments. @@ -90,7 +90,7 @@ namespace ts { performance.measure("commentTime", "preEmitNodeWithComment"); } - if (emitFlags & NodeEmitFlags.NoNestedComments) { + if (emitFlags & EmitFlags.NoNestedComments) { disableCommentsAndEmit(node, emitCallback); } else { @@ -125,9 +125,9 @@ namespace ts { } const { pos, end } = detachedRange; - const emitFlags = node.emitFlags; - const skipLeadingComments = pos < 0 || (emitFlags & NodeEmitFlags.NoLeadingComments) !== 0; - const skipTrailingComments = disabled || end < 0 || (emitFlags & NodeEmitFlags.NoTrailingComments) !== 0; + const emitFlags = getEmitFlags(node); + const skipLeadingComments = pos < 0 || (emitFlags & EmitFlags.NoLeadingComments) !== 0; + const skipTrailingComments = disabled || end < 0 || (emitFlags & EmitFlags.NoTrailingComments) !== 0; if (!skipLeadingComments) { emitDetachedCommentsAndUpdateCommentsInfo(detachedRange); @@ -137,7 +137,7 @@ namespace ts { performance.measure("commentTime", "preEmitBodyWithDetachedComments"); } - if (emitFlags & NodeEmitFlags.NoNestedComments) { + if (emitFlags & EmitFlags.NoNestedComments) { disableCommentsAndEmit(node, emitCallback); } else { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 72d05e1cfd7..6a37292c532 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -824,6 +824,72 @@ namespace ts { }; } + /** + * High-order function, creates a function that executes a function composition. + * For example, `chain(a, b)` is the equivalent of `x => ((a', b') => y => b'(a'(y)))(a(x), b(x))` + * + * @param args The functions to chain. + */ + export function chain(...args: ((t: T) => (u: U) => U)[]): (t: T) => (u: U) => U; + export function chain(a: (t: T) => (u: U) => U, b: (t: T) => (u: U) => U, c: (t: T) => (u: U) => U, d: (t: T) => (u: U) => U, e: (t: T) => (u: U) => U): (t: T) => (u: U) => U { + if (e) { + const args: ((t: T) => (u: U) => U)[] = []; + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return t => compose(...map(args, f => f(t))); + } + else if (d) { + return t => compose(a(t), b(t), c(t), d(t)); + } + else if (c) { + return t => compose(a(t), b(t), c(t)); + } + else if (b) { + return t => compose(a(t), b(t)); + } + else if (a) { + return t => compose(a(t)); + } + else { + return t => u => u; + } + } + + /** + * High-order function, composes functions. Note that functions are composed inside-out; + * for example, `compose(a, b)` is the equivalent of `x => b(a(x))`. + * + * @param args The functions to compose. + */ + export function compose(...args: ((t: T) => T)[]): (t: T) => T; + export function compose(a: (t: T) => T, b: (t: T) => T, c: (t: T) => T, d: (t: T) => T, e: (t: T) => T): (t: T) => T { + if (e) { + const args: ((t: T) => T)[] = []; + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return t => reduceLeft<(t: T) => T, T>(args, (u, f) => f(u), t); + } + else if (d) { + return t => d(c(b(a(t)))); + } + else if (c) { + return t => c(b(a(t))); + } + else if (b) { + return t => b(a(t)); + } + else if (a) { + return t => a(t); + } + else { + return t => t; + } + } + function formatStringFromArgs(text: string, args: { [index: number]: any; }, baseIndex?: number): string { baseIndex = baseIndex || 0; @@ -1715,7 +1781,6 @@ namespace ts { this.transformFlags = TransformFlags.None; this.parent = undefined; this.original = undefined; - this.transformId = 0; } export let objectAllocator: ObjectAllocator = { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 14e743cf59f..5487057bbca 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -244,7 +244,6 @@ const _super = (function (geti, seti) { // Extract helpers from the result const { - getTokenSourceMapRange, isSubstitutionEnabled, isEmitNotificationEnabled, onSubstituteNode, @@ -351,7 +350,7 @@ const _super = (function (geti, seti) { currentFileIdentifiers = node.identifiers; sourceMap.setSourceFile(node); comments.setSourceFile(node); - emitNodeWithNotification(node, emitWorker); + emitNodeWithNotification(node, emitWithSubstitution); } /** @@ -361,7 +360,6 @@ const _super = (function (geti, seti) { emitNodeWithNotification(node, emitWithComments); } - /** * Emits a node with comments. * @@ -379,17 +377,37 @@ const _super = (function (geti, seti) { * and should only be called indirectly from emitWithComments. */ function emitWithSourceMap(node: Node) { - emitNodeWithSourceMap(node, emitWorker); + emitNodeWithSourceMap(node, emitWithSubstitution); } + /** + * Emits a node with possible substitution. + * + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from emitWithSourceMap or + * emitIdentifierNameWithComments. + */ + function emitWithSubstitution(node: Node) { + emitNodeWithSubstitution(node, /*isExpression*/ false, emitWorker); + } + + /** + * Emits an IdentifierName. + */ function emitIdentifierName(node: Identifier) { if (node) { emitNodeWithNotification(node, emitIdentifierNameWithComments); } } + /** + * Emits an IdentifierName with possible comments. + * + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from emitIdentifierName. + */ function emitIdentifierNameWithComments(node: Identifier) { - emitNodeWithComments(node, emitWorker); + emitNodeWithComments(node, emitWithSubstitution); } /** @@ -410,18 +428,30 @@ const _super = (function (geti, seti) { } /** - * Emits an expression with source maps. + * Emits an expression with possible source maps. * * NOTE: Do not call this method directly. It is part of the emitExpression pipeline * and should only be called indirectly from emitExpressionWithComments. */ function emitExpressionWithSourceMap(node: Expression) { - emitNodeWithSourceMap(node, emitExpressionWorker); + emitNodeWithSourceMap(node, emitExpressionWithSubstitution); } /** - * Emits a node with emit notification if available. + * Emits an expression with possible substitution. + * + * NOTE: Do not call this method directly. It is part of the emitExpression pipeline + * and should only be called indirectly from emitExpressionWithSourceMap or + * from emitWorker. */ + function emitExpressionWithSubstitution(node: Expression) { + emitNodeWithSubstitution(node, /*isExpression*/ true, emitExpressionWorker); + } + + /** + * Emits a node with possible emit notification. + */ + // TODO(rbuckton): Move this into transformer.ts function emitNodeWithNotification(node: Node, emitCallback: (node: Node) => void) { if (node) { if (isEmitNotificationEnabled(node)) { @@ -433,6 +463,10 @@ const _super = (function (geti, seti) { } } + /** + * Emits a node with possible source maps. + */ + // TODO(rbuckton): Move this into sourcemap.ts function emitNodeWithSourceMap(node: Node, emitCallback: (node: Node) => void) { if (node) { emitStart(/*range*/ node, /*contextNode*/ node, shouldSkipLeadingSourceMapForNode, shouldSkipSourceMapForChildren, getSourceMapRange); @@ -441,10 +475,6 @@ const _super = (function (geti, seti) { } } - function getSourceMapRange(node: Node) { - return node.sourceMapRange || node; - } - /** * Determines whether to skip leading comment emit for a node. * @@ -453,9 +483,10 @@ const _super = (function (geti, seti) { * * @param node A Node. */ + // TODO(rbuckton): Move this into comments.ts function shouldSkipLeadingCommentsForNode(node: Node) { return isNotEmittedStatement(node) - || (node.emitFlags & NodeEmitFlags.NoLeadingComments) !== 0; + || (getEmitFlags(node) & EmitFlags.NoLeadingComments) !== 0; } /** @@ -466,12 +497,12 @@ const _super = (function (geti, seti) { * * @param node A Node. */ + // TODO(rbuckton): Move this into sourcemap.ts function shouldSkipLeadingSourceMapForNode(node: Node) { return isNotEmittedStatement(node) - || (node.emitFlags & NodeEmitFlags.NoLeadingSourceMap) !== 0; + || (getEmitFlags(node) & EmitFlags.NoLeadingSourceMap) !== 0; } - /** * Determines whether to skip source map emit for the end position of a node. * @@ -480,9 +511,10 @@ const _super = (function (geti, seti) { * * @param node A Node. */ + // TODO(rbuckton): Move this into sourcemap.ts function shouldSkipTrailingSourceMapForNode(node: Node) { return isNotEmittedStatement(node) - || (node.emitFlags & NodeEmitFlags.NoTrailingSourceMap) !== 0; + || (getEmitFlags(node) & EmitFlags.NoTrailingSourceMap) !== 0; } /** @@ -490,15 +522,34 @@ const _super = (function (geti, seti) { * * We do not emit source maps for a node that has NodeEmitFlags.NoNestedSourceMaps. */ + // TODO(rbuckton): Move this into sourcemap.ts function shouldSkipSourceMapForChildren(node: Node) { - return (node.emitFlags & NodeEmitFlags.NoNestedSourceMaps) !== 0; + return (getEmitFlags(node) & EmitFlags.NoNestedSourceMaps) !== 0; } - function emitWorker(node: Node): void { - if (tryEmitSubstitute(node, emitWorker, /*isExpression*/ false)) { - return; + /** + * Emits a node with possible substitution. + */ + // TODO(rbuckton): Move this into transformer.ts + function emitNodeWithSubstitution(node: Node, isExpression: boolean, emitCallback: (node: Node) => void) { + if (isSubstitutionEnabled(node) && (getEmitFlags(node) & EmitFlags.NoSubstitution) === 0) { + const substitute = onSubstituteNode(node, isExpression); + if (substitute !== node) { + emitCallback(substitute); + return; + } } + emitCallback(node); + } + + /** + * Emits a node. + * + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from emitNodeWithSubstitution. + */ + function emitWorker(node: Node): void { const kind = node.kind; switch (kind) { // Pseudo-literals @@ -749,15 +800,17 @@ const _super = (function (geti, seti) { } if (isExpression(node)) { - return emitExpressionWorker(node); + return emitExpressionWithSubstitution(node); } } + /** + * Emits an expression. + * + * NOTE: Do not call this method directly. It is part of the emitExpression pipeline + * and should only be called indirectly from emitExpressionWithNotification. + */ function emitExpressionWorker(node: Node) { - if (tryEmitSubstitute(node, emitExpressionWorker, /*isExpression*/ true)) { - return; - } - const kind = node.kind; switch (kind) { // Literals @@ -881,7 +934,7 @@ const _super = (function (geti, seti) { // function emitIdentifier(node: Identifier) { - if (node.emitFlags & NodeEmitFlags.UMDDefine) { + if (getEmitFlags(node) & EmitFlags.UMDDefine) { writeLines(umdHelper); } else { @@ -1154,7 +1207,7 @@ const _super = (function (geti, seti) { write("{}"); } else { - const indentedFlag = node.emitFlags & NodeEmitFlags.Indented; + const indentedFlag = getEmitFlags(node) & EmitFlags.Indented; if (indentedFlag) { increaseIndent(); } @@ -1176,7 +1229,7 @@ const _super = (function (geti, seti) { let indentBeforeDot = false; let indentAfterDot = false; - if (!(node.emitFlags & NodeEmitFlags.NoIndentation)) { + if (!(getEmitFlags(node) & EmitFlags.NoIndentation)) { const dotRangeStart = node.expression.end; const dotRangeEnd = skipTrivia(currentText, node.expression.end) + 1; const dotToken = { kind: SyntaxKind.DotToken, pos: dotRangeStart, end: dotRangeEnd }; @@ -1419,7 +1472,7 @@ const _super = (function (geti, seti) { } function emitBlockStatements(node: Block) { - if (node.emitFlags & NodeEmitFlags.SingleLine) { + if (getEmitFlags(node) & EmitFlags.SingleLine) { emitList(node, node.statements, ListFormat.SingleLineBlockStatements); } else { @@ -1623,12 +1676,12 @@ const _super = (function (geti, seti) { const body = node.body; if (body) { if (isBlock(body)) { - const indentedFlag = node.emitFlags & NodeEmitFlags.Indented; + const indentedFlag = getEmitFlags(node) & EmitFlags.Indented; if (indentedFlag) { increaseIndent(); } - if (node.emitFlags & NodeEmitFlags.ReuseTempVariableScope) { + if (getEmitFlags(node) & EmitFlags.ReuseTempVariableScope) { emitSignatureHead(node); emitBlockFunctionBody(node, body); } @@ -1672,7 +1725,7 @@ const _super = (function (geti, seti) { // * A non-synthesized body's start and end position are on different lines. // * Any statement in the body starts on a new line. - if (body.emitFlags & NodeEmitFlags.SingleLine) { + if (getEmitFlags(body) & EmitFlags.SingleLine) { return true; } @@ -1743,7 +1796,7 @@ const _super = (function (geti, seti) { write("class"); emitNodeWithPrefix(" ", node.name, emitIdentifierName); - const indentedFlag = node.emitFlags & NodeEmitFlags.Indented; + const indentedFlag = getEmitFlags(node) & EmitFlags.Indented; if (indentedFlag) { increaseIndent(); } @@ -2077,7 +2130,7 @@ const _super = (function (geti, seti) { // but rather a trailing comment on the previous node. const initializer = node.initializer; if (!shouldSkipLeadingCommentsForNode(initializer)) { - const commentRange = initializer.commentRange || initializer; + const commentRange = getCommentRange(initializer); emitTrailingCommentsOfPosition(commentRange.pos); } @@ -2149,23 +2202,23 @@ const _super = (function (geti, seti) { } function emitHelpers(node: Node) { - const emitFlags = node.emitFlags; + const emitFlags = getEmitFlags(node); let helpersEmitted = false; - if (emitFlags & NodeEmitFlags.EmitEmitHelpers) { + if (emitFlags & EmitFlags.EmitEmitHelpers) { helpersEmitted = emitEmitHelpers(currentSourceFile); } - if (emitFlags & NodeEmitFlags.EmitExportStar) { + if (emitFlags & EmitFlags.EmitExportStar) { writeLines(exportStarHelper); helpersEmitted = true; } - if (emitFlags & NodeEmitFlags.EmitSuperHelper) { + if (emitFlags & EmitFlags.EmitSuperHelper) { writeLines(superHelper); helpersEmitted = true; } - if (emitFlags & NodeEmitFlags.EmitAdvancedSuperHelper) { + if (emitFlags & EmitFlags.EmitAdvancedSuperHelper) { writeLines(advancedSuperHelper); helpersEmitted = true; } @@ -2287,19 +2340,7 @@ const _super = (function (geti, seti) { } } - function tryEmitSubstitute(node: Node, emitNode: (node: Node) => void, isExpression: boolean) { - if (isSubstitutionEnabled(node) && (node.emitFlags & NodeEmitFlags.NoSubstitution) === 0) { - const substitute = onSubstituteNode(node, isExpression); - if (substitute !== node) { - substitute.emitFlags |= NodeEmitFlags.NoSubstitution; - emitNode(substitute); - return true; - } - } - - return false; - } - + // TODO(rbuckton): Move this into a transformer function tryEmitConstantValue(node: PropertyAccessExpression | ElementAccessExpression): boolean { const constantValue = tryGetConstEnumValue(node); if (constantValue !== undefined) { @@ -2440,7 +2481,7 @@ const _super = (function (geti, seti) { } if (shouldEmitInterveningComments) { - const commentRange = child.commentRange || child; + const commentRange = getCommentRange(child); emitTrailingCommentsOfPosition(commentRange.pos); } else { @@ -2502,11 +2543,11 @@ const _super = (function (geti, seti) { } function shouldSkipLeadingSourceMapForToken(contextNode: Node) { - return (contextNode.emitFlags & NodeEmitFlags.NoTokenLeadingSourceMaps) !== 0; + return (getEmitFlags(contextNode) & EmitFlags.NoTokenLeadingSourceMaps) !== 0; } function shouldSkipTrailingSourceMapForToken(contextNode: Node) { - return (contextNode.emitFlags & NodeEmitFlags.NoTokenTrailingSourceMaps) !== 0; + return (getEmitFlags(contextNode) & EmitFlags.NoTokenTrailingSourceMaps) !== 0; } function writeTokenText(token: SyntaxKind, pos?: number) { diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 16eeb86f59a..c0565f6e91d 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -76,7 +76,7 @@ namespace ts { // the original node. We also need to exclude specific properties and only include own- // properties (to skip members already defined on the shared prototype). const clone = createNode(node.kind, /*location*/ undefined, node.flags); - clone.original = node; + setOriginalNode(clone, node); for (const key in node) { if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { @@ -435,7 +435,7 @@ namespace ts { export function createPropertyAccess(expression: Expression, name: string | Identifier, location?: TextRange, flags?: NodeFlags) { const node = createNode(SyntaxKind.PropertyAccessExpression, location, flags); node.expression = parenthesizeForAccess(expression); - node.emitFlags = NodeEmitFlags.NoIndentation; + (node.emitNode || (node.emitNode = {})).flags |= EmitFlags.NoIndentation; node.name = typeof name === "string" ? createIdentifier(name) : name; return node; } @@ -444,7 +444,7 @@ namespace ts { if (node.expression !== expression || node.name !== name) { const propertyAccess = createPropertyAccess(expression, name, /*location*/ node, node.flags); // Because we are updating existed propertyAccess we want to inherit its emitFlags instead of using default from createPropertyAccess - propertyAccess.emitFlags = node.emitFlags; + (propertyAccess.emitNode || (propertyAccess.emitNode = {})).flags = getEmitFlags(node); return updateNode(propertyAccess, node); } return node; @@ -1551,7 +1551,7 @@ namespace ts { } else { const expression = isIdentifier(memberName) ? createPropertyAccess(target, memberName, location) : createElementAccess(target, memberName, location); - expression.emitFlags |= NodeEmitFlags.NoNestedSourceMaps; + (expression.emitNode || (expression.emitNode = {})).flags |= EmitFlags.NoNestedSourceMaps; return expression; } } @@ -1744,7 +1744,7 @@ namespace ts { ); // Mark this node as originally an async function - generatorFunc.emitFlags |= NodeEmitFlags.AsyncFunctionBody; + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= EmitFlags.AsyncFunctionBody; return createCall( createHelperName(externalHelpersModuleName, "__awaiter"), @@ -2222,7 +2222,7 @@ namespace ts { target.push(startOnNewLine(createStatement(createLiteral("use strict")))); foundUseStrict = true; } - if (statement.emitFlags & NodeEmitFlags.CustomPrologue) { + if (getEmitFlags(statement) & EmitFlags.CustomPrologue) { target.push(visitor ? visitNode(statement, visitor, isStatement) : statement); } else { @@ -2643,14 +2643,28 @@ namespace ts { export function setOriginalNode(node: T, original: Node): T { node.original = original; if (original) { - const { emitFlags, commentRange, sourceMapRange } = original; - if (emitFlags) node.emitFlags = emitFlags; - if (commentRange) node.commentRange = commentRange; - if (sourceMapRange) node.sourceMapRange = sourceMapRange; + const emitNode = original.emitNode; + if (emitNode) node.emitNode = mergeEmitNode(emitNode, node.emitNode); } return node; } + function mergeEmitNode(sourceEmitNode: EmitNode, destEmitNode: EmitNode) { + const { flags, commentRange, sourceMapRange, tokenSourceMapRanges } = sourceEmitNode; + if (!destEmitNode && (flags || commentRange || sourceMapRange || tokenSourceMapRanges)) destEmitNode = {}; + if (flags) destEmitNode.flags = flags; + if (commentRange) destEmitNode.commentRange = commentRange; + if (sourceMapRange) destEmitNode.sourceMapRange = sourceMapRange; + if (tokenSourceMapRanges) destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + return destEmitNode; + } + + function mergeTokenSourceMapRanges(sourceRanges: Map, destRanges: Map) { + if (!destRanges) destRanges = createMap(); + copyProperties(sourceRanges, destRanges); + return destRanges; + } + export function setTextRange(node: T, location: TextRange): T { if (location) { node.pos = location.pos; diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index 6242a2f2347..8c6fae458f0 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -30,11 +30,6 @@ namespace ts { */ getSourceFiles(): SourceFile[]; - /** - * Gets the TextRange to use for source maps for a token of a node. - */ - getTokenSourceMapRange(node: Node, token: SyntaxKind): TextRange; - /** * Determines whether expression substitutions are enabled for the provided node. */ @@ -75,46 +70,6 @@ namespace ts { getEmitResolver(): EmitResolver; getEmitHost(): EmitHost; - /** - * Gets flags used to customize later transformations or emit. - */ - getNodeEmitFlags(node: Node): NodeEmitFlags; - - /** - * Sets flags used to customize later transformations or emit. - */ - setNodeEmitFlags(node: T, flags: NodeEmitFlags): T; - - /** - * Gets the TextRange to use for source maps for the node. - */ - getSourceMapRange(node: Node): TextRange; - - /** - * Sets the TextRange to use for source maps for the node. - */ - setSourceMapRange(node: T, range: TextRange): T; - - /** - * Gets the TextRange to use for source maps for a token of a node. - */ - getTokenSourceMapRange(node: Node, token: SyntaxKind): TextRange; - - /** - * Sets the TextRange to use for source maps for a token of a node. - */ - setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange): T; - - /** - * Gets the TextRange to use for comments for the node. - */ - getCommentRange(node: Node): TextRange; - - /** - * Sets the TextRange to use for comments for the node. - */ - setCommentRange(node: T, range: TextRange): T; - /** * Hoists a function declaration to the containing scope. */ @@ -187,12 +142,137 @@ namespace ts { } /** - * Tracks a monotonically increasing transformation id used to associate a node with a specific - * transformation. This ensures transient properties related to transformations can be safely - * stored on source tree nodes that may be reused across multiple transformations (such as - * with compile-on-save). + * Clears any EmitNode entries from parse-tree nodes. + * @param sourceFile A source file. */ - let nextTransformId = 1; + export function disposeEmitNodes(sourceFile: SourceFile) { + // During transformation we may need to annotate a parse tree node with transient + // transformation properties. As parse tree nodes live longer than transformation + // nodes, we need to make sure we reclaim any memory allocated for custom ranges + // from these nodes to ensure we do not hold onto entire subtrees just for position + // information. We also need to reset these nodes to a pre-transformation state + // for incremental parsing scenarios so that we do not impact later emit. + sourceFile = getSourceFileOfNode(getParseTreeNode(sourceFile)); + const emitNode = sourceFile && sourceFile.emitNode; + const annotatedNodes = emitNode && emitNode.annotatedNodes; + if (annotatedNodes) { + for (const node of annotatedNodes) { + node.emitNode = undefined; + } + } + } + + /** + * Associates a node with the current transformation, initializing + * various transient transformation properties. + * + * @param node The node. + */ + function getOrCreateEmitNode(node: Node) { + if (!node.emitNode) { + if (isParseTreeNode(node)) { + // To avoid holding onto transformation artifacts, we keep track of any + // parse tree node we are annotating. This allows us to clean them up after + // all transformations have completed. + if (node.kind === SyntaxKind.SourceFile) { + return node.emitNode = { annotatedNodes: [node] }; + } + + const sourceFile = getSourceFileOfNode(node); + getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); + } + + node.emitNode = {}; + } + + return node.emitNode; + } + + /** + * Gets flags that control emit behavior of a node. + * + * @param node The node. + */ + export function getEmitFlags(node: Node) { + const emitNode = node.emitNode; + return emitNode && emitNode.flags; + } + + /** + * Sets flags that control emit behavior of a node. + * + * @param node The node. + * @param emitFlags The NodeEmitFlags for the node. + */ + export function setEmitFlags(node: T, emitFlags: EmitFlags) { + getOrCreateEmitNode(node).flags = emitFlags; + return node; + } + + /** + * Sets a custom text range to use when emitting source maps. + * + * @param node The node. + * @param range The text range. + */ + export function setSourceMapRange(node: T, range: TextRange) { + getOrCreateEmitNode(node).sourceMapRange = range; + return node; + } + + /** + * Sets the TextRange to use for source maps for a token of a node. + * + * @param node The node. + * @param token The token. + * @param range The text range. + */ + export function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange) { + const emitNode = getOrCreateEmitNode(node); + const tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = createMap()); + tokenSourceMapRanges[token] = range; + return node; + } + + /** + * Sets a custom text range to use when emitting comments. + */ + export function setCommentRange(node: T, range: TextRange) { + getOrCreateEmitNode(node).commentRange = range; + return node; + } + + /** + * Gets a custom text range to use when emitting comments. + * + * @param node The node. + */ + export function getCommentRange(node: Node) { + const emitNode = node.emitNode; + return (emitNode && emitNode.commentRange) || node; + } + + /** + * Gets a custom text range to use when emitting source maps. + * + * @param node The node. + */ + export function getSourceMapRange(node: Node) { + const emitNode = node.emitNode; + return (emitNode && emitNode.sourceMapRange) || node; + } + + /** + * Gets the TextRange to use for source maps for a token of a node. + * + * @param node The node. + * @param token The token. + */ + export function getTokenSourceMapRange(node: Node, token: SyntaxKind) { + const emitNode = node.emitNode; + const tokenSourceMapRanges = emitNode && emitNode.tokenSourceMapRanges; + return tokenSourceMapRanges && tokenSourceMapRanges[token]; + } /** * Transforms an array of SourceFiles by passing them through each transformer. @@ -203,18 +283,10 @@ namespace ts { * @param transforms An array of Transformers. */ export function transformFiles(resolver: EmitResolver, host: EmitHost, sourceFiles: SourceFile[], transformers: Transformer[]): TransformationResult { - const transformId = nextTransformId; - nextTransformId++; - - const tokenSourceMapRanges = createMap(); const lexicalEnvironmentVariableDeclarationsStack: VariableDeclaration[][] = []; const lexicalEnvironmentFunctionDeclarationsStack: FunctionDeclaration[][] = []; const enabledSyntaxKindFeatures = new Array(SyntaxKind.Count); - const parseTreeNodesWithAnnotations: Node[] = []; - let lastTokenSourceMapRangeNode: Node; - let lastTokenSourceMapRangeToken: SyntaxKind; - let lastTokenSourceMapRange: TextRange; let lexicalEnvironmentStackOffset = 0; let hoistedVariableDeclarations: VariableDeclaration[]; let hoistedFunctionDeclarations: FunctionDeclaration[]; @@ -226,14 +298,6 @@ namespace ts { getCompilerOptions: () => host.getCompilerOptions(), getEmitResolver: () => resolver, getEmitHost: () => host, - getNodeEmitFlags, - setNodeEmitFlags, - getSourceMapRange, - setSourceMapRange, - getTokenSourceMapRange, - setTokenSourceMapRange, - getCommentRange, - setCommentRange, hoistVariableDeclaration, hoistFunctionDeclaration, startLexicalEnvironment, @@ -257,7 +321,6 @@ namespace ts { return { getSourceFiles: () => transformed, - getTokenSourceMapRange, isSubstitutionEnabled, isEmitNotificationEnabled, onSubstituteNode: context.onSubstituteNode, @@ -269,16 +332,9 @@ namespace ts { // from these nodes to ensure we do not hold onto entire subtrees just for position // information. We also need to reset these nodes to a pre-transformation state // for incremental parsing scenarios so that we do not impact later emit. - for (const node of parseTreeNodesWithAnnotations) { - if (node.transformId === transformId) { - node.transformId = 0; - node.emitFlags = 0; - node.commentRange = undefined; - node.sourceMapRange = undefined; - } + for (const sourceFile of sourceFiles) { + disposeEmitNodes(sourceFile); } - - parseTreeNodesWithAnnotations.length = 0; } }; @@ -333,7 +389,7 @@ namespace ts { */ function isEmitNotificationEnabled(node: Node) { return (enabledSyntaxKindFeatures[node.kind] & SyntaxKindFeatureFlags.EmitNotifications) !== 0 - || (getNodeEmitFlags(node) & NodeEmitFlags.AdviseOnEmitNode) !== 0; + || (getEmitFlags(node) & EmitFlags.AdviseOnEmitNode) !== 0; } /** @@ -346,143 +402,6 @@ namespace ts { emit(node); } - /** - * Associates a node with the current transformation, initializing - * various transient transformation properties. - * - * @param node The node. - */ - function beforeSetAnnotation(node: Node) { - if ((node.flags & NodeFlags.Synthesized) === 0 && node.transformId !== transformId) { - // To avoid holding onto transformation artifacts, we keep track of any - // parse tree node we are annotating. This allows us to clean them up after - // all transformations have completed. - parseTreeNodesWithAnnotations.push(node); - node.transformId = transformId; - } - } - - /** - * Gets flags that control emit behavior of a node. - * - * If the node does not have its own NodeEmitFlags set, the node emit flags of its - * original pointer are used. - * - * @param node The node. - */ - function getNodeEmitFlags(node: Node) { - return node.emitFlags; - } - - /** - * Sets flags that control emit behavior of a node. - * - * @param node The node. - * @param emitFlags The NodeEmitFlags for the node. - */ - function setNodeEmitFlags(node: T, emitFlags: NodeEmitFlags) { - beforeSetAnnotation(node); - node.emitFlags = emitFlags; - return node; - } - - /** - * Gets a custom text range to use when emitting source maps. - * - * If a node does not have its own custom source map text range, the custom source map - * text range of its original pointer is used. - * - * @param node The node. - */ - function getSourceMapRange(node: Node) { - return node.sourceMapRange || node; - } - - /** - * Sets a custom text range to use when emitting source maps. - * - * @param node The node. - * @param range The text range. - */ - function setSourceMapRange(node: T, range: TextRange) { - beforeSetAnnotation(node); - node.sourceMapRange = range; - return node; - } - - /** - * Gets the TextRange to use for source maps for a token of a node. - * - * If a node does not have its own custom source map text range for a token, the custom - * source map text range for the token of its original pointer is used. - * - * @param node The node. - * @param token The token. - */ - function getTokenSourceMapRange(node: Node, token: SyntaxKind) { - // As a performance optimization, use the cached value of the most recent node. - // This helps for cases where this function is called repeatedly for the same node. - if (lastTokenSourceMapRangeNode === node && lastTokenSourceMapRangeToken === token) { - return lastTokenSourceMapRange; - } - - // Get the custom token source map range for a node or from one of its original nodes. - // Custom token ranges are not stored on the node to avoid the GC burden. - let range: TextRange; - let current = node; - while (current) { - range = current.id ? tokenSourceMapRanges[current.id + "-" + token] : undefined; - if (range !== undefined) { - break; - } - - current = current.original; - } - - // Cache the most recently requested value. - lastTokenSourceMapRangeNode = node; - lastTokenSourceMapRangeToken = token; - lastTokenSourceMapRange = range; - return range; - } - - /** - * Sets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. - * @param range The text range. - */ - function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange) { - // Cache the most recently requested value. - lastTokenSourceMapRangeNode = node; - lastTokenSourceMapRangeToken = token; - lastTokenSourceMapRange = range; - tokenSourceMapRanges[getNodeId(node) + "-" + token] = range; - return node; - } - - /** - * Gets a custom text range to use when emitting comments. - * - * If a node does not have its own custom source map text range, the custom source map - * text range of its original pointer is used. - * - * @param node The node. - */ - function getCommentRange(node: Node) { - return node.commentRange || node; - } - - /** - * Sets a custom text range to use when emitting comments. - */ - function setCommentRange(node: T, range: TextRange) { - beforeSetAnnotation(node); - node.commentRange = range; - return node; - } - /** * Records a hoisted variable declaration for the provided name within a lexical environment. */ @@ -563,70 +482,4 @@ namespace ts { return statements; } } - - /** - * High-order function, creates a function that executes a function composition. - * For example, `chain(a, b)` is the equivalent of `x => ((a', b') => y => b'(a'(y)))(a(x), b(x))` - * - * @param args The functions to chain. - */ - function chain(...args: ((t: T) => (u: U) => U)[]): (t: T) => (u: U) => U; - function chain(a: (t: T) => (u: U) => U, b: (t: T) => (u: U) => U, c: (t: T) => (u: U) => U, d: (t: T) => (u: U) => U, e: (t: T) => (u: U) => U): (t: T) => (u: U) => U { - if (e) { - const args: ((t: T) => (u: U) => U)[] = []; - for (let i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - - return t => compose(...map(args, f => f(t))); - } - else if (d) { - return t => compose(a(t), b(t), c(t), d(t)); - } - else if (c) { - return t => compose(a(t), b(t), c(t)); - } - else if (b) { - return t => compose(a(t), b(t)); - } - else if (a) { - return t => compose(a(t)); - } - else { - return t => u => u; - } - } - - /** - * High-order function, composes functions. Note that functions are composed inside-out; - * for example, `compose(a, b)` is the equivalent of `x => b(a(x))`. - * - * @param args The functions to compose. - */ - function compose(...args: ((t: T) => T)[]): (t: T) => T; - function compose(a: (t: T) => T, b: (t: T) => T, c: (t: T) => T, d: (t: T) => T, e: (t: T) => T): (t: T) => T { - if (e) { - const args: ((t: T) => T)[] = []; - for (let i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - - return t => reduceLeft<(t: T) => T, T>(args, (u, f) => f(u), t); - } - else if (d) { - return t => d(c(b(a(t)))); - } - else if (c) { - return t => c(b(a(t))); - } - else if (b) { - return t => b(a(t)); - } - else if (a) { - return t => a(t); - } - else { - return t => t; - } - } } \ No newline at end of file diff --git a/src/compiler/transformers/destructuring.ts b/src/compiler/transformers/destructuring.ts index c6079ee1378..ac433647f55 100644 --- a/src/compiler/transformers/destructuring.ts +++ b/src/compiler/transformers/destructuring.ts @@ -66,7 +66,7 @@ namespace ts { // NOTE: this completely disables source maps, but aligns with the behavior of // `emitAssignment` in the old emitter. - context.setNodeEmitFlags(expression, NodeEmitFlags.NoNestedSourceMaps); + setEmitFlags(expression, EmitFlags.NoNestedSourceMaps); aggregateTransformFlags(expression); expressions.push(expression); @@ -102,7 +102,7 @@ namespace ts { // NOTE: this completely disables source maps, but aligns with the behavior of // `emitAssignment` in the old emitter. - context.setNodeEmitFlags(declaration, NodeEmitFlags.NoNestedSourceMaps); + setEmitFlags(declaration, EmitFlags.NoNestedSourceMaps); aggregateTransformFlags(declaration); declarations.push(declaration); @@ -139,7 +139,7 @@ namespace ts { // NOTE: this completely disables source maps, but aligns with the behavior of // `emitAssignment` in the old emitter. - context.setNodeEmitFlags(declaration, NodeEmitFlags.NoNestedSourceMaps); + setEmitFlags(declaration, EmitFlags.NoNestedSourceMaps); declarations.push(declaration); aggregateTransformFlags(declaration); @@ -192,7 +192,7 @@ namespace ts { // NOTE: this completely disables source maps, but aligns with the behavior of // `emitAssignment` in the old emitter. - context.setNodeEmitFlags(expression, NodeEmitFlags.NoNestedSourceMaps); + setEmitFlags(expression, EmitFlags.NoNestedSourceMaps); pendingAssignments.push(expression); return expression; @@ -252,8 +252,8 @@ namespace ts { } else { const name = getMutableClone(target); - context.setSourceMapRange(name, target); - context.setCommentRange(name, target); + setSourceMapRange(name, target); + setCommentRange(name, target); emitAssignment(name, value, location, /*original*/ undefined); } } diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 51a6a088fb7..eda0d03c704 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -144,13 +144,6 @@ namespace ts { startLexicalEnvironment, endLexicalEnvironment, hoistVariableDeclaration, - getNodeEmitFlags, - setNodeEmitFlags, - getCommentRange, - setCommentRange, - getSourceMapRange, - setSourceMapRange, - setTokenSourceMapRange, } = context; const resolver = context.getEmitResolver(); @@ -190,6 +183,10 @@ namespace ts { return transformSourceFile; function transformSourceFile(node: SourceFile) { + if (isDeclarationFile(node)) { + return node; + } + currentSourceFile = node; currentText = node.text; return visitNode(node, visitor, isSourceFile); @@ -427,7 +424,7 @@ namespace ts { case SyntaxKind.SetAccessor: case SyntaxKind.FunctionDeclaration: containingNonArrowFunction = currentParent; - if (!(containingNonArrowFunction.emitFlags & NodeEmitFlags.AsyncFunctionBody)) { + if (!(getEmitFlags(containingNonArrowFunction) & EmitFlags.AsyncFunctionBody)) { superScopeContainer = containingNonArrowFunction; } break; @@ -669,19 +666,19 @@ namespace ts { // To preserve the behavior of the old emitter, we explicitly indent // the body of the function here if it was requested in an earlier // transformation. - if (getNodeEmitFlags(node) & NodeEmitFlags.Indented) { - setNodeEmitFlags(classFunction, NodeEmitFlags.Indented); + if (getEmitFlags(node) & EmitFlags.Indented) { + setEmitFlags(classFunction, EmitFlags.Indented); } // "inner" and "outer" below are added purely to preserve source map locations from // the old emitter const inner = createPartiallyEmittedExpression(classFunction); inner.end = node.end; - setNodeEmitFlags(inner, NodeEmitFlags.NoComments); + setEmitFlags(inner, EmitFlags.NoComments); const outer = createPartiallyEmittedExpression(inner); outer.end = skipTrivia(currentText, node.pos); - setNodeEmitFlags(outer, NodeEmitFlags.NoComments); + setEmitFlags(outer, EmitFlags.NoComments); return createParen( createCall( @@ -715,17 +712,17 @@ namespace ts { // emit with the original emitter. const outer = createPartiallyEmittedExpression(localName); outer.end = closingBraceLocation.end; - setNodeEmitFlags(outer, NodeEmitFlags.NoComments); + setEmitFlags(outer, EmitFlags.NoComments); const statement = createReturn(outer); statement.pos = closingBraceLocation.pos; - setNodeEmitFlags(statement, NodeEmitFlags.NoComments | NodeEmitFlags.NoTokenSourceMaps); + setEmitFlags(statement, EmitFlags.NoComments | EmitFlags.NoTokenSourceMaps); statements.push(statement); addRange(statements, endLexicalEnvironment()); const block = createBlock(createNodeArray(statements, /*location*/ node.members), /*location*/ undefined, /*multiLine*/ true); - setNodeEmitFlags(block, NodeEmitFlags.NoComments); + setEmitFlags(block, EmitFlags.NoComments); return block; } @@ -828,7 +825,7 @@ namespace ts { ); if (!constructor) { - setNodeEmitFlags(block, NodeEmitFlags.NoComments); + setEmitFlags(block, EmitFlags.NoComments); } return block; @@ -965,27 +962,27 @@ namespace ts { // of an initializer, we must emit that expression to preserve side effects. if (name.elements.length > 0) { statements.push( - setNodeEmitFlags( + setEmitFlags( createVariableStatement( /*modifiers*/ undefined, createVariableDeclarationList( flattenParameterDestructuring(context, parameter, temp, visitor) ) ), - NodeEmitFlags.CustomPrologue + EmitFlags.CustomPrologue ) ); } else if (initializer) { statements.push( - setNodeEmitFlags( + setEmitFlags( createStatement( createAssignment( temp, visitNode(initializer, visitor, isExpression) ) ), - NodeEmitFlags.CustomPrologue + EmitFlags.CustomPrologue ) ); } @@ -1006,23 +1003,23 @@ namespace ts { getSynthesizedClone(name), createVoidZero() ), - setNodeEmitFlags( + setEmitFlags( createBlock([ createStatement( createAssignment( - setNodeEmitFlags(getMutableClone(name), NodeEmitFlags.NoSourceMap), - setNodeEmitFlags(initializer, NodeEmitFlags.NoSourceMap | getNodeEmitFlags(initializer)), + setEmitFlags(getMutableClone(name), EmitFlags.NoSourceMap), + setEmitFlags(initializer, EmitFlags.NoSourceMap | getEmitFlags(initializer)), /*location*/ parameter ) ) ], /*location*/ parameter), - NodeEmitFlags.SingleLine | NodeEmitFlags.NoTrailingSourceMap | NodeEmitFlags.NoTokenSourceMaps + EmitFlags.SingleLine | EmitFlags.NoTrailingSourceMap | EmitFlags.NoTokenSourceMaps ), /*elseStatement*/ undefined, /*location*/ parameter ); statement.startsOnNewLine = true; - setNodeEmitFlags(statement, NodeEmitFlags.NoTokenSourceMaps | NodeEmitFlags.NoTrailingSourceMap | NodeEmitFlags.CustomPrologue); + setEmitFlags(statement, EmitFlags.NoTokenSourceMaps | EmitFlags.NoTrailingSourceMap | EmitFlags.CustomPrologue); statements.push(statement); } @@ -1055,7 +1052,7 @@ namespace ts { // `declarationName` is the name of the local declaration for the parameter. const declarationName = getMutableClone(parameter.name); - setNodeEmitFlags(declarationName, NodeEmitFlags.NoSourceMap); + setEmitFlags(declarationName, EmitFlags.NoSourceMap); // `expressionName` is the name of the parameter used in expressions. const expressionName = getSynthesizedClone(parameter.name); @@ -1064,7 +1061,7 @@ namespace ts { // var param = []; statements.push( - setNodeEmitFlags( + setEmitFlags( createVariableStatement( /*modifiers*/ undefined, createVariableDeclarationList([ @@ -1076,7 +1073,7 @@ namespace ts { ]), /*location*/ parameter ), - NodeEmitFlags.CustomPrologue + EmitFlags.CustomPrologue ) ); @@ -1109,7 +1106,7 @@ namespace ts { ]) ); - setNodeEmitFlags(forStatement, NodeEmitFlags.CustomPrologue); + setEmitFlags(forStatement, EmitFlags.CustomPrologue); startOnNewLine(forStatement); statements.push(forStatement); } @@ -1134,7 +1131,7 @@ namespace ts { ]) ); - setNodeEmitFlags(captureThisStatement, NodeEmitFlags.NoComments | NodeEmitFlags.CustomPrologue); + setEmitFlags(captureThisStatement, EmitFlags.NoComments | EmitFlags.CustomPrologue); setSourceMapRange(captureThisStatement, node); statements.push(captureThisStatement); } @@ -1198,7 +1195,7 @@ namespace ts { const sourceMapRange = getSourceMapRange(member); const func = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined); - setNodeEmitFlags(func, NodeEmitFlags.NoComments); + setEmitFlags(func, EmitFlags.NoComments); setSourceMapRange(func, sourceMapRange); const statement = createStatement( @@ -1219,7 +1216,7 @@ namespace ts { // The location for the statement is used to emit comments only. // No source map should be emitted for this statement to align with the // old emitter. - setNodeEmitFlags(statement, NodeEmitFlags.NoSourceMap); + setEmitFlags(statement, EmitFlags.NoSourceMap); return statement; } @@ -1238,7 +1235,7 @@ namespace ts { // The location for the statement is used to emit source maps only. // No comments should be emitted for this statement to align with the // old emitter. - setNodeEmitFlags(statement, NodeEmitFlags.NoComments); + setEmitFlags(statement, EmitFlags.NoComments); return statement; } @@ -1252,11 +1249,11 @@ namespace ts { // To align with source maps in the old emitter, the receiver and property name // arguments are both mapped contiguously to the accessor name. const target = getMutableClone(receiver); - setNodeEmitFlags(target, NodeEmitFlags.NoComments | NodeEmitFlags.NoTrailingSourceMap); + setEmitFlags(target, EmitFlags.NoComments | EmitFlags.NoTrailingSourceMap); setSourceMapRange(target, firstAccessor.name); const propertyName = createExpressionForPropertyName(visitNode(firstAccessor.name, visitor, isPropertyName)); - setNodeEmitFlags(propertyName, NodeEmitFlags.NoComments | NodeEmitFlags.NoLeadingSourceMap); + setEmitFlags(propertyName, EmitFlags.NoComments | EmitFlags.NoLeadingSourceMap); setSourceMapRange(propertyName, firstAccessor.name); const properties: ObjectLiteralElement[] = []; @@ -1312,7 +1309,7 @@ namespace ts { const func = transformFunctionLikeToExpression(node, /*location*/ node, /*name*/ undefined); useCapturedThis = savedUseCapturedThis; - setNodeEmitFlags(func, NodeEmitFlags.CapturesThis); + setEmitFlags(func, EmitFlags.CapturesThis); return func; } @@ -1437,7 +1434,7 @@ namespace ts { const expression = visitNode(body, visitor, isExpression); const returnStatement = createReturn(expression, /*location*/ body); - setNodeEmitFlags(returnStatement, NodeEmitFlags.NoTokenSourceMaps | NodeEmitFlags.NoTrailingSourceMap | NodeEmitFlags.NoTrailingComments); + setEmitFlags(returnStatement, EmitFlags.NoTokenSourceMaps | EmitFlags.NoTrailingSourceMap | EmitFlags.NoTrailingComments); statements.push(returnStatement); // To align with the source map emit for the old emitter, we set a custom @@ -1455,7 +1452,7 @@ namespace ts { const block = createBlock(createNodeArray(statements, statementsLocation), node.body, multiLine); if (!multiLine && singleLine) { - setNodeEmitFlags(block, NodeEmitFlags.SingleLine); + setEmitFlags(block, EmitFlags.SingleLine); } if (closeBraceLocation) { @@ -1875,7 +1872,7 @@ namespace ts { } // The old emitter does not emit source maps for the expression - setNodeEmitFlags(expression, NodeEmitFlags.NoSourceMap | getNodeEmitFlags(expression)); + setEmitFlags(expression, EmitFlags.NoSourceMap | getEmitFlags(expression)); // The old emitter does not emit source maps for the block. // We add the location to preserve comments. @@ -1884,7 +1881,7 @@ namespace ts { /*location*/ bodyLocation ); - setNodeEmitFlags(body, NodeEmitFlags.NoSourceMap | NodeEmitFlags.NoTokenSourceMaps); + setEmitFlags(body, EmitFlags.NoSourceMap | EmitFlags.NoTokenSourceMaps); const forStatement = createFor( createVariableDeclarationList([ @@ -1902,7 +1899,7 @@ namespace ts { ); // Disable trailing source maps for the OpenParenToken to align source map emit with the old emitter. - setNodeEmitFlags(forStatement, NodeEmitFlags.NoTokenTrailingSourceMaps); + setEmitFlags(forStatement, EmitFlags.NoTokenTrailingSourceMaps); return forStatement; } @@ -1938,13 +1935,13 @@ namespace ts { const expressions: Expression[] = []; const assignment = createAssignment( temp, - setNodeEmitFlags( + setEmitFlags( createObjectLiteral( visitNodes(properties, visitor, isObjectLiteralElement, 0, numInitialProperties), /*location*/ undefined, node.multiLine ), - NodeEmitFlags.Indented + EmitFlags.Indented ) ); if (node.multiLine) { @@ -2067,16 +2064,16 @@ namespace ts { const isAsyncBlockContainingAwait = containingNonArrowFunction - && (containingNonArrowFunction.emitFlags & NodeEmitFlags.AsyncFunctionBody) !== 0 + && (getEmitFlags(containingNonArrowFunction) & EmitFlags.AsyncFunctionBody) !== 0 && (node.statement.transformFlags & TransformFlags.ContainsYield) !== 0; - let loopBodyFlags: NodeEmitFlags = 0; + let loopBodyFlags: EmitFlags = 0; if (currentState.containsLexicalThis) { - loopBodyFlags |= NodeEmitFlags.CapturesThis; + loopBodyFlags |= EmitFlags.CapturesThis; } if (isAsyncBlockContainingAwait) { - loopBodyFlags |= NodeEmitFlags.AsyncFunctionBody; + loopBodyFlags |= EmitFlags.AsyncFunctionBody; } const convertedLoopVariable = @@ -2087,7 +2084,7 @@ namespace ts { createVariableDeclaration( functionName, /*type*/ undefined, - setNodeEmitFlags( + setEmitFlags( createFunctionExpression( isAsyncBlockContainingAwait ? createToken(SyntaxKind.AsteriskToken) : undefined, /*name*/ undefined, @@ -2480,7 +2477,7 @@ namespace ts { // Methods with computed property names are handled in visitObjectLiteralExpression. Debug.assert(!isComputedPropertyName(node.name)); const functionExpression = transformFunctionLikeToExpression(node, /*location*/ moveRangePos(node, -1), /*name*/ undefined); - setNodeEmitFlags(functionExpression, NodeEmitFlags.NoLeadingComments | getNodeEmitFlags(functionExpression)); + setEmitFlags(functionExpression, EmitFlags.NoLeadingComments | getEmitFlags(functionExpression)); return createPropertyAssignment( node.name, functionExpression, @@ -2861,7 +2858,7 @@ namespace ts { if (enabledSubstitutions & ES6SubstitutionFlags.CapturedThis && isFunctionLike(node)) { // If we are tracking a captured `this`, push a bit that indicates whether the // containing function is an arrow function. - useCapturedThis = (getNodeEmitFlags(node) & NodeEmitFlags.CapturesThis) !== 0; + useCapturedThis = (getEmitFlags(node) & EmitFlags.CapturesThis) !== 0; } previousOnEmitNode(node, emit); @@ -3012,7 +3009,7 @@ namespace ts { * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. */ function getLocalName(node: ClassDeclaration | ClassExpression | FunctionDeclaration, allowComments?: boolean, allowSourceMaps?: boolean) { - return getDeclarationName(node, allowComments, allowSourceMaps, NodeEmitFlags.LocalName); + return getDeclarationName(node, allowComments, allowSourceMaps, EmitFlags.LocalName); } /** @@ -3021,18 +3018,18 @@ namespace ts { * @param node The declaration. * @param allowComments Allow comments for the name. */ - function getDeclarationName(node: DeclarationStatement | ClassExpression, allowComments?: boolean, allowSourceMaps?: boolean, emitFlags?: NodeEmitFlags) { + function getDeclarationName(node: DeclarationStatement | ClassExpression, allowComments?: boolean, allowSourceMaps?: boolean, emitFlags?: EmitFlags) { if (node.name && !isGeneratedIdentifier(node.name)) { const name = getMutableClone(node.name); - emitFlags |= getNodeEmitFlags(node.name); + emitFlags |= getEmitFlags(node.name); if (!allowSourceMaps) { - emitFlags |= NodeEmitFlags.NoSourceMap; + emitFlags |= EmitFlags.NoSourceMap; } if (!allowComments) { - emitFlags |= NodeEmitFlags.NoComments; + emitFlags |= EmitFlags.NoComments; } if (emitFlags) { - setNodeEmitFlags(name, emitFlags); + setEmitFlags(name, emitFlags); } return name; } diff --git a/src/compiler/transformers/es7.ts b/src/compiler/transformers/es7.ts index 5d848bc608b..4d5e96134c4 100644 --- a/src/compiler/transformers/es7.ts +++ b/src/compiler/transformers/es7.ts @@ -9,6 +9,10 @@ namespace ts { return transformSourceFile; function transformSourceFile(node: SourceFile) { + if (isDeclarationFile(node)) { + return node; + } + return visitEachChild(node, visitor, context); } diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts index d1e2b6033a6..d6a30a81d61 100644 --- a/src/compiler/transformers/generators.ts +++ b/src/compiler/transformers/generators.ts @@ -231,9 +231,6 @@ namespace ts { endLexicalEnvironment, hoistFunctionDeclaration, hoistVariableDeclaration, - setSourceMapRange, - setCommentRange, - setNodeEmitFlags } = context; const compilerOptions = context.getCompilerOptions(); @@ -294,6 +291,10 @@ namespace ts { return transformSourceFile; function transformSourceFile(node: SourceFile) { + if (isDeclarationFile(node)) { + return node; + } + if (node.transformFlags & TransformFlags.ContainsGenerator) { currentSourceFile = node; node = visitEachChild(node, visitor, context); @@ -444,7 +445,7 @@ namespace ts { */ function visitFunctionDeclaration(node: FunctionDeclaration): Statement { // Currently, we only support generators that were originally async functions. - if (node.asteriskToken && node.emitFlags & NodeEmitFlags.AsyncFunctionBody) { + if (node.asteriskToken && getEmitFlags(node) & EmitFlags.AsyncFunctionBody) { node = setOriginalNode( createFunctionDeclaration( /*decorators*/ undefined, @@ -492,7 +493,7 @@ namespace ts { */ function visitFunctionExpression(node: FunctionExpression): Expression { // Currently, we only support generators that were originally async functions. - if (node.asteriskToken && node.emitFlags & NodeEmitFlags.AsyncFunctionBody) { + if (node.asteriskToken && getEmitFlags(node) & EmitFlags.AsyncFunctionBody) { node = setOriginalNode( createFunctionExpression( /*asteriskToken*/ undefined, @@ -2580,7 +2581,7 @@ namespace ts { /*typeArguments*/ undefined, [ createThis(), - setNodeEmitFlags( + setEmitFlags( createFunctionExpression( /*asteriskToken*/ undefined, /*name*/ undefined, @@ -2593,7 +2594,7 @@ namespace ts { /*multiLine*/ buildResult.length > 0 ) ), - NodeEmitFlags.ReuseTempVariableScope + EmitFlags.ReuseTempVariableScope ) ] ); diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index 9e6aa507cce..95a4016bb0a 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -16,6 +16,10 @@ namespace ts { * @param node A SourceFile node. */ function transformSourceFile(node: SourceFile) { + if (isDeclarationFile(node)) { + return node; + } + currentSourceFile = node; node = visitEachChild(node, visitor, context); currentSourceFile = undefined; diff --git a/src/compiler/transformers/module/es6.ts b/src/compiler/transformers/module/es6.ts index 2716165f2d3..09a2890727c 100644 --- a/src/compiler/transformers/module/es6.ts +++ b/src/compiler/transformers/module/es6.ts @@ -12,6 +12,10 @@ namespace ts { return transformSourceFile; function transformSourceFile(node: SourceFile) { + if (isDeclarationFile(node)) { + return node; + } + if (isExternalModule(node) || compilerOptions.isolatedModules) { currentSourceFile = node; return visitEachChild(node, visitor, context); diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 9abd91b47c8..286ef967288 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -15,9 +15,6 @@ namespace ts { startLexicalEnvironment, endLexicalEnvironment, hoistVariableDeclaration, - setNodeEmitFlags, - getNodeEmitFlags, - setSourceMapRange, } = context; const compilerOptions = context.getCompilerOptions(); @@ -54,6 +51,10 @@ namespace ts { * @param node The SourceFile node. */ function transformSourceFile(node: SourceFile) { + if (isDeclarationFile(node)) { + return node; + } + if (isExternalModule(node) || compilerOptions.isolatedModules) { currentSourceFile = node; @@ -92,7 +93,7 @@ namespace ts { const updated = updateSourceFile(node, statements); if (hasExportStarsToExportValues) { - setNodeEmitFlags(updated, NodeEmitFlags.EmitExportStar | getNodeEmitFlags(node)); + setEmitFlags(updated, EmitFlags.EmitExportStar | getEmitFlags(node)); } return updated; @@ -116,7 +117,7 @@ namespace ts { */ function transformUMDModule(node: SourceFile) { const define = createIdentifier("define"); - setNodeEmitFlags(define, NodeEmitFlags.UMDDefine); + setEmitFlags(define, EmitFlags.UMDDefine); return transformAsynchronousModule(node, define, /*moduleName*/ undefined, /*includeNonAmdDependencies*/ false); } @@ -220,7 +221,7 @@ namespace ts { if (hasExportStarsToExportValues) { // If we have any `export * from ...` declarations // we need to inform the emitter to add the __export helper. - setNodeEmitFlags(body, NodeEmitFlags.EmitExportStar); + setEmitFlags(body, EmitFlags.EmitExportStar); } return body; @@ -234,7 +235,7 @@ namespace ts { /*location*/ exportEquals ); - setNodeEmitFlags(statement, NodeEmitFlags.NoTokenSourceMaps | NodeEmitFlags.NoComments); + setEmitFlags(statement, EmitFlags.NoTokenSourceMaps | EmitFlags.NoComments); statements.push(statement); } else { @@ -249,7 +250,7 @@ namespace ts { /*location*/ exportEquals ); - setNodeEmitFlags(statement, NodeEmitFlags.NoComments); + setEmitFlags(statement, EmitFlags.NoComments); statements.push(statement); } } @@ -388,7 +389,7 @@ namespace ts { // Set emitFlags on the name of the importEqualsDeclaration // This is so the printer will not substitute the identifier - setNodeEmitFlags(node.name, NodeEmitFlags.NoSubstitution); + setEmitFlags(node.name, EmitFlags.NoSubstitution); const statements: Statement[] = []; if (moduleKind !== ModuleKind.AMD) { if (hasModifier(node, ModifierFlags.Export)) { @@ -598,7 +599,7 @@ namespace ts { } else { statements.push( - createExportStatement(node.name, setNodeEmitFlags(getSynthesizedClone(node.name), NodeEmitFlags.LocalName), /*location*/ node) + createExportStatement(node.name, setEmitFlags(getSynthesizedClone(node.name), EmitFlags.LocalName), /*location*/ node) ); } } @@ -813,7 +814,7 @@ namespace ts { )], /*location*/ node ); - setNodeEmitFlags(transformedStatement, NodeEmitFlags.NoComments); + setEmitFlags(transformedStatement, EmitFlags.NoComments); statements.push(transformedStatement); } @@ -890,7 +891,7 @@ namespace ts { // If the left-hand-side of the binaryExpression is an identifier and its is export through export Specifier if (isIdentifier(left) && isAssignmentOperator(node.operatorToken.kind)) { if (bindingNameExportSpecifiersMap && hasProperty(bindingNameExportSpecifiersMap, left.text)) { - setNodeEmitFlags(node, NodeEmitFlags.NoSubstitution); + setEmitFlags(node, EmitFlags.NoSubstitution); let nestedExportAssignment: BinaryExpression; for (const specifier of bindingNameExportSpecifiersMap[left.text]) { nestedExportAssignment = nestedExportAssignment ? @@ -910,7 +911,7 @@ namespace ts { const operand = node.operand; if (isIdentifier(operand) && bindingNameExportSpecifiersForFileMap) { if (bindingNameExportSpecifiersMap && hasProperty(bindingNameExportSpecifiersMap, operand.text)) { - setNodeEmitFlags(node, NodeEmitFlags.NoSubstitution); + setEmitFlags(node, EmitFlags.NoSubstitution); let transformedUnaryExpression: BinaryExpression; if (node.kind === SyntaxKind.PostfixUnaryExpression) { transformedUnaryExpression = createBinary( @@ -920,7 +921,7 @@ namespace ts { /*location*/ node ); // We have to set no substitution flag here to prevent visit the binary expression and substitute it again as we will preform all necessary substitution in here - setNodeEmitFlags(transformedUnaryExpression, NodeEmitFlags.NoSubstitution); + setEmitFlags(transformedUnaryExpression, EmitFlags.NoSubstitution); } let nestedExportAssignment: BinaryExpression; for (const specifier of bindingNameExportSpecifiersMap[operand.text]) { @@ -935,9 +936,9 @@ namespace ts { } function trySubstituteExportedName(node: Identifier) { - const emitFlags = getNodeEmitFlags(node); - if ((emitFlags & NodeEmitFlags.LocalName) === 0) { - const container = resolver.getReferencedExportContainer(node, (emitFlags & NodeEmitFlags.ExportName) !== 0); + const emitFlags = getEmitFlags(node); + if ((emitFlags & EmitFlags.LocalName) === 0) { + const container = resolver.getReferencedExportContainer(node, (emitFlags & EmitFlags.ExportName) !== 0); if (container) { if (container.kind === SyntaxKind.SourceFile) { return createPropertyAccess( @@ -953,7 +954,7 @@ namespace ts { } function trySubstituteImportedName(node: Identifier): Expression { - if ((getNodeEmitFlags(node) & NodeEmitFlags.LocalName) === 0) { + if ((getEmitFlags(node) & EmitFlags.LocalName) === 0) { const declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { if (isImportClause(declaration)) { @@ -1077,7 +1078,7 @@ namespace ts { if (includeNonAmdDependencies && importAliasName) { // Set emitFlags on the name of the classDeclaration // This is so that when printer will not substitute the identifier - setNodeEmitFlags(importAliasName, NodeEmitFlags.NoSubstitution); + setEmitFlags(importAliasName, EmitFlags.NoSubstitution); aliasedModuleNames.push(externalModuleName); importAliasNames.push(createParameter(importAliasName)); } diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index 7b013e18e7d..2a14f341272 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -10,8 +10,6 @@ namespace ts { } const { - getNodeEmitFlags, - setNodeEmitFlags, startLexicalEnvironment, endLexicalEnvironment, hoistVariableDeclaration, @@ -50,6 +48,10 @@ namespace ts { return transformSourceFile; function transformSourceFile(node: SourceFile) { + if (isDeclarationFile(node)) { + return node; + } + if (isExternalModule(node) || compilerOptions.isolatedModules) { currentSourceFile = node; currentNode = node; @@ -116,9 +118,9 @@ namespace ts { createParameter(contextObjectForFile) ], /*type*/ undefined, - setNodeEmitFlags( + setEmitFlags( createBlock(statements, /*location*/ undefined, /*multiLine*/ true), - NodeEmitFlags.EmitEmitHelpers + EmitFlags.EmitEmitHelpers ) ); @@ -135,7 +137,7 @@ namespace ts { : [dependencies, body] ) ) - ], /*nodeEmitFlags*/ ~NodeEmitFlags.EmitEmitHelpers & getNodeEmitFlags(node)); + ], /*nodeEmitFlags*/ ~EmitFlags.EmitEmitHelpers & getEmitFlags(node)); } /** @@ -1053,7 +1055,7 @@ namespace ts { } function substituteAssignmentExpression(node: BinaryExpression): Expression { - setNodeEmitFlags(node, NodeEmitFlags.NoSubstitution); + setEmitFlags(node, EmitFlags.NoSubstitution); const left = node.left; switch (left.kind) { @@ -1176,7 +1178,7 @@ namespace ts { const exportDeclaration = resolver.getReferencedExportContainer(operand); if (exportDeclaration) { const expr = createPrefix(node.operator, operand, node); - setNodeEmitFlags(expr, NodeEmitFlags.NoSubstitution); + setEmitFlags(expr, EmitFlags.NoSubstitution); const call = createExportExpression(operand, expr); if (node.kind === SyntaxKind.PrefixUnaryExpression) { return call; @@ -1241,7 +1243,7 @@ namespace ts { ]), m, createBlock([ - setNodeEmitFlags( + setEmitFlags( createIf( condition, createStatement( @@ -1251,7 +1253,7 @@ namespace ts { ) ) ), - NodeEmitFlags.SingleLine + EmitFlags.SingleLine ) ]) ), @@ -1393,10 +1395,10 @@ namespace ts { hoistBindingElement(node, /*isExported*/ false); } - function updateSourceFile(node: SourceFile, statements: Statement[], nodeEmitFlags: NodeEmitFlags) { + function updateSourceFile(node: SourceFile, statements: Statement[], nodeEmitFlags: EmitFlags) { const updated = getMutableClone(node); updated.statements = createNodeArray(statements, node.statements); - setNodeEmitFlags(updated, nodeEmitFlags); + setEmitFlags(updated, nodeEmitFlags); return updated; } } diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index d41a32d92c7..e1892ff5bf4 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -24,10 +24,6 @@ namespace ts { export function transformTypeScript(context: TransformationContext) { const { - getNodeEmitFlags, - setNodeEmitFlags, - setCommentRange, - setSourceMapRange, startLexicalEnvironment, endLexicalEnvironment, hoistVariableDeclaration, @@ -85,6 +81,10 @@ namespace ts { * @param node A SourceFile node. */ function transformSourceFile(node: SourceFile) { + if (isDeclarationFile(node)) { + return node; + } + return visitNode(node, visitor, isSourceFile); } @@ -449,7 +449,7 @@ namespace ts { node = visitEachChild(node, visitor, context); } - setNodeEmitFlags(node, NodeEmitFlags.EmitEmitHelpers | node.emitFlags); + setEmitFlags(node, EmitFlags.EmitEmitHelpers | getEmitFlags(node)); return node; } @@ -521,7 +521,7 @@ namespace ts { // To better align with the old emitter, we should not emit a trailing source map // entry if the class has static properties. if (staticProperties.length > 0) { - setNodeEmitFlags(classDeclaration, NodeEmitFlags.NoTrailingSourceMap | getNodeEmitFlags(classDeclaration)); + setEmitFlags(classDeclaration, EmitFlags.NoTrailingSourceMap | getEmitFlags(classDeclaration)); } statements.push(classDeclaration); @@ -776,7 +776,7 @@ namespace ts { // To preserve the behavior of the old emitter, we explicitly indent // the body of a class with static initializers. - setNodeEmitFlags(classExpression, NodeEmitFlags.Indented | getNodeEmitFlags(classExpression)); + setEmitFlags(classExpression, EmitFlags.Indented | getEmitFlags(classExpression)); expressions.push(startOnNewLine(createAssignment(temp, classExpression))); addRange(expressions, generateInitializedPropertyExpressions(node, staticProperties, temp)); expressions.push(startOnNewLine(temp)); @@ -1009,10 +1009,10 @@ namespace ts { Debug.assert(isIdentifier(node.name)); const name = node.name as Identifier; const propertyName = getMutableClone(name); - setNodeEmitFlags(propertyName, NodeEmitFlags.NoComments | NodeEmitFlags.NoSourceMap); + setEmitFlags(propertyName, EmitFlags.NoComments | EmitFlags.NoSourceMap); const localName = getMutableClone(name); - setNodeEmitFlags(localName, NodeEmitFlags.NoComments); + setEmitFlags(localName, EmitFlags.NoComments); return startOnNewLine( createStatement( @@ -1418,7 +1418,7 @@ namespace ts { moveRangePastDecorators(member) ); - setNodeEmitFlags(helper, NodeEmitFlags.NoComments); + setEmitFlags(helper, EmitFlags.NoComments); return helper; } @@ -1467,7 +1467,7 @@ namespace ts { ); const result = createAssignment(getDeclarationName(node), expression, moveRangePastDecorators(node)); - setNodeEmitFlags(result, NodeEmitFlags.NoComments); + setEmitFlags(result, EmitFlags.NoComments); return result; } // Emit the call to __decorate. Given the class: @@ -1491,7 +1491,7 @@ namespace ts { moveRangePastDecorators(node) ); - setNodeEmitFlags(result, NodeEmitFlags.NoComments); + setEmitFlags(result, EmitFlags.NoComments); return result; } } @@ -1521,7 +1521,7 @@ namespace ts { transformDecorator(decorator), parameterOffset, /*location*/ decorator.expression); - setNodeEmitFlags(helper, NodeEmitFlags.NoComments); + setEmitFlags(helper, EmitFlags.NoComments); expressions.push(helper); } } @@ -2324,11 +2324,11 @@ namespace ts { if (languageVersion >= ScriptTarget.ES6) { if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.AsyncMethodWithSuperBinding) { enableSubstitutionForAsyncMethodsWithSuper(); - setNodeEmitFlags(block, NodeEmitFlags.EmitAdvancedSuperHelper); + setEmitFlags(block, EmitFlags.EmitAdvancedSuperHelper); } else if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.AsyncMethodWithSuper) { enableSubstitutionForAsyncMethodsWithSuper(); - setNodeEmitFlags(block, NodeEmitFlags.EmitSuperHelper); + setEmitFlags(block, EmitFlags.EmitSuperHelper); } } @@ -2375,7 +2375,7 @@ namespace ts { setOriginalNode(parameter, node); setCommentRange(parameter, node); setSourceMapRange(parameter, moveRangePastModifiers(node)); - setNodeEmitFlags(parameter.name, NodeEmitFlags.NoTrailingSourceMap); + setEmitFlags(parameter.name, EmitFlags.NoTrailingSourceMap); return parameter; } @@ -2534,7 +2534,7 @@ namespace ts { // We request to be advised when the printer is about to print this node. This allows // us to set up the correct state for later substitutions. - let emitFlags = NodeEmitFlags.AdviseOnEmitNode; + let emitFlags = EmitFlags.AdviseOnEmitNode; // If needed, we should emit a variable declaration for the enum. If we emit // a leading variable declaration, we should not emit leading comments for the @@ -2544,7 +2544,7 @@ namespace ts { // We should still emit the comments if we are emitting a system module. if (moduleKind !== ModuleKind.System || currentScope !== currentSourceFile) { - emitFlags |= NodeEmitFlags.NoLeadingComments; + emitFlags |= EmitFlags.NoLeadingComments; } } @@ -2584,7 +2584,7 @@ namespace ts { ); setOriginalNode(enumStatement, node); - setNodeEmitFlags(enumStatement, emitFlags); + setEmitFlags(enumStatement, emitFlags); statements.push(enumStatement); if (isNamespaceExport(node)) { @@ -2736,7 +2736,7 @@ namespace ts { // })(m1 || (m1 = {})); // trailing comment module // setCommentRange(statement, node); - setNodeEmitFlags(statement, NodeEmitFlags.NoTrailingComments); + setEmitFlags(statement, EmitFlags.NoTrailingComments); statements.push(statement); } @@ -2759,7 +2759,7 @@ namespace ts { // We request to be advised when the printer is about to print this node. This allows // us to set up the correct state for later substitutions. - let emitFlags = NodeEmitFlags.AdviseOnEmitNode; + let emitFlags = EmitFlags.AdviseOnEmitNode; // If needed, we should emit a variable declaration for the module. If we emit // a leading variable declaration, we should not emit leading comments for the @@ -2768,7 +2768,7 @@ namespace ts { addVarForEnumOrModuleDeclaration(statements, node); // We should still emit the comments if we are emitting a system module. if (moduleKind !== ModuleKind.System || currentScope !== currentSourceFile) { - emitFlags |= NodeEmitFlags.NoLeadingComments; + emitFlags |= EmitFlags.NoLeadingComments; } } @@ -2820,7 +2820,7 @@ namespace ts { ); setOriginalNode(moduleStatement, node); - setNodeEmitFlags(moduleStatement, emitFlags); + setEmitFlags(moduleStatement, emitFlags); statements.push(moduleStatement); return statements; } @@ -2895,7 +2895,7 @@ namespace ts { // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. if (body.kind !== SyntaxKind.ModuleBlock) { - setNodeEmitFlags(block, block.emitFlags | NodeEmitFlags.NoComments); + setEmitFlags(block, getEmitFlags(block) | EmitFlags.NoComments); } return block; } @@ -2936,7 +2936,7 @@ namespace ts { } const moduleReference = createExpressionFromEntityName(node.moduleReference); - setNodeEmitFlags(moduleReference, NodeEmitFlags.NoComments | NodeEmitFlags.NoNestedComments); + setEmitFlags(moduleReference, EmitFlags.NoComments | EmitFlags.NoNestedComments); if (isNamedExternalModuleExport(node) || !isNamespaceExport(node)) { // export var ${name} = ${moduleReference}; @@ -3048,15 +3048,15 @@ namespace ts { function getNamespaceMemberName(name: Identifier, allowComments?: boolean, allowSourceMaps?: boolean): Expression { const qualifiedName = createPropertyAccess(currentNamespaceContainerName, getSynthesizedClone(name), /*location*/ name); - let emitFlags: NodeEmitFlags; + let emitFlags: EmitFlags; if (!allowComments) { - emitFlags |= NodeEmitFlags.NoComments; + emitFlags |= EmitFlags.NoComments; } if (!allowSourceMaps) { - emitFlags |= NodeEmitFlags.NoSourceMap; + emitFlags |= EmitFlags.NoSourceMap; } if (emitFlags) { - setNodeEmitFlags(qualifiedName, emitFlags); + setEmitFlags(qualifiedName, emitFlags); } return qualifiedName; } @@ -3093,7 +3093,7 @@ namespace ts { * @param allowComments A value indicating whether comments may be emitted for the name. */ function getLocalName(node: DeclarationStatement | ClassExpression, noSourceMaps?: boolean, allowComments?: boolean) { - return getDeclarationName(node, allowComments, !noSourceMaps, NodeEmitFlags.LocalName); + return getDeclarationName(node, allowComments, !noSourceMaps, EmitFlags.LocalName); } /** @@ -3111,7 +3111,7 @@ namespace ts { return getNamespaceMemberName(getDeclarationName(node), allowComments, !noSourceMaps); } - return getDeclarationName(node, allowComments, !noSourceMaps, NodeEmitFlags.ExportName); + return getDeclarationName(node, allowComments, !noSourceMaps, EmitFlags.ExportName); } /** @@ -3122,20 +3122,20 @@ namespace ts { * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. * @param emitFlags Additional NodeEmitFlags to specify for the name. */ - function getDeclarationName(node: DeclarationStatement | ClassExpression, allowComments?: boolean, allowSourceMaps?: boolean, emitFlags?: NodeEmitFlags) { + function getDeclarationName(node: DeclarationStatement | ClassExpression, allowComments?: boolean, allowSourceMaps?: boolean, emitFlags?: EmitFlags) { if (node.name) { const name = getMutableClone(node.name); - emitFlags |= getNodeEmitFlags(node.name); + emitFlags |= getEmitFlags(node.name); if (!allowSourceMaps) { - emitFlags |= NodeEmitFlags.NoSourceMap; + emitFlags |= EmitFlags.NoSourceMap; } if (!allowComments) { - emitFlags |= NodeEmitFlags.NoComments; + emitFlags |= EmitFlags.NoComments; } if (emitFlags) { - setNodeEmitFlags(name, emitFlags); + setEmitFlags(name, emitFlags); } return name; @@ -3342,7 +3342,7 @@ namespace ts { function trySubstituteNamespaceExportedName(node: Identifier): Expression { // If this is explicitly a local name, do not substitute. - if (enabledSubstitutions & applicableSubstitutions && (getNodeEmitFlags(node) & NodeEmitFlags.LocalName) === 0) { + if (enabledSubstitutions & applicableSubstitutions && (getEmitFlags(node) & EmitFlags.LocalName) === 0) { // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. const container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b1b672d015b..c18ebdd7200 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -493,10 +493,7 @@ namespace ts { /* @internal */ nextContainer?: Node; // Next container in declaration order (initialized by binding) /* @internal */ localSymbol?: Symbol; // Local symbol declared by node (initialized by binding only for exported nodes) /* @internal */ flowNode?: FlowNode; // Associated FlowNode (initialized by binding) - /* @internal */ transformId?: number; // Associates transient transformation properties with a specific transformation (initialized by transformation). - /* @internal */ emitFlags?: NodeEmitFlags; // Transient emit flags for a synthesized node (initialized by transformation). - /* @internal */ sourceMapRange?: TextRange; // Transient custom sourcemap range for a synthesized node (initialized by transformation). - /* @internal */ commentRange?: TextRange; // Transient custom comment range for a synthesized node (initialized by transformation). + /* @internal */ emitNode?: EmitNode; // Associated EmitNode (initialized by transforms) } export interface NodeArray extends Array, TextRange { @@ -3153,7 +3150,16 @@ namespace ts { } /* @internal */ - export const enum NodeEmitFlags { + export interface EmitNode { + flags?: EmitFlags; + commentRange?: TextRange; + sourceMapRange?: TextRange; + tokenSourceMapRanges?: Map; + annotatedNodes?: Node[]; // Tracks Parse-tree nodes with EmitNodes for eventual cleanup. + } + + /* @internal */ + export const enum EmitFlags { EmitEmitHelpers = 1 << 0, // Any emit helpers should be written to this node. EmitExportStar = 1 << 1, // The export * helper should be written to this node. EmitSuperHelper = 1 << 2, // Emit the basic _super helper for async methods. From c1ee53497465bcd3a6f5915c5fb97f475e6dc861 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 26 Sep 2016 13:52:09 -0700 Subject: [PATCH 33/47] Clean up SourceMapWriter and emitter. --- src/compiler/emitter.ts | 137 +-------- src/compiler/sourcemap.ts | 545 ++++++------------------------------ src/compiler/transformer.ts | 73 ++--- 3 files changed, 141 insertions(+), 614 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 5487057bbca..8457ea41d02 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -203,10 +203,8 @@ const _super = (function (geti, seti) { const sourceMap = createSourceMapWriter(host, writer); const { - emitStart, - emitEnd, - emitTokenStart, - emitTokenEnd + emitNodeWithSourceMap, + emitTokenWithSourceMap } = sourceMap; const comments = createCommentWriter(host, writer, sourceMap); @@ -244,10 +242,8 @@ const _super = (function (geti, seti) { // Extract helpers from the result const { - isSubstitutionEnabled, - isEmitNotificationEnabled, - onSubstituteNode, - onEmitNode + emitNodeWithSubstitution, + emitNodeWithNotification } = transformed; performance.mark("beforePrint"); @@ -448,101 +444,6 @@ const _super = (function (geti, seti) { emitNodeWithSubstitution(node, /*isExpression*/ true, emitExpressionWorker); } - /** - * Emits a node with possible emit notification. - */ - // TODO(rbuckton): Move this into transformer.ts - function emitNodeWithNotification(node: Node, emitCallback: (node: Node) => void) { - if (node) { - if (isEmitNotificationEnabled(node)) { - onEmitNode(node, emitCallback); - } - else { - emitCallback(node); - } - } - } - - /** - * Emits a node with possible source maps. - */ - // TODO(rbuckton): Move this into sourcemap.ts - function emitNodeWithSourceMap(node: Node, emitCallback: (node: Node) => void) { - if (node) { - emitStart(/*range*/ node, /*contextNode*/ node, shouldSkipLeadingSourceMapForNode, shouldSkipSourceMapForChildren, getSourceMapRange); - emitCallback(node); - emitEnd(/*range*/ node, /*contextNode*/ node, shouldSkipTrailingSourceMapForNode, shouldSkipSourceMapForChildren, getSourceMapRange); - } - } - - /** - * Determines whether to skip leading comment emit for a node. - * - * We do not emit comments for NotEmittedStatement nodes or any node that has - * NodeEmitFlags.NoLeadingComments. - * - * @param node A Node. - */ - // TODO(rbuckton): Move this into comments.ts - function shouldSkipLeadingCommentsForNode(node: Node) { - return isNotEmittedStatement(node) - || (getEmitFlags(node) & EmitFlags.NoLeadingComments) !== 0; - } - - /** - * Determines whether to skip source map emit for the start position of a node. - * - * We do not emit source maps for NotEmittedStatement nodes or any node that - * has NodeEmitFlags.NoLeadingSourceMap. - * - * @param node A Node. - */ - // TODO(rbuckton): Move this into sourcemap.ts - function shouldSkipLeadingSourceMapForNode(node: Node) { - return isNotEmittedStatement(node) - || (getEmitFlags(node) & EmitFlags.NoLeadingSourceMap) !== 0; - } - - /** - * Determines whether to skip source map emit for the end position of a node. - * - * We do not emit source maps for NotEmittedStatement nodes or any node that - * has NodeEmitFlags.NoTrailingSourceMap. - * - * @param node A Node. - */ - // TODO(rbuckton): Move this into sourcemap.ts - function shouldSkipTrailingSourceMapForNode(node: Node) { - return isNotEmittedStatement(node) - || (getEmitFlags(node) & EmitFlags.NoTrailingSourceMap) !== 0; - } - - /** - * Determines whether to skip source map emit for a node and its children. - * - * We do not emit source maps for a node that has NodeEmitFlags.NoNestedSourceMaps. - */ - // TODO(rbuckton): Move this into sourcemap.ts - function shouldSkipSourceMapForChildren(node: Node) { - return (getEmitFlags(node) & EmitFlags.NoNestedSourceMaps) !== 0; - } - - /** - * Emits a node with possible substitution. - */ - // TODO(rbuckton): Move this into transformer.ts - function emitNodeWithSubstitution(node: Node, isExpression: boolean, emitCallback: (node: Node) => void) { - if (isSubstitutionEnabled(node) && (getEmitFlags(node) & EmitFlags.NoSubstitution) === 0) { - const substitute = onSubstituteNode(node, isExpression); - if (substitute !== node) { - emitCallback(substitute); - return; - } - } - - emitCallback(node); - } - /** * Emits a node. * @@ -585,7 +486,7 @@ const _super = (function (geti, seti) { case SyntaxKind.StringKeyword: case SyntaxKind.SymbolKeyword: case SyntaxKind.GlobalKeyword: - return writeTokenNode(node); + return emitTokenNode(node); // Parse tree nodes @@ -832,7 +733,7 @@ const _super = (function (geti, seti) { case SyntaxKind.SuperKeyword: case SyntaxKind.TrueKeyword: case SyntaxKind.ThisKeyword: - return writeTokenNode(node); + return emitTokenNode(node); // Expressions case SyntaxKind.ArrayLiteralExpression: @@ -2129,7 +2030,7 @@ const _super = (function (geti, seti) { // "comment1" is not considered to be leading comment for node.initializer // but rather a trailing comment on the previous node. const initializer = node.initializer; - if (!shouldSkipLeadingCommentsForNode(initializer)) { + if ((getEmitFlags(initializer) & EmitFlags.NoLeadingComments) === 0) { const commentRange = getCommentRange(initializer); emitTrailingCommentsOfPosition(commentRange.pos); } @@ -2537,17 +2438,7 @@ const _super = (function (geti, seti) { } function writeToken(token: SyntaxKind, pos: number, contextNode?: Node) { - const tokenStartPos = emitTokenStart(token, pos, contextNode, shouldSkipLeadingSourceMapForToken, getTokenSourceMapRange); - const tokenEndPos = writeTokenText(token, tokenStartPos); - return emitTokenEnd(token, tokenEndPos, contextNode, shouldSkipTrailingSourceMapForToken, getTokenSourceMapRange); - } - - function shouldSkipLeadingSourceMapForToken(contextNode: Node) { - return (getEmitFlags(contextNode) & EmitFlags.NoTokenLeadingSourceMaps) !== 0; - } - - function shouldSkipTrailingSourceMapForToken(contextNode: Node) { - return (getEmitFlags(contextNode) & EmitFlags.NoTokenTrailingSourceMaps) !== 0; + return emitTokenWithSourceMap(contextNode, token, pos, writeTokenText); } function writeTokenText(token: SyntaxKind, pos?: number) { @@ -2556,12 +2447,12 @@ const _super = (function (geti, seti) { return positionIsSynthesized(pos) ? -1 : pos + tokenString.length; } - function writeTokenNode(node: Node) { - if (node) { - emitStart(/*range*/ node, /*contextNode*/ node, shouldSkipLeadingSourceMapForNode, shouldSkipSourceMapForChildren, getSourceMapRange); - writeTokenText(node.kind); - emitEnd(/*range*/ node, /*contextNode*/ node, shouldSkipTrailingSourceMapForNode, shouldSkipSourceMapForChildren, getSourceMapRange); - } + function emitTokenNode(node: Node) { + emitNodeWithSourceMap(node, emitTokenNodeWorker); + } + + function emitTokenNodeWorker(node: Node) { + writeTokenText(node.kind); } function increaseIndentIf(value: boolean, valueToWriteWhenNotIndenting?: string) { diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index eb369be39d7..3517c54b407 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -18,11 +18,6 @@ namespace ts { */ reset(): void; - /** - * Gets test data for source maps. - */ - getSourceMapData(): SourceMapData; - /** * Set the current source file. * @@ -41,123 +36,22 @@ namespace ts { emitPos(pos: number): void; /** - * Emits a mapping for the start of a range. + * Emits a node with possible leading and trailing source maps. * - * If the range's start position is synthetic (undefined or a negative value), no mapping - * will be created. Any trivia at the start position in the original source will be - * skipped. - * - * @param range The range to emit. + * @param node The node to emit. + * @param emitCallback The callback used to emit the node. */ - emitStart(range: TextRange): void; + emitNodeWithSourceMap(node: Node, emitCallback: (node: Node) => void): void; /** - * Emits a mapping for the start of a range. - * - * If the node's start position is synthetic (undefined or a negative value), no mapping - * will be created. Any trivia at the start position in the original source will be - * skipped. - * - * @param range The range to emit. - * @param contextNode The node for the current range. - * @param ignoreNodeCallback A callback used to determine whether to skip source map - * emit for the start position of this node. - * @param ignoreChildrenCallback A callback used to determine whether to skip source - * map emit for all children of this node. - * @param getTextRangeCallbackCallback A callback used to get a custom source map - * range for this node. - */ - emitStart(range: TextRange, contextNode: Node, ignoreNodeCallback: (node: Node) => boolean, ignoreChildrenCallback: (node: Node) => boolean, getTextRangeCallbackCallback: (node: Node) => TextRange): void; - - /** - * Emits a mapping for the end of a range. - * - * If the range's end position is synthetic (undefined or a negative value), no mapping - * will be created. - * - * @param range The range to emit. - */ - emitEnd(range: TextRange): void; - - /** - * Emits a mapping for the end of a range. - * - * If the node's end position is synthetic (undefined or a negative value), no mapping - * will be created. - * - * @param range The range to emit. - * @param contextNode The node for the current range. - * @param ignoreNodeCallback A callback used to determine whether to skip source map - * emit for the end position of this node. - * @param ignoreChildrenCallback A callback used to determine whether to skip source - * map emit for all children of this node. - * @param getTextRangeCallbackCallback A callback used to get a custom source map - * range for this node. - */ - emitEnd(range: TextRange, contextNode: Node, ignoreNodeCallback: (node: Node) => boolean, ignoreChildrenCallback: (node: Node) => boolean, getTextRangeCallbackCallback: (node: Node) => TextRange): void; - - /** - * Emits a mapping for the start position of a token. - * - * If the token's start position is synthetic (undefined or a negative value), no mapping - * will be created. Any trivia at the start position in the original source will be - * skipped. + * Emits a token of a node node with possible leading and trailing source maps. * + * @param node The node containing the token. * @param token The token to emit. - * @param tokenStartPos The start position of the token. - * @returns The start position of the token, following any trivia. + * @param tokenStartPos The start pos of the token. + * @param emitCallback The callback used to emit the token. */ - emitTokenStart(token: SyntaxKind, tokenStartPos: number): number; - - /** - * Emits a mapping for the start position of a token. - * - * If the token's start position is synthetic (undefined or a negative value), no mapping - * will be created. Any trivia at the start position in the original source will be - * skipped. - * - * @param token The token to emit. - * @param tokenStartPos The start position of the token. - * @param contextNode The node containing this token. - * @param ignoreTokenCallback A callback used to determine whether to skip source map - * emit for the start position of this token. - * @param getTokenTextRangeCallback A callback used to get a custom source - * map range for this node. - * @returns The start position of the token, following any trivia. - */ - emitTokenStart(token: SyntaxKind, tokenStartPos: number, contextNode: Node, ignoreTokenCallback: (node: Node, token: SyntaxKind) => boolean, getTokenTextRangeCallback: (node: Node, token: SyntaxKind) => TextRange): number; - - /** - * Emits a mapping for the end position of a token. - * - * If the token's end position is synthetic (undefined or a negative value), no mapping - * will be created. - * - * @param token The token to emit. - * @param tokenEndPos The end position of the token. - * @returns The end position of the token. - */ - emitTokenEnd(token: SyntaxKind, tokenEndPos: number): number; - - /** - * Emits a mapping for the end position of a token. - * - * If the token's end position is synthetic (undefined or a negative value), no mapping - * will be created. - * - * @param token The token to emit. - * @param tokenEndPos The end position of the token. - * @param contextNode The node containing this token. - * @param ignoreTokenCallback A callback used to determine whether to skip source map - * emit for the end position of this token. - * @param getTokenTextRangeCallback A callback used to get a custom source - * map range for this node. - * @returns The end position of the token. - */ - emitTokenEnd(token: SyntaxKind, tokenEndPos: number, contextNode: Node, ignoreTokenCallback: (node: Node, token: SyntaxKind) => boolean, getTokenTextRangeCallback: (node: Node, token: SyntaxKind) => TextRange): number; - - /*@deprecated*/ changeEmitSourcePos(): void; - /*@deprecated*/ stopOverridingSpan(): void; + emitTokenWithSourceMap(node: Node, token: SyntaxKind, tokenStartPos: number, emitCallback: (token: SyntaxKind, tokenStartPos: number) => number): number; /** * Gets the text for the source map. @@ -168,44 +62,11 @@ namespace ts { * Gets the SourceMappingURL for the source map. */ getSourceMappingURL(): string; - } - export function createSourceMapWriter(host: EmitHost, writer: EmitTextWriter): SourceMapWriter { - const compilerOptions = host.getCompilerOptions(); - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - if (compilerOptions.extendedDiagnostics) { - return createSourceMapWriterWithExtendedDiagnostics(host, writer); - } - - return createSourceMapWriterWorker(host, writer); - } - else { - return getNullSourceMapWriter(); - } - } - - let nullSourceMapWriter: SourceMapWriter; - - export function getNullSourceMapWriter(): SourceMapWriter { - if (nullSourceMapWriter === undefined) { - nullSourceMapWriter = { - initialize(filePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean): void { }, - reset(): void { }, - getSourceMapData(): SourceMapData { return undefined; }, - setSourceFile(sourceFile: SourceFile): void { }, - emitPos(pos: number): void { }, - emitStart(range: TextRange, contextNode?: Node, ignoreNodeCallback?: (node: Node) => boolean, ignoreChildrenCallback?: (node: Node) => boolean, getTextRangeCallback?: (node: Node) => TextRange): void { }, - emitEnd(range: TextRange, contextNode?: Node, ignoreNodeCallback?: (node: Node) => boolean, ignoreChildrenCallback?: (node: Node) => boolean, getTextRangeCallback?: (node: Node) => TextRange): void { }, - emitTokenStart(token: SyntaxKind, pos: number, contextNode?: Node, ignoreTokenCallback?: (node: Node) => boolean, getTokenTextRangeCallback?: (node: Node, token: SyntaxKind) => TextRange): number { return -1; }, - emitTokenEnd(token: SyntaxKind, end: number, contextNode?: Node, ignoreTokenCallback?: (node: Node) => boolean, getTokenTextRangeCallback?: (node: Node, token: SyntaxKind) => TextRange): number { return -1; }, - changeEmitSourcePos(): void { }, - stopOverridingSpan(): void { }, - getText(): string { return undefined; }, - getSourceMappingURL(): string { return undefined; } - }; - } - - return nullSourceMapWriter; + /** + * Gets test data for source maps. + */ + getSourceMapData(): SourceMapData; } // Used for initialize lastEncodedSourceMapSpan and reset lastEncodedSourceMapSpan when updateLastEncodedAndRecordedSpans @@ -217,14 +78,12 @@ namespace ts { sourceIndex: 0 }; - function createSourceMapWriterWorker(host: EmitHost, writer: EmitTextWriter): SourceMapWriter { + export function createSourceMapWriter(host: EmitHost, writer: EmitTextWriter): SourceMapWriter { const compilerOptions = host.getCompilerOptions(); const extendedDiagnostics = compilerOptions.extendedDiagnostics; let currentSourceFile: SourceFile; let currentSourceText: string; let sourceMapDir: string; // The directory in which sourcemap will be - let stopOverridingSpan = false; - let modifyLastSourcePos = false; // Current source map file and its index in the sources list let sourceMapSourceIndex: number; @@ -236,13 +95,7 @@ namespace ts { // Source map data let sourceMapData: SourceMapData; - - // This keeps track of the number of times `disable` has been called without a - // corresponding call to `enable`. As long as this value is non-zero, mappings will not - // be recorded. - // This is primarily used to provide a better experience when debugging binding - // patterns and destructuring assignments for simple expressions. - let disableDepth: number; + let disabled: boolean = !(compilerOptions.sourceMap || compilerOptions.inlineSourceMap); return { initialize, @@ -250,12 +103,8 @@ namespace ts { getSourceMapData: () => sourceMapData, setSourceFile, emitPos, - emitStart, - emitEnd, - emitTokenStart, - emitTokenEnd, - changeEmitSourcePos, - stopOverridingSpan: () => stopOverridingSpan = true, + emitNodeWithSourceMap, + emitTokenWithSourceMap, getText, getSourceMappingURL, }; @@ -269,13 +118,16 @@ namespace ts { * @param isBundledEmit A value indicating whether the generated output file is a bundle. */ function initialize(filePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean) { + if (disabled) { + return; + } + if (sourceMapData) { reset(); } currentSourceFile = undefined; currentSourceText = undefined; - disableDepth = 0; // Current source map file and its index in the sources list sourceMapSourceIndex = -1; @@ -338,6 +190,10 @@ namespace ts { * Reset the SourceMapWriter to an empty state. */ function reset() { + if (disabled) { + return; + } + currentSourceFile = undefined; sourceMapDir = undefined; sourceMapSourceIndex = undefined; @@ -345,64 +201,6 @@ namespace ts { lastEncodedSourceMapSpan = undefined; lastEncodedNameIndex = undefined; sourceMapData = undefined; - disableDepth = 0; - } - - /** - * Re-enables the recording of mappings. - */ - function enable() { - if (disableDepth > 0) { - disableDepth--; - } - } - - /** - * Disables the recording of mappings. - */ - function disable() { - disableDepth++; - } - - function updateLastEncodedAndRecordedSpans() { - if (modifyLastSourcePos) { - // Reset the source pos - modifyLastSourcePos = false; - - // Change Last recorded Map with last encoded emit line and character - lastRecordedSourceMapSpan.emittedLine = lastEncodedSourceMapSpan.emittedLine; - lastRecordedSourceMapSpan.emittedColumn = lastEncodedSourceMapSpan.emittedColumn; - - // Pop sourceMapDecodedMappings to remove last entry - sourceMapData.sourceMapDecodedMappings.pop(); - - // Point the lastEncodedSourceMapSpace to the previous encoded sourceMapSpan - // If the list is empty which indicates that we are at the beginning of the file, - // we have to reset it to default value (same value when we first initialize sourceMapWriter) - lastEncodedSourceMapSpan = sourceMapData.sourceMapDecodedMappings.length ? - sourceMapData.sourceMapDecodedMappings[sourceMapData.sourceMapDecodedMappings.length - 1] : - defaultLastEncodedSourceMapSpan; - - // TODO: Update lastEncodedNameIndex - // Since we dont support this any more, lets not worry about it right now. - // When we start supporting nameIndex, we will get back to this - - // Change the encoded source map - const sourceMapMappings = sourceMapData.sourceMapMappings; - let lenthToSet = sourceMapMappings.length - 1; - for (; lenthToSet >= 0; lenthToSet--) { - const currentChar = sourceMapMappings.charAt(lenthToSet); - if (currentChar === ",") { - // Separator for the entry found - break; - } - if (currentChar === ";" && lenthToSet !== 0 && sourceMapMappings.charAt(lenthToSet - 1) !== ";") { - // Last line separator found - break; - } - } - sourceMapData.sourceMapMappings = sourceMapMappings.substr(0, Math.max(0, lenthToSet)); - } } // Encoding for sourcemap span @@ -459,7 +257,7 @@ namespace ts { * @param pos The position. */ function emitPos(pos: number) { - if (positionIsSynthesized(pos) || disableDepth > 0) { + if (disabled || positionIsSynthesized(pos)) { return; } @@ -495,209 +293,89 @@ namespace ts { sourceColumn: sourceLinePos.character, sourceIndex: sourceMapSourceIndex }; - - stopOverridingSpan = false; } - else if (!stopOverridingSpan) { + else { // Take the new pos instead since there is no change in emittedLine and column since last location lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } - updateLastEncodedAndRecordedSpans(); - if (extendedDiagnostics) { performance.mark("afterSourcemap"); performance.measure("Source Map", "beforeSourcemap", "afterSourcemap"); } } - function getStartPosPastDecorators(range: TextRange) { - const rangeHasDecorators = !!(range as Node).decorators; - return skipTrivia(currentSourceText, rangeHasDecorators ? (range as Node).decorators.end : range.pos); - } - /** - * Emits a mapping for the start of a range. + * Emits a node with possible leading and trailing source maps. * - * If the range's start position is synthetic (undefined or a negative value), no mapping - * will be created. Any trivia at the start position in the original source will be - * skipped. - * - * @param range The range to emit.0 + * @param node The node to emit. + * @param emitCallback The callback used to emit the node. */ - function emitStart(range: TextRange): void; - /** - * Emits a mapping for the start of a range. - * - * If the node's start position is synthetic (undefined or a negative value), no mapping - * will be created. Any trivia at the start position in the original source will be - * skipped. - * - * @param range The range to emit. - * @param contextNode The node for the current range. - * @param ignoreNodeCallback A callback used to determine whether to skip source map - * emit for the start position of this node. - * @param ignoreChildrenCallback A callback used to determine whether to skip source - * map emit for all children of this node. - * @param getTextRangeCallbackCallback A callback used to get a custom source map - * range for this node. - */ - function emitStart(range: TextRange, contextNode: Node, ignoreNodeCallback: (node: Node) => boolean, ignoreChildrenCallback: (node: Node) => boolean, getTextRangeCallback: (node: Node) => TextRange): void; - function emitStart(range: TextRange, contextNode?: Node, ignoreNodeCallback?: (node: Node) => boolean, ignoreChildrenCallback?: (node: Node) => boolean, getTextRangeCallback?: (node: Node) => TextRange) { - if (contextNode) { - if (!ignoreNodeCallback(contextNode)) { - range = getTextRangeCallback(contextNode) || range; - emitPos(getStartPosPastDecorators(range)); - } - - if (ignoreChildrenCallback(contextNode)) { - disable(); - } + function emitNodeWithSourceMap(node: Node, emitCallback: (node: Node) => void) { + if (disabled) { + return emitCallback(node); } - else { - emitPos(getStartPosPastDecorators(range)); + + if (node) { + const emitNode = node.emitNode; + const emitFlags = emitNode && emitNode.flags; + const { pos, end } = emitNode && emitNode.sourceMapRange || node; + + if (node.kind !== SyntaxKind.NotEmittedStatement + && (emitFlags & EmitFlags.NoLeadingSourceMap) === 0 + && pos >= 0) { + emitPos(skipTrivia(currentSourceText, pos)); + } + + if (emitFlags & EmitFlags.NoNestedSourceMaps) { + disabled = true; + emitCallback(node); + disabled = false; + } + else { + emitCallback(node); + } + + if (node.kind !== SyntaxKind.NotEmittedStatement + && (emitFlags & EmitFlags.NoTrailingSourceMap) === 0 + && end >= 0) { + emitPos(end); + } } } /** - * Emits a mapping for the end of a range. - * - * If the range's end position is synthetic (undefined or a negative value), no mapping - * will be created. - * - * @param range The range to emit. - */ - function emitEnd(range: TextRange): void; - /** - * Emits a mapping for the end of a range. - * - * If the node's end position is synthetic (undefined or a negative value), no mapping - * will be created. - * - * @param range The range to emit. - * @param contextNode The node for the current range. - * @param ignoreNodeCallback A callback used to determine whether to skip source map - * emit for the end position of this node. - * @param ignoreChildrenCallback A callback used to determine whether to skip source - * map emit for all children of this node. - * @param getTextRangeCallbackCallback A callback used to get a custom source map - * range for this node. - */ - function emitEnd(range: TextRange, contextNode: Node, ignoreNodeCallback: (node: Node) => boolean, ignoreChildrenCallback: (node: Node) => boolean, getTextRangeCallback: (node: Node) => TextRange): void; - function emitEnd(range: TextRange, contextNode?: Node, ignoreNodeCallback?: (node: Node) => boolean, ignoreChildrenCallback?: (node: Node) => boolean, getTextRangeCallback?: (node: Node) => TextRange) { - if (contextNode) { - if (ignoreChildrenCallback(contextNode)) { - enable(); - } - - if (!ignoreNodeCallback(contextNode)) { - range = getTextRangeCallback(contextNode) || range; - emitPos(range.end); - } - } - else { - emitPos(range.end); - } - - stopOverridingSpan = false; - } - - /** - * Emits a mapping for the start position of a token. - * - * If the token's start position is synthetic (undefined or a negative value), no mapping - * will be created. Any trivia at the start position in the original source will be - * skipped. + * Emits a token of a node node with possible leading and trailing source maps. * + * @param node The node containing the token. * @param token The token to emit. - * @param tokenStartPos The start position of the token. - * @returns The start position of the token, following any trivia. + * @param tokenStartPos The start pos of the token. + * @param emitCallback The callback used to emit the token. */ - function emitTokenStart(token: SyntaxKind, tokenStartPos: number): number; - /** - * Emits a mapping for the start position of a token. - * - * If the token's start position is synthetic (undefined or a negative value), no mapping - * will be created. Any trivia at the start position in the original source will be - * skipped. - * - * @param token The token to emit. - * @param tokenStartPos The start position of the token. - * @param contextNode The node containing this token. - * @param ignoreTokenCallback A callback used to determine whether to skip source map - * emit for the start position of this token. - * @param getTokenTextRangeCallback A callback used to get a custom source - * map range for this node. - * @returns The start position of the token, following any trivia. - */ - function emitTokenStart(token: SyntaxKind, tokenStartPos: number, contextNode: Node, ignoreTokenCallback: (node: Node, token: SyntaxKind) => boolean, getTokenTextRangeCallback: (node: Node, token: SyntaxKind) => TextRange): number; - function emitTokenStart(token: SyntaxKind, tokenStartPos: number, contextNode?: Node, ignoreTokenCallback?: (node: Node, token: SyntaxKind) => boolean, getTokenTextRangeCallback?: (node: Node, token: SyntaxKind) => TextRange): number { - if (contextNode) { - if (ignoreTokenCallback(contextNode, token)) { - return skipTrivia(currentSourceText, tokenStartPos); - } - - const range = getTokenTextRangeCallback(contextNode, token); - if (range) { - tokenStartPos = range.pos; - } + function emitTokenWithSourceMap(node: Node, token: SyntaxKind, tokenPos: number, emitCallback: (token: SyntaxKind, tokenStartPos: number) => number) { + if (disabled) { + return emitCallback(token, tokenPos); } - tokenStartPos = skipTrivia(currentSourceText, tokenStartPos); - emitPos(tokenStartPos); - return tokenStartPos; - } + const emitNode = node && node.emitNode; + const emitFlags = emitNode && emitNode.flags; + const range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token]; - /** - * Emits a mapping for the end position of a token. - * - * If the token's end position is synthetic (undefined or a negative value), no mapping - * will be created. - * - * @param token The token to emit. - * @param tokenEndPos The end position of the token. - * @returns The end position of the token. - */ - function emitTokenEnd(token: SyntaxKind, tokenEndPos: number): number; - /** - * Emits a mapping for the end position of a token. - * - * If the token's end position is synthetic (undefined or a negative value), no mapping - * will be created. - * - * @param token The token to emit. - * @param tokenEndPos The end position of the token. - * @param contextNode The node containing this token. - * @param ignoreTokenCallback A callback used to determine whether to skip source map - * emit for the end position of this token. - * @param getTokenTextRangeCallback A callback used to get a custom source - * map range for this node. - * @returns The end position of the token. - */ - function emitTokenEnd(token: SyntaxKind, tokenEndPos: number, contextNode: Node, ignoreTokenCallback: (node: Node, token: SyntaxKind) => boolean, getTokenTextRangeCallback: (node: Node, token: SyntaxKind) => TextRange): number; - function emitTokenEnd(token: SyntaxKind, tokenEndPos: number, contextNode?: Node, ignoreTokenCallback?: (node: Node, token: SyntaxKind) => boolean, getTokenTextRangeCallback?: (node: Node, token: SyntaxKind) => TextRange): number { - if (contextNode) { - if (ignoreTokenCallback(contextNode, token)) { - return tokenEndPos; - } - - const range = getTokenTextRangeCallback(contextNode, token); - if (range) { - tokenEndPos = range.end; - } + tokenPos = skipTrivia(currentSourceText, range ? range.pos : tokenPos); + if ((emitFlags & EmitFlags.NoTokenLeadingSourceMaps) === 0 && tokenPos >= 0) { + emitPos(tokenPos); } - emitPos(tokenEndPos); - return tokenEndPos; - } + tokenPos = emitCallback(token, tokenPos); + if (range) tokenPos = range.end; + if ((emitFlags & EmitFlags.NoTokenTrailingSourceMaps) === 0 && tokenPos >= 0) { + emitPos(tokenPos); + } - // @deprecated - function changeEmitSourcePos() { - Debug.assert(!modifyLastSourcePos); - modifyLastSourcePos = true; + return tokenPos; } /** @@ -706,6 +384,10 @@ namespace ts { * @param sourceFile The source file. */ function setSourceFile(sourceFile: SourceFile) { + if (disabled) { + return; + } + currentSourceFile = sourceFile; currentSourceText = currentSourceFile.text; @@ -738,6 +420,10 @@ namespace ts { * Gets the text for the source map. */ function getText() { + if (disabled) { + return; + } + encodeLastRecordedSourceMapSpan(); return stringify({ @@ -755,6 +441,10 @@ namespace ts { * Gets the SourceMappingURL for the source map. */ function getSourceMappingURL() { + if (disabled) { + return; + } + if (compilerOptions.inlineSourceMap) { // Encode the sourceMap into the sourceMap url const base64SourceMapText = convertToBase64(getText()); @@ -766,61 +456,6 @@ namespace ts { } } - function createSourceMapWriterWithExtendedDiagnostics(host: EmitHost, writer: EmitTextWriter): SourceMapWriter { - const { - initialize, - reset, - getSourceMapData, - setSourceFile, - emitPos, - emitStart, - emitEnd, - emitTokenStart, - emitTokenEnd, - changeEmitSourcePos, - stopOverridingSpan, - getText, - getSourceMappingURL, - } = createSourceMapWriterWorker(host, writer); - return { - initialize, - reset, - getSourceMapData, - setSourceFile, - emitPos(pos: number): void { - performance.mark("sourcemapStart"); - emitPos(pos); - performance.measure("sourceMapTime", "sourcemapStart"); - }, - emitStart(range: TextRange, contextNode?: Node, ignoreNodeCallback?: (node: Node) => boolean, ignoreChildrenCallback?: (node: Node) => boolean, getTextRangeCallback?: (node: Node) => TextRange): void { - performance.mark("emitSourcemap:emitStart"); - emitStart(range, contextNode, ignoreNodeCallback, ignoreChildrenCallback, getTextRangeCallback); - performance.measure("sourceMapTime", "emitSourcemap:emitStart"); - }, - emitEnd(range: TextRange, contextNode?: Node, ignoreNodeCallback?: (node: Node) => boolean, ignoreChildrenCallback?: (node: Node) => boolean, getTextRangeCallback?: (node: Node) => TextRange): void { - performance.mark("emitSourcemap:emitEnd"); - emitEnd(range, contextNode, ignoreNodeCallback, ignoreChildrenCallback, getTextRangeCallback); - performance.measure("sourceMapTime", "emitSourcemap:emitEnd"); - }, - emitTokenStart(token: SyntaxKind, tokenStartPos: number, contextNode?: Node, ignoreTokenCallback?: (node: Node) => boolean, getTokenTextRangeCallback?: (node: Node, token: SyntaxKind) => TextRange): number { - performance.mark("emitSourcemap:emitTokenStart"); - tokenStartPos = emitTokenStart(token, tokenStartPos, contextNode, ignoreTokenCallback, getTokenTextRangeCallback); - performance.measure("sourceMapTime", "emitSourcemap:emitTokenStart"); - return tokenStartPos; - }, - emitTokenEnd(token: SyntaxKind, tokenEndPos: number, contextNode?: Node, ignoreTokenCallback?: (node: Node) => boolean, getTokenTextRangeCallback?: (node: Node, token: SyntaxKind) => TextRange): number { - performance.mark("emitSourcemap:emitTokenEnd"); - tokenEndPos = emitTokenEnd(token, tokenEndPos, contextNode, ignoreTokenCallback, getTokenTextRangeCallback); - performance.measure("sourceMapTime", "emitSourcemap:emitTokenEnd"); - return tokenEndPos; - }, - changeEmitSourcePos, - stopOverridingSpan, - getText, - getSourceMappingURL, - }; - } - const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; function base64FormatEncode(inValue: number) { diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index 8c6fae458f0..5695bea7ae9 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -31,33 +31,21 @@ namespace ts { getSourceFiles(): SourceFile[]; /** - * Determines whether expression substitutions are enabled for the provided node. - */ - isSubstitutionEnabled(node: Node): boolean; - - /** - * Determines whether before/after emit notifications should be raised in the pretty - * printer when it emits a node. - */ - isEmitNotificationEnabled(node: Node): boolean; - - /** - * Hook used by transformers to substitute expressions just before they - * are emitted by the pretty printer. + * Emits the substitute for a node, if one is available; otherwise, emits the node. * * @param node The node to substitute. * @param isExpression A value indicating whether the node is in an expression context. + * @param emitCallback A callback used to emit the node or its substitute. */ - onSubstituteNode(node: Node, isExpression: boolean): Node; + emitNodeWithSubstitution(node: Node, isExpression: boolean, emitCallback: (node: Node) => void): void; /** - * Hook used to allow transformers to capture state before or after - * the printer emits a node. + * Emits a node with possible notification. * * @param node The node to emit. * @param emitCallback A callback used to emit the node. */ - onEmitNode(node: Node, emitCallback: (node: Node) => void): void; + emitNodeWithNotification(node: Node, emitCallback: (node: Node) => void): void; /** * Reset transient transformation properties on parse tree nodes. @@ -302,10 +290,10 @@ namespace ts { hoistFunctionDeclaration, startLexicalEnvironment, endLexicalEnvironment, - onSubstituteNode, + onSubstituteNode: (node, isExpression) => node, enableSubstitution, isSubstitutionEnabled, - onEmitNode, + onEmitNode: (node, emitCallback) => emitCallback(node), enableEmitNotification, isEmitNotificationEnabled }; @@ -321,10 +309,8 @@ namespace ts { return { getSourceFiles: () => transformed, - isSubstitutionEnabled, - isEmitNotificationEnabled, - onSubstituteNode: context.onSubstituteNode, - onEmitNode: context.onEmitNode, + emitNodeWithSubstitution, + emitNodeWithNotification, dispose() { // During transformation we may need to annotate a parse tree node with transient // transformation properties. As parse tree nodes live longer than transformation @@ -362,18 +348,29 @@ namespace ts { * Determines whether expression substitutions are enabled for the provided node. */ function isSubstitutionEnabled(node: Node) { - return (enabledSyntaxKindFeatures[node.kind] & SyntaxKindFeatureFlags.Substitution) !== 0; + return (enabledSyntaxKindFeatures[node.kind] & SyntaxKindFeatureFlags.Substitution) !== 0 + && (getEmitFlags(node) & EmitFlags.NoSubstitution) === 0; } /** - * Default hook for node substitutions. + * Emits a node with possible substitution. * - * @param node The node to substitute. - * @param isExpression A value indicating whether the node is to be used in an expression - * position. + * @param node The node to emit. + * @param isExpression Whether the node represents an expression. + * @param emitCallback The callback used to emit the node or its substitute. */ - function onSubstituteNode(node: Node, isExpression: boolean) { - return node; + function emitNodeWithSubstitution(node: Node, isExpression: boolean, emitCallback: (node: Node) => void) { + if (node) { + if (isSubstitutionEnabled(node)) { + const substitute = context.onSubstituteNode(node, isExpression); + if (substitute && substitute !== node) { + emitCallback(substitute); + return; + } + } + + emitCallback(node); + } } /** @@ -393,13 +390,17 @@ namespace ts { } /** - * Default hook for node emit. - * - * @param node The node to emit. - * @param emit A callback used to emit the node in the printer. + * Emits a node with possible emit notification. */ - function onEmitNode(node: Node, emit: (node: Node) => void) { - emit(node); + function emitNodeWithNotification(node: Node, emitCallback: (node: Node) => void) { + if (node) { + if (isEmitNotificationEnabled(node)) { + context.onEmitNode(node, emitCallback); + } + else { + emitCallback(node); + } + } } /** From bfb8933a9392c17344354487cb1f29c73aa343d3 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 26 Sep 2016 15:21:03 -0700 Subject: [PATCH 34/47] Refactored emit pipeline. --- src/compiler/comments.ts | 35 ++-- src/compiler/emitter.ts | 219 +++++++++++---------- src/compiler/factory.ts | 135 ++++++++++++- src/compiler/sourcemap.ts | 11 +- src/compiler/transformer.ts | 190 +++--------------- src/compiler/transformers/es6.ts | 10 +- src/compiler/transformers/generators.ts | 6 +- src/compiler/transformers/module/module.ts | 12 +- src/compiler/transformers/module/system.ts | 12 +- src/compiler/transformers/ts.ts | 10 +- src/compiler/types.ts | 8 + 11 files changed, 326 insertions(+), 322 deletions(-) diff --git a/src/compiler/comments.ts b/src/compiler/comments.ts index f9f8e74d4ca..116a8e849a3 100644 --- a/src/compiler/comments.ts +++ b/src/compiler/comments.ts @@ -5,7 +5,7 @@ namespace ts { export interface CommentWriter { reset(): void; setSourceFile(sourceFile: SourceFile): void; - emitNodeWithComments(node: Node, emitCallback: (node: Node) => void): void; + emitNodeWithComments(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void; emitBodyWithDetachedComments(node: Node, detachedRange: TextRange, emitCallback: (node: Node) => void): void; emitTrailingCommentsOfPosition(pos: number): void; } @@ -34,9 +34,9 @@ namespace ts { emitTrailingCommentsOfPosition, }; - function emitNodeWithComments(node: Node, emitCallback: (node: Node) => void) { + function emitNodeWithComments(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void) { if (disabled) { - emitCallback(node); + emitCallback(emitContext, node); return; } @@ -46,10 +46,12 @@ namespace ts { if ((pos < 0 && end < 0) || (pos === end)) { // Both pos and end are synthesized, so just emit the node without comments. if (emitFlags & EmitFlags.NoNestedComments) { - disableCommentsAndEmit(node, emitCallback); + disabled = true; + emitCallback(emitContext, node); + disabled = false; } else { - emitCallback(node); + emitCallback(emitContext, node); } } else { @@ -91,10 +93,12 @@ namespace ts { } if (emitFlags & EmitFlags.NoNestedComments) { - disableCommentsAndEmit(node, emitCallback); + disabled = true; + emitCallback(emitContext, node); + disabled = false; } else { - emitCallback(node); + emitCallback(emitContext, node); } if (extendedDiagnostics) { @@ -137,8 +141,10 @@ namespace ts { performance.measure("commentTime", "preEmitBodyWithDetachedComments"); } - if (emitFlags & EmitFlags.NoNestedComments) { - disableCommentsAndEmit(node, emitCallback); + if (emitFlags & EmitFlags.NoNestedComments && !disabled) { + disabled = true; + emitCallback(node); + disabled = false; } else { emitCallback(node); @@ -284,17 +290,6 @@ namespace ts { detachedCommentsInfo = undefined; } - function disableCommentsAndEmit(node: Node, emitCallback: (node: Node) => void): void { - if (disabled) { - emitCallback(node); - } - else { - disabled = true; - emitCallback(node); - disabled = false; - } - } - function hasDetachedComments(pos: number) { return detachedCommentsInfo !== undefined && lastOrUndefined(detachedCommentsInfo).nodePos === pos; } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8457ea41d02..03f785dc7de 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -229,33 +229,27 @@ const _super = (function (geti, seti) { let isOwnFileEmit: boolean; let emitSkipped = false; - performance.mark("beforeTransform"); + const sourceFiles = getSourceFilesToEmit(host, targetSourceFile); // Transform the source files - const transformed = transformFiles( - resolver, - host, - getSourceFilesToEmit(host, targetSourceFile), - transformers); - - performance.measure("transformTime", "beforeTransform"); - - // Extract helpers from the result + performance.mark("beforeTransform"); const { + transformed, emitNodeWithSubstitution, emitNodeWithNotification - } = transformed; - - performance.mark("beforePrint"); + } = transformFiles(resolver, host, sourceFiles, transformers); + performance.measure("transformTime", "beforeTransform"); // Emit each output file - forEachTransformedEmitFile(host, transformed.getSourceFiles(), emitFile); - - // Clean up after transformation - transformed.dispose(); - + performance.mark("beforePrint"); + forEachTransformedEmitFile(host, transformed, emitFile); performance.measure("printTime", "beforePrint"); + // Clean up emit nodes on parse tree + for (const sourceFile of sourceFiles) { + disposeEmitNodes(sourceFile); + } + return { emitSkipped, diagnostics: emitterDiagnostics.getDiagnostics(), @@ -346,111 +340,137 @@ const _super = (function (geti, seti) { currentFileIdentifiers = node.identifiers; sourceMap.setSourceFile(node); comments.setSourceFile(node); - emitNodeWithNotification(node, emitWithSubstitution); + pipelineEmitWithNotification(EmitContext.SourceFile, node); } /** * Emits a node. */ function emit(node: Node) { - emitNodeWithNotification(node, emitWithComments); - } - - /** - * Emits a node with comments. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from emit. - */ - function emitWithComments(node: Node) { - emitNodeWithComments(node, emitWithSourceMap); - } - - /** - * Emits a node with source maps. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from emitWithComments. - */ - function emitWithSourceMap(node: Node) { - emitNodeWithSourceMap(node, emitWithSubstitution); - } - - /** - * Emits a node with possible substitution. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from emitWithSourceMap or - * emitIdentifierNameWithComments. - */ - function emitWithSubstitution(node: Node) { - emitNodeWithSubstitution(node, /*isExpression*/ false, emitWorker); + pipelineEmitWithNotification(EmitContext.Unspecified, node); } /** * Emits an IdentifierName. */ function emitIdentifierName(node: Identifier) { - if (node) { - emitNodeWithNotification(node, emitIdentifierNameWithComments); - } - } - - /** - * Emits an IdentifierName with possible comments. - * - * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from emitIdentifierName. - */ - function emitIdentifierNameWithComments(node: Identifier) { - emitNodeWithComments(node, emitWithSubstitution); + pipelineEmitWithNotification(EmitContext.IdentifierName, node); } /** * Emits an expression node. */ function emitExpression(node: Expression) { - emitNodeWithNotification(node, emitExpressionWithComments); + pipelineEmitWithNotification(EmitContext.Expression, node); } /** - * Emits an expression with comments. + * Emits a node with possible notification. * - * NOTE: Do not call this method directly. It is part of the emitExpression pipeline - * and should only be called indirectly from emitExpression. + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called from printSourceFile, emit, emitExpression, or + * emitIdentifierName. */ - function emitExpressionWithComments(node: Expression) { - emitNodeWithComments(node, emitExpressionWithSourceMap); + function pipelineEmitWithNotification(emitContext: EmitContext, node: Node) { + emitNodeWithNotification(emitContext, node, pipelineEmitWithComments); } /** - * Emits an expression with possible source maps. + * Emits a node with comments. * - * NOTE: Do not call this method directly. It is part of the emitExpression pipeline - * and should only be called indirectly from emitExpressionWithComments. + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from pipelineEmitWithNotification. */ - function emitExpressionWithSourceMap(node: Expression) { - emitNodeWithSourceMap(node, emitExpressionWithSubstitution); + function pipelineEmitWithComments(emitContext: EmitContext, node: Node) { + // Do not emit comments for SourceFile + if (emitContext === EmitContext.SourceFile) { + pipelineEmitWithSourceMap(emitContext, node); + return; + } + + emitNodeWithComments(emitContext, node, pipelineEmitWithSourceMap); } /** - * Emits an expression with possible substitution. + * Emits a node with source maps. * - * NOTE: Do not call this method directly. It is part of the emitExpression pipeline - * and should only be called indirectly from emitExpressionWithSourceMap or - * from emitWorker. + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from pipelineEmitWithComments. */ - function emitExpressionWithSubstitution(node: Expression) { - emitNodeWithSubstitution(node, /*isExpression*/ true, emitExpressionWorker); + function pipelineEmitWithSourceMap(emitContext: EmitContext, node: Node) { + // Do not emit source mappings for SourceFile or IdentifierName + if (emitContext === EmitContext.SourceFile + || emitContext === EmitContext.IdentifierName) { + pipelineEmitWithSubstitution(emitContext, node); + return; + } + + emitNodeWithSourceMap(emitContext, node, pipelineEmitWithSubstitution); + } + + /** + * Emits a node with possible substitution. + * + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from pipelineEmitWithSourceMap or + * pipelineEmitInUnspecifiedContext (when pickign a more specific context). + */ + function pipelineEmitWithSubstitution(emitContext: EmitContext, node: Node) { + emitNodeWithSubstitution(emitContext, node, pipelineEmitForContext); } /** * Emits a node. * * NOTE: Do not call this method directly. It is part of the emit pipeline - * and should only be called indirectly from emitNodeWithSubstitution. + * and should only be called indirectly from pipelineEmitWithSubstitution. */ - function emitWorker(node: Node): void { + function pipelineEmitForContext(emitContext: EmitContext, node: Node): void { + switch (emitContext) { + case EmitContext.SourceFile: return pipelineEmitInSourceFileContext(node); + case EmitContext.IdentifierName: return pipelineEmitInIdentifierNameContext(node); + case EmitContext.Unspecified: return pipelineEmitInUnspecifiedContext(node); + case EmitContext.Expression: return pipelineEmitInExpressionContext(node); + } + } + + /** + * Emits a node in the SourceFile EmitContext. + * + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from pipelineEmitForContext. + */ + function pipelineEmitInSourceFileContext(node: Node): void { + const kind = node.kind; + switch (kind) { + // Top-level nodes + case SyntaxKind.SourceFile: + return emitSourceFile(node); + } + } + + /** + * Emits a node in the IdentifierName EmitContext. + * + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from pipelineEmitForContext. + */ + function pipelineEmitInIdentifierNameContext(node: Node): void { + const kind = node.kind; + switch (kind) { + // Identifiers + case SyntaxKind.Identifier: + return emitIdentifier(node); + } + } + + /** + * Emits a node in the Unspecified EmitContext. + * + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from pipelineEmitForContext. + */ + function pipelineEmitInUnspecifiedContext(node: Node): void { const kind = node.kind; switch (kind) { // Pseudo-literals @@ -486,7 +506,8 @@ const _super = (function (geti, seti) { case SyntaxKind.StringKeyword: case SyntaxKind.SymbolKeyword: case SyntaxKind.GlobalKeyword: - return emitTokenNode(node); + writeTokenText(kind); + return; // Parse tree nodes @@ -691,27 +712,24 @@ const _super = (function (geti, seti) { case SyntaxKind.EnumMember: return emitEnumMember(node); - // Top-level nodes - case SyntaxKind.SourceFile: - return emitSourceFile(node); - // JSDoc nodes (ignored) - // Transformation nodes (ignored) } + // If the node is an expression, try to emit it as an expression with + // substitution. if (isExpression(node)) { - return emitExpressionWithSubstitution(node); + return pipelineEmitWithSubstitution(EmitContext.Expression, node); } } /** - * Emits an expression. + * Emits a node in the Expression EmitContext. * - * NOTE: Do not call this method directly. It is part of the emitExpression pipeline - * and should only be called indirectly from emitExpressionWithNotification. + * NOTE: Do not call this method directly. It is part of the emit pipeline + * and should only be called indirectly from pipelineEmitForContext. */ - function emitExpressionWorker(node: Node) { + function pipelineEmitInExpressionContext(node: Node): void { const kind = node.kind; switch (kind) { // Literals @@ -733,7 +751,8 @@ const _super = (function (geti, seti) { case SyntaxKind.SuperKeyword: case SyntaxKind.TrueKeyword: case SyntaxKind.ThisKeyword: - return emitTokenNode(node); + writeTokenText(kind); + return; // Expressions case SyntaxKind.ArrayLiteralExpression: @@ -2444,15 +2463,7 @@ const _super = (function (geti, seti) { function writeTokenText(token: SyntaxKind, pos?: number) { const tokenString = tokenToString(token); write(tokenString); - return positionIsSynthesized(pos) ? -1 : pos + tokenString.length; - } - - function emitTokenNode(node: Node) { - emitNodeWithSourceMap(node, emitTokenNodeWorker); - } - - function emitTokenNodeWorker(node: Node) { - writeTokenText(node.kind); + return pos < 0 ? pos : pos + tokenString.length; } function increaseIndentIf(value: boolean, valueToWriteWhenNotIndenting?: string) { diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index c0565f6e91d..b6fc2093288 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2665,6 +2665,139 @@ namespace ts { return destRanges; } + /** + * Clears any EmitNode entries from parse-tree nodes. + * @param sourceFile A source file. + */ + export function disposeEmitNodes(sourceFile: SourceFile) { + // During transformation we may need to annotate a parse tree node with transient + // transformation properties. As parse tree nodes live longer than transformation + // nodes, we need to make sure we reclaim any memory allocated for custom ranges + // from these nodes to ensure we do not hold onto entire subtrees just for position + // information. We also need to reset these nodes to a pre-transformation state + // for incremental parsing scenarios so that we do not impact later emit. + sourceFile = getSourceFileOfNode(getParseTreeNode(sourceFile)); + const emitNode = sourceFile && sourceFile.emitNode; + const annotatedNodes = emitNode && emitNode.annotatedNodes; + if (annotatedNodes) { + for (const node of annotatedNodes) { + node.emitNode = undefined; + } + } + } + + /** + * Associates a node with the current transformation, initializing + * various transient transformation properties. + * + * @param node The node. + */ + function getOrCreateEmitNode(node: Node) { + if (!node.emitNode) { + if (isParseTreeNode(node)) { + // To avoid holding onto transformation artifacts, we keep track of any + // parse tree node we are annotating. This allows us to clean them up after + // all transformations have completed. + if (node.kind === SyntaxKind.SourceFile) { + return node.emitNode = { annotatedNodes: [node] }; + } + + const sourceFile = getSourceFileOfNode(node); + getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); + } + + node.emitNode = {}; + } + + return node.emitNode; + } + + /** + * Gets flags that control emit behavior of a node. + * + * @param node The node. + */ + export function getEmitFlags(node: Node) { + const emitNode = node.emitNode; + return emitNode && emitNode.flags; + } + + /** + * Sets flags that control emit behavior of a node. + * + * @param node The node. + * @param emitFlags The NodeEmitFlags for the node. + */ + export function setEmitFlags(node: T, emitFlags: EmitFlags) { + getOrCreateEmitNode(node).flags = emitFlags; + return node; + } + + /** + * Sets a custom text range to use when emitting source maps. + * + * @param node The node. + * @param range The text range. + */ + export function setSourceMapRange(node: T, range: TextRange) { + getOrCreateEmitNode(node).sourceMapRange = range; + return node; + } + + /** + * Sets the TextRange to use for source maps for a token of a node. + * + * @param node The node. + * @param token The token. + * @param range The text range. + */ + export function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange) { + const emitNode = getOrCreateEmitNode(node); + const tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = createMap()); + tokenSourceMapRanges[token] = range; + return node; + } + + /** + * Sets a custom text range to use when emitting comments. + */ + export function setCommentRange(node: T, range: TextRange) { + getOrCreateEmitNode(node).commentRange = range; + return node; + } + + /** + * Gets a custom text range to use when emitting comments. + * + * @param node The node. + */ + export function getCommentRange(node: Node) { + const emitNode = node.emitNode; + return (emitNode && emitNode.commentRange) || node; + } + + /** + * Gets a custom text range to use when emitting source maps. + * + * @param node The node. + */ + export function getSourceMapRange(node: Node) { + const emitNode = node.emitNode; + return (emitNode && emitNode.sourceMapRange) || node; + } + + /** + * Gets the TextRange to use for source maps for a token of a node. + * + * @param node The node. + * @param token The token. + */ + export function getTokenSourceMapRange(node: Node, token: SyntaxKind) { + const emitNode = node.emitNode; + const tokenSourceMapRanges = emitNode && emitNode.tokenSourceMapRanges; + return tokenSourceMapRanges && tokenSourceMapRanges[token]; + } + export function setTextRange(node: T, location: TextRange): T { if (location) { node.pos = location.pos; @@ -2706,7 +2839,7 @@ namespace ts { return undefined; } - /** + /** * Get the name of a target module from an import/export declaration as should be written in the emitted output. * The emitted output name can be different from the input if: * 1. The module has a /// diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 3517c54b407..d6e6501c598 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -38,10 +38,11 @@ namespace ts { /** * Emits a node with possible leading and trailing source maps. * + * @param emitContext The current emit context * @param node The node to emit. * @param emitCallback The callback used to emit the node. */ - emitNodeWithSourceMap(node: Node, emitCallback: (node: Node) => void): void; + emitNodeWithSourceMap(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void; /** * Emits a token of a node node with possible leading and trailing source maps. @@ -313,9 +314,9 @@ namespace ts { * @param node The node to emit. * @param emitCallback The callback used to emit the node. */ - function emitNodeWithSourceMap(node: Node, emitCallback: (node: Node) => void) { + function emitNodeWithSourceMap(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void) { if (disabled) { - return emitCallback(node); + return emitCallback(emitContext, node); } if (node) { @@ -331,11 +332,11 @@ namespace ts { if (emitFlags & EmitFlags.NoNestedSourceMaps) { disabled = true; - emitCallback(node); + emitCallback(emitContext, node); disabled = false; } else { - emitCallback(node); + emitCallback(emitContext, node); } if (node.kind !== SyntaxKind.NotEmittedStatement diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index 5695bea7ae9..92407af2bb9 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -28,29 +28,25 @@ namespace ts { /** * Gets the transformed source files. */ - getSourceFiles(): SourceFile[]; + transformed: SourceFile[]; /** * Emits the substitute for a node, if one is available; otherwise, emits the node. * + * @param emitContext The current emit context. * @param node The node to substitute. - * @param isExpression A value indicating whether the node is in an expression context. * @param emitCallback A callback used to emit the node or its substitute. */ - emitNodeWithSubstitution(node: Node, isExpression: boolean, emitCallback: (node: Node) => void): void; + emitNodeWithSubstitution(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void; /** * Emits a node with possible notification. * + * @param emitContext The current emit context. * @param node The node to emit. * @param emitCallback A callback used to emit the node. */ - emitNodeWithNotification(node: Node, emitCallback: (node: Node) => void): void; - - /** - * Reset transient transformation properties on parse tree nodes. - */ - dispose(): void; + emitNodeWithNotification(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void; } export interface TransformationContext extends LexicalEnvironment { @@ -82,7 +78,7 @@ namespace ts { * Hook used by transformers to substitute expressions just before they * are emitted by the pretty printer. */ - onSubstituteNode?: (node: Node, isExpression: boolean) => Node; + onSubstituteNode?: (emitContext: EmitContext, node: Node) => Node; /** * Enables before/after emit notifications in the pretty printer for the provided @@ -100,7 +96,7 @@ namespace ts { * Hook used to allow transformers to capture state before or after * the printer emits a node. */ - onEmitNode?: (node: Node, emit: (node: Node) => void) => void; + onEmitNode?: (emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void) => void; } /* @internal */ @@ -129,139 +125,6 @@ namespace ts { return transformers; } - /** - * Clears any EmitNode entries from parse-tree nodes. - * @param sourceFile A source file. - */ - export function disposeEmitNodes(sourceFile: SourceFile) { - // During transformation we may need to annotate a parse tree node with transient - // transformation properties. As parse tree nodes live longer than transformation - // nodes, we need to make sure we reclaim any memory allocated for custom ranges - // from these nodes to ensure we do not hold onto entire subtrees just for position - // information. We also need to reset these nodes to a pre-transformation state - // for incremental parsing scenarios so that we do not impact later emit. - sourceFile = getSourceFileOfNode(getParseTreeNode(sourceFile)); - const emitNode = sourceFile && sourceFile.emitNode; - const annotatedNodes = emitNode && emitNode.annotatedNodes; - if (annotatedNodes) { - for (const node of annotatedNodes) { - node.emitNode = undefined; - } - } - } - - /** - * Associates a node with the current transformation, initializing - * various transient transformation properties. - * - * @param node The node. - */ - function getOrCreateEmitNode(node: Node) { - if (!node.emitNode) { - if (isParseTreeNode(node)) { - // To avoid holding onto transformation artifacts, we keep track of any - // parse tree node we are annotating. This allows us to clean them up after - // all transformations have completed. - if (node.kind === SyntaxKind.SourceFile) { - return node.emitNode = { annotatedNodes: [node] }; - } - - const sourceFile = getSourceFileOfNode(node); - getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); - } - - node.emitNode = {}; - } - - return node.emitNode; - } - - /** - * Gets flags that control emit behavior of a node. - * - * @param node The node. - */ - export function getEmitFlags(node: Node) { - const emitNode = node.emitNode; - return emitNode && emitNode.flags; - } - - /** - * Sets flags that control emit behavior of a node. - * - * @param node The node. - * @param emitFlags The NodeEmitFlags for the node. - */ - export function setEmitFlags(node: T, emitFlags: EmitFlags) { - getOrCreateEmitNode(node).flags = emitFlags; - return node; - } - - /** - * Sets a custom text range to use when emitting source maps. - * - * @param node The node. - * @param range The text range. - */ - export function setSourceMapRange(node: T, range: TextRange) { - getOrCreateEmitNode(node).sourceMapRange = range; - return node; - } - - /** - * Sets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. - * @param range The text range. - */ - export function setTokenSourceMapRange(node: T, token: SyntaxKind, range: TextRange) { - const emitNode = getOrCreateEmitNode(node); - const tokenSourceMapRanges = emitNode.tokenSourceMapRanges || (emitNode.tokenSourceMapRanges = createMap()); - tokenSourceMapRanges[token] = range; - return node; - } - - /** - * Sets a custom text range to use when emitting comments. - */ - export function setCommentRange(node: T, range: TextRange) { - getOrCreateEmitNode(node).commentRange = range; - return node; - } - - /** - * Gets a custom text range to use when emitting comments. - * - * @param node The node. - */ - export function getCommentRange(node: Node) { - const emitNode = node.emitNode; - return (emitNode && emitNode.commentRange) || node; - } - - /** - * Gets a custom text range to use when emitting source maps. - * - * @param node The node. - */ - export function getSourceMapRange(node: Node) { - const emitNode = node.emitNode; - return (emitNode && emitNode.sourceMapRange) || node; - } - - /** - * Gets the TextRange to use for source maps for a token of a node. - * - * @param node The node. - * @param token The token. - */ - export function getTokenSourceMapRange(node: Node, token: SyntaxKind) { - const emitNode = node.emitNode; - const tokenSourceMapRanges = emitNode && emitNode.tokenSourceMapRanges; - return tokenSourceMapRanges && tokenSourceMapRanges[token]; - } - /** * Transforms an array of SourceFiles by passing them through each transformer. * @@ -290,10 +153,10 @@ namespace ts { hoistFunctionDeclaration, startLexicalEnvironment, endLexicalEnvironment, - onSubstituteNode: (node, isExpression) => node, + onSubstituteNode: (emitContext, node) => node, enableSubstitution, isSubstitutionEnabled, - onEmitNode: (node, emitCallback) => emitCallback(node), + onEmitNode: (node, emitContext, emitCallback) => emitCallback(node, emitContext), enableEmitNotification, isEmitNotificationEnabled }; @@ -308,20 +171,9 @@ namespace ts { lexicalEnvironmentDisabled = true; return { - getSourceFiles: () => transformed, + transformed, emitNodeWithSubstitution, - emitNodeWithNotification, - dispose() { - // During transformation we may need to annotate a parse tree node with transient - // transformation properties. As parse tree nodes live longer than transformation - // nodes, we need to make sure we reclaim any memory allocated for custom ranges - // from these nodes to ensure we do not hold onto entire subtrees just for position - // information. We also need to reset these nodes to a pre-transformation state - // for incremental parsing scenarios so that we do not impact later emit. - for (const sourceFile of sourceFiles) { - disposeEmitNodes(sourceFile); - } - } + emitNodeWithNotification }; /** @@ -355,21 +207,21 @@ namespace ts { /** * Emits a node with possible substitution. * + * @param emitContext The current emit context. * @param node The node to emit. - * @param isExpression Whether the node represents an expression. * @param emitCallback The callback used to emit the node or its substitute. */ - function emitNodeWithSubstitution(node: Node, isExpression: boolean, emitCallback: (node: Node) => void) { + function emitNodeWithSubstitution(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void) { if (node) { if (isSubstitutionEnabled(node)) { - const substitute = context.onSubstituteNode(node, isExpression); + const substitute = context.onSubstituteNode(emitContext, node); if (substitute && substitute !== node) { - emitCallback(substitute); + emitCallback(emitContext, substitute); return; } } - emitCallback(node); + emitCallback(emitContext, node); } } @@ -391,14 +243,18 @@ namespace ts { /** * Emits a node with possible emit notification. + * + * @param emitContext The current emit context. + * @param node The node to emit. + * @param emitCallback The callback used to emit the node. */ - function emitNodeWithNotification(node: Node, emitCallback: (node: Node) => void) { + function emitNodeWithNotification(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void) { if (node) { if (isEmitNotificationEnabled(node)) { - context.onEmitNode(node, emitCallback); + context.onEmitNode(emitContext, node, emitCallback); } else { - emitCallback(node); + emitCallback(emitContext, node); } } } diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index eda0d03c704..589478f1f6f 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -2852,7 +2852,7 @@ namespace ts { * * @param node The node to be printed. */ - function onEmitNode(node: Node, emit: (node: Node) => void) { + function onEmitNode(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void) { const savedUseCapturedThis = useCapturedThis; if (enabledSubstitutions & ES6SubstitutionFlags.CapturedThis && isFunctionLike(node)) { @@ -2861,7 +2861,7 @@ namespace ts { useCapturedThis = (getEmitFlags(node) & EmitFlags.CapturesThis) !== 0; } - previousOnEmitNode(node, emit); + previousOnEmitNode(emitContext, node, emitCallback); useCapturedThis = savedUseCapturedThis; } @@ -2902,10 +2902,10 @@ namespace ts { * @param isExpression A value indicating whether the node is to be used in an expression * position. */ - function onSubstituteNode(node: Node, isExpression: boolean) { - node = previousOnSubstituteNode(node, isExpression); + function onSubstituteNode(emitContext: EmitContext, node: Node) { + node = previousOnSubstituteNode(emitContext, node); - if (isExpression) { + if (emitContext === EmitContext.Expression) { return substituteExpression(node); } diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts index d6a30a81d61..58c18fdbc5d 100644 --- a/src/compiler/transformers/generators.ts +++ b/src/compiler/transformers/generators.ts @@ -1883,9 +1883,9 @@ namespace ts { return -1; } - function onSubstituteNode(node: Node, isExpression: boolean): Node { - node = previousOnSubstituteNode(node, isExpression); - if (isExpression) { + function onSubstituteNode(emitContext: EmitContext, node: Node): Node { + node = previousOnSubstituteNode(emitContext, node); + if (emitContext === EmitContext.Expression) { return substituteExpression(node); } return node; diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 286ef967288..8bcf8f5fb25 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -822,14 +822,14 @@ namespace ts { return node.name ? getSynthesizedClone(node.name) : getGeneratedNameForNode(node); } - function onEmitNode(node: Node, emit: (node: Node) => void): void { + function onEmitNode(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void { if (node.kind === SyntaxKind.SourceFile) { bindingNameExportSpecifiersMap = bindingNameExportSpecifiersForFileMap[getOriginalNodeId(node)]; - previousOnEmitNode(node, emit); + previousOnEmitNode(emitContext, node, emitCallback); bindingNameExportSpecifiersMap = undefined; } else { - previousOnEmitNode(node, emit); + previousOnEmitNode(emitContext, node, emitCallback); } } @@ -840,9 +840,9 @@ namespace ts { * @param isExpression A value indicating whether the node is to be used in an expression * position. */ - function onSubstituteNode(node: Node, isExpression: boolean) { - node = previousOnSubstituteNode(node, isExpression); - if (isExpression) { + function onSubstituteNode(emitContext: EmitContext, node: Node) { + node = previousOnSubstituteNode(emitContext, node); + if (emitContext === EmitContext.Expression) { return substituteExpression(node); } else if (isShorthandPropertyAssignment(node)) { diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index 2a14f341272..7e5b36d239c 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -986,14 +986,14 @@ namespace ts { // Substitutions // - function onEmitNode(node: Node, emit: (node: Node) => void): void { + function onEmitNode(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void { if (node.kind === SyntaxKind.SourceFile) { exportFunctionForFile = exportFunctionForFileMap[getOriginalNodeId(node)]; - previousOnEmitNode(node, emit); + previousOnEmitNode(emitContext, node, emitCallback); exportFunctionForFile = undefined; } else { - previousOnEmitNode(node, emit); + previousOnEmitNode(emitContext, node, emitCallback); } } @@ -1004,9 +1004,9 @@ namespace ts { * @param isExpression A value indicating whether the node is to be used in an expression * position. */ - function onSubstituteNode(node: Node, isExpression: boolean) { - node = previousOnSubstituteNode(node, isExpression); - if (isExpression) { + function onSubstituteNode(emitContext: EmitContext, node: Node) { + node = previousOnSubstituteNode(emitContext, node); + if (emitContext === EmitContext.Expression) { return substituteExpression(node); } diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index e1892ff5bf4..225ab130d62 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -3231,7 +3231,7 @@ namespace ts { * @param node The node to emit. * @param emit A callback used to emit the node in the printer. */ - function onEmitNode(node: Node, emit: (node: Node) => void): void { + function onEmitNode(emitContext: EmitContext, node: Node, emitCallback: (emitContext: EmitContext, node: Node) => void): void { const savedApplicableSubstitutions = applicableSubstitutions; const savedCurrentSuperContainer = currentSuperContainer; // If we need to support substitutions for `super` in an async method, @@ -3248,7 +3248,7 @@ namespace ts { applicableSubstitutions |= TypeScriptSubstitutionFlags.NonQualifiedEnumMembers; } - previousOnEmitNode(node, emit); + previousOnEmitNode(emitContext, node, emitCallback); applicableSubstitutions = savedApplicableSubstitutions; currentSuperContainer = savedCurrentSuperContainer; @@ -3261,9 +3261,9 @@ namespace ts { * @param isExpression A value indicating whether the node is to be used in an expression * position. */ - function onSubstituteNode(node: Node, isExpression: boolean) { - node = previousOnSubstituteNode(node, isExpression); - if (isExpression) { + function onSubstituteNode(emitContext: EmitContext, node: Node) { + node = previousOnSubstituteNode(emitContext, node); + if (emitContext === EmitContext.Expression) { return substituteExpression(node); } else if (isShorthandPropertyAssignment(node)) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c18ebdd7200..74e7e741be8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3189,6 +3189,14 @@ namespace ts { CustomPrologue = 1 << 23, // Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed). } + /* @internal */ + export const enum EmitContext { + SourceFile, // Emitting a SourceFile + Expression, // Emitting an Expression + IdentifierName, // Emitting an IdentifierName + Unspecified, // Emitting an otherwise unspecified node + } + /** Additional context provided to `visitEachChild` */ /* @internal */ export interface LexicalEnvironment { From 21c10af13c1297e55a19c49d7dc12cef3d89ecd6 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 26 Sep 2016 17:53:46 -0700 Subject: [PATCH 35/47] Moved constant value emit to ts transform. --- src/compiler/emitter.ts | 46 +++------------ src/compiler/factory.ts | 14 +++++ src/compiler/transformers/ts.ts | 58 ++++++++++++++----- src/compiler/types.ts | 2 + .../constEnumToStringWithComments.js | 16 ++--- 5 files changed, 76 insertions(+), 60 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 03f785dc7de..6ad91069033 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1143,10 +1143,6 @@ const _super = (function (geti, seti) { } function emitPropertyAccessExpression(node: PropertyAccessExpression) { - if (tryEmitConstantValue(node)) { - return; - } - let indentBeforeDot = false; let indentAfterDot = false; if (!(getEmitFlags(node) & EmitFlags.NoIndentation)) { @@ -1156,11 +1152,13 @@ const _super = (function (geti, seti) { indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } - const shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); emitExpression(node.expression); increaseIndentIf(indentBeforeDot); + + const shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); write(shouldEmitDotDot ? ".." : "."); + increaseIndentIf(indentAfterDot); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -1176,17 +1174,15 @@ const _super = (function (geti, seti) { } else { // check if constant enum value is integer - const constantValue = tryGetConstEnumValue(expression); + const constantValue = getConstantValue(expression); // isFinite handles cases when constantValue is undefined - return isFinite(constantValue) && Math.floor(constantValue) === constantValue; + return isFinite(constantValue) + && Math.floor(constantValue) === constantValue + && compilerOptions.removeComments; } } function emitElementAccessExpression(node: ElementAccessExpression) { - if (tryEmitConstantValue(node)) { - return; - } - emitExpression(node.expression); write("["); emitExpression(node.argumentExpression); @@ -2260,24 +2256,6 @@ const _super = (function (geti, seti) { } } - // TODO(rbuckton): Move this into a transformer - function tryEmitConstantValue(node: PropertyAccessExpression | ElementAccessExpression): boolean { - const constantValue = tryGetConstEnumValue(node); - if (constantValue !== undefined) { - write(String(constantValue)); - if (!compilerOptions.removeComments) { - const propertyName = isPropertyAccessExpression(node) - ? declarationNameToString(node.name) - : getTextOfNode(node.argumentExpression); - write(` /* ${propertyName} */`); - } - - return true; - } - - return false; - } - function emitEmbeddedStatement(node: Statement) { if (isBlock(node)) { write(" "); @@ -2628,16 +2606,6 @@ const _super = (function (geti, seti) { return getLiteralText(node, currentSourceFile, languageVersion); } - function tryGetConstEnumValue(node: Node): number { - if (compilerOptions.isolatedModules) { - return undefined; - } - - return isPropertyAccessExpression(node) || isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; - } - function isSingleLineEmptyBlock(block: Block) { return !block.multiLine && block.statements.length === 0 diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index b6fc2093288..75655d8cff8 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2798,6 +2798,20 @@ namespace ts { return tokenSourceMapRanges && tokenSourceMapRanges[token]; } + export function getConstantValue(node: Node) { + const emitNode = node.emitNode; + if (emitNode && emitNode.flags & EmitFlags.ConstantValue) { + return emitNode.constantValue; + } + } + + export function setConstantValue(node: Node, value: number) { + const emitNode = getOrCreateEmitNode(node); + emitNode.constantValue = value; + emitNode.flags |= EmitFlags.ConstantValue; + return node; + } + export function setTextRange(node: T, location: TextRange): T { if (location) { node.pos = location.pos; diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 225ab130d62..2a33ecc0e37 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -42,6 +42,10 @@ namespace ts { context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; + // Enable substitution for property/element access to emit const enum values. + context.enableSubstitution(SyntaxKind.PropertyAccessExpression); + context.enableSubstitution(SyntaxKind.ElementAccessExpression); + // These variables contain state that changes as we descend into the tree. let currentSourceFile: SourceFile; let currentNamespace: ModuleDeclaration; @@ -3294,17 +3298,15 @@ namespace ts { switch (node.kind) { case SyntaxKind.Identifier: return substituteExpressionIdentifier(node); - } - - if (enabledSubstitutions & TypeScriptSubstitutionFlags.AsyncMethodsWithSuper) { - switch (node.kind) { - case SyntaxKind.CallExpression: + case SyntaxKind.PropertyAccessExpression: + return substitutePropertyAccessExpression(node); + case SyntaxKind.ElementAccessExpression: + return substituteElementAccessExpression(node); + case SyntaxKind.CallExpression: + if (enabledSubstitutions & TypeScriptSubstitutionFlags.AsyncMethodsWithSuper) { return substituteCallExpression(node); - case SyntaxKind.PropertyAccessExpression: - return substitutePropertyAccessExpression(node); - case SyntaxKind.ElementAccessExpression: - return substituteElementAccessExpression(node); - } + } + break; } return node; @@ -3381,7 +3383,7 @@ namespace ts { } function substitutePropertyAccessExpression(node: PropertyAccessExpression) { - if (node.expression.kind === SyntaxKind.SuperKeyword) { + if (enabledSubstitutions & TypeScriptSubstitutionFlags.AsyncMethodsWithSuper && node.expression.kind === SyntaxKind.SuperKeyword) { const flags = getSuperContainerAsyncMethodFlags(); if (flags) { return createSuperAccessInAsyncMethod( @@ -3392,11 +3394,11 @@ namespace ts { } } - return node; + return substituteConstantValue(node); } function substituteElementAccessExpression(node: ElementAccessExpression) { - if (node.expression.kind === SyntaxKind.SuperKeyword) { + if (enabledSubstitutions & TypeScriptSubstitutionFlags.AsyncMethodsWithSuper && node.expression.kind === SyntaxKind.SuperKeyword) { const flags = getSuperContainerAsyncMethodFlags(); if (flags) { return createSuperAccessInAsyncMethod( @@ -3407,9 +3409,39 @@ namespace ts { } } + return substituteConstantValue(node); + } + + function substituteConstantValue(node: PropertyAccessExpression | ElementAccessExpression): LeftHandSideExpression { + const constantValue = tryGetConstEnumValue(node); + if (constantValue !== undefined) { + const substitute = createLiteral(constantValue); + setSourceMapRange(substitute, node); + setCommentRange(substitute, node); + if (!compilerOptions.removeComments) { + const propertyName = isPropertyAccessExpression(node) + ? declarationNameToString(node.name) + : getTextOfNode(node.argumentExpression); + substitute.trailingComment = ` ${propertyName} `; + } + + setConstantValue(node, constantValue); + return substitute; + } + return node; } + function tryGetConstEnumValue(node: Node): number { + if (compilerOptions.isolatedModules) { + return undefined; + } + + return isPropertyAccessExpression(node) || isElementAccessExpression(node) + ? resolver.getConstantValue(node) + : undefined; + } + function createSuperAccessInAsyncMethod(argumentExpression: Expression, flags: NodeCheckFlags, location: TextRange): LeftHandSideExpression { if (flags & NodeCheckFlags.AsyncMethodWithSuperBinding) { return createPropertyAccess( diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 74e7e741be8..e8a521ef3ff 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3156,6 +3156,7 @@ namespace ts { sourceMapRange?: TextRange; tokenSourceMapRanges?: Map; annotatedNodes?: Node[]; // Tracks Parse-tree nodes with EmitNodes for eventual cleanup. + constantValue?: number; } /* @internal */ @@ -3187,6 +3188,7 @@ namespace ts { AsyncFunctionBody = 1 << 21, ReuseTempVariableScope = 1 << 22, // Reuse the existing temp variable scope during emit. CustomPrologue = 1 << 23, // Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed). + ConstantValue = 1 << 24, // The node was replaced with a constant value during substitution. } /* @internal */ diff --git a/tests/baselines/reference/constEnumToStringWithComments.js b/tests/baselines/reference/constEnumToStringWithComments.js index c01e75cb923..f0fbc866385 100644 --- a/tests/baselines/reference/constEnumToStringWithComments.js +++ b/tests/baselines/reference/constEnumToStringWithComments.js @@ -23,15 +23,15 @@ let c1 = Foo["C"].toString(); //// [constEnumToStringWithComments.js] -var x0 = 100 /* X */..toString(); -var x1 = 100 /* "X" */..toString(); +var x0 = 100 /* X */.toString(); +var x1 = 100 /* "X" */.toString(); var y0 = 0.5 /* Y */.toString(); var y1 = 0.5 /* "Y" */.toString(); -var z0 = 2 /* Z */..toString(); -var z1 = 2 /* "Z" */..toString(); -var a0 = -1 /* A */..toString(); -var a1 = -1 /* "A" */..toString(); +var z0 = 2 /* Z */.toString(); +var z1 = 2 /* "Z" */.toString(); +var a0 = -1 /* A */.toString(); +var a1 = -1 /* "A" */.toString(); var b0 = -1.5 /* B */.toString(); var b1 = -1.5 /* "B" */.toString(); -var c0 = -1 /* C */..toString(); -var c1 = -1 /* "C" */..toString(); +var c0 = -1 /* C */.toString(); +var c1 = -1 /* "C" */.toString(); From 4a5830dd0c3e4d2d2e7cb350233d198ad7acd741 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 11:44:11 -0700 Subject: [PATCH 36/47] Remove usage of 'useCapturedThis'. --- src/compiler/transformers/es6.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 995b04c74da..2f529a09f9b 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -783,8 +783,6 @@ namespace ts { function addConstructor(statements: Statement[], node: ClassExpression | ClassDeclaration, extendsClauseElement: ExpressionWithTypeArguments): void { const constructor = getFirstConstructorWithBody(node); const hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); - const savedUseCapturedThis = useCapturedThis; - useCapturedThis = true; const constructorFunction = createFunctionDeclaration( @@ -802,7 +800,6 @@ namespace ts { if (extendsClauseElement) { setNodeEmitFlags(constructorFunction, NodeEmitFlags.CapturesThis); } - useCapturedThis = savedUseCapturedThis; statements.push(constructorFunction); } From c668644e0b77e5843cdaed982a9d2d8340e1a5d8 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 14:09:26 -0700 Subject: [PATCH 37/47] Collapse 'super()' capture/returns into a single return statement for generated 'super()' calls. --- src/compiler/transformers/es6.ts | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 2f529a09f9b..ed5659e8a3f 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -837,7 +837,7 @@ namespace ts { startLexicalEnvironment(); let statementOffset = -1; - let thisCaptureStatus = SuperCaptureResult.NoReplacement; + let superCaptureStatus = SuperCaptureResult.NoReplacement; if (hasSynthesizedSuper) { // If a super call has already been synthesized, // we're going to assume that we should just transform everything after that. @@ -854,13 +854,17 @@ namespace ts { addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); - thisCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, statementOffset); - if (thisCaptureStatus === SuperCaptureResult.ReplaceSuperCapture || thisCaptureStatus === SuperCaptureResult.ReplaceWithReturn) { - statementOffset++; - } + superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, statementOffset); } - addDefaultSuperCallIfNeeded(statements, constructor, extendsClauseElement, hasSynthesizedSuper); + if (superCaptureStatus === SuperCaptureResult.NoReplacement) { + superCaptureStatus = addDefaultSuperCallIfNeeded(statements, constructor, extendsClauseElement, hasSynthesizedSuper); + } + + // The last statement expression was replaced. Skip it. + if (superCaptureStatus === SuperCaptureResult.ReplaceSuperCapture || superCaptureStatus === SuperCaptureResult.ReplaceWithReturn) { + statementOffset++; + } if (constructor) { const body = saveStateAndInvoke(constructor, makeTransformerForConstructorBodyAtOffset(statementOffset)); @@ -870,7 +874,7 @@ namespace ts { // 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 - && thisCaptureStatus !== SuperCaptureResult.ReplaceWithReturn + && superCaptureStatus !== SuperCaptureResult.ReplaceWithReturn && !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) { statements.push( createReturn( @@ -955,6 +959,16 @@ namespace ts { ); const superReturnValueOrThis = createLogicalOr(superCall, actualThis); + if (!constructor) { + // We must be here because the user didn't write a constructor + // but we needed to call 'super()' anyway - but if that's the case, + // we can just immediately return the result of a 'super()' call. + statements.push(createReturn(superReturnValueOrThis)); + return SuperCaptureResult.ReplaceWithReturn; + } + + // The constructor was generated for some reason. + // Create a captured '_this' variable. statements.push( createVariableStatement( /*modifiers*/ undefined, @@ -969,7 +983,11 @@ namespace ts { ); enableSubstitutionsForCapturedThis(); + + return SuperCaptureResult.ReplaceSuperCapture; } + + return SuperCaptureResult.NoReplacement; } /** From 1fbdb862027ed63828adb1c71bfc08a604bc1201 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 14:43:55 -0700 Subject: [PATCH 38/47] Accepted baselines. --- ...sClassHeritageListMemberTypeAnnotations.js | 3 +- ...accessibleTypeInTypeParameterConstraint.js | 3 +- .../reference/abstractClassInLocalScope.js | 3 +- .../abstractClassInLocalScopeIsAbstract.js | 3 +- .../reference/abstractPropertyNegative.js | 3 +- .../accessors_spec_section-4.5_inference.js | 3 +- .../reference/aliasUsageInAccessorsOfClass.js | 3 +- .../baselines/reference/aliasUsageInArray.js | 3 +- .../aliasUsageInFunctionExpression.js | 3 +- .../reference/aliasUsageInGenericFunction.js | 3 +- .../reference/aliasUsageInIndexerOfClass.js | 3 +- .../reference/aliasUsageInObjectLiteral.js | 3 +- .../reference/aliasUsageInOrExpression.js | 3 +- ...aliasUsageInTypeArgumentOfExtendsClause.js | 3 +- .../reference/aliasUsageInVarAssignment.js | 3 +- .../reference/ambiguousOverloadResolution.js | 3 +- .../reference/apparentTypeSubtyping.js | 6 +- .../reference/apparentTypeSupertype.js | 3 +- .../reference/arrayAssignmentTest1.js | 3 +- .../reference/arrayAssignmentTest2.js | 3 +- .../reference/arrayBestCommonTypes.js | 6 +- .../reference/arrayLiteralTypeInference.js | 6 +- tests/baselines/reference/arrayLiterals.js | 6 +- .../arrayLiteralsWithRecursiveGenerics.js | 3 +- ...rayOfSubtypeIsAssignableToReadonlyArray.js | 6 +- .../assignmentCompatWithCallSignatures3.js | 9 +- .../assignmentCompatWithCallSignatures4.js | 9 +- .../assignmentCompatWithCallSignatures5.js | 9 +- .../assignmentCompatWithCallSignatures6.js | 9 +- ...ssignmentCompatWithConstructSignatures3.js | 9 +- ...ssignmentCompatWithConstructSignatures4.js | 9 +- ...ssignmentCompatWithConstructSignatures5.js | 9 +- ...ssignmentCompatWithConstructSignatures6.js | 9 +- .../assignmentCompatWithNumericIndexer.js | 3 +- .../assignmentCompatWithNumericIndexer3.js | 3 +- .../assignmentCompatWithObjectMembers4.js | 12 +- ...nmentCompatWithObjectMembersOptionality.js | 6 +- ...mentCompatWithObjectMembersOptionality2.js | 6 +- .../assignmentCompatWithStringIndexer.js | 6 +- .../reference/asyncImportedPromise_es5.js | 3 +- .../reference/asyncMethodWithSuper_es5.js | 3 +- .../reference/asyncQualifiedReturnType_es5.js | 3 +- .../reference/awaitClassExpression_es5.js | 3 +- .../reference/baseIndexSignatureResolution.js | 3 +- .../reference/baseTypeOrderChecking.js | 6 +- .../baseTypeWrappingInstantiationChain.js | 6 +- .../bestCommonTypeOfConditionalExpressions.js | 6 +- ...bestCommonTypeOfConditionalExpressions2.js | 6 +- .../reference/bestCommonTypeOfTuple2.js | 3 +- ...allSignatureAssignabilityInInheritance2.js | 9 +- ...allSignatureAssignabilityInInheritance3.js | 9 +- ...allSignatureAssignabilityInInheritance4.js | 9 +- ...allSignatureAssignabilityInInheritance5.js | 9 +- ...allSignatureAssignabilityInInheritance6.js | 9 +- tests/baselines/reference/castingTuple.js | 6 +- .../baselines/reference/chainedAssignment3.js | 3 +- ...arameterConstrainedToOtherTypeParameter.js | 6 +- .../reference/circularImportAlias.js | 3 +- .../circularTypeofWithFunctionModule.js | 3 +- .../classAbstractConstructorAssignability.js | 6 +- .../reference/classAbstractCrashedOnce.js | 3 +- .../reference/classAbstractExtends.js | 12 +- .../reference/classAbstractFactoryFunction.js | 3 +- .../reference/classAbstractGeneric.js | 18 +-- .../reference/classAbstractInAModule.js | 3 +- .../reference/classAbstractInheritance.js | 24 +-- .../reference/classAbstractInstantiations1.js | 6 +- .../reference/classAbstractInstantiations2.js | 12 +- .../classAbstractOverrideWithAbstract.js | 12 +- .../reference/classAbstractSuperCalls.js | 9 +- .../classAbstractUsingAbstractMethod1.js | 6 +- .../classAbstractUsingAbstractMethods2.js | 21 +-- .../classConstructorAccessibility4.js | 6 +- .../classConstructorAccessibility5.js | 3 +- ...clarationMergedInModuleWithContinuation.js | 3 +- .../classDoesNotDependOnBaseTypes.js | 3 +- tests/baselines/reference/classExpression2.js | 3 +- .../classExpressionExtendingAbstractClass.js | 3 +- .../reference/classExtendingBuiltinType.js | 30 ++-- .../reference/classExtendingClass.js | 6 +- .../reference/classExtendingClassLikeType.js | 9 +- .../reference/classExtendingNonConstructor.js | 21 +-- .../baselines/reference/classExtendingNull.js | 6 +- .../reference/classExtendingPrimitive.js | 27 ++-- .../reference/classExtendingPrimitive2.js | 3 +- .../reference/classExtendingQualifiedName.js | 3 +- .../reference/classExtendingQualifiedName2.js | 3 +- .../reference/classExtendsAcrossFiles.js | 6 +- ...sMergedWithModuleNotReferingConstructor.js | 3 +- ...tendsClauseClassNotReferringConstructor.js | 3 +- .../reference/classExtendsEveryObjectType.js | 18 +-- .../reference/classExtendsEveryObjectType2.js | 6 +- .../reference/classExtendsInterface.js | 6 +- .../classExtendsInterfaceInExpression.js | 3 +- .../classExtendsInterfaceInModule.js | 9 +- .../baselines/reference/classExtendsItself.js | 9 +- .../reference/classExtendsItselfIndirectly.js | 18 +-- .../classExtendsItselfIndirectly2.js | 18 +-- .../classExtendsItselfIndirectly3.js | 18 +-- .../classExtendsMultipleBaseClasses.js | 3 +- ...classExtendsShadowedConstructorFunction.js | 3 +- .../classExtendsValidConstructorFunction.js | 3 +- .../classHeritageWithTrailingSeparator.js | 3 +- .../reference/classImplementsClass2.js | 3 +- .../reference/classImplementsClass3.js | 3 +- .../reference/classImplementsClass4.js | 3 +- .../reference/classImplementsClass5.js | 3 +- .../reference/classImplementsClass6.js | 3 +- tests/baselines/reference/classIndexer3.js | 3 +- tests/baselines/reference/classInheritence.js | 6 +- .../reference/classIsSubtypeOfBaseType.js | 6 +- tests/baselines/reference/classOrder2.js | 3 +- tests/baselines/reference/classOrderBug.js | 3 +- .../reference/classSideInheritance1.js | 3 +- .../classWithBaseClassButNoConstructor.js | 12 +- .../reference/classWithConstructors.js | 6 +- .../reference/classWithProtectedProperty.js | 3 +- .../reference/classWithStaticMembers.js | 3 +- tests/baselines/reference/classdecl.js | 9 +- .../reference/clodulesDerivedClasses.js | 3 +- ...llisionSuperAndLocalFunctionInAccessors.js | 6 +- .../collisionSuperAndLocalFunctionInMethod.js | 6 +- .../collisionSuperAndLocalVarInAccessors.js | 6 +- .../collisionSuperAndLocalVarInMethod.js | 6 +- .../collisionSuperAndNameResolution.js | 3 +- .../reference/collisionSuperAndParameter1.js | 3 +- ...xpressionAndLocalVarWithSuperExperssion.js | 6 +- .../reference/commentsInheritance.js | 3 +- .../comparisonOperatorWithIdenticalObjects.js | 6 +- ...ithNoRelationshipObjectsOnCallSignature.js | 3 +- ...lationshipObjectsOnConstructorSignature.js | 3 +- ...thNoRelationshipObjectsOnIndexSignature.js | 3 +- ...nshipObjectsOnInstantiatedCallSignature.js | 3 +- ...jectsOnInstantiatedConstructorSignature.js | 3 +- ...peratorWithSubtypeObjectOnCallSignature.js | 3 +- ...WithSubtypeObjectOnConstructorSignature.js | 3 +- ...eratorWithSubtypeObjectOnIndexSignature.js | 3 +- ...ubtypeObjectOnInstantiatedCallSignature.js | 3 +- ...bjectOnInstantiatedConstructorSignature.js | 3 +- ...isonOperatorWithSubtypeObjectOnProperty.js | 6 +- .../reference/complexClassRelationships.js | 3 +- ...catedGenericRecursiveBaseClassReference.js | 3 +- .../reference/computedPropertyNames24_ES5.js | 3 +- .../reference/computedPropertyNames25_ES5.js | 3 +- .../reference/computedPropertyNames26_ES5.js | 3 +- .../reference/computedPropertyNames27_ES5.js | 3 +- .../reference/computedPropertyNames31_ES5.js | 3 +- .../reference/computedPropertyNames43_ES5.js | 3 +- .../reference/computedPropertyNames44_ES5.js | 3 +- .../reference/computedPropertyNames45_ES5.js | 3 +- .../conditionalOperatorWithIdenticalBCT.js | 6 +- .../conditionalOperatorWithoutIdenticalBCT.js | 6 +- .../reference/constantOverloadFunction.js | 9 +- .../constantOverloadFunctionNoSubtypeError.js | 9 +- ...nstraintCheckInGenericBaseTypeReference.js | 3 +- ...uctSignatureAssignabilityInInheritance2.js | 9 +- ...uctSignatureAssignabilityInInheritance3.js | 9 +- ...uctSignatureAssignabilityInInheritance4.js | 9 +- ...uctSignatureAssignabilityInInheritance5.js | 9 +- ...uctSignatureAssignabilityInInheritance6.js | 9 +- ...uctorFunctionTypeIsAssignableToBaseType.js | 6 +- .../constructorHasPrototypeProperty.js | 6 +- ...constructorWithIncompleteTypeAnnotation.js | 3 +- .../contextualTypingArrayOfLambdas.js | 6 +- ...contextualTypingOfConditionalExpression.js | 6 +- ...ontextualTypingOfConditionalExpression2.js | 6 +- ...urcePropertyIsRelatableToTargetProperty.js | 3 +- .../reference/declFileClassExtendsNull.js | 3 +- .../declFileForFunctionTypeAsTypeParameter.js | 3 +- ...ileGenericClassWithGenericExtendedClass.js | 3 +- .../reference/declFileGenericType.js | 3 +- ...lictingWithClassReferredByExtendsClause.js | 6 +- ...dsClauseThatHasItsContainerNameConflict.js | 3 +- .../declarationEmitExpressionInExtends.js | 3 +- .../declarationEmitExpressionInExtends2.js | 3 +- .../declarationEmitExpressionInExtends3.js | 12 +- .../declarationEmitExpressionInExtends4.js | 9 +- .../declarationEmitNameConflicts3.js | 3 +- .../declarationEmitProtectedMembers.js | 6 +- .../declarationEmitThisPredicates01.js | 3 +- ...tionEmitThisPredicatesWithPrivateName01.js | 3 +- .../reference/declareDottedExtend.js | 6 +- .../reference/decoratorOnClassMethod12.js | 3 +- ...ClassFunctionOverridesBaseClassAccessor.js | 3 +- .../derivedClassIncludesInheritedMembers.js | 6 +- ...idesIndexersWithAssignmentCompatibility.js | 6 +- .../derivedClassOverridesPrivates.js | 6 +- .../derivedClassOverridesProtectedMembers2.js | 3 +- .../derivedClassOverridesProtectedMembers4.js | 6 +- .../derivedClassOverridesPublicMembers.js | 3 +- .../derivedClassOverridesWithoutSubtype.js | 6 +- .../reference/derivedClassTransitivity.js | 6 +- .../reference/derivedClassTransitivity2.js | 6 +- .../reference/derivedClassTransitivity3.js | 6 +- .../reference/derivedClassTransitivity4.js | 6 +- .../reference/derivedClassWithAny.js | 6 +- ...ivateInstanceShadowingProtectedInstance.js | 3 +- ...hPrivateInstanceShadowingPublicInstance.js | 3 +- ...thPrivateStaticShadowingProtectedStatic.js | 3 +- ...sWithPrivateStaticShadowingPublicStatic.js | 3 +- tests/baselines/reference/derivedClasses.js | 6 +- .../reference/derivedGenericClassWithAny.js | 6 +- ...sesHiddenBaseCallViaSuperPropertyAccess.js | 3 +- .../derivedTypeDoesNotRequireExtendsClause.js | 3 +- .../reference/emitThisInSuperMethodCall.js | 3 +- tests/baselines/reference/emptyModuleName.js | 3 +- ...rorForwardReferenceForwadingConstructor.js | 3 +- .../reference/errorSuperPropertyAccess.js | 3 +- .../reference/errorsInGenericTypeReference.js | 3 +- tests/baselines/reference/es6ClassTest2.js | 3 +- tests/baselines/reference/es6ClassTest7.js | 3 +- .../exportAssignmentOfGenericType1.js | 3 +- .../exportDeclarationInInternalModule.js | 3 +- tests/baselines/reference/extBaseClass1.js | 9 +- tests/baselines/reference/extBaseClass2.js | 6 +- .../extendAndImplementTheSameBaseType.js | 3 +- .../extendAndImplementTheSameBaseType2.js | 3 +- .../extendBaseClassBeforeItsDeclared.js | 3 +- .../extendClassExpressionFromModule.js | 3 +- .../extendConstructSignatureInInterface.js | 3 +- .../reference/extendNonClassSymbol1.js | 3 +- .../reference/extendNonClassSymbol2.js | 3 +- ...xtendingClassFromAliasAndUsageInIndexer.js | 6 +- .../reference/extendsClauseAlreadySeen.js | 3 +- .../reference/extendsClauseAlreadySeen2.js | 3 +- tests/baselines/reference/fluentClasses.js | 6 +- tests/baselines/reference/for-inStatements.js | 3 +- .../reference/for-inStatementsInvalid.js | 3 +- .../forStatementsMultipleInvalidDecl.js | 3 +- .../reference/functionImplementationErrors.js | 6 +- .../reference/functionImplementations.js | 6 +- .../reference/functionSubtypingOfVarArgs.js | 3 +- .../reference/functionSubtypingOfVarArgs2.js | 3 +- .../reference/generatedContextualTyping.js | 6 +- .../genericBaseClassLiteralProperty.js | 3 +- .../genericBaseClassLiteralProperty2.js | 3 +- ...allWithConstraintsTypeArgumentInference.js | 6 +- .../genericCallWithObjectTypeArgs2.js | 6 +- ...icCallWithObjectTypeArgsAndConstraints2.js | 3 +- ...icCallWithObjectTypeArgsAndConstraints3.js | 6 +- .../genericCallbacksAndClassHierarchy.js | 3 +- .../genericClassExpressionInFunction.js | 18 +-- ...sInheritsConstructorFromNonGenericClass.js | 6 +- .../reference/genericClassStaticMethod.js | 3 +- tests/baselines/reference/genericClasses3.js | 3 +- .../genericDerivedTypeWithSpecializedBase.js | 3 +- .../genericDerivedTypeWithSpecializedBase2.js | 3 +- .../genericInheritedDefaultConstructors.js | 3 +- .../reference/genericPrototypeProperty2.js | 6 +- .../reference/genericPrototypeProperty3.js | 6 +- ...ericRecursiveImplicitConstructorErrors2.js | 3 +- .../reference/genericTypeAssertions2.js | 3 +- .../reference/genericTypeAssertions4.js | 6 +- .../reference/genericTypeAssertions6.js | 3 +- ...genericTypeReferenceWithoutTypeArgument.js | 6 +- ...enericTypeReferenceWithoutTypeArgument2.js | 6 +- .../genericWithIndexerOfTypeParameterType2.js | 6 +- .../reference/heterogeneousArrayLiterals.js | 6 +- .../reference/ifDoWhileStatements.js | 3 +- .../implementClausePrecedingExtends.js | 3 +- ...gAnInterfaceExtendingClassWithPrivates2.js | 33 ++-- ...AnInterfaceExtendingClassWithProtecteds.js | 12 +- .../baselines/reference/importAsBaseClass.js | 3 +- tests/baselines/reference/importHelpers.js | 6 +- tests/baselines/reference/importHelpersAmd.js | 3 +- .../importHelpersInIsolatedModules.js | 6 +- .../reference/importHelpersNoHelpers.js | 6 +- .../reference/importHelpersNoModule.js | 6 +- .../reference/importHelpersOutFile.js | 6 +- .../reference/importHelpersSystem.js | 3 +- .../reference/importShadowsGlobalName.js | 3 +- .../reference/importUsedInExtendsList1.js | 3 +- .../reference/indexerConstraints2.js | 12 +- .../reference/indirectSelfReference.js | 6 +- .../reference/indirectSelfReferenceGeneric.js | 6 +- .../infinitelyExpandingTypesNonGenericBase.js | 3 +- .../inheritFromGenericTypeParameter.js | 3 +- ...SameNamePrivatePropertiesFromSameOrigin.js | 6 +- tests/baselines/reference/inheritance.js | 12 +- tests/baselines/reference/inheritance1.js | 12 +- ...itanceGrandParentPrivateMemberCollision.js | 6 +- ...tPrivateMemberCollisionWithPublicMember.js | 6 +- ...tPublicMemberCollisionWithPrivateMember.js | 6 +- ...ritanceMemberAccessorOverridingAccessor.js | 3 +- ...heritanceMemberAccessorOverridingMethod.js | 3 +- ...ritanceMemberAccessorOverridingProperty.js | 3 +- ...inheritanceMemberFuncOverridingAccessor.js | 3 +- .../inheritanceMemberFuncOverridingMethod.js | 3 +- ...inheritanceMemberFuncOverridingProperty.js | 3 +- ...ritanceMemberPropertyOverridingAccessor.js | 3 +- ...heritanceMemberPropertyOverridingMethod.js | 3 +- ...ritanceMemberPropertyOverridingProperty.js | 3 +- .../inheritanceOfGenericConstructorMethod1.js | 3 +- .../inheritanceOfGenericConstructorMethod2.js | 6 +- ...ritanceStaticAccessorOverridingAccessor.js | 3 +- ...heritanceStaticAccessorOverridingMethod.js | 3 +- ...ritanceStaticAccessorOverridingProperty.js | 3 +- ...inheritanceStaticFuncOverridingAccessor.js | 3 +- ...eStaticFuncOverridingAccessorOfFuncType.js | 3 +- .../inheritanceStaticFuncOverridingMethod.js | 3 +- ...inheritanceStaticFuncOverridingProperty.js | 3 +- ...eStaticFuncOverridingPropertyOfFuncType.js | 3 +- ...taticFunctionOverridingInstanceProperty.js | 3 +- .../inheritanceStaticMembersCompatible.js | 3 +- .../inheritanceStaticMembersIncompatible.js | 3 +- ...ritanceStaticPropertyOverridingAccessor.js | 3 +- ...heritanceStaticPropertyOverridingMethod.js | 3 +- ...ritanceStaticPropertyOverridingProperty.js | 3 +- .../inheritedConstructorWithRestParams.js | 3 +- .../inheritedConstructorWithRestParams2.js | 6 +- .../inheritedModuleMembersForClodule.js | 6 +- .../reference/instanceOfAssignability.js | 6 +- ...nstancePropertiesInheritedIntoClassType.js | 6 +- .../reference/instanceSubtypeCheck2.js | 3 +- ...nstanceofWithStructurallyIdenticalTypes.js | 6 +- .../instantiatedReturnTypeContravariance.js | 3 +- .../reference/interfaceClassMerging.js | 3 +- .../reference/interfaceClassMerging2.js | 3 +- .../reference/interfaceExtendsClass1.js | 9 +- .../interfaceExtendsClassWithPrivate1.js | 3 +- .../reference/interfaceImplementation8.js | 12 +- .../invalidModuleWithStatementsOfEveryKind.js | 18 +-- .../invalidMultipleVariableDeclarations.js | 3 +- .../reference/invalidReturnStatements.js | 3 +- .../isolatedModulesImportExportElision.js | 3 +- tests/baselines/reference/jsxViaImport.js | 3 +- tests/baselines/reference/lambdaArgCrash.js | 3 +- tests/baselines/reference/localTypes1.js | 6 +- tests/baselines/reference/m7Bugs.js | 3 +- .../reference/mergedDeclarations5.js | 3 +- .../reference/mergedDeclarations6.js | 3 +- .../mergedInheritedClassInterface.js | 6 +- .../mergedInterfacesWithInheritedPrivates2.js | 6 +- .../mergedInterfacesWithInheritedPrivates3.js | 3 +- tests/baselines/reference/moduleAsBaseType.js | 3 +- .../moduleImportedForTypeArgumentPosition.js | 3 +- .../moduleWithStatementsOfEveryKind.js | 12 +- .../reference/multipleInheritance.js | 18 +-- .../mutuallyRecursiveGenericBaseTypes2.js | 3 +- tests/baselines/reference/noEmitHelpers.js | 3 +- .../noImplicitAnyMissingGetAccessor.js | 3 +- .../noImplicitAnyMissingSetAccessor.js | 3 +- ...enericClassExtendingGenericClassWithAny.js | 3 +- ...cIndexerConstrainsPropertyDeclarations2.js | 3 +- .../reference/numericIndexerConstraint3.js | 3 +- .../reference/numericIndexerConstraint4.js | 3 +- .../reference/numericIndexerTyping2.js | 3 +- ...objectTypeHidingMembersOfExtendedObject.js | 3 +- ...objectTypesIdentityWithNumericIndexers1.js | 6 +- ...objectTypesIdentityWithNumericIndexers2.js | 9 +- ...objectTypesIdentityWithNumericIndexers3.js | 6 +- .../objectTypesIdentityWithPrivates.js | 6 +- .../objectTypesIdentityWithPrivates2.js | 3 +- .../objectTypesIdentityWithPrivates3.js | 6 +- .../objectTypesIdentityWithStringIndexers.js | 6 +- .../objectTypesIdentityWithStringIndexers2.js | 9 +- .../optionalConstructorArgInSuper.js | 3 +- .../reference/optionalParamInOverride.js | 3 +- .../baselines/reference/outModuleConcatAmd.js | 3 +- .../reference/outModuleConcatAmd.js.map | 2 +- .../outModuleConcatAmd.sourcemap.txt | 40 ++--- .../reference/outModuleConcatSystem.js | 3 +- .../reference/outModuleConcatSystem.js.map | 2 +- .../outModuleConcatSystem.sourcemap.txt | 40 ++--- .../reference/outModuleTripleSlashRefs.js | 3 +- .../reference/outModuleTripleSlashRefs.js.map | 2 +- .../outModuleTripleSlashRefs.sourcemap.txt | 40 ++--- tests/baselines/reference/overload1.js | 6 +- .../overloadOnConstConstraintChecks1.js | 9 +- .../overloadOnConstConstraintChecks2.js | 6 +- .../overloadOnConstConstraintChecks3.js | 6 +- .../overloadOnConstConstraintChecks4.js | 6 +- .../overloadOnConstantsInvalidOverload1.js | 9 +- .../baselines/reference/overloadResolution.js | 9 +- .../overloadResolutionClassConstructors.js | 9 +- .../overloadResolutionConstructors.js | 9 +- .../reference/overloadingOnConstants1.js | 9 +- .../reference/overloadingOnConstants2.js | 3 +- .../overridingPrivateStaticMembers.js | 3 +- .../reference/parseErrorInHeritageClause1.js | 3 +- tests/baselines/reference/parser509630.js | 3 +- tests/baselines/reference/parserAstSpans1.js | 3 +- .../reference/parserClassDeclaration1.js | 3 +- .../reference/parserClassDeclaration3.js | 3 +- .../reference/parserClassDeclaration4.js | 3 +- .../reference/parserClassDeclaration5.js | 3 +- .../reference/parserClassDeclaration6.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause2.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause4.js | 3 +- ...rrorRecovery_ExtendsOrImplementsClause5.js | 3 +- .../parserGenericsInTypeContexts1.js | 3 +- .../parserGenericsInTypeContexts2.js | 3 +- tests/baselines/reference/primitiveMembers.js | 3 +- tests/baselines/reference/privacyClass.js | 72 +++------ .../privacyClassExtendsClauseDeclFile.js | 69 +++------ tests/baselines/reference/privacyGloClass.js | 30 ++-- .../reference/privateAccessInSubclass1.js | 3 +- ...tedMembersAreNotAccessibleDestructuring.js | 3 +- .../privateStaticNotAccessibleInClodule2.js | 3 +- .../amd/testGlo.js | 12 +- .../node/testGlo.js | 12 +- .../reference/project/prologueEmit/amd/out.js | 3 +- .../project/prologueEmit/node/out.js | 3 +- .../amd/m'ain.js | 3 +- .../node/m'ain.js | 3 +- .../reference/propertiesAndIndexers.js | 3 +- tests/baselines/reference/propertyAccess.js | 3 +- ...tyAccessOnTypeParameterWithConstraints2.js | 3 +- ...tyAccessOnTypeParameterWithConstraints3.js | 3 +- ...tyAccessOnTypeParameterWithConstraints5.js | 3 +- ...sPropertyAccessibleWithinNestedSubclass.js | 6 +- ...PropertyAccessibleWithinNestedSubclass1.js | 12 +- ...edClassPropertyAccessibleWithinSubclass.js | 3 +- ...dClassPropertyAccessibleWithinSubclass2.js | 12 +- ...dClassPropertyAccessibleWithinSubclass3.js | 3 +- .../protectedInstanceMemberAccessibility.js | 6 +- tests/baselines/reference/protectedMembers.js | 21 +-- ...icClassPropertyAccessibleWithinSubclass.js | 9 +- ...cClassPropertyAccessibleWithinSubclass2.js | 6 +- ...solution-does-not-affect-class-heritage.js | 3 +- .../reference/recursiveBaseCheck3.js | 6 +- .../reference/recursiveBaseCheck4.js | 3 +- .../reference/recursiveBaseCheck6.js | 3 +- .../recursiveBaseConstructorCreation1.js | 3 +- ...ssInstantiationsWithDefaultConstructors.js | 3 +- .../reference/recursiveClassReferenceTest.js | 3 +- .../recursiveClassReferenceTest.js.map | 2 +- .../recursiveClassReferenceTest.sourcemap.txt | 144 +++++++++--------- .../reference/recursiveComplicatedClasses.js | 9 +- ...sivelySpecializedConstructorDeclaration.js | 3 +- .../reference/reexportClassDefinition.js | 3 +- ...lassDeclarationWhenInBaseTypeResolution.js | 141 ++++++----------- tests/baselines/reference/returnStatements.js | 3 +- ...peCheckExtendedClassInsidePublicMethod2.js | 3 +- ...peCheckExtendedClassInsideStaticMethod1.js | 3 +- .../reference/shadowPrivateMembers.js | 3 +- .../specializedInheritedConstructors1.js | 3 +- .../specializedOverloadWithRestParameters.js | 3 +- tests/baselines/reference/staticFactory1.js | 3 +- .../staticMemberAccessOffDerivedType1.js | 3 +- .../reference/strictModeReservedWord.js | 3 +- ...trictModeReservedWordInClassDeclaration.js | 6 +- ...gIndexerConstrainsPropertyDeclarations2.js | 3 +- .../reference/subtypesOfTypeParameter.js | 3 +- .../subtypesOfTypeParameterWithConstraints.js | 87 ++++------- ...subtypesOfTypeParameterWithConstraints4.js | 27 ++-- ...OfTypeParameterWithRecursiveConstraints.js | 54 +++---- .../reference/subtypingTransitivity.js | 6 +- .../reference/subtypingWithCallSignatures2.js | 9 +- .../reference/subtypingWithCallSignatures3.js | 9 +- .../reference/subtypingWithCallSignatures4.js | 9 +- .../subtypingWithConstructSignatures2.js | 9 +- .../subtypingWithConstructSignatures3.js | 9 +- .../subtypingWithConstructSignatures4.js | 9 +- .../subtypingWithConstructSignatures5.js | 9 +- .../subtypingWithConstructSignatures6.js | 9 +- .../reference/subtypingWithNumericIndexer.js | 18 +-- .../reference/subtypingWithNumericIndexer3.js | 21 +-- .../reference/subtypingWithNumericIndexer4.js | 9 +- .../reference/subtypingWithObjectMembers.js | 24 +-- .../reference/subtypingWithObjectMembers4.js | 12 +- ...subtypingWithObjectMembersAccessibility.js | 12 +- ...ubtypingWithObjectMembersAccessibility2.js | 21 +-- .../reference/subtypingWithStringIndexer.js | 18 +-- .../reference/subtypingWithStringIndexer3.js | 21 +-- .../reference/subtypingWithStringIndexer4.js | 9 +- tests/baselines/reference/super.js | 6 +- tests/baselines/reference/super1.js | 15 +- tests/baselines/reference/super2.js | 12 +- tests/baselines/reference/superAccess.js | 3 +- .../reference/superAccessInFatArrow1.js | 3 +- .../reference/superCallInStaticMethod.js | 3 +- .../superCallWithMissingBaseClass.js | 3 +- .../baselines/reference/superInCatchBlock1.js | 3 +- .../reference/superInObjectLiterals_ES5.js | 3 +- .../reference/superPropertyAccess.js | 3 +- ...essInComputedPropertiesOfNestedType_ES5.js | 3 +- .../reference/superPropertyAccess_ES5.js | 3 +- .../reference/superSymbolIndexedAccess5.js | 3 +- .../reference/superSymbolIndexedAccess6.js | 3 +- ...side-object-literal-getters-and-setters.js | 3 +- tests/baselines/reference/switchStatements.js | 3 +- .../reference/systemModuleWithSuperClass.js | 3 +- .../reference/thisInInvalidContexts.js | 3 +- .../thisInInvalidContextsExternalModule.js | 3 +- .../reference/thisTypeInFunctions.js | 9 +- .../reference/thisTypeInFunctionsNegative.js | 6 +- .../reference/tsxExternalModuleEmit1.js | 6 +- .../tsxStatelessFunctionComponents2.js | 3 +- .../reference/tsxUnionTypeComponent1.js | 6 +- tests/baselines/reference/typeAssertions.js | 3 +- .../baselines/reference/typeGuardFunction.js | 3 +- .../reference/typeGuardFunctionErrors.js | 3 +- .../reference/typeGuardFunctionGenerics.js | 3 +- .../reference/typeGuardFunctionOfFormThis.js | 18 +-- .../typeGuardFunctionOfFormThisErrors.js | 6 +- .../reference/typeGuardOfFormInstanceOf.js | 3 +- .../reference/typeGuardOfFormIsType.js | 3 +- .../reference/typeGuardOfFormThisMember.js | 3 +- .../typeGuardOfFormThisMemberErrors.js | 3 +- tests/baselines/reference/typeMatch2.js | 3 +- .../reference/typeParameterAsBaseClass.js | 3 +- .../reference/typeParameterAsBaseType.js | 6 +- .../reference/typeParameterExtendingUnion1.js | 6 +- .../reference/typeParameterExtendingUnion2.js | 6 +- .../baselines/reference/typeValueConflict1.js | 3 +- .../baselines/reference/typeValueConflict2.js | 6 +- tests/baselines/reference/typeofClass2.js | 3 +- .../typesWithSpecializedCallSignatures.js | 6 +- ...typesWithSpecializedConstructSignatures.js | 6 +- tests/baselines/reference/undeclaredBase.js | 3 +- .../undefinedIsSubtypeOfEverything.js | 66 +++----- .../baselines/reference/underscoreMapFirst.js | 3 +- .../reference/unionTypeEquivalence.js | 3 +- .../reference/unionTypeFromArrayLiteral.js | 6 +- .../reference/unionTypesAssignability.js | 6 +- .../reference/unspecializedConstraints.js | 3 +- ...untypedFunctionCallsWithTypeParameters1.js | 3 +- .../reference/unusedClassesinNamespace4.js | 3 +- .../unusedIdentifiersConsolidated1.js | 3 +- 520 files changed, 1217 insertions(+), 2346 deletions(-) diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index de8e08843a2..ec0ed5494a4 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -38,8 +38,7 @@ var A; var Point3d = (function (_super) { __extends(Point3d, _super); function Point3d() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Point3d; }(Point)); diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index 58c7bd4c3c1..bae9593fb98 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -41,8 +41,7 @@ var A; var Point3d = (function (_super) { __extends(Point3d, _super); function Point3d() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Point3d; }(Point)); diff --git a/tests/baselines/reference/abstractClassInLocalScope.js b/tests/baselines/reference/abstractClassInLocalScope.js index 04407cfc08c..db5144be399 100644 --- a/tests/baselines/reference/abstractClassInLocalScope.js +++ b/tests/baselines/reference/abstractClassInLocalScope.js @@ -22,8 +22,7 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js index 09109c40675..1b3e11cfa32 100644 --- a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js +++ b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js @@ -22,8 +22,7 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/abstractPropertyNegative.js b/tests/baselines/reference/abstractPropertyNegative.js index 5a4c24fe233..bebf9026a0e 100644 --- a/tests/baselines/reference/abstractPropertyNegative.js +++ b/tests/baselines/reference/abstractPropertyNegative.js @@ -92,8 +92,7 @@ var WrongTypeAccessor = (function () { var WrongTypeAccessorImpl = (function (_super) { __extends(WrongTypeAccessorImpl, _super); function WrongTypeAccessorImpl() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Object.defineProperty(WrongTypeAccessorImpl.prototype, "num", { get: function () { return "nope, wrong"; }, 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 860d74f5204..dbaeec1f688 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.js @@ -38,8 +38,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js index d717da94d38..8b60ed8e76d 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js @@ -46,8 +46,7 @@ var Backbone = require("./aliasUsage1_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f08363776cc..bf573aa9abb 100644 --- a/tests/baselines/reference/aliasUsageInArray.js +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -40,8 +40,7 @@ var Backbone = require("./aliasUsageInArray_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 06e3e266ee9..49bdd493aac 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.js +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -39,8 +39,7 @@ var Backbone = require("./aliasUsageInFunctionExpression_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 96121364837..dc3a8a88bab 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.js +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -43,8 +43,7 @@ var Backbone = require("./aliasUsageInGenericFunction_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 bbfe2952594..cb7ad3027ca 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -45,8 +45,7 @@ var Backbone = require("./aliasUsageInIndexerOfClass_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 3b036f52a9d..81e3e621e85 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.js +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -40,8 +40,7 @@ var Backbone = require("./aliasUsageInObjectLiteral_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 4167294e5f2..4faa41dd034 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.js +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -43,8 +43,7 @@ var Backbone = require("./aliasUsageInOrExpression_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 91c6ca2c53f..2cf4aefab6c 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -43,8 +43,7 @@ var Backbone = require("./aliasUsageInTypeArgumentOfExtendsClause_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.js b/tests/baselines/reference/aliasUsageInVarAssignment.js index 0ba5cbbc8d0..80bb2dca20e 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.js +++ b/tests/baselines/reference/aliasUsageInVarAssignment.js @@ -39,8 +39,7 @@ var Backbone = require("./aliasUsageInVarAssignment_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 27e6dd714ba..01002792921 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -22,8 +22,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js index 914679c7de2..6ca9d343a72 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.js +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -38,8 +38,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -52,8 +51,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js index 01fdb92a24e..c6d3378872e 100644 --- a/tests/baselines/reference/apparentTypeSupertype.js +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -28,8 +28,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index 911df30a423..a887203cd5e 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -101,8 +101,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 aff812247a2..d82dedff29d 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -75,8 +75,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 7df39836542..b7ddaa5d6da 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -128,8 +128,7 @@ var EmptyTypes; var derived = (function (_super) { __extends(derived, _super); function derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return derived; }(base)); @@ -188,8 +187,7 @@ var NonEmptyTypes; var derived = (function (_super) { __extends(derived, _super); function derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return derived; }(base)); diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index 81155544cab..919d3a5e922 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -65,16 +65,14 @@ var Action = (function () { var ActionA = (function (_super) { __extends(ActionA, _super); function ActionA() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ActionA; }(Action)); var ActionB = (function (_super) { __extends(ActionB, _super); function ActionB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ActionB; }(Action)); diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index 53066c70391..530cdedec73 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -70,8 +70,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); @@ -79,8 +78,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index 3c5f4365053..c0f320ac1e5 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -39,8 +39,7 @@ var List = (function () { var DerivedList = (function (_super) { __extends(DerivedList, _super); function DerivedList() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return DerivedList; }(List)); diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js index aba7a7cbc8c..d1d75e8041c 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js @@ -33,16 +33,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(Array)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js index 80a9aa9cf14..c5a1f415437 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -114,24 +114,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js index 5932aec049a..58faf663ea8 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -115,24 +115,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js index 7ea579d87ed..87506cad08f 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -80,24 +80,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js index 0fb5867836c..2c05d5960b2 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -57,24 +57,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index b933425ffb0..76ad53e4e05 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -114,24 +114,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js index e407c3acdb0..f516df153c6 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -115,24 +115,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js index 59c816dcc5c..ef7de7f011b 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -80,24 +80,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js index b3b349ebc06..3d58ae707a5 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -57,24 +57,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js index 6e14fb66ecd..37160506683 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -72,8 +72,7 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js index 3b32f327b07..2e6ecd72741 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -59,8 +59,7 @@ b = a; // ok var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index ce80efc3c7a..2cc2510c8da 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -108,16 +108,14 @@ var OnlyDerived; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); @@ -169,16 +167,14 @@ var WithBase; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index d95eb43f0e5..3b12701b3d9 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -103,16 +103,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index f4c401979cf..f965d18e2ce 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -105,16 +105,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js index 54839da4b5a..8d081c90794 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -82,8 +82,7 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -94,8 +93,7 @@ var Generics; var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); diff --git a/tests/baselines/reference/asyncImportedPromise_es5.js b/tests/baselines/reference/asyncImportedPromise_es5.js index 396f380db3e..76ffbc833aa 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5.js +++ b/tests/baselines/reference/asyncImportedPromise_es5.js @@ -19,8 +19,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Task = (function (_super) { __extends(Task, _super); function Task() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 1bada582b03..9ceff6bab4e 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5.js +++ b/tests/baselines/reference/asyncMethodWithSuper_es5.js @@ -61,8 +61,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 0081a30d930..dd54f6ee833 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es5.js +++ b/tests/baselines/reference/asyncQualifiedReturnType_es5.js @@ -13,8 +13,7 @@ var X; var MyPromise = (function (_super) { __extends(MyPromise, _super); function MyPromise() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyPromise; }(Promise)); diff --git a/tests/baselines/reference/awaitClassExpression_es5.js b/tests/baselines/reference/awaitClassExpression_es5.js index f81b5800929..b207ba08f8d 100644 --- a/tests/baselines/reference/awaitClassExpression_es5.js +++ b/tests/baselines/reference/awaitClassExpression_es5.js @@ -17,8 +17,7 @@ function func() { _a = function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }; diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js index 6629ef35dda..7e922cf83b2 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.js +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -38,8 +38,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js index 187a354553d..ec96b80a999 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.js +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -51,8 +51,7 @@ var Class1 = (function () { var Class2 = (function (_super) { __extends(Class2, _super); function Class2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Class2; }(Class1)); @@ -64,8 +63,7 @@ var Class3 = (function () { var Class4 = (function (_super) { __extends(Class4, _super); function Class4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Class4; }(Class3)); diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js index bbf57046a97..5f8dcbd0e10 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js @@ -41,8 +41,7 @@ var CBaseBase = (function () { var CBase = (function (_super) { __extends(CBase, _super); function CBase() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return CBase; }(CBaseBase)); @@ -60,8 +59,7 @@ var Wrapper = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } C.prototype.works = function () { new CBaseBase(this); diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index a9e38f0520c..6d0f19dd37d 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -44,16 +44,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js index 9af685812c2..2e2d0bcb1e2 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -40,16 +40,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index d71b6f17abf..928909f4c38 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -46,8 +46,7 @@ var E = (function () { var F = (function (_super) { __extends(F, _super); function F() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return F; }(C)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js index 4fd0dc2cefc..0ae7648c7f9 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -84,24 +84,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js index 710725f145b..7a7791280ad 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -131,24 +131,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js index 154aee0693b..19d66ce8d46 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -64,24 +64,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js index 7359d330cd6..1c53de5d26e 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -64,24 +64,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js index 594d2dcafb7..c42e36389ca 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -67,24 +67,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js index 426889df7de..f0178dcbbf0 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -59,8 +59,7 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(A)); @@ -68,8 +67,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return F; }(A)); diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js index 71b345a311c..3857867043c 100644 --- a/tests/baselines/reference/chainedAssignment3.js +++ b/tests/baselines/reference/chainedAssignment3.js @@ -36,8 +36,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index 7c428751b28..26d341e1f6a 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -42,16 +42,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js index 9d0e7648dcb..6fe5e604e57 100644 --- a/tests/baselines/reference/circularImportAlias.js +++ b/tests/baselines/reference/circularImportAlias.js @@ -32,8 +32,7 @@ var B; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 811e86b21ca..78e9d3f34e7 100644 --- a/tests/baselines/reference/circularTypeofWithFunctionModule.js +++ b/tests/baselines/reference/circularTypeofWithFunctionModule.js @@ -32,8 +32,7 @@ var maker; var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); diff --git a/tests/baselines/reference/classAbstractConstructorAssignability.js b/tests/baselines/reference/classAbstractConstructorAssignability.js index 8738b43bb3f..35d9e75884f 100644 --- a/tests/baselines/reference/classAbstractConstructorAssignability.js +++ b/tests/baselines/reference/classAbstractConstructorAssignability.js @@ -28,16 +28,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/classAbstractCrashedOnce.js b/tests/baselines/reference/classAbstractCrashedOnce.js index 02d31377de8..fe23e60c94f 100644 --- a/tests/baselines/reference/classAbstractCrashedOnce.js +++ b/tests/baselines/reference/classAbstractCrashedOnce.js @@ -24,8 +24,7 @@ var foo = (function () { var bar = (function (_super) { __extends(bar, _super); function bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 8ac2cc9de3d..e899cb82d6d 100644 --- a/tests/baselines/reference/classAbstractExtends.js +++ b/tests/baselines/reference/classAbstractExtends.js @@ -31,32 +31,28 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(B)); var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 4f612e3d9c6..50e232a9fca 100644 --- a/tests/baselines/reference/classAbstractFactoryFunction.js +++ b/tests/baselines/reference/classAbstractFactoryFunction.js @@ -31,8 +31,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classAbstractGeneric.js b/tests/baselines/reference/classAbstractGeneric.js index b76117fddfc..96df8f5f19e 100644 --- a/tests/baselines/reference/classAbstractGeneric.js +++ b/tests/baselines/reference/classAbstractGeneric.js @@ -39,32 +39,28 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); // error -- inherits abstract methods var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(A)); // error -- inherits abstract methods var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } E.prototype.foo = function () { return this.t; }; return E; @@ -72,8 +68,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } F.prototype.bar = function (t) { }; return F; @@ -81,8 +76,7 @@ var F = (function (_super) { var G = (function (_super) { __extends(G, _super); function G() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 aa66ba540a8..c6a9e206bcc 100644 --- a/tests/baselines/reference/classAbstractInAModule.js +++ b/tests/baselines/reference/classAbstractInAModule.js @@ -24,8 +24,7 @@ var M; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classAbstractInheritance.js b/tests/baselines/reference/classAbstractInheritance.js index 0bd5dab31a9..297a80dd99c 100644 --- a/tests/baselines/reference/classAbstractInheritance.js +++ b/tests/baselines/reference/classAbstractInheritance.js @@ -35,16 +35,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); @@ -56,48 +54,42 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return BB; }(AA)); var CC = (function (_super) { __extends(CC, _super); function CC() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return CC; }(AA)); var DD = (function (_super) { __extends(DD, _super); function DD() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return DD; }(BB)); var EE = (function (_super) { __extends(EE, _super); function EE() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return EE; }(BB)); var FF = (function (_super) { __extends(FF, _super); function FF() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return FF; }(CC)); var GG = (function (_super) { __extends(GG, _super); function GG() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return GG; }(CC)); diff --git a/tests/baselines/reference/classAbstractInstantiations1.js b/tests/baselines/reference/classAbstractInstantiations1.js index aef8f58fab2..5abbb9c1baa 100644 --- a/tests/baselines/reference/classAbstractInstantiations1.js +++ b/tests/baselines/reference/classAbstractInstantiations1.js @@ -41,16 +41,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/classAbstractInstantiations2.js b/tests/baselines/reference/classAbstractInstantiations2.js index 2e6cd648dc0..dea4c744ae0 100644 --- a/tests/baselines/reference/classAbstractInstantiations2.js +++ b/tests/baselines/reference/classAbstractInstantiations2.js @@ -82,24 +82,21 @@ new x; // okay -- undefined behavior at runtime var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); // error -- not declared abstract var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(B)); // okay var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } E.prototype.bar = function () { return 1; }; return E; @@ -107,8 +104,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 5cb07934658..4ecebdf7b32 100644 --- a/tests/baselines/reference/classAbstractOverrideWithAbstract.js +++ b/tests/baselines/reference/classAbstractOverrideWithAbstract.js @@ -38,8 +38,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -52,8 +51,7 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } BB.prototype.bar = function () { }; return BB; @@ -61,16 +59,14 @@ var BB = (function (_super) { var CC = (function (_super) { __extends(CC, _super); function CC() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return CC; }(BB)); // error var DD = (function (_super) { __extends(DD, _super); function DD() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 44b15710c73..0197f48a429 100644 --- a/tests/baselines/reference/classAbstractSuperCalls.js +++ b/tests/baselines/reference/classAbstractSuperCalls.js @@ -42,8 +42,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { _super.prototype.foo.call(this); }; B.prototype.baz = function () { return this.foo; }; @@ -52,8 +51,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 @@ -70,8 +68,7 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return BB; }(AA)); diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js index ae6b08e4bca..74b5d62aaf5 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js @@ -31,8 +31,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.foo = function () { return 1; }; return B; @@ -40,8 +39,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js index 9f43ee1a6b3..25cf1a307c7 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js @@ -41,24 +41,21 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } D.prototype.foo = function () { }; return D; @@ -66,8 +63,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } E.prototype.foo = function () { }; return E; @@ -80,24 +76,21 @@ var AA = (function () { var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return BB; }(AA)); var CC = (function (_super) { __extends(CC, _super); function CC() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return CC; }(AA)); var DD = (function (_super) { __extends(DD, _super); function DD() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } DD.prototype.foo = function () { }; return DD; diff --git a/tests/baselines/reference/classConstructorAccessibility4.js b/tests/baselines/reference/classConstructorAccessibility4.js index dfbc70de115..4772ac68d11 100644 --- a/tests/baselines/reference/classConstructorAccessibility4.js +++ b/tests/baselines/reference/classConstructorAccessibility4.js @@ -51,8 +51,7 @@ var A = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); @@ -74,8 +73,7 @@ var D = (function () { var F = (function (_super) { __extends(F, _super); function F() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return F; }(D)); diff --git a/tests/baselines/reference/classConstructorAccessibility5.js b/tests/baselines/reference/classConstructorAccessibility5.js index b73ecb4a92b..d658349c2a5 100644 --- a/tests/baselines/reference/classConstructorAccessibility5.js +++ b/tests/baselines/reference/classConstructorAccessibility5.js @@ -25,8 +25,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived.make = function () { new Base(); }; // ok return Derived; diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index 83152355a13..c1ecad3a792 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -35,8 +35,7 @@ var M; var O = (function (_super) { __extends(O, _super); function O() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ef584afd6e9..076412e164d 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -31,8 +31,7 @@ var StringTreeCollectionBase = (function () { var StringTreeCollection = (function (_super) { __extends(StringTreeCollection, _super); function StringTreeCollection() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return StringTreeCollection; }(StringTreeCollectionBase)); diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js index f7405cfd38a..59b62c60cfe 100644 --- a/tests/baselines/reference/classExpression2.js +++ b/tests/baselines/reference/classExpression2.js @@ -16,8 +16,7 @@ var D = (function () { var v = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(D)); diff --git a/tests/baselines/reference/classExpressionExtendingAbstractClass.js b/tests/baselines/reference/classExpressionExtendingAbstractClass.js index 8673e48d65f..7312ab6567d 100644 --- a/tests/baselines/reference/classExpressionExtendingAbstractClass.js +++ b/tests/baselines/reference/classExpressionExtendingAbstractClass.js @@ -22,8 +22,7 @@ var A = (function () { var C = (function (_super) { __extends(class_1, _super); function class_1() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 2a01c1aa8b3..4c95e3008ea 100644 --- a/tests/baselines/reference/classExtendingBuiltinType.js +++ b/tests/baselines/reference/classExtendingBuiltinType.js @@ -20,80 +20,70 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C1; }(Object)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(Function)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C3; }(String)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C4; }(Boolean)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C5; }(Number)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C6; }(Date)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C7; }(RegExp)); var C8 = (function (_super) { __extends(C8, _super); function C8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C8; }(Error)); var C9 = (function (_super) { __extends(C9, _super); function C9() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C9; }(Array)); var C10 = (function (_super) { __extends(C10, _super); function C10() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C10; }(Array)); diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index 4218bfbea98..91e3752980c 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -47,8 +47,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -67,8 +66,7 @@ var C2 = (function () { var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(C2)); diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index fdda53a381f..bfc10c23563 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -68,8 +68,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D0 = (function (_super) { __extends(D0, _super); function D0() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D0; }(Base)); @@ -108,8 +107,7 @@ var D3 = (function (_super) { var D4 = (function (_super) { __extends(D4, _super); function D4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D4; }(getBase())); @@ -117,8 +115,7 @@ var D4 = (function (_super) { var D5 = (function (_super) { __extends(D5, _super); function D5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D5; }(getBadBase())); diff --git a/tests/baselines/reference/classExtendingNonConstructor.js b/tests/baselines/reference/classExtendingNonConstructor.js index d33e6b4edef..574d5004486 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.js +++ b/tests/baselines/reference/classExtendingNonConstructor.js @@ -27,56 +27,49 @@ function foo() { var C1 = (function (_super) { __extends(C1, _super); function C1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C1; }(undefined)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(true)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C3; }(false)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C4; }(42)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C5; }("hello")); var C6 = (function (_super) { __extends(C6, _super); function C6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C6; }(x)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C7; }(foo)); diff --git a/tests/baselines/reference/classExtendingNull.js b/tests/baselines/reference/classExtendingNull.js index d6188aaf988..8d5d73329aa 100644 --- a/tests/baselines/reference/classExtendingNull.js +++ b/tests/baselines/reference/classExtendingNull.js @@ -12,16 +12,14 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C1; }(null)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }((null))); diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index c23683470d0..53cb45c2081 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -24,32 +24,28 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(number)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(string)); var C3 = (function (_super) { __extends(C3, _super); function C3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C3; }(boolean)); var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C4; }(Void)); @@ -62,32 +58,28 @@ void {}; var C5 = (function (_super) { __extends(C5, _super); function C5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C5; }(Null)); var C5a = (function (_super) { __extends(C5a, _super); function C5a() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C5a; }(null)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C6; }(undefined)); var C7 = (function (_super) { __extends(C7, _super); function C7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C7; }(Undefined)); @@ -98,8 +90,7 @@ var E; var C8 = (function (_super) { __extends(C8, _super); function C8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C8; }(E)); diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index 072dc8138c7..b32dc31a5b4 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -20,8 +20,7 @@ void {}; var C5a = (function (_super) { __extends(C5a, _super); function C5a() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C5a; }(null)); diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js index b5cf4ae1382..fced8c2a373 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.js +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -23,8 +23,7 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 d1ee8b48b3a..c133ceb87dc 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.js +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -24,8 +24,7 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 0dcf4103f49..5be0ab8f9c0 100644 --- a/tests/baselines/reference/classExtendsAcrossFiles.js +++ b/tests/baselines/reference/classExtendsAcrossFiles.js @@ -37,8 +37,7 @@ exports.b = { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -63,8 +62,7 @@ exports.a = { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index f1a695c0b2a..cc4870e837b 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -33,8 +33,7 @@ var Foo; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js index f754e140d37..6c3dc789445 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -23,8 +23,7 @@ var Foo; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index 584b31b7e8e..a19f5d5cdd6 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -25,16 +25,14 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(I)); // error var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }({ foo: string })); // error @@ -42,8 +40,7 @@ var x; var C3 = (function (_super) { __extends(C3, _super); function C3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C3; }(x)); // error @@ -54,8 +51,7 @@ var M; var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C4; }(M)); // error @@ -63,16 +59,14 @@ function foo() { } var C5 = (function (_super) { __extends(C5, _super); function C5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C5; }(foo)); // error var C6 = (function (_super) { __extends(C6, _super); function C6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C6; }([])); // error diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index e01e90d512d..fbc364ca5da 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -12,16 +12,14 @@ var __extends = (this && this.__extends) || function (d, b) { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }({ foo: string })); // error var C6 = (function (_super) { __extends(C6, _super); function C6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C6; }([])); // error diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js index 7047eaad658..b5946224317 100644 --- a/tests/baselines/reference/classExtendsInterface.js +++ b/tests/baselines/reference/classExtendsInterface.js @@ -17,8 +17,7 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A; }(Comparable)); @@ -30,8 +29,7 @@ var B = (function () { var A2 = (function (_super) { __extends(A2, _super); function A2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A2; }(Comparable2)); diff --git a/tests/baselines/reference/classExtendsInterfaceInExpression.js b/tests/baselines/reference/classExtendsInterfaceInExpression.js index 64d519d6952..9dcd8dd7279 100644 --- a/tests/baselines/reference/classExtendsInterfaceInExpression.js +++ b/tests/baselines/reference/classExtendsInterfaceInExpression.js @@ -20,8 +20,7 @@ function factory(a) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ced164bca10..9da8831a138 100644 --- a/tests/baselines/reference/classExtendsInterfaceInModule.js +++ b/tests/baselines/reference/classExtendsInterfaceInModule.js @@ -24,24 +24,21 @@ var __extends = (this && this.__extends) || function (d, b) { var C1 = (function (_super) { __extends(C1, _super); function C1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C1; }(M.I1)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(M.I2)); var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 654cd35c400..36f2263d671 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -14,24 +14,21 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(C)); // error var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(D)); // error var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ae5852d91f9..0f3f48d2f2c 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -20,48 +20,42 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(E)); // error var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(D)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(E2)); // error var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(C2)); var E2 = (function (_super) { __extends(E2, _super); function E2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E2; }(D2)); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index 63eeb5bc178..e215a07c357 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -31,8 +31,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(N.E)); // error @@ -41,8 +40,7 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -53,8 +51,7 @@ var N; var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(M.D)); @@ -65,8 +62,7 @@ var O; var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(Q.E2)); // error @@ -75,8 +71,7 @@ var O; var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(C2)); @@ -87,8 +82,7 @@ var O; var E2 = (function (_super) { __extends(E2, _super); function E2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 4e67909f2d3..f8366d77e13 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -27,8 +27,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(E)); // error @@ -41,8 +40,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -55,8 +53,7 @@ var __extends = (this && this.__extends) || function (d, b) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(D)); @@ -69,8 +66,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(E2)); // error @@ -83,8 +79,7 @@ var __extends = (this && this.__extends) || function (d, b) { var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(C2)); @@ -97,8 +92,7 @@ var __extends = (this && this.__extends) || function (d, b) { var E2 = (function (_super) { __extends(E2, _super); function E2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E2; }(D2)); diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.js b/tests/baselines/reference/classExtendsMultipleBaseClasses.js index a185f6cf40a..cd9c28ad283 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.js +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.js @@ -22,8 +22,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js index a7f4a4bb9d9..ddaadc2dc62 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -25,8 +25,7 @@ var M; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index 519074358cc..31bff6e430c 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -16,8 +16,7 @@ var x = new foo(); // can be used as a constructor function var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 d3134a97ccd..12265f569bd 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.js +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.js @@ -17,8 +17,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index d525fb8a6ad..5e3eae46543 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -33,8 +33,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 3257e51b5b8..5fd003e93b9 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -37,8 +37,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index f0b8698c64d..477288972df 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -40,8 +40,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index bf5d0141a19..0ec258ab77b 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -42,8 +42,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index f1929cdc798..0771c56415c 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -47,8 +47,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js index ab825abcd31..2e55c894645 100644 --- a/tests/baselines/reference/classIndexer3.js +++ b/tests/baselines/reference/classIndexer3.js @@ -24,8 +24,7 @@ var C123 = (function () { var D123 = (function (_super) { __extends(D123, _super); function D123() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D123; }(C123)); diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js index 11b0c5e3ae2..f68d76fad47 100644 --- a/tests/baselines/reference/classInheritence.js +++ b/tests/baselines/reference/classInheritence.js @@ -11,16 +11,14 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var A = (function (_super) { __extends(A, _super); function A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A; }(A)); diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js index 6caa97781dd..52300987d8e 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.js +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -29,16 +29,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index 49b2a428e06..63490fa29b1 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -28,8 +28,7 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 1381df2797d..e21a5ed64cf 100644 --- a/tests/baselines/reference/classOrderBug.js +++ b/tests/baselines/reference/classOrderBug.js @@ -35,8 +35,7 @@ var baz = (function () { var foo = (function (_super) { __extends(foo, _super); function foo() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return foo; }(baz)); diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index 7898ae8a2b2..9443509032c 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -33,8 +33,7 @@ var A = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(A)); diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index 6ff5ae2ac5b..c25687d3c74 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -54,8 +54,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(Base)); @@ -70,8 +69,7 @@ var Base2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(Base2)); @@ -82,8 +80,7 @@ var d2 = new D(1); // ok var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(Base2)); @@ -93,8 +90,7 @@ var d4 = new D(1); // ok var D3 = (function (_super) { __extends(D3, _super); function D3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D3; }(Base2)); diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index 6bb9387f673..f445d22d18f 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -75,8 +75,7 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C2)); @@ -104,8 +103,7 @@ var Generics; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C2)); diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index fb07eb3d0b2..2cb8a4e0a50 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -48,8 +48,7 @@ C.g = function () { return ''; }; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 cd23c220231..9e79780d5cc 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -45,8 +45,7 @@ var r3 = r.foo; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/classdecl.js b/tests/baselines/reference/classdecl.js index d4f6bb11ca9..a3059757d2f 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -136,8 +136,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); @@ -162,8 +161,7 @@ var m2; var c = (function (_super) { __extends(c, _super); function c() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return c; }(b)); @@ -179,8 +177,7 @@ var m2; var c = (function (_super) { __extends(c, _super); function c() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 dbbbe340ba7..f65295627f1 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -44,8 +44,7 @@ var Shape; var Path = (function (_super) { __extends(Path, _super); function Path() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Path; }(Shape)); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js index eaf031c2571..85c0e398fbd 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js @@ -68,8 +68,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Object.defineProperty(b.prototype, "prop2", { get: function () { @@ -89,8 +88,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Object.defineProperty(c.prototype, "prop2", { get: function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js index 14965b53abd..81c069da169 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -50,8 +50,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } b.prototype.foo = function () { function _super() { @@ -64,8 +63,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } c.prototype.foo = function () { var x = function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js index 55db3a5e625..26f782c0d17 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js @@ -58,8 +58,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Object.defineProperty(b.prototype, "prop2", { get: function () { @@ -77,8 +76,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Object.defineProperty(c.prototype, "prop2", { get: function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index c5bb6ebcd01..0524d993ba1 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -36,8 +36,7 @@ var Foo = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } b.prototype.foo = function () { var _super = 10; // Should be error @@ -47,8 +46,7 @@ var b = (function (_super) { var c = (function (_super) { __extends(c, _super); function c() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } c.prototype.foo = function () { var x = function () { diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index 5501b3e2df4..cb5636ec904 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -27,8 +27,7 @@ var base = (function () { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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/collisionSuperAndParameter1.js b/tests/baselines/reference/collisionSuperAndParameter1.js index 105fe849767..ed19500f9d4 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.js +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -23,8 +23,7 @@ var Foo = (function () { var Foo2 = (function (_super) { __extends(Foo2, _super); function Foo2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Foo2.prototype.x = function () { var lambda = function (_super) { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index 59b64e4a9ba..9e8132c6883 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -34,8 +34,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } b.prototype.foo = function () { var _this = this; @@ -47,8 +46,7 @@ var b = (function (_super) { var b2 = (function (_super) { __extends(b2, _super); function b2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a8a8d5fa889..3527f5d23bb 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -258,8 +258,7 @@ c2_i = c3_i; var c4 = (function (_super) { __extends(c4, _super); function c4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return c4; }(c2)); diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js index fb7a811cba3..a263a30e382 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -227,16 +227,14 @@ var Base = (function () { var A2 = (function (_super) { __extends(A2, _super); function A2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A2; }(Base)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js index 675235ae324..b8584522b7b 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -182,8 +182,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js index ceb386b3e14..93e1e876a7f 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -182,8 +182,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js index 03494b4f88d..a8973bf2c10 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -125,8 +125,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js index ee8185802d4..4539538782d 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -163,8 +163,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js index 5a36f91c7ca..5e8412bc361 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -163,8 +163,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js index f23588dcbc5..d30c3586b12 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -273,8 +273,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js index cc6fe9ce640..4235c1352d4 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -235,8 +235,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js index d401defc2ed..9a6fecd668d 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -121,8 +121,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js index b4b531b8084..5721a452486 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -178,8 +178,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js index 69f46e2ccd2..b6bf8a16e61 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -178,8 +178,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js index 171f21e77fc..690214fc00f 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -92,8 +92,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -115,8 +114,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A2)); diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js index 523002e5b57..4f48e5fc2c5 100644 --- a/tests/baselines/reference/complexClassRelationships.js +++ b/tests/baselines/reference/complexClassRelationships.js @@ -57,8 +57,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 1201dcf3d3d..326c0830c4f 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -14,8 +14,7 @@ var __extends = (this && this.__extends) || function (d, b) { var S18 = (function (_super) { __extends(S18, _super); function S18() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return S18; }(S18)); diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.js b/tests/baselines/reference/computedPropertyNames24_ES5.js index 00186f40a28..ff9112755bd 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.js +++ b/tests/baselines/reference/computedPropertyNames24_ES5.js @@ -25,8 +25,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 afc0e20eca9..dad9c5c291a 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -30,8 +30,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 6b75da57e9a..5db7768270a 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -27,8 +27,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 3c89ecd50c0..381805659e2 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.js +++ b/tests/baselines/reference/computedPropertyNames27_ES5.js @@ -19,8 +19,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } C.prototype[(_this = _super.call(this) || this, "prop")] = function () { }; return C; diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index 7b803e9c987..00cc765f4cc 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -32,8 +32,7 @@ var Base = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 293d017734e..b1bb0fec72c 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -36,8 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 c990298c4ac..bf940f15014 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.js +++ b/tests/baselines/reference/computedPropertyNames44_ES5.js @@ -40,8 +40,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f5a31fffabb..5b5d64f9bf0 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.js +++ b/tests/baselines/reference/computedPropertyNames45_ES5.js @@ -41,8 +41,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a6d00d847f3..408571af42a 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -63,8 +63,7 @@ var X = (function () { var A = (function (_super) { __extends(A, _super); function A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A; }(X)); @@ -72,8 +71,7 @@ var A = (function (_super) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(X)); diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 58b050c5ebe..0ac935a582a 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -39,8 +39,7 @@ var X = (function () { var A = (function (_super) { __extends(A, _super); function A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A; }(X)); @@ -48,8 +47,7 @@ var A = (function (_super) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(X)); diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index 934c7eceb0e..160191c5ca0 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -28,8 +28,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -37,8 +36,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -46,8 +44,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 217cf23f9cb..509f9ba70e6 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -29,8 +29,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -38,8 +37,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -47,8 +45,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 511c293d417..7908d36a56a 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -40,8 +40,7 @@ var GenericBase = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(GenericBase)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js index 0e14e958b28..6b308d88896 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -84,24 +84,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js index cb2cadb7698..09abd6e0868 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -129,24 +129,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js index 25c69839117..4e9a8c59bf9 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -74,24 +74,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js index dcd972d3a97..91ec3b313bb 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -64,24 +64,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js index 69fdebe8f5c..edafb009916 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -67,24 +67,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js index b16721d0acc..45ed976e191 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -33,16 +33,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js index 956e8cd2e0d..a16694cdbf5 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -47,8 +47,7 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -67,8 +66,7 @@ var Generic; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 1b91e8a131a..2e3190c15c8 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -525,8 +525,7 @@ method2(); var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 365e17afc9b..caf7ed445e5 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -28,16 +28,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index 7be8079cfd9..a6ce98f61e2 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -29,16 +29,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index 102562a841a..e3bd1643cfb 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -26,16 +26,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js index 5fafe95c1a8..89979da4812 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js @@ -25,8 +25,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/declFileClassExtendsNull.js b/tests/baselines/reference/declFileClassExtendsNull.js index 58bff801774..30ddc3f08bf 100644 --- a/tests/baselines/reference/declFileClassExtendsNull.js +++ b/tests/baselines/reference/declFileClassExtendsNull.js @@ -12,8 +12,7 @@ var __extends = (this && this.__extends) || function (d, b) { var ExtendsNull = (function (_super) { __extends(ExtendsNull, _super); function ExtendsNull() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ExtendsNull; }(null)); diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js index d58dcd1f536..442007d9b9a 100644 --- a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js @@ -23,8 +23,7 @@ var X = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(X)); diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js index 2f68300a4bf..47593dc9d68 100644 --- a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js @@ -26,8 +26,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index 2ed404342d7..b2e99a73ad7 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -91,8 +91,7 @@ exports.g = C.F5(); var h = (function (_super) { __extends(h, _super); function h() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return h; }(C.A)); diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index c9c569f8676..cd10a9e9456 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -35,8 +35,7 @@ var X; var W = (function (_super) { __extends(W, _super); function W() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return W; }(A.B.Base.W)); @@ -55,8 +54,7 @@ var X; var W = (function (_super) { __extends(W, _super); function W() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 3681f9fa859..f3b93efc9eb 100644 --- a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -45,8 +45,7 @@ var A; var ContextMenu = (function (_super) { __extends(ContextMenu, _super); function ContextMenu() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 8973fbb1455..726c7b22446 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends.js @@ -29,8 +29,7 @@ var Q = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(x)); diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends2.js b/tests/baselines/reference/declarationEmitExpressionInExtends2.js index ff75df8baba..4081de6d3ed 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends2.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends2.js @@ -29,8 +29,7 @@ function getClass(c) { var MyClass = (function (_super) { __extends(MyClass, _super); function MyClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 fc73eb5dbd0..f36a7e250a2 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends3.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends3.js @@ -70,8 +70,7 @@ function getExportedClass(c) { var MyClass = (function (_super) { __extends(MyClass, _super); function MyClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyClass; }(getLocalClass(undefined))); @@ -79,8 +78,7 @@ exports.MyClass = MyClass; var MyClass2 = (function (_super) { __extends(MyClass2, _super); function MyClass2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyClass2; }(getExportedClass(undefined))); @@ -88,8 +86,7 @@ exports.MyClass2 = MyClass2; var MyClass3 = (function (_super) { __extends(MyClass3, _super); function MyClass3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyClass3; }(getExportedClass(undefined))); @@ -97,8 +94,7 @@ exports.MyClass3 = MyClass3; var MyClass4 = (function (_super) { __extends(MyClass4, _super); function MyClass4() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ed34544256b..b90c1275197 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends4.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends4.js @@ -33,24 +33,21 @@ function getSomething() { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(getSomething())); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(SomeUndefinedFunction())); var C3 = (function (_super) { __extends(C3, _super); function C3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C3; }(SomeUndefinedFunction)); diff --git a/tests/baselines/reference/declarationEmitNameConflicts3.js b/tests/baselines/reference/declarationEmitNameConflicts3.js index c17f624087d..09dcea089a8 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts3.js +++ b/tests/baselines/reference/declarationEmitNameConflicts3.js @@ -64,8 +64,7 @@ var M; var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(C)); diff --git a/tests/baselines/reference/declarationEmitProtectedMembers.js b/tests/baselines/reference/declarationEmitProtectedMembers.js index cc4e27895f1..9ae8e8a2437 100644 --- a/tests/baselines/reference/declarationEmitProtectedMembers.js +++ b/tests/baselines/reference/declarationEmitProtectedMembers.js @@ -88,8 +88,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } C2.prototype.f = function () { return _super.prototype.f.call(this) + this.x; @@ -103,8 +102,7 @@ var C2 = (function (_super) { var C3 = (function (_super) { __extends(C3, _super); function C3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 0b364e90e45..ad9b7a70373 100644 --- a/tests/baselines/reference/declarationEmitThisPredicates01.js +++ b/tests/baselines/reference/declarationEmitThisPredicates01.js @@ -28,8 +28,7 @@ exports.C = C; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js b/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js index aea36311add..fe7995462ef 100644 --- a/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js +++ b/tests/baselines/reference/declarationEmitThisPredicatesWithPrivateName01.js @@ -28,8 +28,7 @@ exports.C = C; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/declareDottedExtend.js b/tests/baselines/reference/declareDottedExtend.js index f167928087d..3c7588d2b6c 100644 --- a/tests/baselines/reference/declareDottedExtend.js +++ b/tests/baselines/reference/declareDottedExtend.js @@ -21,16 +21,14 @@ var ab = A.B; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(ab.C)); var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(A.B.C)); diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js index 6d95c696176..7dd5f698182 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.js +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -32,8 +32,7 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } C.prototype.method = function () { }; return C; diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js index 6dcf8f3fd83..7f6b83593ca 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js @@ -38,8 +38,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 2fe5906e746..8224473cb54 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js @@ -68,8 +68,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -90,8 +89,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js index dc63ccb21d8..4753e395390 100644 --- a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js @@ -32,8 +32,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -46,8 +45,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.js b/tests/baselines/reference/derivedClassOverridesPrivates.js index 7ab70d93ff2..1a58c038fea 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.js +++ b/tests/baselines/reference/derivedClassOverridesPrivates.js @@ -29,8 +29,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -42,8 +41,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js index ac9b401a45c..6797eef0e77 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -131,8 +131,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js index eeaf80061af..06f80997600 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js @@ -30,16 +30,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived1)); diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index 92fbc07e774..7943d904dea 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -129,8 +129,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js index f2d8f72edfb..e42ff9c9e1d 100644 --- a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js @@ -37,8 +37,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -50,8 +49,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index 0e88d3664c6..a76ac8101a0 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -36,8 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } D.prototype.foo = function () { }; // ok to drop parameters return D; @@ -45,8 +44,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 5a3f8f3cf57..a3894863696 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -36,8 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } D.prototype.foo = function (x) { }; // ok to drop parameters return D; @@ -45,8 +44,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f6aa6963795..71dfecb346f 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -36,8 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } D.prototype.foo = function (x) { }; // ok to drop parameters return D; @@ -45,8 +44,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 8d18e311d88..0030ce702d8 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.js +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -36,8 +36,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } D.prototype.foo = function () { }; // ok to drop parameters return D; @@ -45,8 +44,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 70885570373..2a199e55861 100644 --- a/tests/baselines/reference/derivedClassWithAny.js +++ b/tests/baselines/reference/derivedClassWithAny.js @@ -91,8 +91,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Object.defineProperty(D.prototype, "X", { get: function () { @@ -120,8 +119,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 24d43468dcf..0542815c4e4 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -46,8 +46,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a6b7710ec6d..41869cad416 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js @@ -56,8 +56,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 3da7720b77e..10ae3cb35c8 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -45,8 +45,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 57f474affe7..3f2c2a3b811 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js @@ -58,8 +58,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived.fn = function () { return ''; diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js index 27947b4f05f..3e097a9b139 100644 --- a/tests/baselines/reference/derivedClasses.js +++ b/tests/baselines/reference/derivedClasses.js @@ -39,8 +39,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Red = (function (_super) { __extends(Red, _super); function Red() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Red.prototype.shade = function () { var _this = this; @@ -59,8 +58,7 @@ var Color = (function () { var Blue = (function (_super) { __extends(Blue, _super); function Blue() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 e31b18e11e7..1822f3fcc47 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.js +++ b/tests/baselines/reference/derivedGenericClassWithAny.js @@ -64,8 +64,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Object.defineProperty(D.prototype, "X", { get: function () { @@ -93,8 +92,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 4430ad5a31b..c17922e05ee 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -34,8 +34,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f6415d84965..6fe690fd692 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -39,8 +39,7 @@ var Derived = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.js b/tests/baselines/reference/emitThisInSuperMethodCall.js index 4bb83a7c172..1f7ed8bfa94 100644 --- a/tests/baselines/reference/emitThisInSuperMethodCall.js +++ b/tests/baselines/reference/emitThisInSuperMethodCall.js @@ -43,8 +43,7 @@ var User = (function () { var RegisteredUser = (function (_super) { __extends(RegisteredUser, _super); function RegisteredUser() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 2292f0a494a..3ed21cf217a 100644 --- a/tests/baselines/reference/emptyModuleName.js +++ b/tests/baselines/reference/emptyModuleName.js @@ -14,8 +14,7 @@ var A = require(""); var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js index 7b05688b8c8..ed2e1aa7f06 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js @@ -30,8 +30,7 @@ var base = (function () { var derived = (function (_super) { __extends(derived, _super); function derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return derived; }(base)); diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index 0fef86493f1..e12a758b053 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -247,8 +247,7 @@ var SomeDerived2 = (function (_super) { var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 d3d275ff25b..6dd9f62edcb 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.js +++ b/tests/baselines/reference/errorsInGenericTypeReference.js @@ -135,8 +135,7 @@ var testClass6 = (function () { var testClass7 = (function (_super) { __extends(testClass7, _super); function testClass7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return testClass7; }(Foo)); // error: could not find symbol V diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index b3787405ff7..de5657b087e 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -314,8 +314,7 @@ var BaseClassWithConstructor = (function () { var ChildClassWithoutConstructor = (function (_super) { __extends(ChildClassWithoutConstructor, _super); function ChildClassWithoutConstructor() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ChildClassWithoutConstructor; }(BaseClassWithConstructor)); diff --git a/tests/baselines/reference/es6ClassTest7.js b/tests/baselines/reference/es6ClassTest7.js index 6e30a1d7879..f786fce4461 100644 --- a/tests/baselines/reference/es6ClassTest7.js +++ b/tests/baselines/reference/es6ClassTest7.js @@ -17,8 +17,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 439f74a9c9d..7c1831ecac4 100644 --- a/tests/baselines/reference/exportAssignmentOfGenericType1.js +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.js @@ -34,8 +34,7 @@ define(["require", "exports", "exportAssignmentOfGenericType1_0"], function (req var M = (function (_super) { __extends(M, _super); function M() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return M; }(q)); diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js index b6eec928a07..518c6636947 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.js +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -32,8 +32,7 @@ var Bbb = (function () { var Aaa = (function (_super) { __extends(Aaa, _super); function Aaa() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Aaa; }(Bbb)); diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js index 508eea66500..b20a463338c 100644 --- a/tests/baselines/reference/extBaseClass1.js +++ b/tests/baselines/reference/extBaseClass1.js @@ -37,8 +37,7 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); @@ -49,8 +48,7 @@ var M; var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(M.B)); @@ -61,8 +59,7 @@ var N; var C3 = (function (_super) { __extends(C3, _super); function C3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 14f3d69ef3e..3ab217eb019 100644 --- a/tests/baselines/reference/extBaseClass2.js +++ b/tests/baselines/reference/extBaseClass2.js @@ -21,8 +21,7 @@ var N; var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C4; }(M.B)); @@ -33,8 +32,7 @@ var M; var C5 = (function (_super) { __extends(C5, _super); function C5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C5; }(B)); diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js index 03bf54db78d..74bbf3a27ac 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -28,8 +28,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 50db54a05e9..fa7963487d5 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -33,8 +33,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 6cab3a8c7f6..596ab319b2c 100644 --- a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js @@ -12,8 +12,7 @@ var __extends = (this && this.__extends) || function (d, b) { var derived = (function (_super) { __extends(derived, _super); function derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return derived; }(base)); diff --git a/tests/baselines/reference/extendClassExpressionFromModule.js b/tests/baselines/reference/extendClassExpressionFromModule.js index c0cb5d49023..895cdedfaff 100644 --- a/tests/baselines/reference/extendClassExpressionFromModule.js +++ b/tests/baselines/reference/extendClassExpressionFromModule.js @@ -31,8 +31,7 @@ var x = foo1; var y = (function (_super) { __extends(y, _super); function y() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return y; }(x)); diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.js b/tests/baselines/reference/extendConstructSignatureInInterface.js index 6985657ced3..4bf92dd0315 100644 --- a/tests/baselines/reference/extendConstructSignatureInInterface.js +++ b/tests/baselines/reference/extendConstructSignatureInInterface.js @@ -20,8 +20,7 @@ var CStatic; var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(CStatic)); diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index 829b1ae1a32..b23b601bc29 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -19,8 +19,7 @@ var x = A; var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 9a2d4fb2adf..78dfaa91827 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.js +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -18,8 +18,7 @@ var x = new Foo(); // legal, considered a constructor function var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 db2fcdbbf36..da081154d8a 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js @@ -51,8 +51,7 @@ var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return VisualizationModel; }(Backbone.Model)); @@ -68,8 +67,7 @@ var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); function VisualizationModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 db11c06d782..267cd86eed0 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen.js @@ -20,8 +20,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f61317c2d50..76fbc3365af 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.js @@ -20,8 +20,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 68a2960b03f..ac44416e133 100644 --- a/tests/baselines/reference/fluentClasses.js +++ b/tests/baselines/reference/fluentClasses.js @@ -35,8 +35,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return this; @@ -46,8 +45,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 7176a27ebc9..4f52b5e1456 100644 --- a/tests/baselines/reference/for-inStatements.js +++ b/tests/baselines/reference/for-inStatements.js @@ -126,8 +126,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 cca8e94dcab..d1181760a36 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.js +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -107,8 +107,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 82910ff0435..3666ad930a6 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -68,8 +68,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(C)); diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 465ea54b73f..433418af41d 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -134,16 +134,14 @@ var AnotherClass = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index e26e49c1b7a..86636b84a87 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -236,8 +236,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -288,8 +287,7 @@ function f6() { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.js b/tests/baselines/reference/functionSubtypingOfVarArgs.js index c604461f32d..55917962184 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.js @@ -32,8 +32,7 @@ var EventBase = (function () { var StringEvent = (function (_super) { __extends(StringEvent, _super); function StringEvent() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 38a98a3f114..a676316459f 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs2.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.js @@ -32,8 +32,7 @@ var EventBase = (function () { var StringEvent = (function (_super) { __extends(StringEvent, _super); function StringEvent() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 5c512883a10..2a6911d9cf5 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -369,16 +369,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.js b/tests/baselines/reference/genericBaseClassLiteralProperty.js index 25dfb7ae722..a075eff9550 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.js @@ -26,8 +26,7 @@ var BaseClass = (function () { var SubClass = (function (_super) { __extends(SubClass, _super); function SubClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 e39353b6a7f..2b562742bf7 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.js @@ -35,8 +35,7 @@ var BaseCollection2 = (function () { var DataView2 = (function (_super) { __extends(DataView2, _super); function DataView2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 53c02a85113..afef6224ba1 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -122,16 +122,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index 3835a4dd787..7b621b3ffd9 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -46,16 +46,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index a16f8bcac68..892cda0ee2d 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -54,8 +54,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index 410675804af..addfbc756a8 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -52,16 +52,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js index 3fbb7c8a901..c2ad2ba29a3 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -46,8 +46,7 @@ var M; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(C1)); diff --git a/tests/baselines/reference/genericClassExpressionInFunction.js b/tests/baselines/reference/genericClassExpressionInFunction.js index d14b70b6312..dc574dedb00 100644 --- a/tests/baselines/reference/genericClassExpressionInFunction.js +++ b/tests/baselines/reference/genericClassExpressionInFunction.js @@ -47,8 +47,7 @@ function B1() { return (function (_super) { __extends(class_1, _super); function class_1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class_1; }(A)); @@ -58,8 +57,7 @@ var B2 = (function () { this.anon = (function (_super) { __extends(class_2, _super); function class_2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class_2; }(A)); @@ -70,8 +68,7 @@ function B3() { return (function (_super) { __extends(Inner, _super); function Inner() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Inner; }(A)); @@ -80,16 +77,14 @@ function B3() { var K = (function (_super) { __extends(K, _super); function K() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return K; }(B1())); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }((new B2().anon))); @@ -97,8 +92,7 @@ var b3Number = B3(); var S = (function (_super) { __extends(S, _super); function S() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return S; }(b3Number)); diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js index a6c14b9ba0f..1f3a6e17f14 100644 --- a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js @@ -14,16 +14,14 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A; }(B)); var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(C)); diff --git a/tests/baselines/reference/genericClassStaticMethod.js b/tests/baselines/reference/genericClassStaticMethod.js index 2124f414172..4609e3bc9db 100644 --- a/tests/baselines/reference/genericClassStaticMethod.js +++ b/tests/baselines/reference/genericClassStaticMethod.js @@ -26,8 +26,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Bar.getFoo = function () { }; diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js index 6f10b979c4a..5371e2479aa 100644 --- a/tests/baselines/reference/genericClasses3.js +++ b/tests/baselines/reference/genericClasses3.js @@ -31,8 +31,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js index 454bc77ae5b..1b455073196 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js @@ -26,8 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js index 26749718d43..0abd655e1da 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js @@ -26,8 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/genericInheritedDefaultConstructors.js b/tests/baselines/reference/genericInheritedDefaultConstructors.js index e7c32cbe73f..059a3213b7a 100644 --- a/tests/baselines/reference/genericInheritedDefaultConstructors.js +++ b/tests/baselines/reference/genericInheritedDefaultConstructors.js @@ -24,8 +24,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/genericPrototypeProperty2.js b/tests/baselines/reference/genericPrototypeProperty2.js index ccaf6fa8807..eac025cce9b 100644 --- a/tests/baselines/reference/genericPrototypeProperty2.js +++ b/tests/baselines/reference/genericPrototypeProperty2.js @@ -29,8 +29,7 @@ var BaseEvent = (function () { var MyEvent = (function (_super) { __extends(MyEvent, _super); function MyEvent() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyEvent; }(BaseEvent)); @@ -42,8 +41,7 @@ var BaseEventWrapper = (function () { var MyEventWrapper = (function (_super) { __extends(MyEventWrapper, _super); function MyEventWrapper() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyEventWrapper; }(BaseEventWrapper)); diff --git a/tests/baselines/reference/genericPrototypeProperty3.js b/tests/baselines/reference/genericPrototypeProperty3.js index 85658593705..9e3ede0019d 100644 --- a/tests/baselines/reference/genericPrototypeProperty3.js +++ b/tests/baselines/reference/genericPrototypeProperty3.js @@ -28,8 +28,7 @@ var BaseEvent = (function () { var MyEvent = (function (_super) { __extends(MyEvent, _super); function MyEvent() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyEvent; }(BaseEvent)); @@ -41,8 +40,7 @@ var BaseEventWrapper = (function () { var MyEventWrapper = (function (_super) { __extends(MyEventWrapper, _super); function MyEventWrapper() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyEventWrapper; }(BaseEventWrapper)); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js index e567e2a8042..6d65ee5531b 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js @@ -57,8 +57,7 @@ var TypeScript2; var PullTypeSymbol = (function (_super) { __extends(PullTypeSymbol, _super); function PullTypeSymbol() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PullTypeSymbol; }(PullSymbol)); diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index 31d2b3976db..687d593f01e 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -28,8 +28,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 41a187edb6a..50dbe5debbd 100644 --- a/tests/baselines/reference/genericTypeAssertions4.js +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -40,8 +40,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.bar = function () { return 1; }; return B; @@ -49,8 +48,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 b776668f2e2..7bbd7351f1d 100644 --- a/tests/baselines/reference/genericTypeAssertions6.js +++ b/tests/baselines/reference/genericTypeAssertions6.js @@ -44,8 +44,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.g = function (x) { var a = x; diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index 39468204a5a..cf19feede34 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -60,8 +60,7 @@ var g = function f(x) { var y; return y; }; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -77,8 +76,7 @@ var M; var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a41d459b445..973ee231762 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -55,16 +55,14 @@ var g = function f(x) { var y; return y; }; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(I)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 c0498b351e1..d6fb98b67ca 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -31,8 +31,7 @@ define(["require", "exports"], function (require, exports) { var List = (function (_super) { __extends(List, _super); function List() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } List.prototype.Bar = function () { }; return List; @@ -47,8 +46,7 @@ define(["require", "exports"], function (require, exports) { var ListItem = (function (_super) { __extends(ListItem, _super); function ListItem() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ListItem; }(CollectionItem)); diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index e3c50cfa8f7..60a8976722d 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -160,16 +160,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index af1e3be18ff..483370bee5c 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -177,8 +177,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(C)); diff --git a/tests/baselines/reference/implementClausePrecedingExtends.js b/tests/baselines/reference/implementClausePrecedingExtends.js index 0dfc867a2f7..df725cde43a 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.js +++ b/tests/baselines/reference/implementClausePrecedingExtends.js @@ -16,8 +16,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js index 033d6150194..a5a5e02c156 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -99,24 +99,21 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar3; }(Foo)); @@ -131,32 +128,28 @@ var M; var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Baz; }(Foo)); var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar3; }(Foo)); @@ -172,16 +165,14 @@ var M2; var Baz = (function (_super) { __extends(Baz, _super); function Baz() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Baz; }(Foo)); var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar; }(Foo)); @@ -192,16 +183,14 @@ var M2; var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar2; }(Foo)); var Bar3 = (function (_super) { __extends(Bar3, _super); function Bar3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar3; }(Foo)); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js index 78cfb6b51b9..d0f74847141 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js @@ -75,32 +75,28 @@ var Bar4 = (function () { var Bar5 = (function (_super) { __extends(Bar5, _super); function Bar5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar5; }(Foo)); var Bar6 = (function (_super) { __extends(Bar6, _super); function Bar6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar6; }(Foo)); var Bar7 = (function (_super) { __extends(Bar7, _super); function Bar7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar7; }(Foo)); var Bar8 = (function (_super) { __extends(Bar8, _super); function Bar8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar8; }(Foo)); diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js index d9f40f83051..b4f45cac806 100644 --- a/tests/baselines/reference/importAsBaseClass.js +++ b/tests/baselines/reference/importAsBaseClass.js @@ -30,8 +30,7 @@ var Greeter = require("./importAsBaseClass_0"); var Hello = (function (_super) { __extends(Hello, _super); function Hello() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Hello; }(Greeter)); diff --git a/tests/baselines/reference/importHelpers.js b/tests/baselines/reference/importHelpers.js index 6641ef9d212..ae4d3127010 100644 --- a/tests/baselines/reference/importHelpers.js +++ b/tests/baselines/reference/importHelpers.js @@ -45,8 +45,7 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -94,8 +93,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersAmd.js b/tests/baselines/reference/importHelpersAmd.js index 89fab70bdba..fea93840fa9 100644 --- a/tests/baselines/reference/importHelpersAmd.js +++ b/tests/baselines/reference/importHelpersAmd.js @@ -32,8 +32,7 @@ define(["require", "exports", "tslib", "./a"], function (require, exports, tslib var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 2a97d3d2d87..28c00f97554 100644 --- a/tests/baselines/reference/importHelpersInIsolatedModules.js +++ b/tests/baselines/reference/importHelpersInIsolatedModules.js @@ -45,8 +45,7 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -79,8 +78,7 @@ var A = (function () { var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersNoHelpers.js b/tests/baselines/reference/importHelpersNoHelpers.js index d5f8db60f97..e22d1f4353d 100644 --- a/tests/baselines/reference/importHelpersNoHelpers.js +++ b/tests/baselines/reference/importHelpersNoHelpers.js @@ -39,8 +39,7 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -88,8 +87,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersNoModule.js b/tests/baselines/reference/importHelpersNoModule.js index 5891922f9f2..41df9710f33 100644 --- a/tests/baselines/reference/importHelpersNoModule.js +++ b/tests/baselines/reference/importHelpersNoModule.js @@ -37,8 +37,7 @@ exports.A = A; var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -86,8 +85,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/importHelpersOutFile.js b/tests/baselines/reference/importHelpersOutFile.js index b4c2040aa71..a45f6285782 100644 --- a/tests/baselines/reference/importHelpersOutFile.js +++ b/tests/baselines/reference/importHelpersOutFile.js @@ -35,8 +35,7 @@ define("b", ["require", "exports", "tslib", "a"], function (require, exports, ts var B = (function (_super) { tslib_1.__extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(a_1.A)); @@ -47,8 +46,7 @@ define("c", ["require", "exports", "tslib", "a"], function (require, exports, ts var C = (function (_super) { tslib_2.__extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 552bd0ed404..20f2d299c52 100644 --- a/tests/baselines/reference/importHelpersSystem.js +++ b/tests/baselines/reference/importHelpersSystem.js @@ -51,8 +51,7 @@ System.register(["tslib", "./a"], function (exports_1, context_1) { B = (function (_super) { tslib_1.__extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 b4950b039f3..34cc0604e7a 100644 --- a/tests/baselines/reference/importShadowsGlobalName.js +++ b/tests/baselines/reference/importShadowsGlobalName.js @@ -31,8 +31,7 @@ define(["require", "exports", "Foo"], function (require, exports, Error) { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar; }(Error)); diff --git a/tests/baselines/reference/importUsedInExtendsList1.js b/tests/baselines/reference/importUsedInExtendsList1.js index 956e20a1045..a40c3a51a78 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.js +++ b/tests/baselines/reference/importUsedInExtendsList1.js @@ -31,8 +31,7 @@ var foo = require("./importUsedInExtendsList1_require"); var Sub = (function (_super) { __extends(Sub, _super); function Sub() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 c8b910abb2d..d7357f021d0 100644 --- a/tests/baselines/reference/indexerConstraints2.js +++ b/tests/baselines/reference/indexerConstraints2.js @@ -42,8 +42,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -56,8 +55,7 @@ var F = (function () { var G = (function (_super) { __extends(G, _super); function G() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return G; }(F)); @@ -70,8 +68,7 @@ var H = (function () { var I = (function (_super) { __extends(I, _super); function I() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return I; }(H)); @@ -84,8 +81,7 @@ var J = (function () { var K = (function (_super) { __extends(K, _super); function K() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return K; }(J)); diff --git a/tests/baselines/reference/indirectSelfReference.js b/tests/baselines/reference/indirectSelfReference.js index c1c77ec5fc9..2f4f37b9b53 100644 --- a/tests/baselines/reference/indirectSelfReference.js +++ b/tests/baselines/reference/indirectSelfReference.js @@ -11,16 +11,14 @@ var __extends = (this && this.__extends) || function (d, b) { var a = (function (_super) { __extends(a, _super); function a() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return a; }(b)); var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.js b/tests/baselines/reference/indirectSelfReferenceGeneric.js index 366ad1f0af5..9171bb0eeb6 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.js +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.js @@ -11,16 +11,14 @@ var __extends = (this && this.__extends) || function (d, b) { var a = (function (_super) { __extends(a, _super); function a() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return a; }(b)); var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js index 9b145b55d04..ad1a063bfb0 100644 --- a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js @@ -43,8 +43,7 @@ var Base = (function () { var A = (function (_super) { __extends(A, _super); function A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A; }(Base)); diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.js b/tests/baselines/reference/inheritFromGenericTypeParameter.js index 5db269f7c58..40e6abd3e53 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.js +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(T)); diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js index 7f3e872245b..a0874eb1c72 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js @@ -24,16 +24,14 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(B)); diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js index c4acea22260..cbfef2d3382 100644 --- a/tests/baselines/reference/inheritance.js +++ b/tests/baselines/reference/inheritance.js @@ -53,16 +53,14 @@ var B2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(B2)); @@ -74,8 +72,7 @@ var N = (function () { var ND = (function (_super) { __extends(ND, _super); function ND() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ND; }(N)); @@ -89,8 +86,7 @@ var Good = (function () { var Baad = (function (_super) { __extends(Baad, _super); function Baad() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f555d5bf694..86de0b76350 100644 --- a/tests/baselines/reference/inheritance1.js +++ b/tests/baselines/reference/inheritance1.js @@ -75,8 +75,7 @@ var Control = (function () { var Button = (function (_super) { __extends(Button, _super); function Button() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Button.prototype.select = function () { }; return Button; @@ -84,8 +83,7 @@ var Button = (function (_super) { var TextBox = (function (_super) { __extends(TextBox, _super); function TextBox() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } TextBox.prototype.select = function () { }; return TextBox; @@ -93,16 +91,14 @@ var TextBox = (function (_super) { var ImageBase = (function (_super) { __extends(ImageBase, _super); function ImageBase() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ImageBase; }(Control)); var Image1 = (function (_super) { __extends(Image1, _super); function Image1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Image1; }(Control)); diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js index 2ed366d7b8a..57a9c897583 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -25,16 +25,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 369c6b20a14..83c5aa3e4cd 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -25,16 +25,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 d884364d95c..b11b6e318a7 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -25,16 +25,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 c1289f99a78..09ea08899d9 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js @@ -40,8 +40,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 665b547154d..59d2abdaab2 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js @@ -31,8 +31,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a9a92003542..98a95747a8e 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js @@ -26,8 +26,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 17541ee163d..0d54e5d42fa 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js @@ -37,8 +37,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a154d0426a9..9af25c6fdb8 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js @@ -28,8 +28,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 be10895642e..5c77ce08101 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js @@ -23,8 +23,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 6895077abda..82c7a94d17c 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js @@ -37,8 +37,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js index 00c1093053b..e6929218e63 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js @@ -26,8 +26,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js index 6cbb7ae7e8c..85764cddc52 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js @@ -21,8 +21,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js index 370e27514c1..28fe8144509 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -21,8 +21,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js index a61b6bafabd..0cc71e168f4 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -40,8 +40,7 @@ var N; var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(M.C1)); @@ -49,8 +48,7 @@ var N; var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 9f71208e5db..bb91ee5f9ea 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js @@ -40,8 +40,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 2e0c3dc90d0..363852a84bf 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js @@ -31,8 +31,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 95bf94572b1..ba8df7a5f0b 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js @@ -26,8 +26,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 25d75bea5af..e464029fba5 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js @@ -37,8 +37,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 5c39c10e738..cc825cfa9b5 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js @@ -32,8 +32,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 c37caf8d53c..466c65fa7d5 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js @@ -28,8 +28,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 eb185d56d0b..dfc0ce2c13f 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js @@ -23,8 +23,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 0779cc10d37..da7850f2071 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js @@ -23,8 +23,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 4934947233f..d5916a9d452 100644 --- a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js @@ -23,8 +23,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 27a65d513fd..b4cae99b64b 100644 --- a/tests/baselines/reference/inheritanceStaticMembersCompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.js @@ -21,8 +21,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js index 7cfafdf1f9d..38c637dd8d1 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js @@ -21,8 +21,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js index 1840a7829e8..49dc86fc500 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js @@ -36,8 +36,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js index 8e498273b86..bcd63537540 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js @@ -26,8 +26,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js index c003eaa60b4..c1bdd9b66a2 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js @@ -21,8 +21,7 @@ var a = (function () { var b = (function (_super) { __extends(b, _super); function b() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return b; }(a)); diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.js b/tests/baselines/reference/inheritedConstructorWithRestParams.js index ca6a379816f..c9db1756676 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.js @@ -32,8 +32,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.js b/tests/baselines/reference/inheritedConstructorWithRestParams2.js index b323aefbd48..9a1b13a8434 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.js @@ -53,16 +53,14 @@ var BaseBase2 = (function () { var Base = (function (_super) { __extends(Base, _super); function Base() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Base; }(BaseBase)); var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js index 1de6f5f638a..7ba382e8c47 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.js +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -38,8 +38,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -54,8 +53,7 @@ var D; var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f78378f0885..b8f39c5b0e2 100644 --- a/tests/baselines/reference/instanceOfAssignability.js +++ b/tests/baselines/reference/instanceOfAssignability.js @@ -115,16 +115,14 @@ var Animal = (function () { var Mammal = (function (_super) { __extends(Mammal, _super); function Mammal() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Mammal; }(Animal)); var Giraffe = (function (_super) { __extends(Giraffe, _super); function Giraffe() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Giraffe; }(Mammal)); diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js index cf056e768d8..8dc5227685f 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js @@ -69,8 +69,7 @@ var NonGeneric; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -102,8 +101,7 @@ var Generic; var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/instanceSubtypeCheck2.js b/tests/baselines/reference/instanceSubtypeCheck2.js index e70dc7b6481..914f3796001 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.js +++ b/tests/baselines/reference/instanceSubtypeCheck2.js @@ -21,8 +21,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js index de2789caa68..54a574238e5 100644 --- a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js +++ b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js @@ -128,8 +128,7 @@ var A = (function () { var A1 = (function (_super) { __extends(A1, _super); function A1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A1; }(A)); @@ -141,8 +140,7 @@ var A2 = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.js b/tests/baselines/reference/instantiatedReturnTypeContravariance.js index 83ad38e64f0..bc496a63632 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.js +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.js @@ -47,8 +47,7 @@ var c = (function () { var d = (function (_super) { __extends(d, _super); function d() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 6111e7f8cee..6542376a19b 100644 --- a/tests/baselines/reference/interfaceClassMerging.js +++ b/tests/baselines/reference/interfaceClassMerging.js @@ -57,8 +57,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 499bd219905..70a62da4131 100644 --- a/tests/baselines/reference/interfaceClassMerging2.js +++ b/tests/baselines/reference/interfaceClassMerging2.js @@ -53,8 +53,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 70ceaa8acd3..8324a001f91 100644 --- a/tests/baselines/reference/interfaceExtendsClass1.js +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -32,8 +32,7 @@ var Control = (function () { var Button = (function (_super) { __extends(Button, _super); function Button() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Button.prototype.select = function () { }; return Button; @@ -41,8 +40,7 @@ var Button = (function (_super) { var TextBox = (function (_super) { __extends(TextBox, _super); function TextBox() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } TextBox.prototype.select = function () { }; return TextBox; @@ -50,8 +48,7 @@ var TextBox = (function (_super) { var Image = (function (_super) { __extends(Image, _super); function Image() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Image; }(Control)); diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js index 5e6695dd200..1179ff101df 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -43,8 +43,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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/interfaceImplementation8.js b/tests/baselines/reference/interfaceImplementation8.js index f3bfa4db6a5..afb5a795264 100644 --- a/tests/baselines/reference/interfaceImplementation8.js +++ b/tests/baselines/reference/interfaceImplementation8.js @@ -64,24 +64,21 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C4; }(C1)); var C5 = (function (_super) { __extends(C5, _super); function C5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C5; }(C2)); var C6 = (function (_super) { __extends(C6, _super); function C6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C6; }(C3)); @@ -93,8 +90,7 @@ var C7 = (function () { var C8 = (function (_super) { __extends(C8, _super); function C8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C8; }(C7)); diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js index 75bf3f91884..6e9b09c906f 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js @@ -95,8 +95,7 @@ var Y; var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return BB; }(A)); @@ -111,8 +110,7 @@ var Y2; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(AA)); @@ -146,8 +144,7 @@ var YY; var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return BB; }(A)); @@ -162,8 +159,7 @@ var YY2; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(AA)); @@ -197,8 +193,7 @@ var YYY; var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return BB; }(A)); @@ -213,8 +208,7 @@ var YYY2; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(AA)); diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js index b4fbd6f3698..340429cc398 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.js +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -67,8 +67,7 @@ var C = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(C)); diff --git a/tests/baselines/reference/invalidReturnStatements.js b/tests/baselines/reference/invalidReturnStatements.js index 1409b1c59a8..a6b07b7d7bd 100644 --- a/tests/baselines/reference/invalidReturnStatements.js +++ b/tests/baselines/reference/invalidReturnStatements.js @@ -41,8 +41,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/isolatedModulesImportExportElision.js b/tests/baselines/reference/isolatedModulesImportExportElision.js index baf2d1de129..6f1d38dcbb5 100644 --- a/tests/baselines/reference/isolatedModulesImportExportElision.js +++ b/tests/baselines/reference/isolatedModulesImportExportElision.js @@ -26,8 +26,7 @@ var ns = require("module"); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 c149d4e3c3d..604787af744 100644 --- a/tests/baselines/reference/jsxViaImport.js +++ b/tests/baselines/reference/jsxViaImport.js @@ -35,8 +35,7 @@ var BaseComponent = require("BaseComponent"); var TestComponent = (function (_super) { __extends(TestComponent, _super); function TestComponent() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 16653cfb4f3..47db7f3ce64 100644 --- a/tests/baselines/reference/lambdaArgCrash.js +++ b/tests/baselines/reference/lambdaArgCrash.js @@ -56,8 +56,7 @@ var Event = (function () { var ItemSetEvent = (function (_super) { __extends(ItemSetEvent, _super); function ItemSetEvent() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } ItemSetEvent.prototype.add = function (listener) { _super.prototype.add.call(this, listener); diff --git a/tests/baselines/reference/localTypes1.js b/tests/baselines/reference/localTypes1.js index 96c9337817d..100452b7a96 100644 --- a/tests/baselines/reference/localTypes1.js +++ b/tests/baselines/reference/localTypes1.js @@ -300,8 +300,7 @@ function f6() { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -309,8 +308,7 @@ function f6() { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/m7Bugs.js b/tests/baselines/reference/m7Bugs.js index 19cd9ee4630..e5a4d11f00c 100644 --- a/tests/baselines/reference/m7Bugs.js +++ b/tests/baselines/reference/m7Bugs.js @@ -42,8 +42,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/mergedDeclarations5.js b/tests/baselines/reference/mergedDeclarations5.js index 53a8c983399..b24e86eca58 100644 --- a/tests/baselines/reference/mergedDeclarations5.js +++ b/tests/baselines/reference/mergedDeclarations5.js @@ -27,8 +27,7 @@ var __extends = (this && this.__extends) || function (d, b) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 50108773a70..d610e4ab46f 100644 --- a/tests/baselines/reference/mergedDeclarations6.js +++ b/tests/baselines/reference/mergedDeclarations6.js @@ -47,8 +47,7 @@ define(["require", "exports", "./a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 fd0bea5494c..0f598f2cf78 100644 --- a/tests/baselines/reference/mergedInheritedClassInterface.js +++ b/tests/baselines/reference/mergedInheritedClassInterface.js @@ -61,8 +61,7 @@ var BaseClass = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Child.prototype.method = function () { }; return Child; @@ -76,8 +75,7 @@ var ChildNoBaseClass = (function () { var Grandchild = (function (_super) { __extends(Grandchild, _super); function Grandchild() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Grandchild; }(ChildNoBaseClass)); diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js index a3baa1920e3..6dccf1dfdd9 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -50,16 +50,14 @@ var C2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(C2)); diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js index e21ca151c87..a3ca796575c 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js @@ -57,8 +57,7 @@ var C2 = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/moduleAsBaseType.js b/tests/baselines/reference/moduleAsBaseType.js index 598ddaef2de..fc0533a2470 100644 --- a/tests/baselines/reference/moduleAsBaseType.js +++ b/tests/baselines/reference/moduleAsBaseType.js @@ -13,8 +13,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(M)); diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js index 2f4ac430cc1..51d9eb89b1d 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js @@ -31,8 +31,7 @@ define(["require", "exports"], function (require, exports) { var Test1 = (function (_super) { __extends(Test1, _super); function Test1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Test1; }(C1)); diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js index 11053d76d2d..1558ef742ab 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -79,16 +79,14 @@ var A; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(AA)); var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return BB; }(A)); @@ -132,8 +130,7 @@ var Y; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(AA)); @@ -141,8 +138,7 @@ var Y; var BB = (function (_super) { __extends(BB, _super); function BB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return BB; }(A)); diff --git a/tests/baselines/reference/multipleInheritance.js b/tests/baselines/reference/multipleInheritance.js index 80e9a469398..9c0e865cdb7 100644 --- a/tests/baselines/reference/multipleInheritance.js +++ b/tests/baselines/reference/multipleInheritance.js @@ -57,32 +57,28 @@ var B2 = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B1)); var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(B2)); var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(D1)); @@ -94,8 +90,7 @@ var N = (function () { var ND = (function (_super) { __extends(ND, _super); function ND() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ND; }(N)); @@ -109,8 +104,7 @@ var Good = (function () { var Baad = (function (_super) { __extends(Baad, _super); function Baad() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 7c5ec66c6be..8b59564d465 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -25,8 +25,7 @@ var foo = (function () { var foo2 = (function (_super) { __extends(foo2, _super); function foo2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return foo2; }(foo)); diff --git a/tests/baselines/reference/noEmitHelpers.js b/tests/baselines/reference/noEmitHelpers.js index c3d27cac8a9..fdb7cbab7d4 100644 --- a/tests/baselines/reference/noEmitHelpers.js +++ b/tests/baselines/reference/noEmitHelpers.js @@ -13,8 +13,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js index d0e87aba25b..cc4c9422373 100644 --- a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js @@ -26,8 +26,7 @@ var Parent = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 1b4119227bc..1323955c05e 100644 --- a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js @@ -25,8 +25,7 @@ var Parent = (function () { var Child = (function (_super) { __extends(Child, _super); function Child() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 bbab8e9ccdd..b0a3365193d 100644 --- a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -19,8 +19,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 1901e169447..92c8b380e00 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -61,8 +61,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 97c3e56d423..29cb75b4234 100644 --- a/tests/baselines/reference/numericIndexerConstraint3.js +++ b/tests/baselines/reference/numericIndexerConstraint3.js @@ -26,8 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js index 732f7e2672c..135e169c4a9 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.js +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -26,8 +26,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js index 1d38f844384..5b9e797bdec 100644 --- a/tests/baselines/reference/numericIndexerTyping2.js +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -26,8 +26,7 @@ var I = (function () { var I2 = (function (_super) { __extends(I2, _super); function I2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return I2; }(I)); diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index 76c18900945..17045d65af0 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -68,8 +68,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js index 3df18cb27cb..e82cef9bdd6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -147,16 +147,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js index e7d2f603d5c..abcea113670 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -140,8 +140,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -163,16 +162,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js index e0b75f54208..f5aeb177472 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -147,16 +147,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js index 681af407bd4..3946027063f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -145,16 +145,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js index 2011b741df2..9cae6960a2e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -53,8 +53,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js index 80bdd4c87e1..68754a583aa 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js @@ -39,8 +39,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(C1)); @@ -54,8 +53,7 @@ var C3 = (function () { var C4 = (function (_super) { __extends(C4, _super); function C4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C4; }(C3)); diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js index 3eac80c60fc..b0211bbbba7 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -147,16 +147,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js index d55ef5eb28c..00d7d1e81d8 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -140,8 +140,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -163,16 +162,14 @@ var C = (function () { var PA = (function (_super) { __extends(PA, _super); function PA() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PA; }(A)); var PB = (function (_super) { __extends(PB, _super); function PB() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return PB; }(B)); diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index 04056fa9c14..e460ab3fb15 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -25,8 +25,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js index a8bd88ed3a8..1312a89502a 100644 --- a/tests/baselines/reference/optionalParamInOverride.js +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -22,8 +22,7 @@ var Z = (function () { var Y = (function (_super) { __extends(Y, _super); function Y() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Y.prototype.func = function (value) { }; return Y; diff --git a/tests/baselines/reference/outModuleConcatAmd.js b/tests/baselines/reference/outModuleConcatAmd.js index 5643875efd3..5054c2a3c33 100644 --- a/tests/baselines/reference/outModuleConcatAmd.js +++ b/tests/baselines/reference/outModuleConcatAmd.js @@ -28,8 +28,7 @@ define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 25873d9cd07..e987d5deb8a 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,kDAAC;;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 2fa35a323a0..1bfda049776 100644 --- a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt @@ -92,35 +92,27 @@ sourceFile:tests/cases/compiler/b.ts --- >>> function B() { 1 >^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(19, 9) Source(2, 1) + SourceIndex(1) --- ->>> var _this = _super.apply(this, arguments) || this; -1->^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1->export class B extends -2 > A -1->Emitted(20, 13) Source(2, 24) + SourceIndex(1) -2 >Emitted(20, 63) Source(2, 25) + SourceIndex(1) ---- ->>> return _this; +>>> return _super.apply(this, arguments) || this; >>> } -1 >^^^^^^^^ +1->^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> -1 > { +1->export class B extends A { 2 > } -1 >Emitted(22, 9) Source(2, 28) + SourceIndex(1) -2 >Emitted(22, 10) Source(2, 29) + SourceIndex(1) +1->Emitted(21, 9) Source(2, 28) + SourceIndex(1) +2 >Emitted(21, 10) Source(2, 29) + SourceIndex(1) --- >>> return B; 1->^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(23, 9) Source(2, 28) + SourceIndex(1) -2 >Emitted(23, 17) Source(2, 29) + SourceIndex(1) +1->Emitted(22, 9) Source(2, 28) + SourceIndex(1) +2 >Emitted(22, 17) Source(2, 29) + SourceIndex(1) --- >>> }(a_1.A)); 1 >^^^^ @@ -136,20 +128,20 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(24, 5) Source(2, 28) + SourceIndex(1) -2 >Emitted(24, 6) Source(2, 29) + SourceIndex(1) -3 >Emitted(24, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(24, 7) Source(2, 24) + SourceIndex(1) -5 >Emitted(24, 12) Source(2, 25) + SourceIndex(1) -6 >Emitted(24, 15) Source(2, 29) + SourceIndex(1) +1 >Emitted(23, 5) Source(2, 28) + SourceIndex(1) +2 >Emitted(23, 6) Source(2, 29) + SourceIndex(1) +3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(23, 7) Source(2, 24) + SourceIndex(1) +5 >Emitted(23, 12) Source(2, 25) + SourceIndex(1) +6 >Emitted(23, 15) Source(2, 29) + SourceIndex(1) --- >>> exports.B = B; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > export class B extends A { } -1->Emitted(25, 5) Source(2, 1) + SourceIndex(1) -2 >Emitted(25, 19) Source(2, 29) + SourceIndex(1) +1->Emitted(24, 5) Source(2, 1) + SourceIndex(1) +2 >Emitted(24, 19) Source(2, 29) + SourceIndex(1) --- >>>}); >>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatSystem.js b/tests/baselines/reference/outModuleConcatSystem.js index eecb4101958..a615090f33a 100644 --- a/tests/baselines/reference/outModuleConcatSystem.js +++ b/tests/baselines/reference/outModuleConcatSystem.js @@ -44,8 +44,7 @@ System.register("b", ["ref/a"], function (exports_2, context_2) { B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f77bed44ffc..ac8fb23d87c 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,kDAAC;;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 5287a760ac8..732214237fa 100644 --- a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt @@ -109,35 +109,27 @@ sourceFile:tests/cases/compiler/b.ts --- >>> function B() { 1 >^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(35, 17) Source(2, 1) + SourceIndex(1) --- ->>> var _this = _super.apply(this, arguments) || this; -1->^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1->export class B extends -2 > A -1->Emitted(36, 21) Source(2, 24) + SourceIndex(1) -2 >Emitted(36, 71) Source(2, 25) + SourceIndex(1) ---- ->>> return _this; +>>> return _super.apply(this, arguments) || this; >>> } -1 >^^^^^^^^^^^^^^^^ +1->^^^^^^^^^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> -1 > { +1->export class B extends A { 2 > } -1 >Emitted(38, 17) Source(2, 28) + SourceIndex(1) -2 >Emitted(38, 18) Source(2, 29) + SourceIndex(1) +1->Emitted(37, 17) Source(2, 28) + SourceIndex(1) +2 >Emitted(37, 18) Source(2, 29) + SourceIndex(1) --- >>> return B; 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(39, 17) Source(2, 28) + SourceIndex(1) -2 >Emitted(39, 25) Source(2, 29) + SourceIndex(1) +1->Emitted(38, 17) Source(2, 28) + SourceIndex(1) +2 >Emitted(38, 25) Source(2, 29) + SourceIndex(1) --- >>> }(a_1.A)); 1 >^^^^^^^^^^^^ @@ -153,12 +145,12 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(40, 13) Source(2, 28) + SourceIndex(1) -2 >Emitted(40, 14) Source(2, 29) + SourceIndex(1) -3 >Emitted(40, 14) Source(2, 1) + SourceIndex(1) -4 >Emitted(40, 15) Source(2, 24) + SourceIndex(1) -5 >Emitted(40, 20) Source(2, 25) + SourceIndex(1) -6 >Emitted(40, 23) Source(2, 29) + SourceIndex(1) +1 >Emitted(39, 13) Source(2, 28) + SourceIndex(1) +2 >Emitted(39, 14) Source(2, 29) + SourceIndex(1) +3 >Emitted(39, 14) Source(2, 1) + SourceIndex(1) +4 >Emitted(39, 15) Source(2, 24) + SourceIndex(1) +5 >Emitted(39, 20) Source(2, 25) + SourceIndex(1) +6 >Emitted(39, 23) Source(2, 29) + SourceIndex(1) --- >>> exports_2("B", B); >>> } @@ -166,8 +158,8 @@ sourceFile:tests/cases/compiler/b.ts 2 > ^ 1-> 2 > -1->Emitted(42, 9) Source(2, 29) + SourceIndex(1) -2 >Emitted(42, 10) Source(2, 30) + SourceIndex(1) +1->Emitted(41, 9) Source(2, 29) + SourceIndex(1) +2 >Emitted(41, 10) Source(2, 30) + SourceIndex(1) --- >>> }; >>>}); diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js b/tests/baselines/reference/outModuleTripleSlashRefs.js index ac2f2510b64..b9ff7c15b61 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.js +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js @@ -57,8 +57,7 @@ define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 1cdbef49afa..45d57990450 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,kDAAC;;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 e940429a74b..482c898e0cb 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt +++ b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt @@ -168,35 +168,27 @@ sourceFile:tests/cases/compiler/b.ts --- >>> function B() { 1 >^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(26, 9) Source(2, 1) + SourceIndex(2) --- ->>> var _this = _super.apply(this, arguments) || this; -1->^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1->export class B extends -2 > A -1->Emitted(27, 13) Source(2, 24) + SourceIndex(2) -2 >Emitted(27, 63) Source(2, 25) + SourceIndex(2) ---- ->>> return _this; +>>> return _super.apply(this, arguments) || this; >>> } -1 >^^^^^^^^ +1->^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^-> -1 > { +1->export class B extends A { 2 > } -1 >Emitted(29, 9) Source(2, 28) + SourceIndex(2) -2 >Emitted(29, 10) Source(2, 29) + SourceIndex(2) +1->Emitted(28, 9) Source(2, 28) + SourceIndex(2) +2 >Emitted(28, 10) Source(2, 29) + SourceIndex(2) --- >>> return B; 1->^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(30, 9) Source(2, 28) + SourceIndex(2) -2 >Emitted(30, 17) Source(2, 29) + SourceIndex(2) +1->Emitted(29, 9) Source(2, 28) + SourceIndex(2) +2 >Emitted(29, 17) Source(2, 29) + SourceIndex(2) --- >>> }(a_1.A)); 1 >^^^^ @@ -212,20 +204,20 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(31, 5) Source(2, 28) + SourceIndex(2) -2 >Emitted(31, 6) Source(2, 29) + SourceIndex(2) -3 >Emitted(31, 6) Source(2, 1) + SourceIndex(2) -4 >Emitted(31, 7) Source(2, 24) + SourceIndex(2) -5 >Emitted(31, 12) Source(2, 25) + SourceIndex(2) -6 >Emitted(31, 15) Source(2, 29) + SourceIndex(2) +1 >Emitted(30, 5) Source(2, 28) + SourceIndex(2) +2 >Emitted(30, 6) Source(2, 29) + SourceIndex(2) +3 >Emitted(30, 6) Source(2, 1) + SourceIndex(2) +4 >Emitted(30, 7) Source(2, 24) + SourceIndex(2) +5 >Emitted(30, 12) Source(2, 25) + SourceIndex(2) +6 >Emitted(30, 15) Source(2, 29) + SourceIndex(2) --- >>> exports.B = B; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > export class B extends A { } -1->Emitted(32, 5) Source(2, 1) + SourceIndex(2) -2 >Emitted(32, 19) Source(2, 29) + SourceIndex(2) +1->Emitted(31, 5) Source(2, 1) + SourceIndex(2) +2 >Emitted(31, 19) Source(2, 29) + SourceIndex(2) --- >>>}); >>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/overload1.js b/tests/baselines/reference/overload1.js index d83c8aea7ad..41aafdfb29c 100644 --- a/tests/baselines/reference/overload1.js +++ b/tests/baselines/reference/overload1.js @@ -56,8 +56,7 @@ var O; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -65,8 +64,7 @@ var O; var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js index ad49f8e9d7a..f9d1c81b06b 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -37,8 +37,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -46,8 +45,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -55,8 +53,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 2b521b4baf5..a680a62ddfe 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -25,16 +25,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 df5e0065adb..025e449fd6f 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -27,16 +27,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 49d96b97b74..0f436a5f0b2 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -36,16 +36,14 @@ var A = (function (_super) { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 5d0546d0edc..e3f58c0f7d0 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -26,8 +26,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -35,8 +34,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -44,8 +42,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 c34d037b350..e5cc35c39c4 100644 --- a/tests/baselines/reference/overloadResolution.js +++ b/tests/baselines/reference/overloadResolution.js @@ -108,24 +108,21 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js index 0a899584c18..7c8b2e2ccb6 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.js +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -115,24 +115,21 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js index 42dceff061e..44bbfbcec2b 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.js +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -116,24 +116,21 @@ var SomeBase = (function () { var SomeDerived1 = (function (_super) { __extends(SomeDerived1, _super); function SomeDerived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived1; }(SomeBase)); var SomeDerived2 = (function (_super) { __extends(SomeDerived2, _super); function SomeDerived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived2; }(SomeBase)); var SomeDerived3 = (function (_super) { __extends(SomeDerived3, _super); function SomeDerived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived3; }(SomeBase)); diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js index 52d8a1b7abe..96f4f7baf24 100644 --- a/tests/baselines/reference/overloadingOnConstants1.js +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -40,8 +40,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.prototype.bar = function () { }; return Derived1; @@ -49,8 +48,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived2.prototype.baz = function () { }; return Derived2; @@ -58,8 +56,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 85976ae7fcd..0c34d0f4b76 100644 --- a/tests/baselines/reference/overloadingOnConstants2.js +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -42,8 +42,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.js b/tests/baselines/reference/overridingPrivateStaticMembers.js index b7ad5b66554..ca5616450ba 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.js +++ b/tests/baselines/reference/overridingPrivateStaticMembers.js @@ -21,8 +21,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/parseErrorInHeritageClause1.js b/tests/baselines/reference/parseErrorInHeritageClause1.js index 0a29bdf2da0..a9ca0a6db73 100644 --- a/tests/baselines/reference/parseErrorInHeritageClause1.js +++ b/tests/baselines/reference/parseErrorInHeritageClause1.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parser509630.js b/tests/baselines/reference/parser509630.js index cdef63aa80f..d3648dc5b64 100644 --- a/tests/baselines/reference/parser509630.js +++ b/tests/baselines/reference/parser509630.js @@ -21,8 +21,7 @@ var Type = (function () { var Any = (function (_super) { __extends(Any, _super); function Any() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Any; }(Type)); diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index c7bdb90775e..6b86353b959 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -363,8 +363,7 @@ c2_i.nc_f1(); var c4 = (function (_super) { __extends(c4, _super); function c4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return c4; }(c2)); diff --git a/tests/baselines/reference/parserClassDeclaration1.js b/tests/baselines/reference/parserClassDeclaration1.js index f91efad621e..a61b492b7a9 100644 --- a/tests/baselines/reference/parserClassDeclaration1.js +++ b/tests/baselines/reference/parserClassDeclaration1.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration3.js b/tests/baselines/reference/parserClassDeclaration3.js index 9d51b0ed25e..f58f0ab00cb 100644 --- a/tests/baselines/reference/parserClassDeclaration3.js +++ b/tests/baselines/reference/parserClassDeclaration3.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(B)); diff --git a/tests/baselines/reference/parserClassDeclaration4.js b/tests/baselines/reference/parserClassDeclaration4.js index 7c91281d05c..912aa8c6581 100644 --- a/tests/baselines/reference/parserClassDeclaration4.js +++ b/tests/baselines/reference/parserClassDeclaration4.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration5.js b/tests/baselines/reference/parserClassDeclaration5.js index aeb7ce09190..054aaf0eb7a 100644 --- a/tests/baselines/reference/parserClassDeclaration5.js +++ b/tests/baselines/reference/parserClassDeclaration5.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserClassDeclaration6.js b/tests/baselines/reference/parserClassDeclaration6.js index b14257310c4..1423edfe037 100644 --- a/tests/baselines/reference/parserClassDeclaration6.js +++ b/tests/baselines/reference/parserClassDeclaration6.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 c4a2fd29711..aa0679bb8f5 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ae9d5068e29..1308c7c194b 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 8992706cd16..b1471628fbd 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.js b/tests/baselines/reference/parserGenericsInTypeContexts1.js index 0ec560c1306..641d296dc43 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.js @@ -26,8 +26,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.js b/tests/baselines/reference/parserGenericsInTypeContexts2.js index d4c754fb0b1..b0f14a090ae 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.js @@ -26,8 +26,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/primitiveMembers.js b/tests/baselines/reference/primitiveMembers.js index 5425696b133..7b94b555eb1 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -63,8 +63,7 @@ var baz = (function () { var foo = (function (_super) { __extends(foo, _super); function foo() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 8181d0612a8..7e56edf2cf1 100644 --- a/tests/baselines/reference/privacyClass.js +++ b/tests/baselines/reference/privacyClass.js @@ -152,24 +152,21 @@ var m1; var m1_C1_private = (function (_super) { __extends(m1_C1_private, _super); function m1_C1_private() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m1_C3_public; }(m1_c_public)); @@ -177,8 +174,7 @@ var m1; var m1_C4_public = (function (_super) { __extends(m1_C4_public, _super); function m1_C4_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m1_C4_public; }(m1_c_private)); @@ -208,24 +204,21 @@ var m1; var m1_C9_private = (function (_super) { __extends(m1_C9_private, _super); function m1_C9_private() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m1_C11_public; }(m1_c_public)); @@ -233,8 +226,7 @@ var m1; var m1_C12_public = (function (_super) { __extends(m1_C12_public, _super); function m1_C12_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m1_C12_public; }(m1_c_private)); @@ -258,24 +250,21 @@ var m2; var m2_C1_private = (function (_super) { __extends(m2_C1_private, _super); function m2_C1_private() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m2_C3_public; }(m2_c_public)); @@ -283,8 +272,7 @@ var m2; var m2_C4_public = (function (_super) { __extends(m2_C4_public, _super); function m2_C4_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m2_C4_public; }(m2_c_private)); @@ -314,24 +302,21 @@ var m2; var m2_C9_private = (function (_super) { __extends(m2_C9_private, _super); function m2_C9_private() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m2_C11_public; }(m2_c_public)); @@ -339,8 +324,7 @@ var m2; var m2_C12_public = (function (_super) { __extends(m2_C12_public, _super); function m2_C12_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m2_C12_public; }(m2_c_private)); @@ -362,24 +346,21 @@ var glo_c_private = (function () { var glo_C1_private = (function (_super) { __extends(glo_C1_private, _super); function glo_C1_private() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return glo_C3_public; }(glo_c_public)); @@ -387,8 +368,7 @@ exports.glo_C3_public = glo_C3_public; var glo_C4_public = (function (_super) { __extends(glo_C4_public, _super); function glo_C4_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return glo_C4_public; }(glo_c_private)); @@ -418,24 +398,21 @@ exports.glo_C8_public = glo_C8_public; var glo_C9_private = (function (_super) { __extends(glo_C9_private, _super); function glo_C9_private() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return glo_C11_public; }(glo_c_public)); @@ -443,8 +420,7 @@ exports.glo_C11_public = glo_C11_public; var glo_C12_public = (function (_super) { __extends(glo_C12_public, _super); function glo_C12_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 fe3ae6ba6d0..e0828809416 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js @@ -122,24 +122,21 @@ var publicModule; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPublicModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClassInModule; }(publicClassInPublicModule)); @@ -147,8 +144,7 @@ var publicModule; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); @@ -156,16 +152,14 @@ var publicModule; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -189,24 +183,21 @@ var privateModule; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPrivateModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPrivateModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClassInModule; }(publicClassInPrivateModule)); @@ -214,8 +205,7 @@ var privateModule; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPrivateModule)); @@ -223,16 +213,14 @@ var privateModule; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -254,24 +242,21 @@ var privateClass = (function () { var privateClassExtendingPublicClass = (function (_super) { __extends(privateClassExtendingPublicClass, _super); function privateClassExtendingPublicClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingPublicClass; }(publicClass)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClass)); var publicClassExtendingPublicClass = (function (_super) { __extends(publicClassExtendingPublicClass, _super); function publicClassExtendingPublicClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClass; }(publicClass)); @@ -279,8 +264,7 @@ exports.publicClassExtendingPublicClass = publicClassExtendingPublicClass; var publicClassExtendingPrivateClass = (function (_super) { __extends(publicClassExtendingPrivateClass, _super); function publicClassExtendingPrivateClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPrivateClass; }(privateClass)); @@ -288,16 +272,14 @@ exports.publicClassExtendingPrivateClass = publicClassExtendingPrivateClass; var privateClassExtendingFromPrivateModuleClass = (function (_super) { __extends(privateClassExtendingFromPrivateModuleClass, _super); function privateClassExtendingFromPrivateModuleClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); var publicClassExtendingFromPrivateModuleClass = (function (_super) { __extends(publicClassExtendingFromPrivateModuleClass, _super); function publicClassExtendingFromPrivateModuleClass() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingFromPrivateModuleClass; }(privateModule.publicClassInPrivateModule)); @@ -326,24 +308,21 @@ var publicModuleInGlobal; var privateClassExtendingPublicClassInModule = (function (_super) { __extends(privateClassExtendingPublicClassInModule, _super); function privateClassExtendingPublicClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingPublicClassInModule; }(publicClassInPublicModule)); var privateClassExtendingPrivateClassInModule = (function (_super) { __extends(privateClassExtendingPrivateClassInModule, _super); function privateClassExtendingPrivateClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return privateClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); var publicClassExtendingPublicClassInModule = (function (_super) { __extends(publicClassExtendingPublicClassInModule, _super); function publicClassExtendingPublicClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClassInModule; }(publicClassInPublicModule)); @@ -351,8 +330,7 @@ var publicModuleInGlobal; var publicClassExtendingPrivateClassInModule = (function (_super) { __extends(publicClassExtendingPrivateClassInModule, _super); function publicClassExtendingPrivateClassInModule() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPrivateClassInModule; }(privateClassInPublicModule)); @@ -366,8 +344,7 @@ var publicClassInGlobal = (function () { var publicClassExtendingPublicClassInGlobal = (function (_super) { __extends(publicClassExtendingPublicClassInGlobal, _super); function publicClassExtendingPublicClassInGlobal() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return publicClassExtendingPublicClassInGlobal; }(publicClassInGlobal)); diff --git a/tests/baselines/reference/privacyGloClass.js b/tests/baselines/reference/privacyGloClass.js index 481a3921921..fa769a606ae 100644 --- a/tests/baselines/reference/privacyGloClass.js +++ b/tests/baselines/reference/privacyGloClass.js @@ -84,24 +84,21 @@ var m1; var m1_C1_private = (function (_super) { __extends(m1_C1_private, _super); function m1_C1_private() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m1_C3_public; }(m1_c_public)); @@ -109,8 +106,7 @@ var m1; var m1_C4_public = (function (_super) { __extends(m1_C4_public, _super); function m1_C4_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m1_C4_public; }(m1_c_private)); @@ -140,24 +136,21 @@ var m1; var m1_C9_private = (function (_super) { __extends(m1_C9_private, _super); function m1_C9_private() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m1_C11_public; }(m1_c_public)); @@ -165,8 +158,7 @@ var m1; var m1_C12_public = (function (_super) { __extends(m1_C12_public, _super); function m1_C12_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return m1_C12_public; }(m1_c_private)); @@ -182,8 +174,7 @@ var glo_c_public = (function () { var glo_C3_public = (function (_super) { __extends(glo_C3_public, _super); function glo_C3_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return glo_C3_public; }(glo_c_public)); @@ -195,8 +186,7 @@ var glo_C7_public = (function () { var glo_C11_public = (function (_super) { __extends(glo_C11_public, _super); function glo_C11_public() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ca432ee7ab7..21ff4793fb3 100644 --- a/tests/baselines/reference/privateAccessInSubclass1.js +++ b/tests/baselines/reference/privateAccessInSubclass1.js @@ -23,8 +23,7 @@ var Base = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } D.prototype.myMethod = function () { this.options; diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js index 8b516a5a19c..b732661edfc 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js @@ -40,8 +40,7 @@ var K = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } C.prototype.m2 = function () { var a = this.priv; // error diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index 44adec751bf..11959f2f174 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -29,8 +29,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ed9768b06c2..99a4842f636 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js @@ -14,8 +14,7 @@ var m2; var class1 = (function (_super) { __extends(class1, _super); function class1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class1; }(m2.mExported.me.class1)); @@ -28,8 +27,7 @@ var m2; var class2 = (function (_super) { __extends(class2, _super); function class2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class2; }(m2.mExported.me.class1)); @@ -42,8 +40,7 @@ var m2; var class3 = (function (_super) { __extends(class3, _super); function class3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class3; }(mNonExported.mne.class1)); @@ -56,8 +53,7 @@ var m2; var class4 = (function (_super) { __extends(class4, _super); function class4() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ed9768b06c2..99a4842f636 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js @@ -14,8 +14,7 @@ var m2; var class1 = (function (_super) { __extends(class1, _super); function class1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class1; }(m2.mExported.me.class1)); @@ -28,8 +27,7 @@ var m2; var class2 = (function (_super) { __extends(class2, _super); function class2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class2; }(m2.mExported.me.class1)); @@ -42,8 +40,7 @@ var m2; var class3 = (function (_super) { __extends(class3, _super); function class3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class3; }(mNonExported.mne.class1)); @@ -56,8 +53,7 @@ var m2; var class4 = (function (_super) { __extends(class4, _super); function class4() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 deb73448794..7ee160b82ef 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -18,8 +18,7 @@ var m; var child = (function (_super) { __extends(child, _super); function child() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 deb73448794..7ee160b82ef 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -18,8 +18,7 @@ var m; var child = (function (_super) { __extends(child, _super); function child() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 b5147a28919..b793b07534c 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js @@ -7,8 +7,7 @@ var __extends = (this && this.__extends) || function (d, b) { var ClassC = (function (_super) { __extends(ClassC, _super); function ClassC() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 b5147a28919..b793b07534c 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js @@ -7,8 +7,7 @@ var __extends = (this && this.__extends) || function (d, b) { var ClassC = (function (_super) { __extends(ClassC, _super); function ClassC() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a22f9663754..dff86f3954e 100644 --- a/tests/baselines/reference/propertiesAndIndexers.js +++ b/tests/baselines/reference/propertiesAndIndexers.js @@ -65,8 +65,7 @@ var P = (function () { var Q = (function (_super) { __extends(Q, _super); function Q() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Q; }(P)); diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index 31b90bcf7ac..0a4c9082a21 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -164,8 +164,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index c570642a1ba..d36d7e27efe 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -97,8 +97,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 aebdc2c3ce3..4aedfe12b04 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -72,8 +72,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 442ae29e278..3cb14438141 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -59,8 +59,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 40a1365b7e1..429dfdf6b14 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js @@ -52,8 +52,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Object.defineProperty(C.prototype, "y", { get: function () { return this.x; }, @@ -94,8 +93,7 @@ var C = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return E; }(C)); diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js index e6c768a6759..0571b85ea9e 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js @@ -147,8 +147,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.prototype.method1 = function () { var B = (function () { @@ -174,8 +173,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived2.prototype.method2 = function () { var C = (function () { @@ -201,8 +199,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived3.prototype.method3 = function () { var D = (function () { @@ -228,8 +225,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 3f46b69ecf3..a10b39b402e 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js @@ -34,8 +34,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 44a4fbdf284..a404b8049bc 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js @@ -120,8 +120,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.prototype.method1 = function () { var b; @@ -140,8 +139,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived2.prototype.method2 = function () { var b; @@ -160,8 +158,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived3.prototype.method3 = function () { var b; @@ -180,8 +177,7 @@ var Derived3 = (function (_super) { var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 4cc09bac99d..7d449bdcbd4 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js @@ -30,8 +30,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 003e2f50e6f..3259d401270 100644 --- a/tests/baselines/reference/protectedInstanceMemberAccessibility.js +++ b/tests/baselines/reference/protectedInstanceMemberAccessibility.js @@ -61,8 +61,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.g = function () { var t1 = this.x; @@ -94,8 +93,7 @@ var B = (function (_super) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/protectedMembers.js b/tests/baselines/reference/protectedMembers.js index 984527b2c0d..46b4691dff7 100644 --- a/tests/baselines/reference/protectedMembers.js +++ b/tests/baselines/reference/protectedMembers.js @@ -137,8 +137,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } C2.prototype.f = function () { return _super.prototype.f.call(this) + this.x; @@ -152,8 +151,7 @@ var C2 = (function (_super) { var C3 = (function (_super) { __extends(C3, _super); function C3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } C3.prototype.f = function () { return _super.prototype.f.call(this); @@ -189,16 +187,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 @@ -212,8 +208,7 @@ var C = (function (_super) { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -244,8 +239,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -258,8 +252,7 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js index a272ad42fa1..ad1b1682aa7 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js @@ -63,8 +63,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.staticMethod1 = function () { Base.x; // OK, accessed within a class derived from their declaring class @@ -77,8 +76,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived2.staticMethod2 = function () { Base.x; // OK, accessed within a class derived from their declaring class @@ -91,8 +89,7 @@ var Derived2 = (function (_super) { var Derived3 = (function (_super) { __extends(Derived3, _super); function Derived3() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 2add5e7e154..a2346b8be40 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js @@ -38,8 +38,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived1.staticMethod1 = function () { this.x; // OK, accessed within a class derived from their declaring class @@ -50,8 +49,7 @@ var Derived1 = (function (_super) { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 225acf74bbe..a881eb55a18 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,8 +19,7 @@ var Alpha; var Beta = (function (_super) { __extends(Beta, _super); function Beta() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Beta; }(Alpha.x)); diff --git a/tests/baselines/reference/recursiveBaseCheck3.js b/tests/baselines/reference/recursiveBaseCheck3.js index 5b3e829d2e6..250a9e0b618 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.js +++ b/tests/baselines/reference/recursiveBaseCheck3.js @@ -13,16 +13,14 @@ var __extends = (this && this.__extends) || function (d, b) { var A = (function (_super) { __extends(A, _super); function A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return A; }(C)); var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/recursiveBaseCheck4.js b/tests/baselines/reference/recursiveBaseCheck4.js index b515c7ab318..7f0c6b5f95d 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.js +++ b/tests/baselines/reference/recursiveBaseCheck4.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var M = (function (_super) { __extends(M, _super); function M() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return M; }(M)); diff --git a/tests/baselines/reference/recursiveBaseCheck6.js b/tests/baselines/reference/recursiveBaseCheck6.js index 1871eff20d4..53a608baeca 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.js +++ b/tests/baselines/reference/recursiveBaseCheck6.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var S18 = (function (_super) { __extends(S18, _super); function S18() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return S18; }(S18)); diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index c2f884aa8e4..344750974cb 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -21,8 +21,7 @@ var C1 = (function () { var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(C1)); diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js index f84c7ad3dae..34aa110b7ee 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js @@ -28,8 +28,7 @@ var TypeScript2; var MemberNameArray = (function (_super) { __extends(MemberNameArray, _super); function MemberNameArray() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MemberNameArray; }(MemberName)); diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index 2baa854e462..4c88b778226 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -190,8 +190,7 @@ var Sample; var Mode = (function (_super) { __extends(Mode, _super); function Mode() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 56c0fc4e6eb..bd22ec33898 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,kDAAY;;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 9656c078343..9dfefe4e1dc 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -1692,24 +1692,16 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> function Mode() { 1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 1 >Emitted(87, 21) Source(91, 2) + SourceIndex(0) --- ->>> var _this = _super.apply(this, arguments) || this; -1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1->export class Mode extends -2 > AbstractMode -1->Emitted(88, 25) Source(91, 28) + SourceIndex(0) -2 >Emitted(88, 75) Source(91, 40) + SourceIndex(0) ---- ->>> return _this; +>>> return _super.apply(this, arguments) || this; >>> } -1 >^^^^^^^^^^^^^^^^^^^^ +1->^^^^^^^^^^^^^^^^^^^^ 2 > ^ 3 > ^^^^^^^^^^^^^-> -1 > { +1->export class Mode extends AbstractMode { > > // scenario 2 > public getInitialState(): IState { @@ -1719,8 +1711,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(90, 21) Source(99, 2) + SourceIndex(0) -2 >Emitted(90, 22) Source(99, 3) + SourceIndex(0) +1->Emitted(89, 21) Source(99, 2) + SourceIndex(0) +2 >Emitted(89, 22) Source(99, 3) + SourceIndex(0) --- >>> // scenario 2 1->^^^^^^^^^^^^^^^^^^^^ @@ -1728,8 +1720,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > // scenario 2 -1->Emitted(91, 21) Source(93, 3) + SourceIndex(0) -2 >Emitted(91, 34) Source(93, 16) + SourceIndex(0) +1->Emitted(90, 21) Source(93, 3) + SourceIndex(0) +2 >Emitted(90, 34) Source(93, 16) + SourceIndex(0) --- >>> Mode.prototype.getInitialState = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1739,9 +1731,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getInitialState 3 > -1->Emitted(92, 21) Source(94, 10) + SourceIndex(0) -2 >Emitted(92, 51) Source(94, 25) + SourceIndex(0) -3 >Emitted(92, 54) Source(94, 3) + SourceIndex(0) +1->Emitted(91, 21) Source(94, 10) + SourceIndex(0) +2 >Emitted(91, 51) Source(94, 25) + SourceIndex(0) +3 >Emitted(91, 54) Source(94, 3) + SourceIndex(0) --- >>> return new State(self); 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1763,15 +1755,15 @@ sourceFile:recursiveClassReferenceTest.ts 7 > self 8 > ) 9 > ; -1 >Emitted(93, 25) Source(95, 4) + SourceIndex(0) -2 >Emitted(93, 31) Source(95, 10) + SourceIndex(0) -3 >Emitted(93, 32) Source(95, 11) + SourceIndex(0) -4 >Emitted(93, 36) Source(95, 15) + SourceIndex(0) -5 >Emitted(93, 41) Source(95, 20) + SourceIndex(0) -6 >Emitted(93, 42) Source(95, 21) + SourceIndex(0) -7 >Emitted(93, 46) Source(95, 25) + SourceIndex(0) -8 >Emitted(93, 47) Source(95, 26) + SourceIndex(0) -9 >Emitted(93, 48) Source(95, 27) + SourceIndex(0) +1 >Emitted(92, 25) Source(95, 4) + SourceIndex(0) +2 >Emitted(92, 31) Source(95, 10) + SourceIndex(0) +3 >Emitted(92, 32) Source(95, 11) + SourceIndex(0) +4 >Emitted(92, 36) Source(95, 15) + SourceIndex(0) +5 >Emitted(92, 41) Source(95, 20) + SourceIndex(0) +6 >Emitted(92, 42) Source(95, 21) + SourceIndex(0) +7 >Emitted(92, 46) Source(95, 25) + SourceIndex(0) +8 >Emitted(92, 47) Source(95, 26) + SourceIndex(0) +9 >Emitted(92, 48) Source(95, 27) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1780,8 +1772,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(94, 21) Source(96, 3) + SourceIndex(0) -2 >Emitted(94, 22) Source(96, 4) + SourceIndex(0) +1 >Emitted(93, 21) Source(96, 3) + SourceIndex(0) +2 >Emitted(93, 22) Source(96, 4) + SourceIndex(0) --- >>> return Mode; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1792,8 +1784,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(95, 21) Source(99, 2) + SourceIndex(0) -2 >Emitted(95, 32) Source(99, 3) + SourceIndex(0) +1->Emitted(94, 21) Source(99, 2) + SourceIndex(0) +2 >Emitted(94, 32) Source(99, 3) + SourceIndex(0) --- >>> }(AbstractMode)); 1->^^^^^^^^^^^^^^^^ @@ -1817,12 +1809,12 @@ sourceFile:recursiveClassReferenceTest.ts > > > } -1->Emitted(96, 17) Source(99, 2) + SourceIndex(0) -2 >Emitted(96, 18) Source(99, 3) + SourceIndex(0) -3 >Emitted(96, 18) Source(91, 2) + SourceIndex(0) -4 >Emitted(96, 19) Source(91, 28) + SourceIndex(0) -5 >Emitted(96, 31) Source(91, 40) + SourceIndex(0) -6 >Emitted(96, 34) Source(99, 3) + SourceIndex(0) +1->Emitted(95, 17) Source(99, 2) + SourceIndex(0) +2 >Emitted(95, 18) Source(99, 3) + SourceIndex(0) +3 >Emitted(95, 18) Source(91, 2) + SourceIndex(0) +4 >Emitted(95, 19) Source(91, 28) + SourceIndex(0) +5 >Emitted(95, 31) Source(91, 40) + SourceIndex(0) +6 >Emitted(95, 34) Source(99, 3) + SourceIndex(0) --- >>> PlainText.Mode = Mode; 1->^^^^^^^^^^^^^^^^ @@ -1842,10 +1834,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(97, 17) Source(91, 15) + SourceIndex(0) -2 >Emitted(97, 31) Source(91, 19) + SourceIndex(0) -3 >Emitted(97, 38) Source(99, 3) + SourceIndex(0) -4 >Emitted(97, 39) Source(99, 3) + SourceIndex(0) +1->Emitted(96, 17) Source(91, 15) + SourceIndex(0) +2 >Emitted(96, 31) Source(91, 19) + SourceIndex(0) +3 >Emitted(96, 38) Source(99, 3) + SourceIndex(0) +4 >Emitted(96, 39) Source(99, 3) + SourceIndex(0) --- >>> })(PlainText = Languages.PlainText || (Languages.PlainText = {})); 1->^^^^^^^^^^^^ @@ -1891,15 +1883,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(98, 13) Source(100, 1) + SourceIndex(0) -2 >Emitted(98, 14) Source(100, 2) + SourceIndex(0) -3 >Emitted(98, 16) Source(76, 31) + SourceIndex(0) -4 >Emitted(98, 25) Source(76, 40) + SourceIndex(0) -5 >Emitted(98, 28) Source(76, 31) + SourceIndex(0) -6 >Emitted(98, 47) Source(76, 40) + SourceIndex(0) -7 >Emitted(98, 52) Source(76, 31) + SourceIndex(0) -8 >Emitted(98, 71) Source(76, 40) + SourceIndex(0) -9 >Emitted(98, 79) Source(100, 2) + SourceIndex(0) +1->Emitted(97, 13) Source(100, 1) + SourceIndex(0) +2 >Emitted(97, 14) Source(100, 2) + SourceIndex(0) +3 >Emitted(97, 16) Source(76, 31) + SourceIndex(0) +4 >Emitted(97, 25) Source(76, 40) + SourceIndex(0) +5 >Emitted(97, 28) Source(76, 31) + SourceIndex(0) +6 >Emitted(97, 47) Source(76, 40) + SourceIndex(0) +7 >Emitted(97, 52) Source(76, 31) + SourceIndex(0) +8 >Emitted(97, 71) Source(76, 40) + SourceIndex(0) +9 >Emitted(97, 79) Source(100, 2) + SourceIndex(0) --- >>> })(Languages = Thing.Languages || (Thing.Languages = {})); 1 >^^^^^^^^ @@ -1944,15 +1936,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(99, 9) Source(100, 1) + SourceIndex(0) -2 >Emitted(99, 10) Source(100, 2) + SourceIndex(0) -3 >Emitted(99, 12) Source(76, 21) + SourceIndex(0) -4 >Emitted(99, 21) Source(76, 30) + SourceIndex(0) -5 >Emitted(99, 24) Source(76, 21) + SourceIndex(0) -6 >Emitted(99, 39) Source(76, 30) + SourceIndex(0) -7 >Emitted(99, 44) Source(76, 21) + SourceIndex(0) -8 >Emitted(99, 59) Source(76, 30) + SourceIndex(0) -9 >Emitted(99, 67) Source(100, 2) + SourceIndex(0) +1 >Emitted(98, 9) Source(100, 1) + SourceIndex(0) +2 >Emitted(98, 10) Source(100, 2) + SourceIndex(0) +3 >Emitted(98, 12) Source(76, 21) + SourceIndex(0) +4 >Emitted(98, 21) Source(76, 30) + SourceIndex(0) +5 >Emitted(98, 24) Source(76, 21) + SourceIndex(0) +6 >Emitted(98, 39) Source(76, 30) + SourceIndex(0) +7 >Emitted(98, 44) Source(76, 21) + SourceIndex(0) +8 >Emitted(98, 59) Source(76, 30) + SourceIndex(0) +9 >Emitted(98, 67) Source(100, 2) + SourceIndex(0) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -1997,15 +1989,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(100, 5) Source(100, 1) + SourceIndex(0) -2 >Emitted(100, 6) Source(100, 2) + SourceIndex(0) -3 >Emitted(100, 8) Source(76, 15) + SourceIndex(0) -4 >Emitted(100, 13) Source(76, 20) + SourceIndex(0) -5 >Emitted(100, 16) Source(76, 15) + SourceIndex(0) -6 >Emitted(100, 28) Source(76, 20) + SourceIndex(0) -7 >Emitted(100, 33) Source(76, 15) + SourceIndex(0) -8 >Emitted(100, 45) Source(76, 20) + SourceIndex(0) -9 >Emitted(100, 53) Source(100, 2) + SourceIndex(0) +1 >Emitted(99, 5) Source(100, 1) + SourceIndex(0) +2 >Emitted(99, 6) Source(100, 2) + SourceIndex(0) +3 >Emitted(99, 8) Source(76, 15) + SourceIndex(0) +4 >Emitted(99, 13) Source(76, 20) + SourceIndex(0) +5 >Emitted(99, 16) Source(76, 15) + SourceIndex(0) +6 >Emitted(99, 28) Source(76, 20) + SourceIndex(0) +7 >Emitted(99, 33) Source(76, 15) + SourceIndex(0) +8 >Emitted(99, 45) Source(76, 20) + SourceIndex(0) +9 >Emitted(99, 53) Source(100, 2) + SourceIndex(0) --- >>>})(Sample || (Sample = {})); 1 > @@ -2047,12 +2039,12 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(101, 1) Source(100, 1) + SourceIndex(0) -2 >Emitted(101, 2) Source(100, 2) + SourceIndex(0) -3 >Emitted(101, 4) Source(76, 8) + SourceIndex(0) -4 >Emitted(101, 10) Source(76, 14) + SourceIndex(0) -5 >Emitted(101, 15) Source(76, 8) + SourceIndex(0) -6 >Emitted(101, 21) Source(76, 14) + SourceIndex(0) -7 >Emitted(101, 29) Source(100, 2) + SourceIndex(0) +1 >Emitted(100, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(100, 2) Source(100, 2) + SourceIndex(0) +3 >Emitted(100, 4) Source(76, 8) + SourceIndex(0) +4 >Emitted(100, 10) Source(76, 14) + SourceIndex(0) +5 >Emitted(100, 15) Source(76, 8) + SourceIndex(0) +6 >Emitted(100, 21) Source(76, 14) + SourceIndex(0) +7 >Emitted(100, 29) Source(100, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=recursiveClassReferenceTest.js.map \ No newline at end of file diff --git a/tests/baselines/reference/recursiveComplicatedClasses.js b/tests/baselines/reference/recursiveComplicatedClasses.js index ea31184d856..8441ff9e15a 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.js +++ b/tests/baselines/reference/recursiveComplicatedClasses.js @@ -51,24 +51,21 @@ var Symbol = (function () { var InferenceSymbol = (function (_super) { __extends(InferenceSymbol, _super); function InferenceSymbol() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return InferenceSymbol; }(Symbol)); var ParameterSymbol = (function (_super) { __extends(ParameterSymbol, _super); function ParameterSymbol() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ParameterSymbol; }(InferenceSymbol)); var TypeSymbol = (function (_super) { __extends(TypeSymbol, _super); function TypeSymbol() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return TypeSymbol; }(InferenceSymbol)); diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js index 72c97c30966..76224741e60 100644 --- a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js @@ -52,8 +52,7 @@ var MsPortal; var ViewModel = (function (_super) { __extends(ViewModel, _super); function ViewModel() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ViewModel; }(ItemValue)); diff --git a/tests/baselines/reference/reexportClassDefinition.js b/tests/baselines/reference/reexportClassDefinition.js index 95ce777e446..a75a90d4d86 100644 --- a/tests/baselines/reference/reexportClassDefinition.js +++ b/tests/baselines/reference/reexportClassDefinition.js @@ -42,8 +42,7 @@ var foo2 = require("./foo2"); var x = (function (_super) { __extends(x, _super); function x() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 d2ec8e168bf..615b0034caa 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -1030,8 +1030,7 @@ var rionegrensis; var caniventer = (function (_super) { __extends(caniventer, _super); function caniventer() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } caniventer.prototype.salomonseni = function () { var _this = this; @@ -1069,8 +1068,7 @@ var rionegrensis; var veraecrucis = (function (_super) { __extends(veraecrucis, _super); function veraecrucis() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } veraecrucis.prototype.naso = function () { var _this = this; @@ -1249,8 +1247,7 @@ var julianae; var oralis = (function (_super) { __extends(oralis, _super); function oralis() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } oralis.prototype.cepapi = function () { var _this = this; @@ -1336,8 +1333,7 @@ var julianae; var sumatrana = (function (_super) { __extends(sumatrana, _super); function sumatrana() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } sumatrana.prototype.wolffsohni = function () { var _this = this; @@ -1537,8 +1533,7 @@ var julianae; var durangae = (function (_super) { __extends(durangae, _super); function durangae() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } durangae.prototype.Californium = function () { var _this = this; @@ -1612,8 +1607,7 @@ var Lanthanum; var nitidus = (function (_super) { __extends(nitidus, _super); function nitidus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } nitidus.prototype.granatensis = function () { var _this = this; @@ -1681,8 +1675,7 @@ var Lanthanum; var megalonyx = (function (_super) { __extends(megalonyx, _super); function megalonyx() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } megalonyx.prototype.phillipsii = function () { var _this = this; @@ -1831,8 +1824,7 @@ var rendalli; var zuluensis = (function (_super) { __extends(zuluensis, _super); function zuluensis() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } zuluensis.prototype.telfairi = function () { var _this = this; @@ -1990,8 +1982,7 @@ var rendalli; var crenulata = (function (_super) { __extends(crenulata, _super); function crenulata() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } crenulata.prototype.salvanius = function () { var _this = this; @@ -2074,8 +2065,7 @@ var trivirgatus; var mixtus = (function (_super) { __extends(mixtus, _super); function mixtus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } mixtus.prototype.ochrogaster = function () { var _this = this; @@ -2317,8 +2307,7 @@ var ruatanica; var americanus = (function (_super) { __extends(americanus, _super); function americanus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } americanus.prototype.nasoloi = function () { var _this = this; @@ -2353,8 +2342,7 @@ var lavali; var wilsoni = (function (_super) { __extends(wilsoni, _super); function wilsoni() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } wilsoni.prototype.setiger = function () { var _this = this; @@ -2446,8 +2434,7 @@ var lavali; var otion = (function (_super) { __extends(otion, _super); function otion() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } otion.prototype.bonaerensis = function () { var _this = this; @@ -2611,8 +2598,7 @@ var lavali; var thaeleri = (function (_super) { __extends(thaeleri, _super); function thaeleri() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } thaeleri.prototype.coromandra = function () { var _this = this; @@ -2668,8 +2654,7 @@ var lavali; var lepturus = (function (_super) { __extends(lepturus, _super); function lepturus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } lepturus.prototype.ferrumequinum = function () { var _this = this; @@ -2692,8 +2677,7 @@ var dogramacii; var robustulus = (function (_super) { __extends(robustulus, _super); function robustulus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } robustulus.prototype.fossor = function () { var _this = this; @@ -2908,8 +2892,7 @@ var lutreolus; var schlegeli = (function (_super) { __extends(schlegeli, _super); function schlegeli() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } schlegeli.prototype.mittendorfi = function () { var _this = this; @@ -3136,8 +3119,7 @@ var panglima; var amphibius = (function (_super) { __extends(amphibius, _super); function amphibius() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } amphibius.prototype.bottegi = function () { var _this = this; @@ -3181,8 +3163,7 @@ var panglima; var fundatus = (function (_super) { __extends(fundatus, _super); function fundatus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } fundatus.prototype.crassulus = function () { var _this = this; @@ -3208,8 +3189,7 @@ var panglima; var abidi = (function (_super) { __extends(abidi, _super); function abidi() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } abidi.prototype.greyii = function () { var _this = this; @@ -3301,8 +3281,7 @@ var minutus; var himalayana = (function (_super) { __extends(himalayana, _super); function himalayana() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } himalayana.prototype.simoni = function () { var _this = this; @@ -3385,8 +3364,7 @@ var caurinus; var mahaganus = (function (_super) { __extends(mahaganus, _super); function mahaganus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } mahaganus.prototype.martiniquensis = function () { var _this = this; @@ -3460,8 +3438,7 @@ var howi; var angulatus = (function (_super) { __extends(angulatus, _super); function angulatus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } angulatus.prototype.pennatus = function () { var _this = this; @@ -3544,8 +3521,7 @@ var sagitta; var walkeri = (function (_super) { __extends(walkeri, _super); function walkeri() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } walkeri.prototype.maracajuensis = function () { var _this = this; @@ -3562,8 +3538,7 @@ var minutus; var inez = (function (_super) { __extends(inez, _super); function inez() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } inez.prototype.vexillaris = function () { var _this = this; @@ -3580,8 +3555,7 @@ var macrorhinos; var konganensis = (function (_super) { __extends(konganensis, _super); function konganensis() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return konganensis; }(imperfecta.lasiurus)); @@ -3592,8 +3566,7 @@ var panamensis; var linulus = (function (_super) { __extends(linulus, _super); function linulus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } linulus.prototype.goslingi = function () { var _this = this; @@ -3745,8 +3718,7 @@ var samarensis; var pelurus = (function (_super) { __extends(pelurus, _super); function pelurus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } pelurus.prototype.Palladium = function () { var _this = this; @@ -3832,8 +3804,7 @@ var samarensis; var fuscus = (function (_super) { __extends(fuscus, _super); function fuscus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } fuscus.prototype.planifrons = function () { var _this = this; @@ -3994,8 +3965,7 @@ var sagitta; var leptoceros = (function (_super) { __extends(leptoceros, _super); function leptoceros() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } leptoceros.prototype.victus = function () { var _this = this; @@ -4036,8 +4006,7 @@ var daubentonii; var nigricans = (function (_super) { __extends(nigricans, _super); function nigricans() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } nigricans.prototype.woosnami = function () { var _this = this; @@ -4063,8 +4032,7 @@ var argurus; var pygmaea = (function (_super) { __extends(pygmaea, _super); function pygmaea() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } pygmaea.prototype.pajeros = function () { var _this = this; @@ -4093,8 +4061,7 @@ var chrysaeolus; var sarasinorum = (function (_super) { __extends(sarasinorum, _super); function sarasinorum() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } sarasinorum.prototype.belzebul = function () { var _this = this; @@ -4198,8 +4165,7 @@ var argurus; var oreas = (function (_super) { __extends(oreas, _super); function oreas() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } oreas.prototype.salamonis = function () { var _this = this; @@ -4426,8 +4392,7 @@ var provocax; var melanoleuca = (function (_super) { __extends(melanoleuca, _super); function melanoleuca() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } melanoleuca.prototype.Neodymium = function () { var _this = this; @@ -4471,8 +4436,7 @@ var howi; var marcanoi = (function (_super) { __extends(marcanoi, _super); function marcanoi() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } marcanoi.prototype.formosae = function () { var _this = this; @@ -4879,8 +4843,7 @@ var gabriellae; var klossii = (function (_super) { __extends(klossii, _super); function klossii() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return klossii; }(imperfecta.lasiurus)); @@ -5083,8 +5046,7 @@ var imperfecta; var ciliolabrum = (function (_super) { __extends(ciliolabrum, _super); function ciliolabrum() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } ciliolabrum.prototype.leschenaultii = function () { var _this = this; @@ -5146,8 +5108,7 @@ var petrophilus; var sodyi = (function (_super) { __extends(sodyi, _super); function sodyi() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } sodyi.prototype.saundersiae = function () { var _this = this; @@ -5212,8 +5173,7 @@ var caurinus; var megaphyllus = (function (_super) { __extends(megaphyllus, _super); function megaphyllus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } megaphyllus.prototype.montana = function () { var _this = this; @@ -5386,8 +5346,7 @@ var lutreolus; var cor = (function (_super) { __extends(cor, _super); function cor() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } cor.prototype.antinorii = function () { var _this = this; @@ -5479,8 +5438,7 @@ var argurus; var germaini = (function (_super) { __extends(germaini, _super); function germaini() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } germaini.prototype.sharpei = function () { var _this = this; @@ -5578,8 +5536,7 @@ var dammermani; var melanops = (function (_super) { __extends(melanops, _super); function melanops() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } melanops.prototype.blarina = function () { var _this = this; @@ -5668,8 +5625,7 @@ var argurus; var peninsulae = (function (_super) { __extends(peninsulae, _super); function peninsulae() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } peninsulae.prototype.aitkeni = function () { var _this = this; @@ -5815,8 +5771,7 @@ var ruatanica; var Praseodymium = (function (_super) { __extends(Praseodymium, _super); function Praseodymium() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Praseodymium.prototype.clara = function () { var _this = this; @@ -5905,8 +5860,7 @@ var caurinus; var johorensis = (function (_super) { __extends(johorensis, _super); function johorensis() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } johorensis.prototype.maini = function () { var _this = this; @@ -6034,8 +5988,7 @@ var caurinus; var psilurus = (function (_super) { __extends(psilurus, _super); function psilurus() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } psilurus.prototype.socialis = function () { var _this = this; diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js index 659eea55689..f786e994963 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -48,8 +48,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js index 02c81245445..1474f8ab29a 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js @@ -22,8 +22,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 781fd5ac6ee..0baf0187009 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js @@ -22,8 +22,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } D.c = function () { v = 1; diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js index d7e1b69e274..4906814f7eb 100644 --- a/tests/baselines/reference/shadowPrivateMembers.js +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -18,8 +18,7 @@ var base = (function () { var derived = (function (_super) { __extends(derived, _super); function derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } derived.prototype.n = function () { }; return derived; diff --git a/tests/baselines/reference/specializedInheritedConstructors1.js b/tests/baselines/reference/specializedInheritedConstructors1.js index 4f14cb6db97..f65f42941bf 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -36,8 +36,7 @@ var Model = (function () { var MyView = (function (_super) { __extends(MyView, _super); function MyView() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return MyView; }(View)); diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js index 3b909a80836..b76afaff08c 100644 --- a/tests/baselines/reference/specializedOverloadWithRestParameters.js +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -27,8 +27,7 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 d229c5330ba..de7588c3ebe 100644 --- a/tests/baselines/reference/staticFactory1.js +++ b/tests/baselines/reference/staticFactory1.js @@ -31,8 +31,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Derived.prototype.foo = function () { return 2; }; return Derived; diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js index a07bea081a9..7b8ca52b9a4 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js @@ -26,8 +26,7 @@ var SomeBase = (function () { var P = (function (_super) { __extends(P, _super); function P() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return P; }(SomeBase)); diff --git a/tests/baselines/reference/strictModeReservedWord.js b/tests/baselines/reference/strictModeReservedWord.js index af01ca1716f..29715745890 100644 --- a/tests/baselines/reference/strictModeReservedWord.js +++ b/tests/baselines/reference/strictModeReservedWord.js @@ -48,8 +48,7 @@ function foo() { var myClass = (function (_super) { __extends(package, _super); function package() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return package; }(public)); diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js index 300d83b9bbc..1507e53d8cf 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js @@ -75,16 +75,14 @@ var F1 = (function () { var G = (function (_super) { __extends(G, _super); function G() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return G; }(package)); var H = (function (_super) { __extends(H, _super); function H() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 eb5052f51d7..b532df7b120 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -55,8 +55,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 cbe42a510b3..a6606c5d559 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -120,8 +120,7 @@ var C3 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(C3)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js index 56800248393..82bcbf14ecc 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js @@ -182,32 +182,28 @@ var C3 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(C3)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(C3)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D3; }(C3)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D4; }(C3)); @@ -217,24 +213,21 @@ var D4 = (function (_super) { var D5 = (function (_super) { __extends(D5, _super); function D5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D5; }(C3)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D6; }(C3)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D7; }(C3)); @@ -243,24 +236,21 @@ var D7 = (function (_super) { var D8 = (function (_super) { __extends(D8, _super); function D8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D8; }(C3)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D9; }(C3)); var D10 = (function (_super) { __extends(D10, _super); function D10() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D10; }(C3)); @@ -269,24 +259,21 @@ var D10 = (function (_super) { var D11 = (function (_super) { __extends(D11, _super); function D11() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D11; }(C3)); var D12 = (function (_super) { __extends(D12, _super); function D12() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D12; }(C3)); var D13 = (function (_super) { __extends(D13, _super); function D13() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D13; }(C3)); @@ -296,32 +283,28 @@ var D13 = (function (_super) { var D14 = (function (_super) { __extends(D14, _super); function D14() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D14; }(C3)); var D15 = (function (_super) { __extends(D15, _super); function D15() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D15; }(C3)); var D16 = (function (_super) { __extends(D16, _super); function D16() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D16; }(C3)); var D17 = (function (_super) { __extends(D17, _super); function D17() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D17; }(C3)); @@ -330,32 +313,28 @@ var D17 = (function (_super) { var D18 = (function (_super) { __extends(D18, _super); function D18() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D18; }(C3)); var D19 = (function (_super) { __extends(D19, _super); function D19() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D19; }(C3)); var D20 = (function (_super) { __extends(D20, _super); function D20() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D20; }(C3)); var D21 = (function (_super) { __extends(D21, _super); function D21() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D21; }(C3)); @@ -364,32 +343,28 @@ var D21 = (function (_super) { var D22 = (function (_super) { __extends(D22, _super); function D22() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D22; }(C3)); var D23 = (function (_super) { __extends(D23, _super); function D23() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D23; }(C3)); var D24 = (function (_super) { __extends(D24, _super); function D24() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D24; }(C3)); var D25 = (function (_super) { __extends(D25, _super); function D25() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D25; }(C3)); @@ -398,32 +373,28 @@ var D25 = (function (_super) { var D26 = (function (_super) { __extends(D26, _super); function D26() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D26; }(C3)); var D27 = (function (_super) { __extends(D27, _super); function D27() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D27; }(C3)); var D28 = (function (_super) { __extends(D28, _super); function D28() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D28; }(C3)); var D29 = (function (_super) { __extends(D29, _super); function D29() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D29; }(C3)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js index e4e35262d80..e0baced37a4 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js @@ -118,72 +118,63 @@ var B1 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(B1)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(B1)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D3; }(B1)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D4; }(B1)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D5; }(B1)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D6; }(B1)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D7; }(B1)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D8; }(B1)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D9; }(B1)); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js index 0d1347cd33c..0b17fc07f24 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js @@ -217,72 +217,63 @@ var M1; var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(Base)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(Base)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D3; }(Base)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D4; }(Base)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D5; }(Base)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D6; }(Base)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D7; }(Base)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D8; }(Base)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D9; }(Base)); @@ -297,72 +288,63 @@ var M2; var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(Base2)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(Base2)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D3; }(Base2)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D4; }(Base2)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D5; }(Base2)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D6; }(Base2)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D7; }(Base2)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D8; }(Base2)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D9; }(Base2)); diff --git a/tests/baselines/reference/subtypingTransitivity.js b/tests/baselines/reference/subtypingTransitivity.js index 9ba7ac52df5..9c4c9011758 100644 --- a/tests/baselines/reference/subtypingTransitivity.js +++ b/tests/baselines/reference/subtypingTransitivity.js @@ -33,16 +33,14 @@ var B = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(B)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(B)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index d4cd66a5e0a..843a727c33e 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -187,24 +187,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index 93b1cbebd0a..a9e7d01aab6 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -136,24 +136,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.js b/tests/baselines/reference/subtypingWithCallSignatures4.js index 5cab9f1e7c4..94f549c62c1 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.js +++ b/tests/baselines/reference/subtypingWithCallSignatures4.js @@ -126,24 +126,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index ec551f5f58c..1d12aeb945f 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -187,24 +187,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index ba833c31e7a..78582304cb8 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -138,24 +138,21 @@ var Errors; var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures4.js b/tests/baselines/reference/subtypingWithConstructSignatures4.js index 0b624fcbc51..17252fdb809 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures4.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures4.js @@ -126,24 +126,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures5.js b/tests/baselines/reference/subtypingWithConstructSignatures5.js index 3d2d4d50d6e..a0561606393 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures5.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures5.js @@ -64,24 +64,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures6.js b/tests/baselines/reference/subtypingWithConstructSignatures6.js index 1cec204ff87..c508781e089 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures6.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures6.js @@ -67,24 +67,21 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return OtherDerived; }(Base)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.js b/tests/baselines/reference/subtypingWithNumericIndexer.js index 2aa4d834395..3cf75dd83fd 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer.js @@ -54,16 +54,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); @@ -77,32 +75,28 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B4; }(A)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.js b/tests/baselines/reference/subtypingWithNumericIndexer3.js index 60f463546c8..e9e8d39bf3c 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.js @@ -58,16 +58,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); @@ -81,40 +79,35 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B4; }(A)); var B5 = (function (_super) { __extends(B5, _super); function B5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B5; }(A)); diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.js b/tests/baselines/reference/subtypingWithNumericIndexer4.js index f40804bd55f..798e775083f 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.js @@ -42,8 +42,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -57,16 +56,14 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A)); diff --git a/tests/baselines/reference/subtypingWithObjectMembers.js b/tests/baselines/reference/subtypingWithObjectMembers.js index 420be798293..3675ed6a410 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.js +++ b/tests/baselines/reference/subtypingWithObjectMembers.js @@ -81,16 +81,14 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Derived)); @@ -104,8 +102,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -117,8 +114,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -130,8 +126,7 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A3)); @@ -145,8 +140,7 @@ var TwoLevels; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -158,8 +152,7 @@ var TwoLevels; var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -171,8 +164,7 @@ var TwoLevels; var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembers4.js b/tests/baselines/reference/subtypingWithObjectMembers4.js index 0bb50afe985..404b6cbe988 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers4.js +++ b/tests/baselines/reference/subtypingWithObjectMembers4.js @@ -48,8 +48,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -61,8 +60,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -74,8 +72,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -87,8 +84,7 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js index ec3b8382eca..8b168ea73b5 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js @@ -48,8 +48,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -61,8 +60,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -74,8 +72,7 @@ var A2 = (function () { var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -87,8 +84,7 @@ var A3 = (function () { var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js index 24f36819ff6..0a83b760218 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js @@ -76,8 +76,7 @@ var Base = (function () { var Derived = (function (_super) { __extends(Derived, _super); function Derived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived; }(Base)); @@ -91,8 +90,7 @@ var ExplicitPublic; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -104,8 +102,7 @@ var ExplicitPublic; var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -117,8 +114,7 @@ var ExplicitPublic; var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A3)); @@ -133,8 +129,7 @@ var ImplicitPublic; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -146,8 +141,7 @@ var ImplicitPublic; var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A2)); @@ -159,8 +153,7 @@ var ImplicitPublic; var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A3)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer.js b/tests/baselines/reference/subtypingWithStringIndexer.js index 95a71a018d1..195b7d2192e 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.js +++ b/tests/baselines/reference/subtypingWithStringIndexer.js @@ -55,16 +55,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); @@ -78,32 +76,28 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B4; }(A)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.js b/tests/baselines/reference/subtypingWithStringIndexer3.js index fd9b400cb3d..0b2a57324eb 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.js +++ b/tests/baselines/reference/subtypingWithStringIndexer3.js @@ -58,16 +58,14 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); @@ -81,40 +79,35 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B2 = (function (_super) { __extends(B2, _super); function B2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B2; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A)); var B4 = (function (_super) { __extends(B4, _super); function B4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B4; }(A)); var B5 = (function (_super) { __extends(B5, _super); function B5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B5; }(A)); diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.js b/tests/baselines/reference/subtypingWithStringIndexer4.js index 46178d1dc32..2937261ad05 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.js +++ b/tests/baselines/reference/subtypingWithStringIndexer4.js @@ -42,8 +42,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); @@ -57,16 +56,14 @@ var Generics; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(A)); var B3 = (function (_super) { __extends(B3, _super); function B3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B3; }(A)); diff --git a/tests/baselines/reference/super.js b/tests/baselines/reference/super.js index 54afddcc119..504e8542d4d 100644 --- a/tests/baselines/reference/super.js +++ b/tests/baselines/reference/super.js @@ -58,8 +58,7 @@ var Base = (function () { var Sub1 = (function (_super) { __extends(Sub1, _super); function Sub1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Sub1.prototype.foo = function () { return "sub1" + _super.prototype.foo.call(this) + _super.prototype.bar.call(this); @@ -69,8 +68,7 @@ var Sub1 = (function (_super) { var SubSub1 = (function (_super) { __extends(SubSub1, _super); function SubSub1() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 8ef621cdf2b..9f1289dce55 100644 --- a/tests/baselines/reference/super1.js +++ b/tests/baselines/reference/super1.js @@ -84,8 +84,7 @@ var Base1 = (function () { var Sub1 = (function (_super) { __extends(Sub1, _super); function Sub1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Sub1.prototype.bar = function () { return "base"; @@ -95,8 +94,7 @@ var Sub1 = (function (_super) { var SubSub1 = (function (_super) { __extends(SubSub1, _super); function SubSub1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } SubSub1.prototype.bar = function () { return _super.prototype.super.foo; @@ -115,8 +113,7 @@ var Base2 = (function () { var SubE2 = (function (_super) { __extends(SubE2, _super); function SubE2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } SubE2.prototype.bar = function () { return _super.prototype.prototype.foo = null; @@ -135,8 +132,7 @@ var Base3 = (function () { var SubE3 = (function (_super) { __extends(SubE3, _super); function SubE3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } SubE3.prototype.bar = function () { return _super.prototype.bar.call(this); @@ -157,8 +153,7 @@ var Base4; var SubSub4 = (function (_super) { __extends(SubSub4, _super); function SubSub4() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 80e26c36f7c..1d2331052db 100644 --- a/tests/baselines/reference/super2.js +++ b/tests/baselines/reference/super2.js @@ -71,8 +71,7 @@ var Base5 = (function () { var Sub5 = (function (_super) { __extends(Sub5, _super); function Sub5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Sub5.prototype.x = function () { return "SubX"; @@ -82,8 +81,7 @@ var Sub5 = (function (_super) { var SubSub5 = (function (_super) { __extends(SubSub5, _super); function SubSub5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } SubSub5.prototype.x = function () { return _super.prototype.x.call(this); @@ -105,8 +103,7 @@ var Base6 = (function () { var Sub6 = (function (_super) { __extends(Sub6, _super); function Sub6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Sub6.prototype.y = function () { return "SubY"; @@ -116,8 +113,7 @@ var Sub6 = (function (_super) { var SubSub6 = (function (_super) { __extends(SubSub6, _super); function SubSub6() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 8c9d93f3a36..0bd9d305d2e 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -30,8 +30,7 @@ MyBase.S1 = 5; var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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/superAccessInFatArrow1.js b/tests/baselines/reference/superAccessInFatArrow1.js index be97707b12a..a7f964309f7 100644 --- a/tests/baselines/reference/superAccessInFatArrow1.js +++ b/tests/baselines/reference/superAccessInFatArrow1.js @@ -34,8 +34,7 @@ var test; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.bar = function (callback) { }; diff --git a/tests/baselines/reference/superCallInStaticMethod.js b/tests/baselines/reference/superCallInStaticMethod.js index 6cf9f79e7a4..b31110fdf78 100644 --- a/tests/baselines/reference/superCallInStaticMethod.js +++ b/tests/baselines/reference/superCallInStaticMethod.js @@ -62,8 +62,7 @@ var Doing = (function () { var Other = (function (_super) { __extends(Other, _super); function Other() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } // in static method Other.staticMethod = function () { diff --git a/tests/baselines/reference/superCallWithMissingBaseClass.js b/tests/baselines/reference/superCallWithMissingBaseClass.js index 561b7300fe4..16f11088640 100644 --- a/tests/baselines/reference/superCallWithMissingBaseClass.js +++ b/tests/baselines/reference/superCallWithMissingBaseClass.js @@ -18,8 +18,7 @@ var __extends = (this && this.__extends) || function (d, b) { var Foo = (function (_super) { __extends(Foo, _super); function Foo() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Foo.prototype.m1 = function () { return _super.prototype.m1.call(this); diff --git a/tests/baselines/reference/superInCatchBlock1.js b/tests/baselines/reference/superInCatchBlock1.js index 9eb7df62c1a..e1fc0f97024 100644 --- a/tests/baselines/reference/superInCatchBlock1.js +++ b/tests/baselines/reference/superInCatchBlock1.js @@ -28,8 +28,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.m = function () { try { diff --git a/tests/baselines/reference/superInObjectLiterals_ES5.js b/tests/baselines/reference/superInObjectLiterals_ES5.js index adeda5835cb..816277e4e9e 100644 --- a/tests/baselines/reference/superInObjectLiterals_ES5.js +++ b/tests/baselines/reference/superInObjectLiterals_ES5.js @@ -100,8 +100,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.f = function () { var _this = this; diff --git a/tests/baselines/reference/superPropertyAccess.js b/tests/baselines/reference/superPropertyAccess.js index b1377eb9cde..7b5823e598b 100644 --- a/tests/baselines/reference/superPropertyAccess.js +++ b/tests/baselines/reference/superPropertyAccess.js @@ -61,8 +61,7 @@ var MyBase = (function () { var MyDerived = (function (_super) { __extends(MyDerived, _super); function MyDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js index 1397a0748ae..956bce4ef2e 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js @@ -29,8 +29,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } B.prototype.foo = function () { return 2; }; B.prototype.bar = function () { diff --git a/tests/baselines/reference/superPropertyAccess_ES5.js b/tests/baselines/reference/superPropertyAccess_ES5.js index 4e817b7bbf1..45c32076be9 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.js +++ b/tests/baselines/reference/superPropertyAccess_ES5.js @@ -72,8 +72,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 0796c912d8c..dd37deb5af3 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.js +++ b/tests/baselines/reference/superSymbolIndexedAccess5.js @@ -31,8 +31,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 ee376cec2cb..8c8534b428a 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.js +++ b/tests/baselines/reference/superSymbolIndexedAccess6.js @@ -31,8 +31,7 @@ var Foo = (function () { var Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Bar[symbol] = function () { return _super[symbol].call(this); 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 ed71cebe3c7..6815b71ce11 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,8 +57,7 @@ var F = (function () { var SuperObjectTest = (function (_super) { __extends(SuperObjectTest, _super); function SuperObjectTest() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 7aac6cb47e0..2e1aecc7288 100644 --- a/tests/baselines/reference/switchStatements.js +++ b/tests/baselines/reference/switchStatements.js @@ -98,8 +98,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); diff --git a/tests/baselines/reference/systemModuleWithSuperClass.js b/tests/baselines/reference/systemModuleWithSuperClass.js index 59aff947e5c..78c09355fa0 100644 --- a/tests/baselines/reference/systemModuleWithSuperClass.js +++ b/tests/baselines/reference/systemModuleWithSuperClass.js @@ -49,8 +49,7 @@ System.register(["./foo"], function (exports_1, context_1) { Bar = (function (_super) { __extends(Bar, _super); function Bar() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Bar; }(foo_1.Foo)); diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 7fcfaf9d317..1fc1c734639 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -97,8 +97,7 @@ genericFunc(undefined); // Should be an error var ErrClass3 = (function (_super) { __extends(ErrClass3, _super); function ErrClass3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ErrClass3; }(this)); diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 546863b5216..f8cb6d695dc 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -98,8 +98,7 @@ genericFunc(undefined); // Should be an error var ErrClass3 = (function (_super) { __extends(ErrClass3, _super); function ErrClass3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return ErrClass3; }(this)); diff --git a/tests/baselines/reference/thisTypeInFunctions.js b/tests/baselines/reference/thisTypeInFunctions.js index 6eaaed5c497..6400f410a09 100644 --- a/tests/baselines/reference/thisTypeInFunctions.js +++ b/tests/baselines/reference/thisTypeInFunctions.js @@ -227,8 +227,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D; }(C)); @@ -337,8 +336,7 @@ var Base1 = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived1; }(Base1)); @@ -352,8 +350,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.js b/tests/baselines/reference/thisTypeInFunctionsNegative.js index 08e12f49dca..446bc15e6d9 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.js +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.js @@ -296,8 +296,7 @@ var Base1 = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived1; }(Base1)); @@ -311,8 +310,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base2)); diff --git a/tests/baselines/reference/tsxExternalModuleEmit1.js b/tests/baselines/reference/tsxExternalModuleEmit1.js index 0f6b8716ed0..58e7f1c8d85 100644 --- a/tests/baselines/reference/tsxExternalModuleEmit1.js +++ b/tests/baselines/reference/tsxExternalModuleEmit1.js @@ -42,8 +42,7 @@ var React = require("react"); var Button = (function (_super) { __extends(Button, _super); function Button() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Button.prototype.render = function () { return ; @@ -64,8 +63,7 @@ var button_1 = require("./button"); var App = (function (_super) { __extends(App, _super); function App() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 f7ac96cff1f..88d91723501 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents2.js +++ b/tests/baselines/reference/tsxStatelessFunctionComponents2.js @@ -52,8 +52,7 @@ function Greet(x) { var BigGreeter = (function (_super) { __extends(BigGreeter, _super); function BigGreeter() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 56a6896f052..3520b5af372 100644 --- a/tests/baselines/reference/tsxUnionTypeComponent1.js +++ b/tests/baselines/reference/tsxUnionTypeComponent1.js @@ -35,8 +35,7 @@ var React = require("react"); var MyComponent = (function (_super) { __extends(MyComponent, _super); function MyComponent() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } MyComponent.prototype.render = function () { var AnyComponent = this.props.AnyComponent; @@ -50,8 +49,7 @@ React.createElement(MyComponent, { AnyComponent: function () { return React.crea var MyButtonComponent = (function (_super) { __extends(MyButtonComponent, _super); function MyButtonComponent() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 083cb5e94b3..a57fb222a77 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -74,8 +74,7 @@ var SomeBase = (function () { var SomeDerived = (function (_super) { __extends(SomeDerived, _super); function SomeDerived() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return SomeDerived; }(SomeBase)); diff --git a/tests/baselines/reference/typeGuardFunction.js b/tests/baselines/reference/typeGuardFunction.js index 45bf0853b13..b88d1038969 100644 --- a/tests/baselines/reference/typeGuardFunction.js +++ b/tests/baselines/reference/typeGuardFunction.js @@ -102,8 +102,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionErrors.js b/tests/baselines/reference/typeGuardFunctionErrors.js index 727640ee8af..6f0880ad7f5 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.js +++ b/tests/baselines/reference/typeGuardFunctionErrors.js @@ -164,8 +164,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionGenerics.js b/tests/baselines/reference/typeGuardFunctionGenerics.js index dad77edf232..703c809274f 100644 --- a/tests/baselines/reference/typeGuardFunctionGenerics.js +++ b/tests/baselines/reference/typeGuardFunctionGenerics.js @@ -52,8 +52,7 @@ var B = (function () { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(A)); diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThis.js b/tests/baselines/reference/typeGuardFunctionOfFormThis.js index eec648976c6..c052ea7d72b 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThis.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThis.js @@ -161,8 +161,7 @@ var RoyalGuard = (function () { var LeadGuard = (function (_super) { __extends(LeadGuard, _super); function LeadGuard() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } LeadGuard.prototype.lead = function () { }; ; @@ -171,8 +170,7 @@ var LeadGuard = (function (_super) { var FollowerGuard = (function (_super) { __extends(FollowerGuard, _super); function FollowerGuard() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } FollowerGuard.prototype.follow = function () { }; ; @@ -226,8 +224,7 @@ var ArrowGuard = (function () { var ArrowElite = (function (_super) { __extends(ArrowElite, _super); function ArrowElite() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } ArrowElite.prototype.defend = function () { }; return ArrowElite; @@ -235,8 +232,7 @@ var ArrowElite = (function (_super) { var ArrowMedic = (function (_super) { __extends(ArrowMedic, _super); function ArrowMedic() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } ArrowMedic.prototype.heal = function () { }; return ArrowMedic; @@ -270,8 +266,7 @@ var MimicGuard = (function () { var MimicLeader = (function (_super) { __extends(MimicLeader, _super); function MimicLeader() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } MimicLeader.prototype.lead = function () { }; return MimicLeader; @@ -279,8 +274,7 @@ var MimicLeader = (function (_super) { var MimicFollower = (function (_super) { __extends(MimicFollower, _super); function MimicFollower() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a82d3d2527f..a85a207a665 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js @@ -79,8 +79,7 @@ var RoyalGuard = (function () { var LeadGuard = (function (_super) { __extends(LeadGuard, _super); function LeadGuard() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } LeadGuard.prototype.lead = function () { }; ; @@ -89,8 +88,7 @@ var LeadGuard = (function (_super) { var FollowerGuard = (function (_super) { __extends(FollowerGuard, _super); function FollowerGuard() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a94d5fe93e7..a181a446a81 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.js +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -91,8 +91,7 @@ var C2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(C1)); diff --git a/tests/baselines/reference/typeGuardOfFormIsType.js b/tests/baselines/reference/typeGuardOfFormIsType.js index 2d83a62ad3e..14e9259a9e7 100644 --- a/tests/baselines/reference/typeGuardOfFormIsType.js +++ b/tests/baselines/reference/typeGuardOfFormIsType.js @@ -56,8 +56,7 @@ var C2 = (function () { var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(C1)); diff --git a/tests/baselines/reference/typeGuardOfFormThisMember.js b/tests/baselines/reference/typeGuardOfFormThisMember.js index 541c03dd4b4..52097af34f7 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMember.js +++ b/tests/baselines/reference/typeGuardOfFormThisMember.js @@ -128,8 +128,7 @@ var Test; var Directory = (function (_super) { __extends(Directory, _super); function Directory() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Directory; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js index b61676b40c3..c65445a3a5a 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js +++ b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js @@ -78,8 +78,7 @@ var Test; var Directory = (function (_super) { __extends(Directory, _super); function Directory() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Directory; }(FileSystemObject)); diff --git a/tests/baselines/reference/typeMatch2.js b/tests/baselines/reference/typeMatch2.js index 03408c6196b..2cae93924bc 100644 --- a/tests/baselines/reference/typeMatch2.js +++ b/tests/baselines/reference/typeMatch2.js @@ -65,8 +65,7 @@ var Animal = (function () { var Giraffe = (function (_super) { __extends(Giraffe, _super); function Giraffe() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Giraffe; }(Animal)); diff --git a/tests/baselines/reference/typeParameterAsBaseClass.js b/tests/baselines/reference/typeParameterAsBaseClass.js index d67259304c3..15d1c3b396e 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.js +++ b/tests/baselines/reference/typeParameterAsBaseClass.js @@ -11,8 +11,7 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(T)); diff --git a/tests/baselines/reference/typeParameterAsBaseType.js b/tests/baselines/reference/typeParameterAsBaseType.js index 24f8789a82d..2d0962f01d7 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.js +++ b/tests/baselines/reference/typeParameterAsBaseType.js @@ -21,16 +21,14 @@ var __extends = (this && this.__extends) || function (d, b) { var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C; }(T)); var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return C2; }(U)); diff --git a/tests/baselines/reference/typeParameterExtendingUnion1.js b/tests/baselines/reference/typeParameterExtendingUnion1.js index 55bc51bbdbb..2738aa20528 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion1.js +++ b/tests/baselines/reference/typeParameterExtendingUnion1.js @@ -27,16 +27,14 @@ var Animal = (function () { var Cat = (function (_super) { __extends(Cat, _super); function Cat() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Cat; }(Animal)); var Dog = (function (_super) { __extends(Dog, _super); function Dog() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Dog; }(Animal)); diff --git a/tests/baselines/reference/typeParameterExtendingUnion2.js b/tests/baselines/reference/typeParameterExtendingUnion2.js index 75f62e94c67..b3754436f26 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion2.js +++ b/tests/baselines/reference/typeParameterExtendingUnion2.js @@ -27,16 +27,14 @@ var Animal = (function () { var Cat = (function (_super) { __extends(Cat, _super); function Cat() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Cat; }(Animal)); var Dog = (function (_super) { __extends(Dog, _super); function Dog() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Dog; }(Animal)); diff --git a/tests/baselines/reference/typeValueConflict1.js b/tests/baselines/reference/typeValueConflict1.js index a1ecef212da..8711a656bf5 100644 --- a/tests/baselines/reference/typeValueConflict1.js +++ b/tests/baselines/reference/typeValueConflict1.js @@ -33,8 +33,7 @@ var M2; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 a0cfeda07ec..7abda8110b6 100644 --- a/tests/baselines/reference/typeValueConflict2.js +++ b/tests/baselines/reference/typeValueConflict2.js @@ -40,8 +40,7 @@ var M2; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return B; }(M1.A)); @@ -52,8 +51,7 @@ var M3; var B = (function (_super) { __extends(B, _super); function B() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 b3da31103df..f1ec6a77b14 100644 --- a/tests/baselines/reference/typeofClass2.js +++ b/tests/baselines/reference/typeofClass2.js @@ -37,8 +37,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 853cb5eafd7..045f7b40e55 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.js @@ -56,16 +56,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js index 99314597440..b4d42d819ed 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js @@ -54,16 +54,14 @@ var Base = (function () { var Derived1 = (function (_super) { __extends(Derived1, _super); function Derived1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived1; }(Base)); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return Derived2; }(Base)); diff --git a/tests/baselines/reference/undeclaredBase.js b/tests/baselines/reference/undeclaredBase.js index 64117b1935a..4b7813231cf 100644 --- a/tests/baselines/reference/undeclaredBase.js +++ b/tests/baselines/reference/undeclaredBase.js @@ -14,8 +14,7 @@ var M; var C = (function (_super) { __extends(C, _super); function C() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 451aec91aff..86948a2d9e6 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -136,120 +136,105 @@ var Base = (function () { var D0 = (function (_super) { __extends(D0, _super); function D0() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D0; }(Base)); var DA = (function (_super) { __extends(DA, _super); function DA() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return DA; }(Base)); var D1 = (function (_super) { __extends(D1, _super); function D1() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1; }(Base)); var D1A = (function (_super) { __extends(D1A, _super); function D1A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D1A; }(Base)); var D2 = (function (_super) { __extends(D2, _super); function D2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2; }(Base)); var D2A = (function (_super) { __extends(D2A, _super); function D2A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D2A; }(Base)); var D3 = (function (_super) { __extends(D3, _super); function D3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D3; }(Base)); var D3A = (function (_super) { __extends(D3A, _super); function D3A() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D3A; }(Base)); var D4 = (function (_super) { __extends(D4, _super); function D4() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D4; }(Base)); var D5 = (function (_super) { __extends(D5, _super); function D5() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D5; }(Base)); var D6 = (function (_super) { __extends(D6, _super); function D6() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D6; }(Base)); var D7 = (function (_super) { __extends(D7, _super); function D7() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D7; }(Base)); var D8 = (function (_super) { __extends(D8, _super); function D8() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D8; }(Base)); var D9 = (function (_super) { __extends(D9, _super); function D9() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D9; }(Base)); var D10 = (function (_super) { __extends(D10, _super); function D10() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D10; }(Base)); @@ -260,8 +245,7 @@ var E; var D11 = (function (_super) { __extends(D11, _super); function D11() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D11; }(Base)); @@ -273,8 +257,7 @@ var f; var D12 = (function (_super) { __extends(D12, _super); function D12() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D12; }(Base)); @@ -290,24 +273,21 @@ var c; var D13 = (function (_super) { __extends(D13, _super); function D13() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D13; }(Base)); var D14 = (function (_super) { __extends(D14, _super); function D14() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D14; }(Base)); var D15 = (function (_super) { __extends(D15, _super); function D15() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D15; }(Base)); @@ -317,16 +297,14 @@ var D15 = (function (_super) { var D16 = (function (_super) { __extends(D16, _super); function D16() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D16; }(Base)); var D17 = (function (_super) { __extends(D17, _super); function D17() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return D17; }(Base)); diff --git a/tests/baselines/reference/underscoreMapFirst.js b/tests/baselines/reference/underscoreMapFirst.js index 61f1bf2c9f9..c8e936af527 100644 --- a/tests/baselines/reference/underscoreMapFirst.js +++ b/tests/baselines/reference/underscoreMapFirst.js @@ -57,8 +57,7 @@ var __extends = (this && this.__extends) || function (d, b) { var MyView = (function (_super) { __extends(MyView, _super); function MyView() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } MyView.prototype.getDataSeries = function () { var data = this.model.get("data"); diff --git a/tests/baselines/reference/unionTypeEquivalence.js b/tests/baselines/reference/unionTypeEquivalence.js index b0be82122de..e4d0acc893c 100644 --- a/tests/baselines/reference/unionTypeEquivalence.js +++ b/tests/baselines/reference/unionTypeEquivalence.js @@ -34,8 +34,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 72cf61f72fd..83ad2a34394 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.js +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.js @@ -54,8 +54,7 @@ var D = (function () { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } E.prototype.foo3 = function () { }; return E; @@ -63,8 +62,7 @@ var E = (function (_super) { var F = (function (_super) { __extends(F, _super); function F() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 fafc4ec85fa..231b8b27f3b 100644 --- a/tests/baselines/reference/unionTypesAssignability.js +++ b/tests/baselines/reference/unionTypesAssignability.js @@ -88,8 +88,7 @@ var C = (function () { var D = (function (_super) { __extends(D, _super); function D() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } D.prototype.foo1 = function () { }; return D; @@ -97,8 +96,7 @@ var D = (function (_super) { var E = (function (_super) { __extends(E, _super); function E() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } E.prototype.foo2 = function () { }; return E; diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index 7d5a4b9deed..1343bea602e 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -169,8 +169,7 @@ var ts; var Type = (function (_super) { __extends(Type, _super); function Type() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } Type.prototype.equals = function (that) { if (this === that) diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js index 324dc784b67..b82a7cbc0ae 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js @@ -70,8 +70,7 @@ var r4 = c2(); // should be an error var C2 = (function (_super) { __extends(C2, _super); function C2() { - var _this = _super.apply(this, arguments) || this; - return _this; + 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 3c1dd16874e..0ab1227bf3d 100644 --- a/tests/baselines/reference/unusedClassesinNamespace4.js +++ b/tests/baselines/reference/unusedClassesinNamespace4.js @@ -36,8 +36,7 @@ var Validation; var c3 = (function (_super) { __extends(c3, _super); function c3() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return c3; }(c1)); diff --git a/tests/baselines/reference/unusedIdentifiersConsolidated1.js b/tests/baselines/reference/unusedIdentifiersConsolidated1.js index fd7d859ac37..dbb261e5f2a 100644 --- a/tests/baselines/reference/unusedIdentifiersConsolidated1.js +++ b/tests/baselines/reference/unusedIdentifiersConsolidated1.js @@ -168,8 +168,7 @@ var Greeter; var class2 = (function (_super) { __extends(class2, _super); function class2() { - var _this = _super.apply(this, arguments) || this; - return _this; + return _super.apply(this, arguments) || this; } return class2; }(class1)); From e0c35f2c829079a00f73bcc9ff4abd671578c26e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 14:17:11 -0700 Subject: [PATCH 39/47] Restore arrow function. --- src/compiler/transformers/es6.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index ed5659e8a3f..df21df5e1fb 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -224,7 +224,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; @@ -867,7 +867,7 @@ namespace ts { } if (constructor) { - const body = saveStateAndInvoke(constructor, makeTransformerForConstructorBodyAtOffset(statementOffset)); + const body = saveStateAndInvoke(constructor, constructor => visitNodes(constructor.body.statements, visitor, isStatement, /*start*/ statementOffset)); addRange(statements, body); } @@ -900,10 +900,6 @@ namespace ts { return block; } - function makeTransformerForConstructorBodyAtOffset(offset: number): (c: ConstructorDeclaration) => NodeArray { - return constructor => visitNodes(constructor.body.statements, visitor, isStatement, /*start*/ offset); - } - /** * We want to try to avoid emitting a return statement in certain cases if a user already returned something. * It would be pointless and generate dead code, so we'll try to make things a little bit prettier From f8fbc22ef23e7c4bc5c2b75af30fb532d2208cb6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 14:35:57 -0700 Subject: [PATCH 40/47] Reuse the 'captureThisForNode' function. --- src/compiler/transformers/es6.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index df21df5e1fb..b0633c309ea 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -965,21 +965,8 @@ namespace ts { // The constructor was generated for some reason. // Create a captured '_this' variable. - statements.push( - createVariableStatement( - /*modifiers*/ undefined, - createVariableDeclarationList([ - createVariableDeclaration( - "_this", - /*type*/ undefined, - superReturnValueOrThis - ) - ]), - /*location*/ extendsClauseElement) - ); - + captureThisForNode(statements, constructor, superReturnValueOrThis); enableSubstitutionsForCapturedThis(); - return SuperCaptureResult.ReplaceSuperCapture; } From fb4b503834456dd833b3c695a0248a228c7339cb Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 14:36:17 -0700 Subject: [PATCH 41/47] Removed pointlessish overloads. --- src/compiler/transformers/es6.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index b0633c309ea..481857e0536 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -1290,8 +1290,6 @@ namespace ts { } } - function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined): void; - function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined, originalStatement: Statement): void; function captureThisForNode(statements: Statement[], node: Node, initializer: Expression | undefined, originalStatement?: Statement): void { enableSubstitutionsForCapturedThis(); const captureThisStatement = createVariableStatement( From b5a10316851ec7943ab24ee6127178e705657f1c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 14:41:47 -0700 Subject: [PATCH 42/47] Moved code around, fixed indent, reworded comment. --- src/compiler/transformers/es6.ts | 129 +++++++++++++++---------------- 1 file changed, 64 insertions(+), 65 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 481857e0536..0495e422fc3 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -161,7 +161,7 @@ namespace ts { * Callers should skip the current statement and avoid any returns of '_this'. */ ReplaceWithReturn, -} + } export function transformES6(context: TransformationContext) { const { @@ -902,7 +902,7 @@ namespace ts { /** * We want to try to avoid emitting a return statement in certain cases if a user already returned something. - * It would be pointless and generate dead code, so we'll try to make things a little bit prettier + * 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 { @@ -910,7 +910,6 @@ namespace ts { 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; @@ -973,6 +972,68 @@ namespace ts { return SuperCaptureResult.NoReplacement; } + /** + * Declares a `_this` variable for derived classes and for when arrow functions capture `this`. + * + * @returns The new statement offset into the `statements` array. + */ + function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements: Statement[], ctor: ConstructorDeclaration, hasExtendsClause: boolean, statementOffset: number) { + // If this isn't a derived class, just capture 'this' for arrow functions if necessary. + if (!hasExtendsClause) { + addCaptureThisForNodeIfNeeded(statements, ctor); + return SuperCaptureResult.NoReplacement; + } + + // 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; + } + /** * Visits a parameter declaration. * @@ -1216,68 +1277,6 @@ namespace ts { statements.push(forStatement); } - /** - * Declares a `_this` variable for derived classes and for when arrow functions capture `this`. - * - * @returns The new statement offset into the `statements` array. - */ - function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements: Statement[], ctor: ConstructorDeclaration, hasExtendsClause: boolean, statementOffset: number) { - // If this isn't a derived class, just capture 'this' for arrow functions if necessary. - if (!hasExtendsClause) { - addCaptureThisForNodeIfNeeded(statements, ctor); - return SuperCaptureResult.NoReplacement; - } - - // 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; - } - /** * Adds a statement to capture the `this` of a function declaration if it is needed. * From c29ec6fe371fb4c1ff2aed13a213ead2acfc961a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 20:53:15 -0700 Subject: [PATCH 43/47] Consolidated 'super()' transformation logic into one function. --- src/compiler/transformers/es6.ts | 88 ++++++++++++++------------------ 1 file changed, 38 insertions(+), 50 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 0495e422fc3..1ed7ee9b7ab 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -837,7 +837,6 @@ namespace ts { startLexicalEnvironment(); let statementOffset = -1; - let superCaptureStatus = SuperCaptureResult.NoReplacement; if (hasSynthesizedSuper) { // If a super call has already been synthesized, // we're going to assume that we should just transform everything after that. @@ -854,12 +853,9 @@ namespace ts { addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper); Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!"); - superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, !!extendsClauseElement, statementOffset); } - if (superCaptureStatus === SuperCaptureResult.NoReplacement) { - superCaptureStatus = 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) { @@ -929,61 +925,42 @@ namespace ts { return false; } - /** - * Adds a synthesized call to `_super` if it is needed. - * - * @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. - */ - 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) { - const actualThis = createThis(); - setNodeEmitFlags(actualThis, NodeEmitFlags.NoSubstitution); - const superCall = createFunctionApply( - createIdentifier("_super"), - actualThis, - createIdentifier("arguments"), - ); - const superReturnValueOrThis = createLogicalOr(superCall, actualThis); - - if (!constructor) { - // We must be here because the user didn't write a constructor - // but we needed to call 'super()' anyway - but if that's the case, - // we can just immediately return the result of a 'super()' call. - statements.push(createReturn(superReturnValueOrThis)); - return SuperCaptureResult.ReplaceWithReturn; - } - - // The constructor was generated for some reason. - // Create a captured '_this' variable. - captureThisForNode(statements, constructor, superReturnValueOrThis); - enableSubstitutionsForCapturedThis(); - return SuperCaptureResult.ReplaceSuperCapture; - } - - return SuperCaptureResult.NoReplacement; - } - /** * Declares a `_this` variable for derived classes and for when arrow functions capture `this`. * * @returns The new statement offset into the `statements` array. */ - function declareOrCaptureOrReturnThisForConstructorIfNeeded(statements: Statement[], ctor: ConstructorDeclaration, hasExtendsClause: boolean, statementOffset: number) { + 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) { - addCaptureThisForNodeIfNeeded(statements, ctor); + 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, @@ -1034,6 +1011,17 @@ namespace ts { return SuperCaptureResult.NoReplacement; } + function createDefaultSuperCallOrThis() { + const actualThis = createThis(); + setNodeEmitFlags(actualThis, NodeEmitFlags.NoSubstitution); + const superCall = createFunctionApply( + createIdentifier("_super"), + actualThis, + createIdentifier("arguments"), + ); + return createLogicalOr(superCall, actualThis); + } + /** * Visits a parameter declaration. * From f03be92e7d12fd32ab9a5f38cc80abdb492595c2 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 28 Sep 2016 18:57:17 -0700 Subject: [PATCH 44/47] Remove ConstantValue flag, comment cleanup. --- src/compiler/emitter.ts | 4 ++-- src/compiler/factory.ts | 15 +++++++++------ src/compiler/sourcemap.ts | 2 +- src/compiler/types.ts | 1 - 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 6ad91069033..6049b004b0b 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -413,7 +413,7 @@ const _super = (function (geti, seti) { * * NOTE: Do not call this method directly. It is part of the emit pipeline * and should only be called indirectly from pipelineEmitWithSourceMap or - * pipelineEmitInUnspecifiedContext (when pickign a more specific context). + * pipelineEmitInUnspecifiedContext (when picking a more specific context). */ function pipelineEmitWithSubstitution(emitContext: EmitContext, node: Node) { emitNodeWithSubstitution(emitContext, node, pipelineEmitForContext); @@ -1172,7 +1172,7 @@ const _super = (function (geti, seti) { const text = getLiteralTextOfNode(expression); return text.indexOf(tokenToString(SyntaxKind.DotToken)) < 0; } - else { + else if (isPropertyAccessExpression(expression) || isElementAccessExpression(expression)) { // check if constant enum value is integer const constantValue = getConstantValue(expression); // isFinite handles cases when constantValue is undefined diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index fd00a051dcb..d873c3ef877 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2798,17 +2798,20 @@ namespace ts { return tokenSourceMapRanges && tokenSourceMapRanges[token]; } - export function getConstantValue(node: Node) { + /** + * Gets the constant value to emit for an expression. + */ + export function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression) { const emitNode = node.emitNode; - if (emitNode && emitNode.flags & EmitFlags.ConstantValue) { - return emitNode.constantValue; - } + return emitNode && emitNode.constantValue; } - export function setConstantValue(node: Node, value: number) { + /** + * Sets the constant value to emit for an expression. + */ + export function setConstantValue(node: PropertyAccessExpression | ElementAccessExpression, value: number) { const emitNode = getOrCreateEmitNode(node); emitNode.constantValue = value; - emitNode.flags |= EmitFlags.ConstantValue; return node; } diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index d6e6501c598..46db5188e33 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -348,7 +348,7 @@ namespace ts { } /** - * Emits a token of a node node with possible leading and trailing source maps. + * Emits a token of a node with possible leading and trailing source maps. * * @param node The node containing the token. * @param token The token to emit. diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 316f8b2b2c0..192367348db 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3205,7 +3205,6 @@ namespace ts { AsyncFunctionBody = 1 << 21, ReuseTempVariableScope = 1 << 22, // Reuse the existing temp variable scope during emit. CustomPrologue = 1 << 23, // Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed). - ConstantValue = 1 << 24, // The node was replaced with a constant value during substitution. } /* @internal */ From 228ddde66ea7ca92e255da183a61a06dacf4bfd6 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 29 Sep 2016 06:15:48 -0700 Subject: [PATCH 45/47] Ensure that `checkGrammarModuleElementContext` reliably returns `true` when there is bad grammar. --- src/compiler/checker.ts | 8 +++++--- tests/baselines/reference/exportInFunction.errors.txt | 9 +++++++++ tests/baselines/reference/exportInFunction.js | 9 +++++++++ tests/cases/compiler/exportInFunction.ts | 2 ++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/exportInFunction.errors.txt create mode 100644 tests/baselines/reference/exportInFunction.js create mode 100644 tests/cases/compiler/exportInFunction.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 61cf701eb95..1f50ace2cf1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17706,9 +17706,11 @@ namespace ts { } function checkGrammarModuleElementContext(node: Statement, errorMessage: DiagnosticMessage): boolean { - if (node.parent.kind !== SyntaxKind.SourceFile && node.parent.kind !== SyntaxKind.ModuleBlock && node.parent.kind !== SyntaxKind.ModuleDeclaration) { - return grammarErrorOnFirstToken(node, errorMessage); + const isInAppropriateContext = node.parent.kind === SyntaxKind.SourceFile || node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.ModuleDeclaration; + if (!isInAppropriateContext) { + grammarErrorOnFirstToken(node, errorMessage); } + return !isInAppropriateContext; } function checkExportSpecifier(node: ExportSpecifier) { @@ -17749,7 +17751,7 @@ namespace ts { checkExpressionCached(node.expression); } - checkExternalModuleExports(container); + checkExternalModuleExports(container); if (node.isExportEquals && !isInAmbientContext(node)) { if (modulekind === ModuleKind.ES6) { diff --git a/tests/baselines/reference/exportInFunction.errors.txt b/tests/baselines/reference/exportInFunction.errors.txt new file mode 100644 index 00000000000..cfd005952f9 --- /dev/null +++ b/tests/baselines/reference/exportInFunction.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/exportInFunction.ts(3,1): error TS1005: '}' expected. + + +==== tests/cases/compiler/exportInFunction.ts (1 errors) ==== + function f() { + export = 0; + + +!!! error TS1005: '}' expected. \ No newline at end of file diff --git a/tests/baselines/reference/exportInFunction.js b/tests/baselines/reference/exportInFunction.js new file mode 100644 index 00000000000..9e1db163d81 --- /dev/null +++ b/tests/baselines/reference/exportInFunction.js @@ -0,0 +1,9 @@ +//// [exportInFunction.ts] +function f() { + export = 0; + + +//// [exportInFunction.js] +function f() { + export = 0; +} diff --git a/tests/cases/compiler/exportInFunction.ts b/tests/cases/compiler/exportInFunction.ts new file mode 100644 index 00000000000..9bb0c5dcd0f --- /dev/null +++ b/tests/cases/compiler/exportInFunction.ts @@ -0,0 +1,2 @@ +function f() { + export = 0; From 8177bd4da076be73d07bd3dba8c16a88aac3ba58 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Fri, 30 Sep 2016 13:19:54 -0700 Subject: [PATCH 46/47] replace hardcodes 'useCaseSensitiveFileNames=false' in services with actual value, use specialized map lookup methods instead of generic 'getOrCreate*' --- src/harness/unittests/tsserverProjectSystem.ts | 18 ++++++++++++++++++ src/server/editorServices.ts | 7 ++++++- src/server/project.ts | 8 +++++++- src/services/services.ts | 2 +- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index c459d2afac2..988e87284c3 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2045,4 +2045,22 @@ namespace ts.projectSystem { assert.equal(snap.getLength(), expectedLength, "Incorrect snapshot size"); } }); + + describe("Language service", () => { + it("should work correctly on case-sensitive file systems", () => { + const lib = { + path: "/a/Lib/lib.d.ts", + content: "let x: number" + }; + const f = { + path: "/a/b/app.ts", + content: "let x = 1;" + }; + const host = createServerHost([lib, f], { executingFilePath: "/a/Lib/tsc.js", useCaseSensitiveFileNames: true }); + const projectService = createProjectService(host); + projectService.openClientFile(f.path); + projectService.checkNumberOfProjects({ inferredProjects: 1 }); + projectService.inferredProjects[0].getLanguageService().getProgram(); + }); + }); } \ No newline at end of file diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 707f286a9b5..2b28e66bf88 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1001,9 +1001,14 @@ namespace ts.server { } getScriptInfoForNormalizedPath(fileName: NormalizedPath) { - return this.filenameToScriptInfo.get(normalizedPathToPath(fileName, this.host.getCurrentDirectory(), this.toCanonicalFileName)); + return this.getScriptInfoForPath(normalizedPathToPath(fileName, this.host.getCurrentDirectory(), this.toCanonicalFileName)); } + getScriptInfoForPath(fileName: Path) { + return this.filenameToScriptInfo.get(fileName); + } + + setHostConfiguration(args: protocol.ConfigureRequestArguments) { if (args.file) { const info = this.getScriptInfoForNormalizedPath(toNormalizedPath(args.file)); diff --git a/src/server/project.ts b/src/server/project.ts index 01858b4cc68..b59efb03cfd 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -215,7 +215,13 @@ namespace ts.server { } getScriptInfos() { - return map(this.program.getSourceFiles(), sourceFile => this.getScriptInfoLSHost(sourceFile.path)); + return map(this.program.getSourceFiles(), sourceFile => { + const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.path); + if (!scriptInfo) { + Debug.assert(false, `scriptInfo for a file '${sourceFile.fileName}' is missing.`); + } + return scriptInfo; + }); } getFileEmitOutput(info: ScriptInfo, emitOnlyDtsFiles: boolean) { diff --git a/src/services/services.ts b/src/services/services.ts index eb103cebb11..b50e1d3313d 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -947,7 +947,7 @@ namespace ts { let lastTypesRootVersion = 0; - const useCaseSensitivefileNames = false; + const useCaseSensitivefileNames = host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(); const cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); const currentDirectory = host.getCurrentDirectory(); From ae7f1be42766150366dcdcad9273f2827da68f32 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 30 Sep 2016 14:20:06 -0700 Subject: [PATCH 47/47] Do not emit extra var decls for merged enums/namespaces --- src/compiler/transformers/ts.ts | 75 +- ...hModuleMemberThatUsesClassTypeParameter.js | 4 - ...GenericClassStaticFunctionOfTheSameName.js | 1 - ...GenericClassStaticFunctionOfTheSameName.js | 1 - ...dStaticFunctionUsingClassPrivateStatics.js | 1 - ...nctionAndExportedFunctionThatShareAName.js | 2 - ...ionAndNonExportedFunctionThatShareAName.js | 2 - ...ticVariableAndExportedVarThatShareAName.js | 2 - ...VariableAndNonExportedVarThatShareAName.js | 2 - ...ClassAndModuleWithSameNameAndCommonRoot.js | 1 - .../EnumAndModuleWithSameNameAndCommonRoot.js | 1 - ...ctionAndModuleWithSameNameAndCommonRoot.js | 1 - .../ModuleAndEnumWithSameNameAndCommonRoot.js | 1 - ...ortedAndNonExportedClassesOfTheSameName.js | 2 - ...rgeEachWithExportedClassesOfTheSameName.js | 2 - ...rgeEachWithExportedModulesOfTheSameName.js | 2 - .../anyAssignabilityInInheritance.js | 2 - .../reference/anyAssignableToEveryType2.js | 2 - ...entCompatWithObjectMembersAccessibility.js | 1 - .../assignmentToObjectAndFunction.js | 3 - .../reference/augmentExportEquals3.js | 1 - .../reference/augmentExportEquals4.js | 1 - .../reference/augmentExportEquals6.js | 1 - .../reference/augmentedTypesClass.js | 1 - .../reference/augmentedTypesClass2.js | 1 - .../reference/augmentedTypesClass3.js | 2 - .../baselines/reference/augmentedTypesEnum.js | 4 - .../reference/augmentedTypesEnum3.js | 5 - .../reference/augmentedTypesFunction.js | 3 - .../reference/augmentedTypesModules.js | 7 - .../reference/augmentedTypesModules2.js | 2 - .../reference/augmentedTypesModules3b.js | 2 - .../reference/augmentedTypesModules4.js | 3 - .../reference/autonumberingInEnums.js | 1 - ...ureWithoutReturnTypeAnnotationInference.js | 3 - .../circularTypeofWithFunctionModule.js | 1 - ...clarationMergedInModuleWithContinuation.js | 2 - ...sMergedWithModuleNotReferingConstructor.js | 1 - .../cloduleAcrossModuleDefinitions.js | 1 - .../reference/cloduleAndTypeParameters.js | 1 - .../reference/cloduleStaticMembers.js | 1 - .../reference/cloduleWithDuplicateMember1.js | 2 - .../reference/cloduleWithDuplicateMember2.js | 2 - .../cloduleWithPriorInstantiatedModule.js | 1 - .../cloduleWithPriorUninstantiatedModule.js | 1 - .../cloduleWithRecursiveReference.js | 1 - .../reference/clodulesDerivedClasses.js | 2 - ...lisionCodeGenModuleWithAccessorChildren.js | 4 - ...ionCodeGenModuleWithConstructorChildren.js | 2 - ...lisionCodeGenModuleWithFunctionChildren.js | 2 - ...ollisionCodeGenModuleWithMethodChildren.js | 3 - ...ollisionCodeGenModuleWithModuleChildren.js | 4 - ...llisionCodeGenModuleWithModuleReopening.js | 2 - .../reference/commentsMultiModuleMultiFile.js | 1 - .../commentsMultiModuleSingleFile.js | 1 - .../constructSignaturesWithOverloads2.js | 2 - .../reference/declFileGenericType2.js | 1 - .../declFileTypeAnnotationTypeAlias.js | 1 - ...lictingWithClassReferredByExtendsClause.js | 1 - ...dsClauseThatHasItsContainerNameConflict.js | 1 - .../reference/declarationEmitNameConflicts.js | 2 - .../declarationEmitNameConflicts2.js | 1 - .../declarationEmitNameConflicts3.js | 1 - tests/baselines/reference/dottedModuleName.js | 1 - .../baselines/reference/dottedModuleName2.js | 1 - .../reference/duplicateAnonymousInners1.js | 1 - .../duplicateAnonymousModuleClasses.js | 3 - ...ateIdentifiersAcrossContainerBoundaries.js | 9 - .../duplicateSymbolsExportMatching.js | 4 - .../enumAssignabilityInInheritance.js | 2 - .../reference/enumAssignmentCompat.js | 1 - .../reference/enumAssignmentCompat2.js | 1 - .../reference/enumAssignmentCompat3.js | 1 - tests/baselines/reference/enumBasics1.js | 1 - .../reference/enumGenericTypeClash.js | 1 - .../enumIsNotASubtypeOfAnythingButNumber.js | 2 - tests/baselines/reference/enumMerging.js | 3 - .../baselines/reference/enumMergingErrors.js | 6 - .../enumsWithMultipleDeclarations1.js | 2 - .../enumsWithMultipleDeclarations2.js | 2 - .../reference/es6modulekindWithES5Target12.js | 70 ++ .../es6modulekindWithES5Target12.symbols | 62 ++ .../es6modulekindWithES5Target12.types | 69 ++ .../reference/exportAssignmentMergedModule.js | 1 - .../exportAssignmentTopLevelClodule.js | 1 - .../exportAssignmentTopLevelEnumdule.js | 1 - .../exportAssignmentTopLevelFundule.js | 1 - .../exportDeclarationInInternalModule.js | 2 - .../reference/exportDefaultProperty.js | 1 - .../reference/exportEqualsProperty.js | 1 - .../baselines/reference/exportImportAlias.js | 2 - .../reference/exportImportAndClodule.js | 1 - tests/baselines/reference/extBaseClass1.js | 1 - tests/baselines/reference/forwardRefInEnum.js | 1 - tests/baselines/reference/funClodule.js | 1 - .../reference/functionMergedWithModule.js | 2 - ...leOfFunctionWithoutReturnTypeAnnotation.js | 1 - .../reference/genericCloduleInModule.js | 1 - .../reference/genericCloduleInModule2.js | 1 - ...genericConstraintOnExtendedBuiltinTypes.js | 1 - ...enericConstraintOnExtendedBuiltinTypes2.js | 1 - .../reference/genericFunduleInModule.js | 1 - .../reference/genericFunduleInModule2.js | 1 - ...ericMergedDeclarationUsingTypeParameter.js | 1 - ...ricMergedDeclarationUsingTypeParameter2.js | 1 - .../reference/genericOfACloduleType1.js | 1 - .../reference/genericOfACloduleType2.js | 1 - ...ericRecursiveImplicitConstructorErrors3.js | 1 - .../reference/heterogeneousArrayLiterals.js | 1 - .../reference/importAliasIdentifiers.js | 2 - .../inheritedModuleMembersForClodule.js | 1 - ...leMergedWithClassNotReferencingInstance.js | 1 - ...thClassNotReferencingInstanceNoConflict.js | 1 - .../reference/invalidNestedModules.js | 2 - .../isDeclarationVisibleNodeKinds.js | 8 - .../reference/mergeThreeInterfaces2.js | 4 - .../reference/mergeTwoInterfaces2.js | 3 - .../reference/mergedDeclarations1.js | 1 - .../reference/mergedDeclarations2.js | 2 - .../reference/mergedDeclarations3.js | 5 - .../reference/mergedDeclarations4.js | 1 - .../reference/mergedEnumDeclarationCodeGen.js | 1 - .../mergedModuleDeclarationCodeGen.js | 1 - .../mergedModuleDeclarationCodeGen2.js | 1 - .../mergedModuleDeclarationCodeGen3.js | 1 - .../mergedModuleDeclarationCodeGen4.js | 1 - .../mergedModuleDeclarationCodeGen5.js | 1 - ...dModuleDeclarationWithSharedExportedVar.js | 1 - .../missingFunctionImplementation.js | 4 - .../reference/moduleDuplicateIdentifiers.js | 1 - .../moduleMemberWithoutTypeAnnotation1.js | 3 - tests/baselines/reference/moduleMerge.js | 1 - .../reference/moduleReopenedTypeOtherBlock.js | 1 - .../reference/moduleReopenedTypeSameBlock.js | 1 - tests/baselines/reference/moduleVariables.js | 2 - .../reference/moduleVisibilityTest1.js | 1 - .../reference/moduleVisibilityTest2.js | 1 - tests/baselines/reference/moduledecl.js | 1 - .../reference/multiModuleClodule1.js | 2 - .../reference/multiModuleFundule1.js | 2 - tests/baselines/reference/multipleExports.js | 1 - tests/baselines/reference/nameCollision.js | 1 - .../nameCollisionWithBlockScopedVariable1.js | 1 - .../nonExportedElementsOfMergedModules.js | 1 - .../nullIsSubtypeOfEverythingButUndefined.js | 2 - ...ectLiteralShorthandPropertiesWithModule.js | 1 - ...LiteralShorthandPropertiesWithModuleES6.js | 1 - .../reference/parserEnumDeclaration4.js | 1 - ...privacyCheckAnonymousFunctionParameter2.js | 1 - ...rtAssignmentOnExportedGenericInterface2.js | 1 - tests/baselines/reference/privacyImport.js | 1 - .../reference/privacyImportParseErrors.js | 1 - .../privateStaticNotAccessibleInClodule.js | 1 - .../privateStaticNotAccessibleInClodule2.js | 1 - .../protectedStaticNotAccessibleInClodule.js | 1 - tests/baselines/reference/qualify.js | 1 - .../reference/recursiveClassReferenceTest.js | 2 - .../recursiveClassReferenceTest.js.map | 2 +- .../recursiveClassReferenceTest.sourcemap.txt | 666 ++++++++---------- .../reference/recursiveCloduleReference.js | 1 - tests/baselines/reference/recursiveMods.js | 1 - tests/baselines/reference/reservedWords2.js | 1 - ...lassDeclarationWhenInBaseTypeResolution.js | 37 - .../sourcemapValidationDuplicateNames.js | 1 - .../sourcemapValidationDuplicateNames.js.map | 2 +- ...emapValidationDuplicateNames.sourcemap.txt | 63 +- .../reference/staticMemberExportAccess.js | 1 - .../reference/staticPropertyNotInClassType.js | 2 - .../reference/staticsNotInScopeInClodule.js | 1 - tests/baselines/reference/subtypesOfAny.js | 2 - .../reference/subtypesOfTypeParameter.js | 2 - ...subtypesOfTypeParameterWithConstraints2.js | 2 - tests/baselines/reference/subtypesOfUnion.js | 2 - .../systemModuleDeclarationMerging.js | 2 +- tests/baselines/reference/tsxEmit3.js | 3 - tests/baselines/reference/tsxEmit3.js.map | 2 +- .../reference/tsxEmit3.sourcemap.txt | 310 ++++---- tests/baselines/reference/tsxPreserveEmit1.js | 1 - tests/baselines/reference/tsxReactEmit6.js | 1 - .../typeOfEnumAndVarRedeclarations.js | 1 - .../reference/typeofANonExportedType.js | 1 - .../reference/typeofAnExportedType.js | 1 - .../undefinedIsSubtypeOfEverything.js | 2 - .../reference/undefinedTypeAssignment4.js | 1 - .../unexportedInstanceClassVariables.js | 1 - ...nSubtypeIfEveryConstituentTypeIsSubtype.js | 2 - ...flictsWithImportInDifferentPartOfModule.js | 1 - .../compiler/es6modulekindWithES5Target12.ts | 39 + 188 files changed, 749 insertions(+), 943 deletions(-) create mode 100644 tests/baselines/reference/es6modulekindWithES5Target12.js create mode 100644 tests/baselines/reference/es6modulekindWithES5Target12.symbols create mode 100644 tests/baselines/reference/es6modulekindWithES5Target12.types create mode 100644 tests/cases/compiler/es6modulekindWithES5Target12.ts diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 054b1e4608b..f6e8074cb07 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -51,6 +51,7 @@ namespace ts { let currentNamespace: ModuleDeclaration; let currentNamespaceContainerName: Identifier; let currentScope: SourceFile | Block | ModuleBlock | CaseBlock; + let currentScopeFirstDeclarationsOfName: Map; let currentSourceFileExternalHelpersModuleName: Identifier; /** @@ -100,6 +101,7 @@ namespace ts { function saveStateAndInvoke(node: Node, f: (node: Node) => T): T { // Save state const savedCurrentScope = currentScope; + const savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; // Handle state changes before visiting a node. onBeforeVisitNode(node); @@ -107,8 +109,11 @@ namespace ts { const visited = f(node); // Restore state - currentScope = savedCurrentScope; + if (currentScope !== savedCurrentScope) { + currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; + } + currentScope = savedCurrentScope; return visited; } @@ -414,6 +419,16 @@ namespace ts { case SyntaxKind.ModuleBlock: case SyntaxKind.Block: currentScope = node; + currentScopeFirstDeclarationsOfName = undefined; + break; + + case SyntaxKind.ClassDeclaration: + case SyntaxKind.FunctionDeclaration: + if (hasModifier(node, ModifierFlags.Ambient)) { + break; + } + + recordEmittedDeclarationInScope(node); break; } } @@ -2502,10 +2517,12 @@ namespace ts { } function shouldEmitVarForEnumDeclaration(node: EnumDeclaration | ModuleDeclaration) { - return !hasModifier(node, ModifierFlags.Export) - || (isES6ExportedDeclaration(node) && isFirstDeclarationOfKind(node, node.kind)); + return isFirstEmittedDeclarationInScope(node) + && (!hasModifier(node, ModifierFlags.Export) + || isES6ExportedDeclaration(node)); } + /* * Adds a trailing VariableStatement for an enum or module declaration. */ @@ -2543,6 +2560,7 @@ namespace ts { // If needed, we should emit a variable declaration for the enum. If we emit // a leading variable declaration, we should not emit leading comments for the // enum body. + recordEmittedDeclarationInScope(node); if (shouldEmitVarForEnumDeclaration(node)) { addVarForEnumOrModuleDeclaration(statements, node); @@ -2679,20 +2697,48 @@ namespace ts { return isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); } - function isModuleMergedWithES6Class(node: ModuleDeclaration) { - return languageVersion === ScriptTarget.ES6 - && isMergedWithClass(node); - } - function isES6ExportedDeclaration(node: Node) { return isExternalModuleExport(node) && moduleKind === ModuleKind.ES6; } + /** + * Records that a declaration was emitted in the current scope, if it was the first + * declaration for the provided symbol. + * + * NOTE: if there is ever a transformation above this one, we may not be able to rely + * on symbol names. + */ + function recordEmittedDeclarationInScope(node: Node) { + const name = node.symbol && node.symbol.name; + if (name) { + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = createMap(); + } + + if (!(name in currentScopeFirstDeclarationsOfName)) { + currentScopeFirstDeclarationsOfName[name] = node; + } + } + } + + /** + * Determines whether a declaration is the first declaration with the same name emitted + * in the current scope. + */ + function isFirstEmittedDeclarationInScope(node: Node) { + if (currentScopeFirstDeclarationsOfName) { + const name = node.symbol && node.symbol.name; + if (name) { + return currentScopeFirstDeclarationsOfName[name] === node; + } + } + + return false; + } + function shouldEmitVarForModuleDeclaration(node: ModuleDeclaration) { - return !isModuleMergedWithES6Class(node) - && (!isES6ExportedDeclaration(node) - || isFirstDeclarationOfKind(node, node.kind)); + return isFirstEmittedDeclarationInScope(node); } /** @@ -2768,6 +2814,7 @@ namespace ts { // If needed, we should emit a variable declaration for the module. If we emit // a leading variable declaration, we should not emit leading comments for the // module body. + recordEmittedDeclarationInScope(node); if (shouldEmitVarForModuleDeclaration(node)) { addVarForEnumOrModuleDeclaration(statements, node); // We should still emit the comments if we are emitting a system module. @@ -2837,8 +2884,10 @@ namespace ts { function transformModuleBody(node: ModuleDeclaration, namespaceLocalName: Identifier): Block { const savedCurrentNamespaceContainerName = currentNamespaceContainerName; const savedCurrentNamespace = currentNamespace; + const savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; currentNamespaceContainerName = namespaceLocalName; currentNamespace = node; + currentScopeFirstDeclarationsOfName = undefined; const statements: Statement[] = []; startLexicalEnvironment(); @@ -2865,10 +2914,12 @@ namespace ts { const moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; statementsLocation = moveRangePos(moduleBlock.statements, -1); } - addRange(statements, endLexicalEnvironment()); + addRange(statements, endLexicalEnvironment()); currentNamespaceContainerName = savedCurrentNamespaceContainerName; currentNamespace = savedCurrentNamespace; + currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; + const block = createBlock( createNodeArray( statements, diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js index bf9875efe30..09f7befae07 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js @@ -56,7 +56,6 @@ var clodule1 = (function () { } return clodule1; }()); -var clodule1; (function (clodule1) { function f(x) { } })(clodule1 || (clodule1 = {})); @@ -65,7 +64,6 @@ var clodule2 = (function () { } return clodule2; }()); -var clodule2; (function (clodule2) { var x; var D = (function () { @@ -79,7 +77,6 @@ var clodule3 = (function () { } return clodule3; }()); -var clodule3; (function (clodule3) { clodule3.y = { id: T }; })(clodule3 || (clodule3 = {})); @@ -88,7 +85,6 @@ var clodule4 = (function () { } return clodule4; }()); -var clodule4; (function (clodule4) { var D = (function () { function D() { diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js index dc6c6f6ee8e..6e12244542e 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js @@ -22,7 +22,6 @@ var clodule = (function () { clodule.fn = function (id) { }; return clodule; }()); -var clodule; (function (clodule) { // error: duplicate identifier expected function fn(x, y) { diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js index 402e0e6ad09..6d04d636eb2 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js @@ -22,7 +22,6 @@ var clodule = (function () { clodule.fn = function (id) { }; return clodule; }()); -var clodule; (function (clodule) { // error: duplicate identifier expected function fn(x, y) { diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js index 0b6c868128e..d3ae3cb0bcf 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js @@ -22,7 +22,6 @@ var clodule = (function () { clodule.sfn = function (id) { return 42; }; return clodule; }()); -var clodule; (function (clodule) { // error: duplicate identifier expected function fn(x, y) { diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js index b8e332f1932..c6b463fa5fd 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js @@ -31,7 +31,6 @@ var Point = (function () { Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246 return Point; }()); -var Point; (function (Point) { function Origin() { return null; } //expected duplicate identifier error Point.Origin = Origin; @@ -47,7 +46,6 @@ var A; return Point; }()); A.Point = Point; - var Point; (function (Point) { function Origin() { return ""; } //expected duplicate identifier error Point.Origin = Origin; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js index 3fcbdefdf7e..7741290babc 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js @@ -31,7 +31,6 @@ var Point = (function () { Point.Origin = function () { return { x: 0, y: 0 }; }; return Point; }()); -var Point; (function (Point) { function Origin() { return ""; } // not an error, since not exported })(Point || (Point = {})); @@ -46,7 +45,6 @@ var A; return Point; }()); A.Point = Point; - var Point; (function (Point) { function Origin() { return ""; } // not an error since not exported })(Point = A.Point || (A.Point = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js index 63d3739846b..cb2f7c6cb77 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js @@ -31,7 +31,6 @@ var Point = (function () { return Point; }()); Point.Origin = { x: 0, y: 0 }; -var Point; (function (Point) { Point.Origin = ""; //expected duplicate identifier error })(Point || (Point = {})); @@ -46,7 +45,6 @@ var A; }()); Point.Origin = { x: 0, y: 0 }; A.Point = Point; - var Point; (function (Point) { Point.Origin = ""; //expected duplicate identifier error })(Point = A.Point || (A.Point = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js index 3921546a21c..ef77d6257fb 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js @@ -31,7 +31,6 @@ var Point = (function () { return Point; }()); Point.Origin = { x: 0, y: 0 }; -var Point; (function (Point) { var Origin = ""; // not an error, since not exported })(Point || (Point = {})); @@ -46,7 +45,6 @@ var A; }()); Point.Origin = { x: 0, y: 0 }; A.Point = Point; - var Point; (function (Point) { var Origin = ""; // not an error since not exported })(Point = A.Point || (A.Point = {})); diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js index 247dc4fe62d..b800ca2d24b 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js @@ -76,7 +76,6 @@ var A = (function () { } return A; }()); -var A; (function (A) { A.Instance = new A(); })(A || (A = {})); diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js index e6a0eb0584d..c0756a56e90 100644 --- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js @@ -22,7 +22,6 @@ var enumdule; enumdule[enumdule["Red"] = 0] = "Red"; enumdule[enumdule["Blue"] = 1] = "Blue"; })(enumdule || (enumdule = {})); -var enumdule; (function (enumdule) { var Point = (function () { function Point(x, y) { diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js index 369a5b4dd52..daa56620014 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js @@ -72,7 +72,6 @@ var B; return { x: 0, y: 0 }; } B.Point = Point; - var Point; (function (Point) { Point.Origin = { x: 0, y: 0 }; })(Point = B.Point || (B.Point = {})); diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js index 6928e189a07..fa38dae1298 100644 --- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js @@ -28,7 +28,6 @@ var enumdule; }()); enumdule.Point = Point; })(enumdule || (enumdule = {})); -var enumdule; (function (enumdule) { enumdule[enumdule["Red"] = 0] = "Red"; enumdule[enumdule["Blue"] = 1] = "Blue"; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js index dd29b88421c..4c5ea297d27 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js @@ -50,7 +50,6 @@ var A; }()); A.Point = Point; })(A || (A = {})); -var A; (function (A) { var Point = (function () { function Point() { @@ -79,7 +78,6 @@ var X; })(Z = Y.Z || (Y.Z = {})); })(Y = X.Y || (X.Y = {})); })(X || (X = {})); -var X; (function (X) { var Y; (function (Y) { diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js index 2a75b92e2db..e98ed836f7b 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js @@ -42,7 +42,6 @@ var A; }()); A.Point = Point; })(A || (A = {})); -var A; (function (A) { // expected error var Point = (function () { @@ -67,7 +66,6 @@ var X; })(Z = Y.Z || (Y.Z = {})); })(Y = X.Y || (X.Y = {})); })(X || (X = {})); -var X; (function (X) { var Y; (function (Y) { diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js index 54ffef5a084..c8412b336dc 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js @@ -41,7 +41,6 @@ var A; (function (B) { })(B = A.B || (A.B = {})); })(A || (A = {})); -var A; (function (A) { var B; (function (B) { @@ -65,7 +64,6 @@ var X; })(Z = Y.Z || (Y.Z = {})); })(Y = X.Y || (X.Y = {})); })(X || (X = {})); -var X; (function (X) { var Y; (function (Y) { diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.js b/tests/baselines/reference/anyAssignabilityInInheritance.js index f73228a464b..a156abe8ab2 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.js +++ b/tests/baselines/reference/anyAssignabilityInInheritance.js @@ -119,7 +119,6 @@ var E; })(E || (E = {})); var r3 = foo3(a); // any function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -129,7 +128,6 @@ var CC = (function () { } return CC; }()); -var CC; (function (CC) { CC.bar = 1; })(CC || (CC = {})); diff --git a/tests/baselines/reference/anyAssignableToEveryType2.js b/tests/baselines/reference/anyAssignableToEveryType2.js index c5fefb60042..9a4534296a4 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.js +++ b/tests/baselines/reference/anyAssignableToEveryType2.js @@ -147,7 +147,6 @@ var E; E[E["A"] = 0] = "A"; })(E || (E = {})); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -156,7 +155,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js index e876ba575be..997c5f7a0c9 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js @@ -157,7 +157,6 @@ var TargetIsPublic; e = d; // errror e = e; })(TargetIsPublic || (TargetIsPublic = {})); -var TargetIsPublic; (function (TargetIsPublic) { // targets var Base = (function () { diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.js b/tests/baselines/reference/assignmentToObjectAndFunction.js index a3c4785b18b..d60e2de4a5a 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.js +++ b/tests/baselines/reference/assignmentToObjectAndFunction.js @@ -38,20 +38,17 @@ var goodObj = { }; // Ok, because toString is a subtype of Object's toString var errFun = {}; // Error for no call signature function foo() { } -var foo; (function (foo) { foo.boom = 0; })(foo || (foo = {})); var goodFundule = foo; // ok function bar() { } -var bar; (function (bar) { function apply(thisArg, argArray) { } bar.apply = apply; })(bar || (bar = {})); var goodFundule2 = bar; // ok function bad() { } -var bad; (function (bad) { bad.apply = 0; })(bad || (bad = {})); diff --git a/tests/baselines/reference/augmentExportEquals3.js b/tests/baselines/reference/augmentExportEquals3.js index 82cfa5f2166..94cb0f8ce95 100644 --- a/tests/baselines/reference/augmentExportEquals3.js +++ b/tests/baselines/reference/augmentExportEquals3.js @@ -28,7 +28,6 @@ let b = x.b; define(["require", "exports"], function (require, exports) { "use strict"; function foo() { } - var foo; (function (foo) { foo.v = 1; })(foo || (foo = {})); diff --git a/tests/baselines/reference/augmentExportEquals4.js b/tests/baselines/reference/augmentExportEquals4.js index ee0fc1892c2..ff0cbd44e0b 100644 --- a/tests/baselines/reference/augmentExportEquals4.js +++ b/tests/baselines/reference/augmentExportEquals4.js @@ -32,7 +32,6 @@ define(["require", "exports"], function (require, exports) { } return foo; }()); - var foo; (function (foo) { foo.v = 1; })(foo || (foo = {})); diff --git a/tests/baselines/reference/augmentExportEquals6.js b/tests/baselines/reference/augmentExportEquals6.js index 94dfa389c6d..3f9cbbb0af8 100644 --- a/tests/baselines/reference/augmentExportEquals6.js +++ b/tests/baselines/reference/augmentExportEquals6.js @@ -36,7 +36,6 @@ define(["require", "exports"], function (require, exports) { } return foo; }()); - var foo; (function (foo) { var A = (function () { function A() { diff --git a/tests/baselines/reference/augmentedTypesClass.js b/tests/baselines/reference/augmentedTypesClass.js index 48cc4ef05de..b9c263971b3 100644 --- a/tests/baselines/reference/augmentedTypesClass.js +++ b/tests/baselines/reference/augmentedTypesClass.js @@ -23,7 +23,6 @@ var c4 = (function () { c4.prototype.foo = function () { }; return c4; }()); -var c4; (function (c4) { c4[c4["One"] = 0] = "One"; })(c4 || (c4 = {})); // error diff --git a/tests/baselines/reference/augmentedTypesClass2.js b/tests/baselines/reference/augmentedTypesClass2.js index ee87a2396ad..0896a03a925 100644 --- a/tests/baselines/reference/augmentedTypesClass2.js +++ b/tests/baselines/reference/augmentedTypesClass2.js @@ -51,7 +51,6 @@ var c33 = (function () { }; return c33; }()); -var c33; (function (c33) { c33[c33["One"] = 0] = "One"; })(c33 || (c33 = {})); diff --git a/tests/baselines/reference/augmentedTypesClass3.js b/tests/baselines/reference/augmentedTypesClass3.js index 216cd118ee6..3a4877707c6 100644 --- a/tests/baselines/reference/augmentedTypesClass3.js +++ b/tests/baselines/reference/augmentedTypesClass3.js @@ -27,7 +27,6 @@ var c5a = (function () { c5a.prototype.foo = function () { }; return c5a; }()); -var c5a; (function (c5a) { var y = 2; })(c5a || (c5a = {})); // should be ok @@ -37,7 +36,6 @@ var c5b = (function () { c5b.prototype.foo = function () { }; return c5b; }()); -var c5b; (function (c5b) { c5b.y = 2; })(c5b || (c5b = {})); // should be ok diff --git a/tests/baselines/reference/augmentedTypesEnum.js b/tests/baselines/reference/augmentedTypesEnum.js index 3d2bb0b7d25..406c1a3bf69 100644 --- a/tests/baselines/reference/augmentedTypesEnum.js +++ b/tests/baselines/reference/augmentedTypesEnum.js @@ -69,7 +69,6 @@ var e5; (function (e5) { e5[e5["One"] = 0] = "One"; })(e5 || (e5 = {})); -var e5; (function (e5) { e5[e5["Two"] = 0] = "Two"; })(e5 || (e5 = {})); // error @@ -77,7 +76,6 @@ var e5a; (function (e5a) { e5a[e5a["One"] = 0] = "One"; })(e5a || (e5a = {})); // error -var e5a; (function (e5a) { e5a[e5a["One"] = 0] = "One"; })(e5a || (e5a = {})); // error @@ -90,7 +88,6 @@ var e6a; (function (e6a) { e6a[e6a["One"] = 0] = "One"; })(e6a || (e6a = {})); -var e6a; (function (e6a) { var y = 2; })(e6a || (e6a = {})); // should be error @@ -98,7 +95,6 @@ var e6b; (function (e6b) { e6b[e6b["One"] = 0] = "One"; })(e6b || (e6b = {})); -var e6b; (function (e6b) { e6b.y = 2; })(e6b || (e6b = {})); // should be error diff --git a/tests/baselines/reference/augmentedTypesEnum3.js b/tests/baselines/reference/augmentedTypesEnum3.js index e0d8b51cf72..4df9dada530 100644 --- a/tests/baselines/reference/augmentedTypesEnum3.js +++ b/tests/baselines/reference/augmentedTypesEnum3.js @@ -25,13 +25,11 @@ var E; (function (E) { var t; })(E || (E = {})); -var E; (function (E) { })(E || (E = {})); var F; (function (F) { })(F || (F = {})); -var F; (function (F) { var t; })(F || (F = {})); @@ -39,15 +37,12 @@ var A; (function (A) { var o; })(A || (A = {})); -var A; (function (A) { A[A["b"] = 0] = "b"; })(A || (A = {})); -var A; (function (A) { A[A["c"] = 0] = "c"; })(A || (A = {})); -var A; (function (A) { var p; })(A || (A = {})); diff --git a/tests/baselines/reference/augmentedTypesFunction.js b/tests/baselines/reference/augmentedTypesFunction.js index 72f36aeeccc..95f91a938d7 100644 --- a/tests/baselines/reference/augmentedTypesFunction.js +++ b/tests/baselines/reference/augmentedTypesFunction.js @@ -63,19 +63,16 @@ var y3a = (function () { }()); // error // function then enum function y4() { } // error -var y4; (function (y4) { y4[y4["One"] = 0] = "One"; })(y4 || (y4 = {})); // error // function then internal module function y5() { } function y5a() { } -var y5a; (function (y5a) { var y = 2; })(y5a || (y5a = {})); // should be an error function y5b() { } -var y5b; (function (y5b) { y5b.y = 3; })(y5b || (y5b = {})); // should be an error diff --git a/tests/baselines/reference/augmentedTypesModules.js b/tests/baselines/reference/augmentedTypesModules.js index 39a4c17454b..61dd64174d9 100644 --- a/tests/baselines/reference/augmentedTypesModules.js +++ b/tests/baselines/reference/augmentedTypesModules.js @@ -138,7 +138,6 @@ function m2b() { } // should be errors to have function first function m2c() { } ; -var m2c; (function (m2c) { m2c.y = 2; })(m2c || (m2c = {})); @@ -146,7 +145,6 @@ function m2f() { } ; function m2g() { } ; -var m2g; (function (m2g) { var C = (function () { function C() { @@ -177,7 +175,6 @@ var m3b = (function () { m3b.prototype.foo = function () { }; return m3b; }()); -var m3b; (function (m3b) { var y = 2; })(m3b || (m3b = {})); @@ -187,7 +184,6 @@ var m3c = (function () { m3c.prototype.foo = function () { }; return m3c; }()); -var m3c; (function (m3c) { m3c.y = 2; })(m3c || (m3c = {})); @@ -216,7 +212,6 @@ var m4a; (function (m4a) { var y = 2; })(m4a || (m4a = {})); -var m4a; (function (m4a) { m4a[m4a["One"] = 0] = "One"; })(m4a || (m4a = {})); @@ -224,7 +219,6 @@ var m4b; (function (m4b) { m4b.y = 2; })(m4b || (m4b = {})); -var m4b; (function (m4b) { m4b[m4b["One"] = 0] = "One"; })(m4b || (m4b = {})); @@ -241,7 +235,6 @@ var m4d; return C; }()); })(m4d || (m4d = {})); -var m4d; (function (m4d) { m4d[m4d["One"] = 0] = "One"; })(m4d || (m4d = {})); diff --git a/tests/baselines/reference/augmentedTypesModules2.js b/tests/baselines/reference/augmentedTypesModules2.js index 82bba357bba..9f7d3613d57 100644 --- a/tests/baselines/reference/augmentedTypesModules2.js +++ b/tests/baselines/reference/augmentedTypesModules2.js @@ -45,7 +45,6 @@ function m2b() { } ; // error since the module is instantiated function m2c() { } ; -var m2c; (function (m2c) { m2c.y = 2; })(m2c || (m2c = {})); @@ -59,7 +58,6 @@ function m2f() { } ; function m2g() { } ; -var m2g; (function (m2g) { var C = (function () { function C() { diff --git a/tests/baselines/reference/augmentedTypesModules3b.js b/tests/baselines/reference/augmentedTypesModules3b.js index a422ad79973..02da7b41f2e 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.js +++ b/tests/baselines/reference/augmentedTypesModules3b.js @@ -25,7 +25,6 @@ var m3b = (function () { m3b.prototype.foo = function () { }; return m3b; }()); -var m3b; (function (m3b) { var y = 2; })(m3b || (m3b = {})); @@ -35,7 +34,6 @@ var m3c = (function () { m3c.prototype.foo = function () { }; return m3c; }()); -var m3c; (function (m3c) { m3c.y = 2; })(m3c || (m3c = {})); diff --git a/tests/baselines/reference/augmentedTypesModules4.js b/tests/baselines/reference/augmentedTypesModules4.js index ed86c057462..5db6c42d707 100644 --- a/tests/baselines/reference/augmentedTypesModules4.js +++ b/tests/baselines/reference/augmentedTypesModules4.js @@ -30,7 +30,6 @@ var m4a; (function (m4a) { var y = 2; })(m4a || (m4a = {})); -var m4a; (function (m4a) { m4a[m4a["One"] = 0] = "One"; })(m4a || (m4a = {})); @@ -38,7 +37,6 @@ var m4b; (function (m4b) { m4b.y = 2; })(m4b || (m4b = {})); -var m4b; (function (m4b) { m4b[m4b["One"] = 0] = "One"; })(m4b || (m4b = {})); @@ -55,7 +53,6 @@ var m4d; return C; }()); })(m4d || (m4d = {})); -var m4d; (function (m4d) { m4d[m4d["One"] = 0] = "One"; })(m4d || (m4d = {})); diff --git a/tests/baselines/reference/autonumberingInEnums.js b/tests/baselines/reference/autonumberingInEnums.js index e6bf29bda8f..218b10ae44c 100644 --- a/tests/baselines/reference/autonumberingInEnums.js +++ b/tests/baselines/reference/autonumberingInEnums.js @@ -12,7 +12,6 @@ var Foo; (function (Foo) { Foo[Foo["a"] = 1] = "a"; })(Foo || (Foo = {})); -var Foo; (function (Foo) { Foo[Foo["b"] = 0] = "b"; // should work fine })(Foo || (Foo = {})); diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js index baa7f6c2c95..caba9d7ef6e 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js @@ -204,7 +204,6 @@ function foo12() { } var r12 = foo12(); function m1() { return 1; } -var m1; (function (m1) { m1.y = 2; })(m1 || (m1 = {})); @@ -217,7 +216,6 @@ var c1 = (function () { } return c1; }()); -var c1; (function (c1) { c1.x = 1; })(c1 || (c1 = {})); @@ -229,7 +227,6 @@ var e1; (function (e1) { e1[e1["A"] = 0] = "A"; })(e1 || (e1 = {})); -var e1; (function (e1) { e1.y = 1; })(e1 || (e1 = {})); diff --git a/tests/baselines/reference/circularTypeofWithFunctionModule.js b/tests/baselines/reference/circularTypeofWithFunctionModule.js index 6ce1dd62fc5..428efa6f45b 100644 --- a/tests/baselines/reference/circularTypeofWithFunctionModule.js +++ b/tests/baselines/reference/circularTypeofWithFunctionModule.js @@ -27,7 +27,6 @@ var Foo = (function () { function maker(value) { return maker.Bar; } -var maker; (function (maker) { var Bar = (function (_super) { __extends(Bar, _super); diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index 7ab6cb2ceca..6969f212bca 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -25,12 +25,10 @@ var M; return N; }()); M.N = N; - var N; (function (N) { N.v = 0; })(N = M.N || (M.N = {})); })(M || (M = {})); -var M; (function (M) { var O = (function (_super) { __extends(O, _super); diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index 80b4b7c175d..4247bb96bae 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -24,7 +24,6 @@ var A = (function () { } return A; }()); -var A; (function (A) { })(A || (A = {})); var Foo; diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js index f0f31325aed..ac3ff22852f 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js @@ -27,7 +27,6 @@ var A; }()); A.B = B; })(A || (A = {})); -var A; (function (A) { var B; (function (B) { diff --git a/tests/baselines/reference/cloduleAndTypeParameters.js b/tests/baselines/reference/cloduleAndTypeParameters.js index 2d47ce1ef75..c37ec8d584f 100644 --- a/tests/baselines/reference/cloduleAndTypeParameters.js +++ b/tests/baselines/reference/cloduleAndTypeParameters.js @@ -19,7 +19,6 @@ var Foo = (function () { } return Foo; }()); -var Foo; (function (Foo) { var Baz = (function () { function Baz() { diff --git a/tests/baselines/reference/cloduleStaticMembers.js b/tests/baselines/reference/cloduleStaticMembers.js index 868b9305bdf..b696a842f3b 100644 --- a/tests/baselines/reference/cloduleStaticMembers.js +++ b/tests/baselines/reference/cloduleStaticMembers.js @@ -20,7 +20,6 @@ var Clod = (function () { }()); Clod.x = 10; Clod.y = 10; -var Clod; (function (Clod) { var p = Clod.x; var q = x; diff --git a/tests/baselines/reference/cloduleWithDuplicateMember1.js b/tests/baselines/reference/cloduleWithDuplicateMember1.js index 6f4a2809b8e..d364af3a751 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember1.js +++ b/tests/baselines/reference/cloduleWithDuplicateMember1.js @@ -34,11 +34,9 @@ var C = (function () { C.foo = function () { }; return C; }()); -var C; (function (C) { C.x = 1; })(C || (C = {})); -var C; (function (C) { function foo() { } C.foo = foo; diff --git a/tests/baselines/reference/cloduleWithDuplicateMember2.js b/tests/baselines/reference/cloduleWithDuplicateMember2.js index f0e8af0e3d2..927ec4356b5 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember2.js +++ b/tests/baselines/reference/cloduleWithDuplicateMember2.js @@ -27,11 +27,9 @@ var C = (function () { }); return C; }()); -var C; (function (C) { C.x = 1; })(C || (C = {})); -var C; (function (C) { function x() { } C.x = x; diff --git a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js index 00040923627..e6bb334a424 100644 --- a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js +++ b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js @@ -28,7 +28,6 @@ var Moclodule = (function () { return Moclodule; }()); // Instantiated module. -var Moclodule; (function (Moclodule) { var Manager = (function () { function Manager() { diff --git a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js index ba29858c5dd..552f9a57656 100644 --- a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js +++ b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js @@ -22,7 +22,6 @@ var Moclodule = (function () { return Moclodule; }()); // Instantiated module. -var Moclodule; (function (Moclodule) { var Manager = (function () { function Manager() { diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.js b/tests/baselines/reference/cloduleWithRecursiveReference.js index d07af909cc7..6da2de4c07e 100644 --- a/tests/baselines/reference/cloduleWithRecursiveReference.js +++ b/tests/baselines/reference/cloduleWithRecursiveReference.js @@ -16,7 +16,6 @@ var M; return C; }()); M.C = C; - var C; (function (C_1) { C_1.C = M.C; })(C = M.C || (M.C = {})); diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index 7e6f26ad591..6f8a56786a6 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -33,7 +33,6 @@ var Shape = (function () { } return Shape; }()); -var Shape; (function (Shape) { var Utils; (function (Utils) { @@ -48,7 +47,6 @@ var Path = (function (_super) { } return Path; }(Shape)); -var Path; (function (Path) { var Utils; (function (Utils) { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js index fd502b32ccf..977d0c4bf49 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js @@ -62,7 +62,6 @@ var M; return c; }()); })(M || (M = {})); -var M; (function (M_2) { var d = (function () { function d() { @@ -78,7 +77,6 @@ var M; return d; }()); })(M || (M = {})); -var M; (function (M) { var e = (function () { function e() { @@ -93,7 +91,6 @@ var M; return e; }()); })(M || (M = {})); -var M; (function (M_3) { var f = (function () { function f() { @@ -109,7 +106,6 @@ var M; return f; }()); })(M || (M = {})); -var M; (function (M) { var e = (function () { function e() { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js index 24332a84797..5dd1fb96e1d 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js @@ -34,7 +34,6 @@ var M; return c; }()); })(M || (M = {})); -var M; (function (M_2) { var d = (function () { function d(M, p) { @@ -44,7 +43,6 @@ var M; return d; }()); })(M || (M = {})); -var M; (function (M_3) { var d2 = (function () { function d2() { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js index 252ad2c63dc..afe3cb43f28 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js @@ -27,14 +27,12 @@ var M; if (p === void 0) { p = M_1.x; } } })(M || (M = {})); -var M; (function (M_2) { function fn2() { var M; var p = M_2.x; } })(M || (M = {})); -var M; (function (M_3) { function fn3() { function M() { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js index a42b6502483..4ff4cb22668 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js @@ -45,7 +45,6 @@ var M; return c; }()); })(M || (M = {})); -var M; (function (M_2) { var d = (function () { function d() { @@ -57,7 +56,6 @@ var M; return d; }()); })(M || (M = {})); -var M; (function (M_3) { var e = (function () { function e() { @@ -70,7 +68,6 @@ var M; return e; }()); })(M || (M = {})); -var M; (function (M) { var f = (function () { function f() { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js index 6726d32d77d..a4486c48de3 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js @@ -52,7 +52,6 @@ var M; var p = M_1.x; })(m1 || (m1 = {})); })(M || (M = {})); -var M; (function (M_2) { var m2; (function (m2) { @@ -65,7 +64,6 @@ var M; var p2 = new M(); })(m2 || (m2 = {})); })(M || (M = {})); -var M; (function (M_3) { var m3; (function (m3) { @@ -75,7 +73,6 @@ var M; var p2 = M(); })(m3 || (m3 = {})); })(M || (M = {})); -var M; (function (M) { var m3; (function (m3) { @@ -83,7 +80,6 @@ var M; var p2; })(m3 || (m3 = {})); })(M || (M = {})); -var M; (function (M_4) { var m4; (function (m4) { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js index eed1095cdc3..def2c8c2bb0 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js @@ -40,7 +40,6 @@ var m1; m1_1.m1 = m1; })(m1 || (m1 = {})); var foo = new m1.m1(); -var m1; (function (m1) { var c1 = (function () { function c1() { @@ -64,7 +63,6 @@ var m2; var x = new c1(); })(m2 || (m2 = {})); var foo3 = new m2.c1(); -var m2; (function (m2_1) { var m2 = (function () { function m2() { diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.js b/tests/baselines/reference/commentsMultiModuleMultiFile.js index 5b30279def5..67794577226 100644 --- a/tests/baselines/reference/commentsMultiModuleMultiFile.js +++ b/tests/baselines/reference/commentsMultiModuleMultiFile.js @@ -51,7 +51,6 @@ define(["require", "exports"], function (require, exports) { multiM.b = b; })(multiM = exports.multiM || (exports.multiM = {})); /** thi is multi module 2*/ - var multiM; (function (multiM) { /** class c comment*/ var c = (function () { diff --git a/tests/baselines/reference/commentsMultiModuleSingleFile.js b/tests/baselines/reference/commentsMultiModuleSingleFile.js index 63b6c67888b..0e00a3eaff6 100644 --- a/tests/baselines/reference/commentsMultiModuleSingleFile.js +++ b/tests/baselines/reference/commentsMultiModuleSingleFile.js @@ -44,7 +44,6 @@ var multiM; multiM.d = d; })(multiM || (multiM = {})); /// this is multi module 2 -var multiM; (function (multiM) { /** class c comment*/ var c = (function () { diff --git a/tests/baselines/reference/constructSignaturesWithOverloads2.js b/tests/baselines/reference/constructSignaturesWithOverloads2.js index eae1b358dcc..b82c6d00a4b 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads2.js +++ b/tests/baselines/reference/constructSignaturesWithOverloads2.js @@ -47,7 +47,6 @@ var C = (function () { } return C; }()); -var C; (function (C) { C.x = 1; })(C || (C = {})); @@ -57,7 +56,6 @@ var C2 = (function () { } return C2; }()); -var C2; (function (C2) { C2.x = 1; })(C2 || (C2 = {})); diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index a4636d82993..df3abafa568 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -67,7 +67,6 @@ var templa; })(dom = templa.dom || (templa.dom = {})); })(templa || (templa = {})); // Module -var templa; (function (templa) { var dom; (function (dom) { diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js index f7672149308..171625efe1a 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js @@ -50,7 +50,6 @@ var M; m.c = c; })(m = M.m || (M.m = {})); })(M || (M = {})); -var M; (function (M) { var N; (function (N) { diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 4ac08f97a52..b705e80ad82 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -43,7 +43,6 @@ var X; })(base = Y.base || (Y.base = {})); })(Y = X.Y || (X.Y = {})); })(X || (X = {})); -var X; (function (X) { var Y; (function (Y) { diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js index 6dfce6e8e63..99684a731e6 100644 --- a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -36,7 +36,6 @@ var A; B.EventManager = EventManager; })(B = A.B || (A.B = {})); })(A || (A = {})); -var A; (function (A) { var B; (function (B) { diff --git a/tests/baselines/reference/declarationEmitNameConflicts.js b/tests/baselines/reference/declarationEmitNameConflicts.js index 2ce92501409..6d848b42869 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts.js +++ b/tests/baselines/reference/declarationEmitNameConflicts.js @@ -85,7 +85,6 @@ var M; M.c = N; M.d = im; })(M = exports.M || (exports.M = {})); -var M; (function (M) { var P; (function (P) { @@ -111,7 +110,6 @@ var M; P.d = M.d; // emitted incorrectly as typeof im })(P = M.P || (M.P = {})); })(M = exports.M || (exports.M = {})); -var M; (function (M) { var Q; (function (Q) { diff --git a/tests/baselines/reference/declarationEmitNameConflicts2.js b/tests/baselines/reference/declarationEmitNameConflicts2.js index b7b345979d7..41dcec4690f 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts2.js +++ b/tests/baselines/reference/declarationEmitNameConflicts2.js @@ -39,7 +39,6 @@ var X; })(base = Y.base || (Y.base = {})); })(Y = X.Y || (X.Y = {})); })(X || (X = {})); -var X; (function (X) { var Y; (function (Y) { diff --git a/tests/baselines/reference/declarationEmitNameConflicts3.js b/tests/baselines/reference/declarationEmitNameConflicts3.js index e9d5ea3b98e..8de521a5fde 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts3.js +++ b/tests/baselines/reference/declarationEmitNameConflicts3.js @@ -50,7 +50,6 @@ var M; E.f = f; })(E = M.E || (M.E = {})); })(M || (M = {})); -var M; (function (M) { var P; (function (P) { diff --git a/tests/baselines/reference/dottedModuleName.js b/tests/baselines/reference/dottedModuleName.js index 6a8f33ca7bb..32d98676d6c 100644 --- a/tests/baselines/reference/dottedModuleName.js +++ b/tests/baselines/reference/dottedModuleName.js @@ -37,7 +37,6 @@ var M; })(X = N.X || (N.X = {})); })(N = M.N || (M.N = {})); })(M || (M = {})); -var M; (function (M) { var N; (function (N) { diff --git a/tests/baselines/reference/dottedModuleName2.js b/tests/baselines/reference/dottedModuleName2.js index 4cbffa0e12f..33c3f459f74 100644 --- a/tests/baselines/reference/dottedModuleName2.js +++ b/tests/baselines/reference/dottedModuleName2.js @@ -60,7 +60,6 @@ var AA; })(AA || (AA = {})); var tmpOK = AA.B.x; var tmpError = A.B.x; -var A; (function (A) { var B; (function (B) { diff --git a/tests/baselines/reference/duplicateAnonymousInners1.js b/tests/baselines/reference/duplicateAnonymousInners1.js index 24f79566d56..8cf1dc89a45 100644 --- a/tests/baselines/reference/duplicateAnonymousInners1.js +++ b/tests/baselines/reference/duplicateAnonymousInners1.js @@ -41,7 +41,6 @@ var Foo; // Inner should show up in intellisense Foo.Outer = 0; })(Foo || (Foo = {})); -var Foo; (function (Foo) { // Should not be an error var Helper = (function () { diff --git a/tests/baselines/reference/duplicateAnonymousModuleClasses.js b/tests/baselines/reference/duplicateAnonymousModuleClasses.js index 74f80a65d40..e27d6987e80 100644 --- a/tests/baselines/reference/duplicateAnonymousModuleClasses.js +++ b/tests/baselines/reference/duplicateAnonymousModuleClasses.js @@ -65,7 +65,6 @@ var F; return Helper; }()); })(F || (F = {})); -var F; (function (F) { // Should not be an error var Helper = (function () { @@ -82,7 +81,6 @@ var Foo; return Helper; }()); })(Foo || (Foo = {})); -var Foo; (function (Foo) { // Should not be an error var Helper = (function () { @@ -101,7 +99,6 @@ var Gar; return Helper; }()); })(Foo || (Foo = {})); - var Foo; (function (Foo) { // Should not be an error var Helper = (function () { diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js index eae9e9e4de1..37fb4fcb633 100644 --- a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js +++ b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js @@ -62,12 +62,10 @@ var M; }()); M.I = I; })(M || (M = {})); -var M; (function (M) { function f() { } M.f = f; })(M || (M = {})); -var M; (function (M) { var f = (function () { function f() { @@ -76,11 +74,9 @@ var M; }()); // error M.f = f; })(M || (M = {})); -var M; (function (M) { function g() { } })(M || (M = {})); -var M; (function (M) { var g = (function () { function g() { @@ -89,7 +85,6 @@ var M; }()); // no error M.g = g; })(M || (M = {})); -var M; (function (M) { var C = (function () { function C() { @@ -98,15 +93,12 @@ var M; }()); M.C = C; })(M || (M = {})); -var M; (function (M) { function C() { } // no error })(M || (M = {})); -var M; (function (M) { M.v = 3; })(M || (M = {})); -var M; (function (M) { M.v = 3; // error for redeclaring var in a different parent })(M || (M = {})); @@ -115,7 +107,6 @@ var Foo = (function () { } return Foo; }()); -var Foo; (function (Foo) { })(Foo || (Foo = {})); var N; diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.js b/tests/baselines/reference/duplicateSymbolsExportMatching.js index bb04e3c72a4..9f977f5fd58 100644 --- a/tests/baselines/reference/duplicateSymbolsExportMatching.js +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.js @@ -75,7 +75,6 @@ define(["require", "exports"], function (require, exports) { (function (inst) { var t; })(inst || (inst = {})); - var inst; (function (inst) { var t; })(inst = M.inst || (M.inst = {})); @@ -86,7 +85,6 @@ define(["require", "exports"], function (require, exports) { var v; var w; })(M2 || (M2 = {})); - var M; (function (M) { var F; (function (F) { @@ -95,14 +93,12 @@ define(["require", "exports"], function (require, exports) { function F() { } // Only one error for duplicate identifier (don't consider visibility) M.F = F; })(M || (M = {})); - var M; (function (M) { var C = (function () { function C() { } return C; }()); - var C; (function (C) { var t; })(C = M.C || (M.C = {})); diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.js b/tests/baselines/reference/enumAssignabilityInInheritance.js index dc5237108f5..c5ff19cf239 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.js +++ b/tests/baselines/reference/enumAssignabilityInInheritance.js @@ -145,7 +145,6 @@ var E2; })(E2 || (E2 = {})); var r4 = foo13(E.A); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -155,7 +154,6 @@ var CC = (function () { } return CC; }()); -var CC; (function (CC) { CC.bar = 1; })(CC || (CC = {})); diff --git a/tests/baselines/reference/enumAssignmentCompat.js b/tests/baselines/reference/enumAssignmentCompat.js index b4762d182d4..9cdac291b99 100644 --- a/tests/baselines/reference/enumAssignmentCompat.js +++ b/tests/baselines/reference/enumAssignmentCompat.js @@ -48,7 +48,6 @@ var W; }()); W.D = D; })(W || (W = {})); -var W; (function (W) { W[W["a"] = 0] = "a"; W[W["b"] = 1] = "b"; diff --git a/tests/baselines/reference/enumAssignmentCompat2.js b/tests/baselines/reference/enumAssignmentCompat2.js index 0cc3b6befbf..5675bc86fe0 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.js +++ b/tests/baselines/reference/enumAssignmentCompat2.js @@ -44,7 +44,6 @@ var W; W[W["b"] = 1] = "b"; W[W["c"] = 2] = "c"; })(W || (W = {})); -var W; (function (W) { var D = (function () { function D() { diff --git a/tests/baselines/reference/enumAssignmentCompat3.js b/tests/baselines/reference/enumAssignmentCompat3.js index 74f74ab1652..62f05c18b5f 100644 --- a/tests/baselines/reference/enumAssignmentCompat3.js +++ b/tests/baselines/reference/enumAssignmentCompat3.js @@ -164,7 +164,6 @@ var Merged2; E[E["c"] = 2] = "c"; })(Merged2.E || (Merged2.E = {})); var E = Merged2.E; - var E; (function (E) { E.d = 5; })(E = Merged2.E || (Merged2.E = {})); diff --git a/tests/baselines/reference/enumBasics1.js b/tests/baselines/reference/enumBasics1.js index e5c9c6d29d4..76e60cde355 100644 --- a/tests/baselines/reference/enumBasics1.js +++ b/tests/baselines/reference/enumBasics1.js @@ -69,7 +69,6 @@ var E2; E2[E2["A"] = 0] = "A"; E2[E2["B"] = 1] = "B"; })(E2 || (E2 = {})); -var E2; (function (E2) { E2[E2["C"] = 0] = "C"; E2[E2["D"] = 1] = "D"; diff --git a/tests/baselines/reference/enumGenericTypeClash.js b/tests/baselines/reference/enumGenericTypeClash.js index 931df9f9d98..31c41be85c2 100644 --- a/tests/baselines/reference/enumGenericTypeClash.js +++ b/tests/baselines/reference/enumGenericTypeClash.js @@ -9,7 +9,6 @@ var X = (function () { } return X; }()); -var X; (function (X) { X[X["MyVal"] = 0] = "MyVal"; })(X || (X = {})); diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js index 56f40eef6e0..9cb6169b2af 100644 --- a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js @@ -151,7 +151,6 @@ var E2; E2[E2["A"] = 0] = "A"; })(E2 || (E2 = {})); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -160,7 +159,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/enumMerging.js b/tests/baselines/reference/enumMerging.js index 5dc5a475b40..d830b03cac9 100644 --- a/tests/baselines/reference/enumMerging.js +++ b/tests/baselines/reference/enumMerging.js @@ -77,7 +77,6 @@ var M1; EImpl1[EImpl1["B"] = 1] = "B"; EImpl1[EImpl1["C"] = 2] = "C"; })(EImpl1 || (EImpl1 = {})); - var EImpl1; (function (EImpl1) { EImpl1[EImpl1["D"] = 1] = "D"; EImpl1[EImpl1["E"] = 2] = "E"; @@ -122,7 +121,6 @@ var M3; EInit[EInit["A"] = 0] = "A"; EInit[EInit["B"] = 1] = "B"; })(EInit || (EInit = {})); - var EInit; (function (EInit) { EInit[EInit["C"] = 1] = "C"; EInit[EInit["D"] = 2] = "D"; @@ -160,7 +158,6 @@ var M6; var Color = A.Color; })(A = M6.A || (M6.A = {})); })(M6 || (M6 = {})); -var M6; (function (M6) { var A; (function (A) { diff --git a/tests/baselines/reference/enumMergingErrors.js b/tests/baselines/reference/enumMergingErrors.js index 46855093816..c9b4aaef754 100644 --- a/tests/baselines/reference/enumMergingErrors.js +++ b/tests/baselines/reference/enumMergingErrors.js @@ -59,7 +59,6 @@ var M; })(M.E3 || (M.E3 = {})); var E3 = M.E3; })(M || (M = {})); -var M; (function (M) { (function (E1) { E1[E1["B"] = 'foo'.length] = "B"; @@ -74,7 +73,6 @@ var M; })(M.E3 || (M.E3 = {})); var E3 = M.E3; })(M || (M = {})); -var M; (function (M) { (function (E1) { E1[E1["C"] = 0] = "C"; @@ -97,14 +95,12 @@ var M1; })(M1.E1 || (M1.E1 = {})); var E1 = M1.E1; })(M1 || (M1 = {})); -var M1; (function (M1) { (function (E1) { E1[E1["B"] = 0] = "B"; })(M1.E1 || (M1.E1 = {})); var E1 = M1.E1; })(M1 || (M1 = {})); -var M1; (function (M1) { (function (E1) { E1[E1["C"] = 0] = "C"; @@ -119,14 +115,12 @@ var M2; })(M2.E1 || (M2.E1 = {})); var E1 = M2.E1; })(M2 || (M2 = {})); -var M2; (function (M2) { (function (E1) { E1[E1["B"] = 0] = "B"; })(M2.E1 || (M2.E1 = {})); var E1 = M2.E1; })(M2 || (M2 = {})); -var M2; (function (M2) { (function (E1) { E1[E1["C"] = 0] = "C"; diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations1.js b/tests/baselines/reference/enumsWithMultipleDeclarations1.js index 35da126205d..67bca48db53 100644 --- a/tests/baselines/reference/enumsWithMultipleDeclarations1.js +++ b/tests/baselines/reference/enumsWithMultipleDeclarations1.js @@ -16,11 +16,9 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -var E; (function (E) { E[E["B"] = 0] = "B"; })(E || (E = {})); -var E; (function (E) { E[E["C"] = 0] = "C"; })(E || (E = {})); diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations2.js b/tests/baselines/reference/enumsWithMultipleDeclarations2.js index 53d0d717711..55cab82bbc5 100644 --- a/tests/baselines/reference/enumsWithMultipleDeclarations2.js +++ b/tests/baselines/reference/enumsWithMultipleDeclarations2.js @@ -16,11 +16,9 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -var E; (function (E) { E[E["B"] = 1] = "B"; })(E || (E = {})); -var E; (function (E) { E[E["C"] = 0] = "C"; })(E || (E = {})); diff --git a/tests/baselines/reference/es6modulekindWithES5Target12.js b/tests/baselines/reference/es6modulekindWithES5Target12.js new file mode 100644 index 00000000000..316718e6f80 --- /dev/null +++ b/tests/baselines/reference/es6modulekindWithES5Target12.js @@ -0,0 +1,70 @@ +//// [es6modulekindWithES5Target12.ts] + +export class C { +} + +export namespace C { + export const x = 1; +} + +export enum E { + w = 1 +} + +export enum E { + x = 2 +} + +export namespace E { + export const y = 1; +} + +export namespace E { + export const z = 1; +} + +export namespace N { +} + +export namespace N { + export const x = 1; +} + +export function F() { +} + +export namespace F { + export const x = 1; +} + +//// [es6modulekindWithES5Target12.js] +export var C = (function () { + function C() { + } + return C; +}()); +(function (C) { + C.x = 1; +})(C || (C = {})); +export var E; +(function (E) { + E[E["w"] = 1] = "w"; +})(E || (E = {})); +(function (E) { + E[E["x"] = 2] = "x"; +})(E || (E = {})); +(function (E) { + E.y = 1; +})(E || (E = {})); +(function (E) { + E.z = 1; +})(E || (E = {})); +export var N; +(function (N) { + N.x = 1; +})(N || (N = {})); +export function F() { +} +(function (F) { + F.x = 1; +})(F || (F = {})); diff --git a/tests/baselines/reference/es6modulekindWithES5Target12.symbols b/tests/baselines/reference/es6modulekindWithES5Target12.symbols new file mode 100644 index 00000000000..e6469a6300a --- /dev/null +++ b/tests/baselines/reference/es6modulekindWithES5Target12.symbols @@ -0,0 +1,62 @@ +=== tests/cases/compiler/es6modulekindWithES5Target12.ts === + +export class C { +>C : Symbol(C, Decl(es6modulekindWithES5Target12.ts, 0, 0), Decl(es6modulekindWithES5Target12.ts, 2, 1)) +} + +export namespace C { +>C : Symbol(C, Decl(es6modulekindWithES5Target12.ts, 0, 0), Decl(es6modulekindWithES5Target12.ts, 2, 1)) + + export const x = 1; +>x : Symbol(x, Decl(es6modulekindWithES5Target12.ts, 5, 16)) +} + +export enum E { +>E : Symbol(E, Decl(es6modulekindWithES5Target12.ts, 6, 1), Decl(es6modulekindWithES5Target12.ts, 10, 1), Decl(es6modulekindWithES5Target12.ts, 14, 1), Decl(es6modulekindWithES5Target12.ts, 18, 1)) + + w = 1 +>w : Symbol(E.w, Decl(es6modulekindWithES5Target12.ts, 8, 15)) +} + +export enum E { +>E : Symbol(E, Decl(es6modulekindWithES5Target12.ts, 6, 1), Decl(es6modulekindWithES5Target12.ts, 10, 1), Decl(es6modulekindWithES5Target12.ts, 14, 1), Decl(es6modulekindWithES5Target12.ts, 18, 1)) + + x = 2 +>x : Symbol(E.x, Decl(es6modulekindWithES5Target12.ts, 12, 15)) +} + +export namespace E { +>E : Symbol(E, Decl(es6modulekindWithES5Target12.ts, 6, 1), Decl(es6modulekindWithES5Target12.ts, 10, 1), Decl(es6modulekindWithES5Target12.ts, 14, 1), Decl(es6modulekindWithES5Target12.ts, 18, 1)) + + export const y = 1; +>y : Symbol(y, Decl(es6modulekindWithES5Target12.ts, 17, 16)) +} + +export namespace E { +>E : Symbol(E, Decl(es6modulekindWithES5Target12.ts, 6, 1), Decl(es6modulekindWithES5Target12.ts, 10, 1), Decl(es6modulekindWithES5Target12.ts, 14, 1), Decl(es6modulekindWithES5Target12.ts, 18, 1)) + + export const z = 1; +>z : Symbol(z, Decl(es6modulekindWithES5Target12.ts, 21, 16)) +} + +export namespace N { +>N : Symbol(N, Decl(es6modulekindWithES5Target12.ts, 22, 1), Decl(es6modulekindWithES5Target12.ts, 25, 1)) +} + +export namespace N { +>N : Symbol(N, Decl(es6modulekindWithES5Target12.ts, 22, 1), Decl(es6modulekindWithES5Target12.ts, 25, 1)) + + export const x = 1; +>x : Symbol(x, Decl(es6modulekindWithES5Target12.ts, 28, 16)) +} + +export function F() { +>F : Symbol(F, Decl(es6modulekindWithES5Target12.ts, 29, 1), Decl(es6modulekindWithES5Target12.ts, 32, 1)) +} + +export namespace F { +>F : Symbol(F, Decl(es6modulekindWithES5Target12.ts, 29, 1), Decl(es6modulekindWithES5Target12.ts, 32, 1)) + + export const x = 1; +>x : Symbol(x, Decl(es6modulekindWithES5Target12.ts, 35, 16)) +} diff --git a/tests/baselines/reference/es6modulekindWithES5Target12.types b/tests/baselines/reference/es6modulekindWithES5Target12.types new file mode 100644 index 00000000000..5bc42cae68a --- /dev/null +++ b/tests/baselines/reference/es6modulekindWithES5Target12.types @@ -0,0 +1,69 @@ +=== tests/cases/compiler/es6modulekindWithES5Target12.ts === + +export class C { +>C : C +} + +export namespace C { +>C : typeof C + + export const x = 1; +>x : 1 +>1 : 1 +} + +export enum E { +>E : E + + w = 1 +>w : E.w +>1 : 1 +} + +export enum E { +>E : E + + x = 2 +>x : E.x +>2 : 2 +} + +export namespace E { +>E : typeof E + + export const y = 1; +>y : 1 +>1 : 1 +} + +export namespace E { +>E : typeof E + + export const z = 1; +>z : 1 +>1 : 1 +} + +export namespace N { +>N : typeof N +} + +export namespace N { +>N : typeof N + + export const x = 1; +>x : 1 +>1 : 1 +} + +export function F() { +>F : typeof F +} + +export namespace F { +>F : typeof F + + export const x = 1; +>x : 1 +>1 : 1 +} diff --git a/tests/baselines/reference/exportAssignmentMergedModule.js b/tests/baselines/reference/exportAssignmentMergedModule.js index 8d78799a05b..aa2a7082f76 100644 --- a/tests/baselines/reference/exportAssignmentMergedModule.js +++ b/tests/baselines/reference/exportAssignmentMergedModule.js @@ -34,7 +34,6 @@ var Foo; Foo.a = a; Foo.b = true; })(Foo || (Foo = {})); -var Foo; (function (Foo) { function c(a) { return a; diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.js b/tests/baselines/reference/exportAssignmentTopLevelClodule.js index 08220cc8de3..9e073462aac 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelClodule.js +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.js @@ -25,7 +25,6 @@ define(["require", "exports"], function (require, exports) { } return Foo; }()); - var Foo; (function (Foo) { Foo.answer = 42; })(Foo || (Foo = {})); diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.js b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.js index 2516b1b0e28..5043a684326 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.js +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.js @@ -26,7 +26,6 @@ define(["require", "exports"], function (require, exports) { foo[foo["green"] = 1] = "green"; foo[foo["blue"] = 2] = "blue"; })(foo || (foo = {})); - var foo; (function (foo) { foo.answer = 42; })(foo || (foo = {})); diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.js b/tests/baselines/reference/exportAssignmentTopLevelFundule.js index d151a61d539..0549700e464 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelFundule.js +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.js @@ -22,7 +22,6 @@ define(["require", "exports"], function (require, exports) { function foo() { return "test"; } - var foo; (function (foo) { foo.answer = 42; })(foo || (foo = {})); diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js index a9ea4bf5eda..465c085fa02 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.js +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -36,7 +36,6 @@ var Aaa = (function (_super) { } return Aaa; }(Bbb)); -var Aaa; (function (Aaa) { var SomeType = (function () { function SomeType() { @@ -45,7 +44,6 @@ var Aaa; }()); Aaa.SomeType = SomeType; })(Aaa || (Aaa = {})); -var Bbb; (function (Bbb) { var SomeType = (function () { function SomeType() { diff --git a/tests/baselines/reference/exportDefaultProperty.js b/tests/baselines/reference/exportDefaultProperty.js index 10ba6d6419a..2dcef41d761 100644 --- a/tests/baselines/reference/exportDefaultProperty.js +++ b/tests/baselines/reference/exportDefaultProperty.js @@ -51,7 +51,6 @@ var A; return B; }()); A.B = B; - var B; (function (B) { B.b = 0; })(B = A.B || (A.B = {})); diff --git a/tests/baselines/reference/exportEqualsProperty.js b/tests/baselines/reference/exportEqualsProperty.js index 2fd8a8c8511..9acb1ee49b7 100644 --- a/tests/baselines/reference/exportEqualsProperty.js +++ b/tests/baselines/reference/exportEqualsProperty.js @@ -50,7 +50,6 @@ var A; return B; }()); A.B = B; - var B; (function (B) { B.b = 0; })(B = A.B || (A.B = {})); diff --git a/tests/baselines/reference/exportImportAlias.js b/tests/baselines/reference/exportImportAlias.js index be77f755368..3f9bc18f45b 100644 --- a/tests/baselines/reference/exportImportAlias.js +++ b/tests/baselines/reference/exportImportAlias.js @@ -96,7 +96,6 @@ var X; return 42; } X.Y = Y; - var Y; (function (Y) { var Point = (function () { function Point(x, y) { @@ -124,7 +123,6 @@ var K; return L; }()); K.L = L; - var L; (function (L) { L.y = 12; })(L = K.L || (K.L = {})); diff --git a/tests/baselines/reference/exportImportAndClodule.js b/tests/baselines/reference/exportImportAndClodule.js index e519d555792..842b97c0871 100644 --- a/tests/baselines/reference/exportImportAndClodule.js +++ b/tests/baselines/reference/exportImportAndClodule.js @@ -29,7 +29,6 @@ var K; return L; }()); K.L = L; - var L; (function (L) { L.y = 12; })(L = K.L || (K.L = {})); diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js index 446c6df9c94..86eda4d5d66 100644 --- a/tests/baselines/reference/extBaseClass1.js +++ b/tests/baselines/reference/extBaseClass1.js @@ -43,7 +43,6 @@ var M; }(B)); M.C = C; })(M || (M = {})); -var M; (function (M) { var C2 = (function (_super) { __extends(C2, _super); diff --git a/tests/baselines/reference/forwardRefInEnum.js b/tests/baselines/reference/forwardRefInEnum.js index 76e2575ec8d..555454dccaa 100644 --- a/tests/baselines/reference/forwardRefInEnum.js +++ b/tests/baselines/reference/forwardRefInEnum.js @@ -25,7 +25,6 @@ var E1; E1[E1["Y"] = E1.Z] = "Y"; E1[E1["Y1"] = E1["Z"]] = "Y1"; })(E1 || (E1 = {})); -var E1; (function (E1) { E1[E1["Z"] = 4] = "Z"; })(E1 || (E1 = {})); diff --git a/tests/baselines/reference/funClodule.js b/tests/baselines/reference/funClodule.js index 8ea98ad7487..b2c18bf3786 100644 --- a/tests/baselines/reference/funClodule.js +++ b/tests/baselines/reference/funClodule.js @@ -21,7 +21,6 @@ class foo3 { } // Should error //// [funClodule.js] function foo3() { } -var foo3; (function (foo3) { function x() { } foo3.x = x; diff --git a/tests/baselines/reference/functionMergedWithModule.js b/tests/baselines/reference/functionMergedWithModule.js index d83c1cd4e37..9265ee9bc1f 100644 --- a/tests/baselines/reference/functionMergedWithModule.js +++ b/tests/baselines/reference/functionMergedWithModule.js @@ -18,7 +18,6 @@ module foo.Baz { function foo(title) { var x = 10; } -var foo; (function (foo) { var Bar; (function (Bar) { @@ -27,7 +26,6 @@ var foo; Bar.f = f; })(Bar = foo.Bar || (foo.Bar = {})); })(foo || (foo = {})); -var foo; (function (foo) { var Baz; (function (Baz) { diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.js b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.js index 36356b1f6ed..868a755bf7e 100644 --- a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.js +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.js @@ -11,7 +11,6 @@ module fn { function fn() { return fn.n; } -var fn; (function (fn) { fn.n = 1; })(fn || (fn = {})); diff --git a/tests/baselines/reference/genericCloduleInModule.js b/tests/baselines/reference/genericCloduleInModule.js index e3f926e1f91..6164bfc0904 100644 --- a/tests/baselines/reference/genericCloduleInModule.js +++ b/tests/baselines/reference/genericCloduleInModule.js @@ -23,7 +23,6 @@ var A; return B; }()); A.B = B; - var B; (function (B) { B.x = 1; })(B = A.B || (A.B = {})); diff --git a/tests/baselines/reference/genericCloduleInModule2.js b/tests/baselines/reference/genericCloduleInModule2.js index 433a165db92..55a5507eed2 100644 --- a/tests/baselines/reference/genericCloduleInModule2.js +++ b/tests/baselines/reference/genericCloduleInModule2.js @@ -27,7 +27,6 @@ var A; }()); A.B = B; })(A || (A = {})); -var A; (function (A) { var B; (function (B) { diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index d2bf12667fc..a1ae3a0f06b 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -45,7 +45,6 @@ var EndGate; Tweening.Tween = Tween; })(Tweening = EndGate.Tweening || (EndGate.Tweening = {})); })(EndGate || (EndGate = {})); -var EndGate; (function (EndGate) { var Tweening; (function (Tweening) { diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index f61f57cb615..810c25b77d4 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -44,7 +44,6 @@ var EndGate; Tweening.Tween = Tween; })(Tweening = EndGate.Tweening || (EndGate.Tweening = {})); })(EndGate || (EndGate = {})); -var EndGate; (function (EndGate) { var Tweening; (function (Tweening) { diff --git a/tests/baselines/reference/genericFunduleInModule.js b/tests/baselines/reference/genericFunduleInModule.js index 95700edecab..9bd1e47b420 100644 --- a/tests/baselines/reference/genericFunduleInModule.js +++ b/tests/baselines/reference/genericFunduleInModule.js @@ -14,7 +14,6 @@ var A; (function (A) { function B(x) { return x; } A.B = B; - var B; (function (B) { B.x = 1; })(B = A.B || (A.B = {})); diff --git a/tests/baselines/reference/genericFunduleInModule2.js b/tests/baselines/reference/genericFunduleInModule2.js index 956e9129ec7..2523b4fe126 100644 --- a/tests/baselines/reference/genericFunduleInModule2.js +++ b/tests/baselines/reference/genericFunduleInModule2.js @@ -18,7 +18,6 @@ var A; function B(x) { return x; } A.B = B; })(A || (A = {})); -var A; (function (A) { var B; (function (B) { diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js index 6dd456ab703..56a64e8934f 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js @@ -8,7 +8,6 @@ module foo { //// [genericMergedDeclarationUsingTypeParameter.js] function foo(y, z) { return y; } -var foo; (function (foo) { var y = 1; })(foo || (foo = {})); diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js index ac51424deea..11a9c0891ae 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js @@ -12,7 +12,6 @@ var foo = (function () { } return foo; }()); -var foo; (function (foo) { var y = 1; })(foo || (foo = {})); diff --git a/tests/baselines/reference/genericOfACloduleType1.js b/tests/baselines/reference/genericOfACloduleType1.js index 3e4b9d3a9d4..1c9657ec8f1 100644 --- a/tests/baselines/reference/genericOfACloduleType1.js +++ b/tests/baselines/reference/genericOfACloduleType1.js @@ -28,7 +28,6 @@ var M; return C; }()); M.C = C; - var C; (function (C) { var X = (function () { function X() { diff --git a/tests/baselines/reference/genericOfACloduleType2.js b/tests/baselines/reference/genericOfACloduleType2.js index f1e3f2a8a00..c96e3f4fa6d 100644 --- a/tests/baselines/reference/genericOfACloduleType2.js +++ b/tests/baselines/reference/genericOfACloduleType2.js @@ -31,7 +31,6 @@ var M; return C; }()); M.C = C; - var C; (function (C) { var X = (function () { function X() { diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index 61cb758c48e..f1726e162c4 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -47,7 +47,6 @@ var TypeScript; }()); TypeScript.MemberName = MemberName; })(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { var PullSymbol = (function () { function PullSymbol() { diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index e482f0d33d3..2ebbfb7f7c6 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -174,7 +174,6 @@ var Derived2 = (function (_super) { var base; var derived; var derived2; -var Derived; (function (Derived) { var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] diff --git a/tests/baselines/reference/importAliasIdentifiers.js b/tests/baselines/reference/importAliasIdentifiers.js index 084b6694e9c..278c5a2e8a0 100644 --- a/tests/baselines/reference/importAliasIdentifiers.js +++ b/tests/baselines/reference/importAliasIdentifiers.js @@ -67,7 +67,6 @@ var clodule = (function () { } return clodule; }()); -var clodule; (function (clodule) { var Point = { x: 0, y: 0 }; })(clodule || (clodule = {})); @@ -78,7 +77,6 @@ var p; function fundule() { return { x: 0, y: 0 }; } -var fundule; (function (fundule) { var Point = { x: 0, y: 0 }; })(fundule || (fundule = {})); diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js index 95b71069584..b704fbf4118 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.js +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -42,7 +42,6 @@ var D = (function (_super) { } return D; }(C)); -var D; (function (D) { function foo() { return 0; diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js index 8feecb53f98..a0c0e0b34fe 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js @@ -19,7 +19,6 @@ var A = (function () { } return A; }()); -var A; (function (A) { A.a = 10; })(A || (A = {})); diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js index 27101bba5f9..5fc852cca40 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js @@ -18,7 +18,6 @@ var A = (function () { } return A; }()); -var A; (function (A) { A.a = 10; })(A || (A = {})); diff --git a/tests/baselines/reference/invalidNestedModules.js b/tests/baselines/reference/invalidNestedModules.js index 8b532ddd757..676817139f9 100644 --- a/tests/baselines/reference/invalidNestedModules.js +++ b/tests/baselines/reference/invalidNestedModules.js @@ -45,7 +45,6 @@ var A; })(C = B.C || (B.C = {})); })(B = A.B || (A.B = {})); })(A || (A = {})); -var A; (function (A) { var B; (function (B) { @@ -69,7 +68,6 @@ var M2; X.Point = Point; })(X = M2.X || (M2.X = {})); })(M2 || (M2 = {})); -var M2; (function (M2) { var X; (function (X) { diff --git a/tests/baselines/reference/isDeclarationVisibleNodeKinds.js b/tests/baselines/reference/isDeclarationVisibleNodeKinds.js index e24032eb858..07bc9994742 100644 --- a/tests/baselines/reference/isDeclarationVisibleNodeKinds.js +++ b/tests/baselines/reference/isDeclarationVisibleNodeKinds.js @@ -79,7 +79,6 @@ var schema; schema_1.createValidator1 = createValidator1; })(schema || (schema = {})); // Constructor types -var schema; (function (schema_2) { function createValidator2(schema) { return undefined; @@ -87,7 +86,6 @@ var schema; schema_2.createValidator2 = createValidator2; })(schema || (schema = {})); // union types -var schema; (function (schema_3) { function createValidator3(schema) { return undefined; @@ -95,7 +93,6 @@ var schema; schema_3.createValidator3 = createValidator3; })(schema || (schema = {})); // Array types -var schema; (function (schema_4) { function createValidator4(schema) { return undefined; @@ -103,7 +100,6 @@ var schema; schema_4.createValidator4 = createValidator4; })(schema || (schema = {})); // TypeLiterals -var schema; (function (schema_5) { function createValidator5(schema) { return undefined; @@ -111,7 +107,6 @@ var schema; schema_5.createValidator5 = createValidator5; })(schema || (schema = {})); // Tuple types -var schema; (function (schema_6) { function createValidator6(schema) { return undefined; @@ -119,7 +114,6 @@ var schema; schema_6.createValidator6 = createValidator6; })(schema || (schema = {})); // Paren Types -var schema; (function (schema_7) { function createValidator7(schema) { return undefined; @@ -127,14 +121,12 @@ var schema; schema_7.createValidator7 = createValidator7; })(schema || (schema = {})); // Type reference -var schema; (function (schema_8) { function createValidator8(schema) { return undefined; } schema_8.createValidator8 = createValidator8; })(schema || (schema = {})); -var schema; (function (schema) { var T = (function () { function T() { diff --git a/tests/baselines/reference/mergeThreeInterfaces2.js b/tests/baselines/reference/mergeThreeInterfaces2.js index f853dad3a28..ef504a5f6ec 100644 --- a/tests/baselines/reference/mergeThreeInterfaces2.js +++ b/tests/baselines/reference/mergeThreeInterfaces2.js @@ -76,7 +76,6 @@ var M2; var r1 = a.foo; var r2 = a.bar; })(M2 || (M2 = {})); -var M2; (function (M2) { var a; var r1 = a.foo; @@ -84,7 +83,6 @@ var M2; var r3 = a.baz; })(M2 || (M2 = {})); // same as above but with an additional level of nesting and third module declaration -var M2; (function (M2) { var M3; (function (M3) { @@ -93,7 +91,6 @@ var M2; var r2 = a.bar; })(M3 = M2.M3 || (M2.M3 = {})); })(M2 || (M2 = {})); -var M2; (function (M2) { var M3; (function (M3) { @@ -103,7 +100,6 @@ var M2; var r3 = a.baz; })(M3 = M2.M3 || (M2.M3 = {})); })(M2 || (M2 = {})); -var M2; (function (M2) { var M3; (function (M3) { diff --git a/tests/baselines/reference/mergeTwoInterfaces2.js b/tests/baselines/reference/mergeTwoInterfaces2.js index 4f45c8f821e..3ab21df428c 100644 --- a/tests/baselines/reference/mergeTwoInterfaces2.js +++ b/tests/baselines/reference/mergeTwoInterfaces2.js @@ -56,14 +56,12 @@ var M2; var r1 = a.foo; var r2 = a.bar; })(M2 || (M2 = {})); -var M2; (function (M2) { var a; var r1 = a.foo; var r2 = a.bar; })(M2 || (M2 = {})); // same as above but with an additional level of nesting -var M2; (function (M2) { var M3; (function (M3) { @@ -72,7 +70,6 @@ var M2; var r2 = a.bar; })(M3 = M2.M3 || (M2.M3 = {})); })(M2 || (M2 = {})); -var M2; (function (M2) { var M3; (function (M3) { diff --git a/tests/baselines/reference/mergedDeclarations1.js b/tests/baselines/reference/mergedDeclarations1.js index 641ff031ded..f8663d12549 100644 --- a/tests/baselines/reference/mergedDeclarations1.js +++ b/tests/baselines/reference/mergedDeclarations1.js @@ -20,7 +20,6 @@ var b = point.equals(p1, p2); function point(x, y) { return { x: x, y: y }; } -var point; (function (point) { point.origin = point(0, 0); function equals(p1, p2) { diff --git a/tests/baselines/reference/mergedDeclarations2.js b/tests/baselines/reference/mergedDeclarations2.js index 962346541cc..b35ec48f7a8 100644 --- a/tests/baselines/reference/mergedDeclarations2.js +++ b/tests/baselines/reference/mergedDeclarations2.js @@ -15,11 +15,9 @@ var Foo; (function (Foo) { Foo[Foo["b"] = 0] = "b"; })(Foo || (Foo = {})); -var Foo; (function (Foo) { Foo[Foo["a"] = 0] = "a"; })(Foo || (Foo = {})); -var Foo; (function (Foo) { Foo.x = b; })(Foo || (Foo = {})); diff --git a/tests/baselines/reference/mergedDeclarations3.js b/tests/baselines/reference/mergedDeclarations3.js index 272946b5075..ddf94b46e81 100644 --- a/tests/baselines/reference/mergedDeclarations3.js +++ b/tests/baselines/reference/mergedDeclarations3.js @@ -48,7 +48,6 @@ var M; })(M.Color || (M.Color = {})); var Color = M.Color; })(M || (M = {})); -var M; (function (M) { var Color; (function (Color) { @@ -56,27 +55,23 @@ var M; })(Color = M.Color || (M.Color = {})); })(M || (M = {})); var p = M.Color.Blue; // ok -var M; (function (M) { function foo() { } M.foo = foo; })(M || (M = {})); -var M; (function (M) { var foo; (function (foo) { foo.x = 1; })(foo || (foo = {})); })(M || (M = {})); -var M; (function (M) { var foo; (function (foo) { foo.y = 2; })(foo = M.foo || (M.foo = {})); })(M || (M = {})); -var M; (function (M) { var foo; (function (foo) { diff --git a/tests/baselines/reference/mergedDeclarations4.js b/tests/baselines/reference/mergedDeclarations4.js index 64fad6bd598..c47632b0a69 100644 --- a/tests/baselines/reference/mergedDeclarations4.js +++ b/tests/baselines/reference/mergedDeclarations4.js @@ -27,7 +27,6 @@ var M; M.f(); var r = f.hello; })(M || (M = {})); -var M; (function (M) { var f; (function (f) { diff --git a/tests/baselines/reference/mergedEnumDeclarationCodeGen.js b/tests/baselines/reference/mergedEnumDeclarationCodeGen.js index 57b6e8051f8..ecf2474430e 100644 --- a/tests/baselines/reference/mergedEnumDeclarationCodeGen.js +++ b/tests/baselines/reference/mergedEnumDeclarationCodeGen.js @@ -13,7 +13,6 @@ var E; E[E["a"] = 0] = "a"; E[E["b"] = 0] = "b"; })(E || (E = {})); -var E; (function (E) { E[E["c"] = 0] = "c"; })(E || (E = {})); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen.js index f71702386ec..573701d407b 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen.js @@ -29,7 +29,6 @@ var X; }()); })(Y = X.Y || (X.Y = {})); })(X = exports.X || (exports.X = {})); -var X; (function (X) { var Y; (function (Y) { diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js index bb7c34e4ac5..224042ac571 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js @@ -20,7 +20,6 @@ var my; })(foo = data.foo || (data.foo = {})); })(data = my.data || (my.data = {})); })(my || (my = {})); -var my; (function (my_1) { var data; (function (data_1) { diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js index 4a002e88f3d..5b16fe16dd2 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js @@ -17,7 +17,6 @@ var my; data.buz = buz; })(data = my.data || (my.data = {})); })(my || (my = {})); -var my; (function (my_1) { var data; (function (data_1) { diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js index 3e4a2dcd308..9a351c5c55e 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js @@ -32,7 +32,6 @@ var superContain; })(data = buz.data || (buz.data = {})); })(buz = my.buz || (my.buz = {})); })(my = contain_1.my || (contain_1.my = {})); - var my; (function (my_1) { var buz; (function (buz_1) { diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js index a5bc2e8e56e..11a4773d63a 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js @@ -32,7 +32,6 @@ var M; })(plop = buz.plop || (buz.plop = {})); })(buz = M_1.buz || (M_1.buz = {})); })(M || (M = {})); -var M; (function (M) { var buz; (function (buz_1) { diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.js b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.js index f2f45c621d0..df8c0f8470c 100644 --- a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.js +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.js @@ -13,7 +13,6 @@ var M; M.v = 10; M.v; })(M || (M = {})); -var M; (function (M) { M.v; })(M || (M = {})); diff --git a/tests/baselines/reference/missingFunctionImplementation.js b/tests/baselines/reference/missingFunctionImplementation.js index a452c8080b7..d9ab942cfc8 100644 --- a/tests/baselines/reference/missingFunctionImplementation.js +++ b/tests/baselines/reference/missingFunctionImplementation.js @@ -131,7 +131,6 @@ var C8 = (function () { } return C8; }()); -var C8; (function (C8) { function m(a, b) { } C8.m = m; @@ -143,14 +142,12 @@ var C9 = (function () { C9.m = function (a) { }; return C9; }()); -var C9; (function (C9) { })(C9 || (C9 = {})); // merged namespaces var N10; (function (N10) { })(N10 || (N10 = {})); -var N10; (function (N10) { function m(a) { } N10.m = m; @@ -161,7 +158,6 @@ var N12; function m(a) { } N12.m = m; })(N12 || (N12 = {})); -var N12; (function (N12) { function m(a) { } N12.m = m; diff --git a/tests/baselines/reference/moduleDuplicateIdentifiers.js b/tests/baselines/reference/moduleDuplicateIdentifiers.js index 1da296d7d12..097192ac73c 100644 --- a/tests/baselines/reference/moduleDuplicateIdentifiers.js +++ b/tests/baselines/reference/moduleDuplicateIdentifiers.js @@ -48,7 +48,6 @@ var FooBar; (function (FooBar) { FooBar.member1 = 2; })(FooBar = exports.FooBar || (exports.FooBar = {})); -var FooBar; (function (FooBar) { FooBar.member2 = 42; })(FooBar = exports.FooBar || (exports.FooBar = {})); diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js index 090d6502d5b..e0e95b3c72b 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js @@ -61,7 +61,6 @@ var TypeScript; }()); })(Parser = TypeScript.Parser || (TypeScript.Parser = {})); })(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { ; ; @@ -81,7 +80,6 @@ var TypeScript; }()); TypeScript.PositionedToken = PositionedToken; })(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { var SyntaxNode = (function () { function SyntaxNode() { @@ -98,7 +96,6 @@ var TypeScript; }()); TypeScript.SyntaxNode = SyntaxNode; })(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { var Syntax; (function (Syntax) { diff --git a/tests/baselines/reference/moduleMerge.js b/tests/baselines/reference/moduleMerge.js index 04f2f511b8d..4e5aac120fc 100644 --- a/tests/baselines/reference/moduleMerge.js +++ b/tests/baselines/reference/moduleMerge.js @@ -36,7 +36,6 @@ var A; return B; }()); })(A || (A = {})); -var A; (function (A) { var B = (function () { function B() { diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.js b/tests/baselines/reference/moduleReopenedTypeOtherBlock.js index 3380cd0ec7d..007090a0c11 100644 --- a/tests/baselines/reference/moduleReopenedTypeOtherBlock.js +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.js @@ -18,7 +18,6 @@ var M; }()); M.C1 = C1; })(M || (M = {})); -var M; (function (M) { var C2 = (function () { function C2() { diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.js b/tests/baselines/reference/moduleReopenedTypeSameBlock.js index b9624e75b75..07b5e8e657e 100644 --- a/tests/baselines/reference/moduleReopenedTypeSameBlock.js +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.js @@ -16,7 +16,6 @@ var M; }()); M.C1 = C1; })(M || (M = {})); -var M; (function (M) { var C2 = (function () { function C2() { diff --git a/tests/baselines/reference/moduleVariables.js b/tests/baselines/reference/moduleVariables.js index e127fec768f..3f5047c6266 100644 --- a/tests/baselines/reference/moduleVariables.js +++ b/tests/baselines/reference/moduleVariables.js @@ -24,11 +24,9 @@ var M; M.x = 2; console.log(M.x); // 2 })(M || (M = {})); -var M; (function (M) { console.log(M.x); // 2 })(M || (M = {})); -var M; (function (M) { var x = 3; console.log(x); // 3 diff --git a/tests/baselines/reference/moduleVisibilityTest1.js b/tests/baselines/reference/moduleVisibilityTest1.js index 3278613409d..52afcf169d9 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.js +++ b/tests/baselines/reference/moduleVisibilityTest1.js @@ -116,7 +116,6 @@ var M; var someModuleVar = 4; function someModuleFunction() { return 5; } })(M || (M = {})); -var M; (function (M) { M.c = M.x; M.meb = M.E.B; diff --git a/tests/baselines/reference/moduleVisibilityTest2.js b/tests/baselines/reference/moduleVisibilityTest2.js index 51f3b00255b..62b12b87808 100644 --- a/tests/baselines/reference/moduleVisibilityTest2.js +++ b/tests/baselines/reference/moduleVisibilityTest2.js @@ -117,7 +117,6 @@ var M; var someModuleVar = 4; function someModuleFunction() { return 5; } })(M || (M = {})); -var M; (function (M) { M.c = x; M.meb = M.E.B; diff --git a/tests/baselines/reference/moduledecl.js b/tests/baselines/reference/moduledecl.js index f4efbadbf3e..437907017fc 100644 --- a/tests/baselines/reference/moduledecl.js +++ b/tests/baselines/reference/moduledecl.js @@ -278,7 +278,6 @@ var m; (function (m3) { })(m3 = m.m3 || (m.m3 = {})); })(m || (m = {})); -var m; (function (m) { var m25; (function (m25) { diff --git a/tests/baselines/reference/multiModuleClodule1.js b/tests/baselines/reference/multiModuleClodule1.js index b5b11058368..eac6bfa8d51 100644 --- a/tests/baselines/reference/multiModuleClodule1.js +++ b/tests/baselines/reference/multiModuleClodule1.js @@ -27,12 +27,10 @@ var C = (function () { C.boo = function () { }; return C; }()); -var C; (function (C) { C.x = 1; var y = 2; })(C || (C = {})); -var C; (function (C) { function foo() { } C.foo = foo; diff --git a/tests/baselines/reference/multiModuleFundule1.js b/tests/baselines/reference/multiModuleFundule1.js index 6aa9cb959ba..43bfe0b35fa 100644 --- a/tests/baselines/reference/multiModuleFundule1.js +++ b/tests/baselines/reference/multiModuleFundule1.js @@ -14,11 +14,9 @@ var r3 = C.foo(); //// [multiModuleFundule1.js] function C(x) { } -var C; (function (C) { C.x = 1; })(C || (C = {})); -var C; (function (C) { function foo() { } C.foo = foo; diff --git a/tests/baselines/reference/multipleExports.js b/tests/baselines/reference/multipleExports.js index c70a5005aab..fd6ac67e82a 100644 --- a/tests/baselines/reference/multipleExports.js +++ b/tests/baselines/reference/multipleExports.js @@ -19,7 +19,6 @@ var M; M.v = 0; })(M = exports.M || (exports.M = {})); var x = 0; -var M; (function (M) { M.v; })(M = exports.M || (exports.M = {})); diff --git a/tests/baselines/reference/nameCollision.js b/tests/baselines/reference/nameCollision.js index 4f41bf4a086..e51bd5e7c69 100644 --- a/tests/baselines/reference/nameCollision.js +++ b/tests/baselines/reference/nameCollision.js @@ -58,7 +58,6 @@ var B; (function (B) { var A = 12; })(B || (B = {})); -var B; (function (B_1) { // re-opened module with colliding name // this should add an underscore. diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js index 6a7041a6733..a13c38cf737 100644 --- a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js @@ -16,7 +16,6 @@ var M; } M.C = C; })(M || (M = {})); -var M; (function (M_1) { { let M = 0; diff --git a/tests/baselines/reference/nonExportedElementsOfMergedModules.js b/tests/baselines/reference/nonExportedElementsOfMergedModules.js index e46bf62c05f..623d8b0036e 100644 --- a/tests/baselines/reference/nonExportedElementsOfMergedModules.js +++ b/tests/baselines/reference/nonExportedElementsOfMergedModules.js @@ -27,7 +27,6 @@ var One; (function (B) { })(B || (B = {})); })(One || (One = {})); -var One; (function (One) { var A; (function (A) { diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js index d285818aaa9..905ea763d56 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js @@ -142,7 +142,6 @@ var r13 = true ? null : E; var r14 = true ? E.A : null; var r14 = true ? null : E.A; function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -154,7 +153,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js index 83dd0210a4c..69395b0df49 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js @@ -19,7 +19,6 @@ module m { var m; (function (m) { })(m || (m = {})); -var m; (function (m) { var z = m.x; var y = { diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js index 7a5aaa34242..c9d7edf8140 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js @@ -17,7 +17,6 @@ module m { var m; (function (m) { })(m || (m = {})); -var m; (function (m) { var z = m.x; var y = { diff --git a/tests/baselines/reference/parserEnumDeclaration4.js b/tests/baselines/reference/parserEnumDeclaration4.js index 47450d419e1..d5b1e696a3d 100644 --- a/tests/baselines/reference/parserEnumDeclaration4.js +++ b/tests/baselines/reference/parserEnumDeclaration4.js @@ -3,7 +3,6 @@ enum void { } //// [parserEnumDeclaration4.js] -var ; (function () { })( || ( = {})); void {}; diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js index 9965f472d75..1da2ec03ed7 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js @@ -25,7 +25,6 @@ define(["require", "exports"], function (require, exports) { } Q.foo = foo; })(Q || (Q = {})); - var Q; (function (Q) { function bar() { Q.foo(null); diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.js b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.js index cb61a823990..c2f88dc08f5 100644 --- a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.js +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.js @@ -19,7 +19,6 @@ define(["require", "exports"], function (require, exports) { function Foo(array) { return undefined; } - var Foo; (function (Foo) { Foo.x = "hello"; })(Foo || (Foo = {})); diff --git a/tests/baselines/reference/privacyImport.js b/tests/baselines/reference/privacyImport.js index fcac37bac36..2915b6e5f24 100644 --- a/tests/baselines/reference/privacyImport.js +++ b/tests/baselines/reference/privacyImport.js @@ -684,7 +684,6 @@ exports.glo_im2_public = glo_M3_private; // module "abc3" { // } //} -var m2; (function (m2) { //import m3 = require("use_glo_M1_public"); var m4; diff --git a/tests/baselines/reference/privacyImportParseErrors.js b/tests/baselines/reference/privacyImportParseErrors.js index 369f9f109af..b705bbe1170 100644 --- a/tests/baselines/reference/privacyImportParseErrors.js +++ b/tests/baselines/reference/privacyImportParseErrors.js @@ -562,7 +562,6 @@ exports.glo_im1_public = glo_M1_public; exports.glo_im2_public = glo_M3_private; exports.glo_im3_public = require("glo_M2_public"); exports.glo_im4_public = require("glo_M4_private"); -var m2; (function (m2_1) { var m4; (function (m4) { diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule.js index cb67a15fb24..8405eb112e2 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule.js @@ -17,7 +17,6 @@ var C = (function () { } return C; }()); -var C; (function (C) { C.y = C.bar; // error })(C || (C = {})); diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index 7ed6f3d6792..31473f5dc4f 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -33,7 +33,6 @@ var D = (function (_super) { } return D; }(C)); -var D; (function (D) { D.y = D.bar; // error })(D || (D = {})); diff --git a/tests/baselines/reference/protectedStaticNotAccessibleInClodule.js b/tests/baselines/reference/protectedStaticNotAccessibleInClodule.js index 91776654692..a1411938405 100644 --- a/tests/baselines/reference/protectedStaticNotAccessibleInClodule.js +++ b/tests/baselines/reference/protectedStaticNotAccessibleInClodule.js @@ -18,7 +18,6 @@ var C = (function () { } return C; }()); -var C; (function (C) { C.f = C.foo; // OK C.b = C.bar; // error diff --git a/tests/baselines/reference/qualify.js b/tests/baselines/reference/qualify.js index ffb643b8ea4..a1e28bd9dc1 100644 --- a/tests/baselines/reference/qualify.js +++ b/tests/baselines/reference/qualify.js @@ -69,7 +69,6 @@ var M; N.n = 1; })(N = M.N || (M.N = {})); })(M || (M = {})); -var M; (function (M) { var N; (function (N) { diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index 3aa066d158d..2498763cde9 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -132,7 +132,6 @@ var Sample; })(Thing = Actions.Thing || (Actions.Thing = {})); })(Actions = Sample.Actions || (Sample.Actions = {})); })(Sample || (Sample = {})); -var Sample; (function (Sample) { var Thing; (function (Thing) { @@ -165,7 +164,6 @@ var AbstractMode = (function () { AbstractMode.prototype.getInitialState = function () { return null; }; return AbstractMode; }()); -var Sample; (function (Sample) { var Thing; (function (Thing) { diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index 7e0b27b82b4..2424983652f 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,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,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 diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt index 7e9da7dddf3..e77da96e92a 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -523,53 +523,18 @@ sourceFile:recursiveClassReferenceTest.ts 6 >Emitted(29, 21) Source(32, 14) + SourceIndex(0) 7 >Emitted(29, 29) Source(42, 2) + SourceIndex(0) --- ->>>var Sample; +>>>(function (Sample) { 1 > -2 >^^^^ -3 > ^^^^^^ -4 > ^ -5 > ^^^^^^^^^^-> +2 >^^^^^^^^^^^ +3 > ^^^^^^ 1 > > > 2 >module -3 > Sample -4 > .Thing.Widgets { - > export class FindWidget implements Sample.Thing.IWidget { - > - > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} - > - > private domNode:any = null; - > constructor(private codeThing: Sample.Thing.ICodeThing) { - > // scenario 1 - > codeThing.addWidget("addWidget", this); - > } - > - > public getDomNode() { - > return domNode; - > } - > - > public destroy() { - > - > } - > - > } - > } -1 >Emitted(30, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(30, 5) Source(44, 8) + SourceIndex(0) -3 >Emitted(30, 11) Source(44, 14) + SourceIndex(0) -4 >Emitted(30, 12) Source(64, 2) + SourceIndex(0) ---- ->>>(function (Sample) { -1-> -2 >^^^^^^^^^^^ -3 > ^^^^^^ -1-> -2 >module 3 > Sample -1->Emitted(31, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(31, 12) Source(44, 8) + SourceIndex(0) -3 >Emitted(31, 18) Source(44, 14) + SourceIndex(0) +1 >Emitted(30, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(30, 12) Source(44, 8) + SourceIndex(0) +3 >Emitted(30, 18) Source(44, 14) + SourceIndex(0) --- >>> var Thing; 1 >^^^^ @@ -601,10 +566,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(32, 5) Source(44, 15) + SourceIndex(0) -2 >Emitted(32, 9) Source(44, 15) + SourceIndex(0) -3 >Emitted(32, 14) Source(44, 20) + SourceIndex(0) -4 >Emitted(32, 15) Source(64, 2) + SourceIndex(0) +1 >Emitted(31, 5) Source(44, 15) + SourceIndex(0) +2 >Emitted(31, 9) Source(44, 15) + SourceIndex(0) +3 >Emitted(31, 14) Source(44, 20) + SourceIndex(0) +4 >Emitted(31, 15) Source(64, 2) + SourceIndex(0) --- >>> (function (Thing) { 1->^^^^ @@ -614,9 +579,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(33, 5) Source(44, 15) + SourceIndex(0) -2 >Emitted(33, 16) Source(44, 15) + SourceIndex(0) -3 >Emitted(33, 21) Source(44, 20) + SourceIndex(0) +1->Emitted(32, 5) Source(44, 15) + SourceIndex(0) +2 >Emitted(32, 16) Source(44, 15) + SourceIndex(0) +3 >Emitted(32, 21) Source(44, 20) + SourceIndex(0) --- >>> var Widgets; 1->^^^^^^^^ @@ -648,10 +613,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(34, 9) Source(44, 21) + SourceIndex(0) -2 >Emitted(34, 13) Source(44, 21) + SourceIndex(0) -3 >Emitted(34, 20) Source(44, 28) + SourceIndex(0) -4 >Emitted(34, 21) Source(64, 2) + SourceIndex(0) +1->Emitted(33, 9) Source(44, 21) + SourceIndex(0) +2 >Emitted(33, 13) Source(44, 21) + SourceIndex(0) +3 >Emitted(33, 20) Source(44, 28) + SourceIndex(0) +4 >Emitted(33, 21) Source(64, 2) + SourceIndex(0) --- >>> (function (Widgets) { 1->^^^^^^^^ @@ -661,16 +626,16 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Widgets -1->Emitted(35, 9) Source(44, 21) + SourceIndex(0) -2 >Emitted(35, 20) Source(44, 21) + SourceIndex(0) -3 >Emitted(35, 27) Source(44, 28) + SourceIndex(0) +1->Emitted(34, 9) Source(44, 21) + SourceIndex(0) +2 >Emitted(34, 20) Source(44, 21) + SourceIndex(0) +3 >Emitted(34, 27) Source(44, 28) + SourceIndex(0) --- >>> var FindWidget = (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { > -1->Emitted(36, 13) Source(45, 2) + SourceIndex(0) +1->Emitted(35, 13) Source(45, 2) + SourceIndex(0) --- >>> function FindWidget(codeThing) { 1->^^^^^^^^^^^^^^^^ @@ -685,9 +650,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > constructor(private 3 > codeThing: Sample.Thing.ICodeThing -1->Emitted(37, 17) Source(50, 3) + SourceIndex(0) -2 >Emitted(37, 37) Source(50, 23) + SourceIndex(0) -3 >Emitted(37, 46) Source(50, 57) + SourceIndex(0) +1->Emitted(36, 17) Source(50, 3) + SourceIndex(0) +2 >Emitted(36, 37) Source(50, 23) + SourceIndex(0) +3 >Emitted(36, 46) Source(50, 57) + SourceIndex(0) --- >>> this.codeThing = codeThing; 1->^^^^^^^^^^^^^^^^^^^^ @@ -700,11 +665,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > codeThing 5 > : Sample.Thing.ICodeThing -1->Emitted(38, 21) Source(50, 23) + SourceIndex(0) -2 >Emitted(38, 35) Source(50, 32) + SourceIndex(0) -3 >Emitted(38, 38) Source(50, 23) + SourceIndex(0) -4 >Emitted(38, 47) Source(50, 32) + SourceIndex(0) -5 >Emitted(38, 48) Source(50, 57) + SourceIndex(0) +1->Emitted(37, 21) Source(50, 23) + SourceIndex(0) +2 >Emitted(37, 35) Source(50, 32) + SourceIndex(0) +3 >Emitted(37, 38) Source(50, 23) + SourceIndex(0) +4 >Emitted(37, 47) Source(50, 32) + SourceIndex(0) +5 >Emitted(37, 48) Source(50, 57) + SourceIndex(0) --- >>> this.domNode = null; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -717,11 +682,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > :any = 4 > null 5 > ; -1 >Emitted(39, 21) Source(49, 11) + SourceIndex(0) -2 >Emitted(39, 33) Source(49, 18) + SourceIndex(0) -3 >Emitted(39, 36) Source(49, 25) + SourceIndex(0) -4 >Emitted(39, 40) Source(49, 29) + SourceIndex(0) -5 >Emitted(39, 41) Source(49, 30) + SourceIndex(0) +1 >Emitted(38, 21) Source(49, 11) + SourceIndex(0) +2 >Emitted(38, 33) Source(49, 18) + SourceIndex(0) +3 >Emitted(38, 36) Source(49, 25) + SourceIndex(0) +4 >Emitted(38, 40) Source(49, 29) + SourceIndex(0) +5 >Emitted(38, 41) Source(49, 30) + SourceIndex(0) --- >>> // scenario 1 1 >^^^^^^^^^^^^^^^^^^^^ @@ -731,8 +696,8 @@ sourceFile:recursiveClassReferenceTest.ts > constructor(private codeThing: Sample.Thing.ICodeThing) { > 2 > // scenario 1 -1 >Emitted(40, 21) Source(51, 7) + SourceIndex(0) -2 >Emitted(40, 34) Source(51, 20) + SourceIndex(0) +1 >Emitted(39, 21) Source(51, 7) + SourceIndex(0) +2 >Emitted(39, 34) Source(51, 20) + SourceIndex(0) --- >>> codeThing.addWidget("addWidget", this); 1->^^^^^^^^^^^^^^^^^^^^ @@ -756,16 +721,16 @@ sourceFile:recursiveClassReferenceTest.ts 8 > this 9 > ) 10> ; -1->Emitted(41, 21) Source(52, 7) + SourceIndex(0) -2 >Emitted(41, 30) Source(52, 16) + SourceIndex(0) -3 >Emitted(41, 31) Source(52, 17) + SourceIndex(0) -4 >Emitted(41, 40) Source(52, 26) + SourceIndex(0) -5 >Emitted(41, 41) Source(52, 27) + SourceIndex(0) -6 >Emitted(41, 52) Source(52, 38) + SourceIndex(0) -7 >Emitted(41, 54) Source(52, 40) + SourceIndex(0) -8 >Emitted(41, 58) Source(52, 44) + SourceIndex(0) -9 >Emitted(41, 59) Source(52, 45) + SourceIndex(0) -10>Emitted(41, 60) Source(52, 46) + SourceIndex(0) +1->Emitted(40, 21) Source(52, 7) + SourceIndex(0) +2 >Emitted(40, 30) Source(52, 16) + SourceIndex(0) +3 >Emitted(40, 31) Source(52, 17) + SourceIndex(0) +4 >Emitted(40, 40) Source(52, 26) + SourceIndex(0) +5 >Emitted(40, 41) Source(52, 27) + SourceIndex(0) +6 >Emitted(40, 52) Source(52, 38) + SourceIndex(0) +7 >Emitted(40, 54) Source(52, 40) + SourceIndex(0) +8 >Emitted(40, 58) Source(52, 44) + SourceIndex(0) +9 >Emitted(40, 59) Source(52, 45) + SourceIndex(0) +10>Emitted(40, 60) Source(52, 46) + SourceIndex(0) --- >>> } 1 >^^^^^^^^^^^^^^^^ @@ -774,8 +739,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(42, 17) Source(53, 3) + SourceIndex(0) -2 >Emitted(42, 18) Source(53, 4) + SourceIndex(0) +1 >Emitted(41, 17) Source(53, 3) + SourceIndex(0) +2 >Emitted(41, 18) Source(53, 4) + SourceIndex(0) --- >>> FindWidget.prototype.gar = function (runner) { if (true) { 1->^^^^^^^^^^^^^^^^ @@ -804,19 +769,19 @@ sourceFile:recursiveClassReferenceTest.ts 11> ) 12> 13> { -1->Emitted(43, 17) Source(47, 10) + SourceIndex(0) -2 >Emitted(43, 41) Source(47, 13) + SourceIndex(0) -3 >Emitted(43, 44) Source(47, 3) + SourceIndex(0) -4 >Emitted(43, 54) Source(47, 14) + SourceIndex(0) -5 >Emitted(43, 60) Source(47, 55) + SourceIndex(0) -6 >Emitted(43, 64) Source(47, 59) + SourceIndex(0) -7 >Emitted(43, 66) Source(47, 61) + SourceIndex(0) -8 >Emitted(43, 67) Source(47, 62) + SourceIndex(0) -9 >Emitted(43, 68) Source(47, 63) + SourceIndex(0) -10>Emitted(43, 72) Source(47, 67) + SourceIndex(0) -11>Emitted(43, 73) Source(47, 68) + SourceIndex(0) -12>Emitted(43, 74) Source(47, 69) + SourceIndex(0) -13>Emitted(43, 75) Source(47, 70) + SourceIndex(0) +1->Emitted(42, 17) Source(47, 10) + SourceIndex(0) +2 >Emitted(42, 41) Source(47, 13) + SourceIndex(0) +3 >Emitted(42, 44) Source(47, 3) + SourceIndex(0) +4 >Emitted(42, 54) Source(47, 14) + SourceIndex(0) +5 >Emitted(42, 60) Source(47, 55) + SourceIndex(0) +6 >Emitted(42, 64) Source(47, 59) + SourceIndex(0) +7 >Emitted(42, 66) Source(47, 61) + SourceIndex(0) +8 >Emitted(42, 67) Source(47, 62) + SourceIndex(0) +9 >Emitted(42, 68) Source(47, 63) + SourceIndex(0) +10>Emitted(42, 72) Source(47, 67) + SourceIndex(0) +11>Emitted(42, 73) Source(47, 68) + SourceIndex(0) +12>Emitted(42, 74) Source(47, 69) + SourceIndex(0) +13>Emitted(42, 75) Source(47, 70) + SourceIndex(0) --- >>> return runner(this); 1 >^^^^^^^^^^^^^^^^^^^^ @@ -835,14 +800,14 @@ sourceFile:recursiveClassReferenceTest.ts 6 > this 7 > ) 8 > ; -1 >Emitted(44, 21) Source(47, 70) + SourceIndex(0) -2 >Emitted(44, 27) Source(47, 76) + SourceIndex(0) -3 >Emitted(44, 28) Source(47, 77) + SourceIndex(0) -4 >Emitted(44, 34) Source(47, 83) + SourceIndex(0) -5 >Emitted(44, 35) Source(47, 84) + SourceIndex(0) -6 >Emitted(44, 39) Source(47, 88) + SourceIndex(0) -7 >Emitted(44, 40) Source(47, 89) + SourceIndex(0) -8 >Emitted(44, 41) Source(47, 90) + SourceIndex(0) +1 >Emitted(43, 21) Source(47, 70) + SourceIndex(0) +2 >Emitted(43, 27) Source(47, 76) + SourceIndex(0) +3 >Emitted(43, 28) Source(47, 77) + SourceIndex(0) +4 >Emitted(43, 34) Source(47, 83) + SourceIndex(0) +5 >Emitted(43, 35) Source(47, 84) + SourceIndex(0) +6 >Emitted(43, 39) Source(47, 88) + SourceIndex(0) +7 >Emitted(43, 40) Source(47, 89) + SourceIndex(0) +8 >Emitted(43, 41) Source(47, 90) + SourceIndex(0) --- >>> } }; 1 >^^^^^^^^^^^^^^^^ @@ -854,10 +819,10 @@ sourceFile:recursiveClassReferenceTest.ts 2 > } 3 > 4 > } -1 >Emitted(45, 17) Source(47, 90) + SourceIndex(0) -2 >Emitted(45, 18) Source(47, 91) + SourceIndex(0) -3 >Emitted(45, 19) Source(47, 91) + SourceIndex(0) -4 >Emitted(45, 20) Source(47, 92) + SourceIndex(0) +1 >Emitted(44, 17) Source(47, 90) + SourceIndex(0) +2 >Emitted(44, 18) Source(47, 91) + SourceIndex(0) +3 >Emitted(44, 19) Source(47, 91) + SourceIndex(0) +4 >Emitted(44, 20) Source(47, 92) + SourceIndex(0) --- >>> FindWidget.prototype.getDomNode = function () { 1->^^^^^^^^^^^^^^^^ @@ -874,9 +839,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getDomNode 3 > -1->Emitted(46, 17) Source(55, 10) + SourceIndex(0) -2 >Emitted(46, 48) Source(55, 20) + SourceIndex(0) -3 >Emitted(46, 51) Source(55, 3) + SourceIndex(0) +1->Emitted(45, 17) Source(55, 10) + SourceIndex(0) +2 >Emitted(45, 48) Source(55, 20) + SourceIndex(0) +3 >Emitted(45, 51) Source(55, 3) + SourceIndex(0) --- >>> return domNode; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -890,11 +855,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > domNode 5 > ; -1 >Emitted(47, 21) Source(56, 4) + SourceIndex(0) -2 >Emitted(47, 27) Source(56, 10) + SourceIndex(0) -3 >Emitted(47, 28) Source(56, 11) + SourceIndex(0) -4 >Emitted(47, 35) Source(56, 18) + SourceIndex(0) -5 >Emitted(47, 36) Source(56, 19) + SourceIndex(0) +1 >Emitted(46, 21) Source(56, 4) + SourceIndex(0) +2 >Emitted(46, 27) Source(56, 10) + SourceIndex(0) +3 >Emitted(46, 28) Source(56, 11) + SourceIndex(0) +4 >Emitted(46, 35) Source(56, 18) + SourceIndex(0) +5 >Emitted(46, 36) Source(56, 19) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -903,8 +868,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(48, 17) Source(57, 3) + SourceIndex(0) -2 >Emitted(48, 18) Source(57, 4) + SourceIndex(0) +1 >Emitted(47, 17) Source(57, 3) + SourceIndex(0) +2 >Emitted(47, 18) Source(57, 4) + SourceIndex(0) --- >>> FindWidget.prototype.destroy = function () { 1->^^^^^^^^^^^^^^^^ @@ -915,9 +880,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > destroy 3 > -1->Emitted(49, 17) Source(59, 10) + SourceIndex(0) -2 >Emitted(49, 45) Source(59, 17) + SourceIndex(0) -3 >Emitted(49, 48) Source(59, 3) + SourceIndex(0) +1->Emitted(48, 17) Source(59, 10) + SourceIndex(0) +2 >Emitted(48, 45) Source(59, 17) + SourceIndex(0) +3 >Emitted(48, 48) Source(59, 3) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -927,8 +892,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(50, 17) Source(61, 3) + SourceIndex(0) -2 >Emitted(50, 18) Source(61, 4) + SourceIndex(0) +1 >Emitted(49, 17) Source(61, 3) + SourceIndex(0) +2 >Emitted(49, 18) Source(61, 4) + SourceIndex(0) --- >>> return FindWidget; 1->^^^^^^^^^^^^^^^^ @@ -937,8 +902,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(51, 17) Source(63, 2) + SourceIndex(0) -2 >Emitted(51, 34) Source(63, 3) + SourceIndex(0) +1->Emitted(50, 17) Source(63, 2) + SourceIndex(0) +2 >Emitted(50, 34) Source(63, 3) + SourceIndex(0) --- >>> }()); 1 >^^^^^^^^^^^^ @@ -968,10 +933,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > > } -1 >Emitted(52, 13) Source(63, 2) + SourceIndex(0) -2 >Emitted(52, 14) Source(63, 3) + SourceIndex(0) -3 >Emitted(52, 14) Source(45, 2) + SourceIndex(0) -4 >Emitted(52, 18) Source(63, 3) + SourceIndex(0) +1 >Emitted(51, 13) Source(63, 2) + SourceIndex(0) +2 >Emitted(51, 14) Source(63, 3) + SourceIndex(0) +3 >Emitted(51, 14) Source(45, 2) + SourceIndex(0) +4 >Emitted(51, 18) Source(63, 3) + SourceIndex(0) --- >>> Widgets.FindWidget = FindWidget; 1->^^^^^^^^^^^^ @@ -1001,10 +966,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(53, 13) Source(45, 15) + SourceIndex(0) -2 >Emitted(53, 31) Source(45, 25) + SourceIndex(0) -3 >Emitted(53, 44) Source(63, 3) + SourceIndex(0) -4 >Emitted(53, 45) Source(63, 3) + SourceIndex(0) +1->Emitted(52, 13) Source(45, 15) + SourceIndex(0) +2 >Emitted(52, 31) Source(45, 25) + SourceIndex(0) +3 >Emitted(52, 44) Source(63, 3) + SourceIndex(0) +4 >Emitted(52, 45) Source(63, 3) + SourceIndex(0) --- >>> })(Widgets = Thing.Widgets || (Thing.Widgets = {})); 1->^^^^^^^^ @@ -1046,15 +1011,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(54, 9) Source(64, 1) + SourceIndex(0) -2 >Emitted(54, 10) Source(64, 2) + SourceIndex(0) -3 >Emitted(54, 12) Source(44, 21) + SourceIndex(0) -4 >Emitted(54, 19) Source(44, 28) + SourceIndex(0) -5 >Emitted(54, 22) Source(44, 21) + SourceIndex(0) -6 >Emitted(54, 35) Source(44, 28) + SourceIndex(0) -7 >Emitted(54, 40) Source(44, 21) + SourceIndex(0) -8 >Emitted(54, 53) Source(44, 28) + SourceIndex(0) -9 >Emitted(54, 61) Source(64, 2) + SourceIndex(0) +1->Emitted(53, 9) Source(64, 1) + SourceIndex(0) +2 >Emitted(53, 10) Source(64, 2) + SourceIndex(0) +3 >Emitted(53, 12) Source(44, 21) + SourceIndex(0) +4 >Emitted(53, 19) Source(44, 28) + SourceIndex(0) +5 >Emitted(53, 22) Source(44, 21) + SourceIndex(0) +6 >Emitted(53, 35) Source(44, 28) + SourceIndex(0) +7 >Emitted(53, 40) Source(44, 21) + SourceIndex(0) +8 >Emitted(53, 53) Source(44, 28) + SourceIndex(0) +9 >Emitted(53, 61) Source(64, 2) + SourceIndex(0) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -1095,15 +1060,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(55, 5) Source(64, 1) + SourceIndex(0) -2 >Emitted(55, 6) Source(64, 2) + SourceIndex(0) -3 >Emitted(55, 8) Source(44, 15) + SourceIndex(0) -4 >Emitted(55, 13) Source(44, 20) + SourceIndex(0) -5 >Emitted(55, 16) Source(44, 15) + SourceIndex(0) -6 >Emitted(55, 28) Source(44, 20) + SourceIndex(0) -7 >Emitted(55, 33) Source(44, 15) + SourceIndex(0) -8 >Emitted(55, 45) Source(44, 20) + SourceIndex(0) -9 >Emitted(55, 53) Source(64, 2) + SourceIndex(0) +1 >Emitted(54, 5) Source(64, 1) + SourceIndex(0) +2 >Emitted(54, 6) Source(64, 2) + SourceIndex(0) +3 >Emitted(54, 8) Source(44, 15) + SourceIndex(0) +4 >Emitted(54, 13) Source(44, 20) + SourceIndex(0) +5 >Emitted(54, 16) Source(44, 15) + SourceIndex(0) +6 >Emitted(54, 28) Source(44, 20) + SourceIndex(0) +7 >Emitted(54, 33) Source(44, 15) + SourceIndex(0) +8 >Emitted(54, 45) Source(44, 20) + SourceIndex(0) +9 >Emitted(54, 53) Source(64, 2) + SourceIndex(0) --- >>>})(Sample || (Sample = {})); 1 > @@ -1141,13 +1106,13 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(56, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(56, 2) Source(64, 2) + SourceIndex(0) -3 >Emitted(56, 4) Source(44, 8) + SourceIndex(0) -4 >Emitted(56, 10) Source(44, 14) + SourceIndex(0) -5 >Emitted(56, 15) Source(44, 8) + SourceIndex(0) -6 >Emitted(56, 21) Source(44, 14) + SourceIndex(0) -7 >Emitted(56, 29) Source(64, 2) + SourceIndex(0) +1 >Emitted(55, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(55, 2) Source(64, 2) + SourceIndex(0) +3 >Emitted(55, 4) Source(44, 8) + SourceIndex(0) +4 >Emitted(55, 10) Source(44, 14) + SourceIndex(0) +5 >Emitted(55, 15) Source(44, 8) + SourceIndex(0) +6 >Emitted(55, 21) Source(44, 14) + SourceIndex(0) +7 >Emitted(55, 29) Source(64, 2) + SourceIndex(0) --- >>>var AbstractMode = (function () { 1-> @@ -1156,13 +1121,13 @@ sourceFile:recursiveClassReferenceTest.ts > >interface IMode { getInitialState(): IState;} > -1->Emitted(57, 1) Source(67, 1) + SourceIndex(0) +1->Emitted(56, 1) Source(67, 1) + SourceIndex(0) --- >>> function AbstractMode() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(58, 5) Source(67, 1) + SourceIndex(0) +1->Emitted(57, 5) Source(67, 1) + SourceIndex(0) --- >>> } 1->^^^^ @@ -1170,8 +1135,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->class AbstractMode implements IMode { public getInitialState(): IState { return null;} 2 > } -1->Emitted(59, 5) Source(67, 88) + SourceIndex(0) -2 >Emitted(59, 6) Source(67, 89) + SourceIndex(0) +1->Emitted(58, 5) Source(67, 88) + SourceIndex(0) +2 >Emitted(58, 6) Source(67, 89) + SourceIndex(0) --- >>> AbstractMode.prototype.getInitialState = function () { return null; }; 1->^^^^ @@ -1194,46 +1159,44 @@ sourceFile:recursiveClassReferenceTest.ts 8 > ; 9 > 10> } -1->Emitted(60, 5) Source(67, 46) + SourceIndex(0) -2 >Emitted(60, 43) Source(67, 61) + SourceIndex(0) -3 >Emitted(60, 46) Source(67, 39) + SourceIndex(0) -4 >Emitted(60, 60) Source(67, 74) + SourceIndex(0) -5 >Emitted(60, 66) Source(67, 80) + SourceIndex(0) -6 >Emitted(60, 67) Source(67, 81) + SourceIndex(0) -7 >Emitted(60, 71) Source(67, 85) + SourceIndex(0) -8 >Emitted(60, 72) Source(67, 86) + SourceIndex(0) -9 >Emitted(60, 73) Source(67, 86) + SourceIndex(0) -10>Emitted(60, 74) Source(67, 87) + SourceIndex(0) +1->Emitted(59, 5) Source(67, 46) + SourceIndex(0) +2 >Emitted(59, 43) Source(67, 61) + SourceIndex(0) +3 >Emitted(59, 46) Source(67, 39) + SourceIndex(0) +4 >Emitted(59, 60) Source(67, 74) + SourceIndex(0) +5 >Emitted(59, 66) Source(67, 80) + SourceIndex(0) +6 >Emitted(59, 67) Source(67, 81) + SourceIndex(0) +7 >Emitted(59, 71) Source(67, 85) + SourceIndex(0) +8 >Emitted(59, 72) Source(67, 86) + SourceIndex(0) +9 >Emitted(59, 73) Source(67, 86) + SourceIndex(0) +10>Emitted(59, 74) Source(67, 87) + SourceIndex(0) --- >>> return AbstractMode; 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^ 1 > 2 > } -1 >Emitted(61, 5) Source(67, 88) + SourceIndex(0) -2 >Emitted(61, 24) Source(67, 89) + SourceIndex(0) +1 >Emitted(60, 5) Source(67, 88) + SourceIndex(0) +2 >Emitted(60, 24) Source(67, 89) + SourceIndex(0) --- >>>}()); 1 > 2 >^ 3 > 4 > ^^^^ -5 > ^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^-> 1 > 2 >} 3 > 4 > class AbstractMode implements IMode { public getInitialState(): IState { return null;} } -1 >Emitted(62, 1) Source(67, 88) + SourceIndex(0) -2 >Emitted(62, 2) Source(67, 89) + SourceIndex(0) -3 >Emitted(62, 2) Source(67, 1) + SourceIndex(0) -4 >Emitted(62, 6) Source(67, 89) + SourceIndex(0) +1 >Emitted(61, 1) Source(67, 88) + SourceIndex(0) +2 >Emitted(61, 2) Source(67, 89) + SourceIndex(0) +3 >Emitted(61, 2) Source(67, 1) + SourceIndex(0) +4 >Emitted(61, 6) Source(67, 89) + SourceIndex(0) --- ->>>var Sample; +>>>(function (Sample) { 1-> -2 >^^^^ -3 > ^^^^^^ -4 > ^ -5 > ^^^^^^^^^^-> +2 >^^^^^^^^^^^ +3 > ^^^^^^ 1-> > >interface IState {} @@ -1245,47 +1208,10 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 >module -3 > Sample -4 > .Thing.Languages.PlainText { - > - > export class State implements IState { - > constructor(private mode: IMode) { } - > public clone():IState { - > return this; - > } - > - > public equals(other:IState):boolean { - > return this === other; - > } - > - > public getMode(): IMode { return mode; } - > } - > - > export class Mode extends AbstractMode { - > - > // scenario 2 - > public getInitialState(): IState { - > return new State(self); - > } - > - > - > } - > } -1->Emitted(63, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(63, 5) Source(76, 8) + SourceIndex(0) -3 >Emitted(63, 11) Source(76, 14) + SourceIndex(0) -4 >Emitted(63, 12) Source(100, 2) + SourceIndex(0) ---- ->>>(function (Sample) { -1-> -2 >^^^^^^^^^^^ -3 > ^^^^^^ -1-> -2 >module 3 > Sample -1->Emitted(64, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(64, 12) Source(76, 8) + SourceIndex(0) -3 >Emitted(64, 18) Source(76, 14) + SourceIndex(0) +1->Emitted(62, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(62, 12) Source(76, 8) + SourceIndex(0) +3 >Emitted(62, 18) Source(76, 14) + SourceIndex(0) --- >>> var Thing; 1 >^^^^ @@ -1321,10 +1247,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(65, 5) Source(76, 15) + SourceIndex(0) -2 >Emitted(65, 9) Source(76, 15) + SourceIndex(0) -3 >Emitted(65, 14) Source(76, 20) + SourceIndex(0) -4 >Emitted(65, 15) Source(100, 2) + SourceIndex(0) +1 >Emitted(63, 5) Source(76, 15) + SourceIndex(0) +2 >Emitted(63, 9) Source(76, 15) + SourceIndex(0) +3 >Emitted(63, 14) Source(76, 20) + SourceIndex(0) +4 >Emitted(63, 15) Source(100, 2) + SourceIndex(0) --- >>> (function (Thing) { 1->^^^^ @@ -1334,9 +1260,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(66, 5) Source(76, 15) + SourceIndex(0) -2 >Emitted(66, 16) Source(76, 15) + SourceIndex(0) -3 >Emitted(66, 21) Source(76, 20) + SourceIndex(0) +1->Emitted(64, 5) Source(76, 15) + SourceIndex(0) +2 >Emitted(64, 16) Source(76, 15) + SourceIndex(0) +3 >Emitted(64, 21) Source(76, 20) + SourceIndex(0) --- >>> var Languages; 1->^^^^^^^^ @@ -1372,10 +1298,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(67, 9) Source(76, 21) + SourceIndex(0) -2 >Emitted(67, 13) Source(76, 21) + SourceIndex(0) -3 >Emitted(67, 22) Source(76, 30) + SourceIndex(0) -4 >Emitted(67, 23) Source(100, 2) + SourceIndex(0) +1->Emitted(65, 9) Source(76, 21) + SourceIndex(0) +2 >Emitted(65, 13) Source(76, 21) + SourceIndex(0) +3 >Emitted(65, 22) Source(76, 30) + SourceIndex(0) +4 >Emitted(65, 23) Source(100, 2) + SourceIndex(0) --- >>> (function (Languages) { 1->^^^^^^^^ @@ -1384,9 +1310,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Languages -1->Emitted(68, 9) Source(76, 21) + SourceIndex(0) -2 >Emitted(68, 20) Source(76, 21) + SourceIndex(0) -3 >Emitted(68, 29) Source(76, 30) + SourceIndex(0) +1->Emitted(66, 9) Source(76, 21) + SourceIndex(0) +2 >Emitted(66, 20) Source(76, 21) + SourceIndex(0) +3 >Emitted(66, 29) Source(76, 30) + SourceIndex(0) --- >>> var PlainText; 1 >^^^^^^^^^^^^ @@ -1422,10 +1348,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(69, 13) Source(76, 31) + SourceIndex(0) -2 >Emitted(69, 17) Source(76, 31) + SourceIndex(0) -3 >Emitted(69, 26) Source(76, 40) + SourceIndex(0) -4 >Emitted(69, 27) Source(100, 2) + SourceIndex(0) +1 >Emitted(67, 13) Source(76, 31) + SourceIndex(0) +2 >Emitted(67, 17) Source(76, 31) + SourceIndex(0) +3 >Emitted(67, 26) Source(76, 40) + SourceIndex(0) +4 >Emitted(67, 27) Source(100, 2) + SourceIndex(0) --- >>> (function (PlainText) { 1->^^^^^^^^^^^^ @@ -1435,9 +1361,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > PlainText -1->Emitted(70, 13) Source(76, 31) + SourceIndex(0) -2 >Emitted(70, 24) Source(76, 31) + SourceIndex(0) -3 >Emitted(70, 33) Source(76, 40) + SourceIndex(0) +1->Emitted(68, 13) Source(76, 31) + SourceIndex(0) +2 >Emitted(68, 24) Source(76, 31) + SourceIndex(0) +3 >Emitted(68, 33) Source(76, 40) + SourceIndex(0) --- >>> var State = (function () { 1->^^^^^^^^^^^^^^^^ @@ -1445,7 +1371,7 @@ sourceFile:recursiveClassReferenceTest.ts 1-> { > > -1->Emitted(71, 17) Source(78, 2) + SourceIndex(0) +1->Emitted(69, 17) Source(78, 2) + SourceIndex(0) --- >>> function State(mode) { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1456,9 +1382,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > constructor(private 3 > mode: IMode -1->Emitted(72, 21) Source(79, 9) + SourceIndex(0) -2 >Emitted(72, 36) Source(79, 29) + SourceIndex(0) -3 >Emitted(72, 40) Source(79, 40) + SourceIndex(0) +1->Emitted(70, 21) Source(79, 9) + SourceIndex(0) +2 >Emitted(70, 36) Source(79, 29) + SourceIndex(0) +3 >Emitted(70, 40) Source(79, 40) + SourceIndex(0) --- >>> this.mode = mode; 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1471,11 +1397,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > mode 5 > : IMode -1->Emitted(73, 25) Source(79, 29) + SourceIndex(0) -2 >Emitted(73, 34) Source(79, 33) + SourceIndex(0) -3 >Emitted(73, 37) Source(79, 29) + SourceIndex(0) -4 >Emitted(73, 41) Source(79, 33) + SourceIndex(0) -5 >Emitted(73, 42) Source(79, 40) + SourceIndex(0) +1->Emitted(71, 25) Source(79, 29) + SourceIndex(0) +2 >Emitted(71, 34) Source(79, 33) + SourceIndex(0) +3 >Emitted(71, 37) Source(79, 29) + SourceIndex(0) +4 >Emitted(71, 41) Source(79, 33) + SourceIndex(0) +5 >Emitted(71, 42) Source(79, 40) + SourceIndex(0) --- >>> } 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1483,8 +1409,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >) { 2 > } -1 >Emitted(74, 21) Source(79, 44) + SourceIndex(0) -2 >Emitted(74, 22) Source(79, 45) + SourceIndex(0) +1 >Emitted(72, 21) Source(79, 44) + SourceIndex(0) +2 >Emitted(72, 22) Source(79, 45) + SourceIndex(0) --- >>> State.prototype.clone = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1494,9 +1420,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > clone 3 > -1->Emitted(75, 21) Source(80, 10) + SourceIndex(0) -2 >Emitted(75, 42) Source(80, 15) + SourceIndex(0) -3 >Emitted(75, 45) Source(80, 3) + SourceIndex(0) +1->Emitted(73, 21) Source(80, 10) + SourceIndex(0) +2 >Emitted(73, 42) Source(80, 15) + SourceIndex(0) +3 >Emitted(73, 45) Source(80, 3) + SourceIndex(0) --- >>> return this; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1510,11 +1436,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > this 5 > ; -1 >Emitted(76, 25) Source(81, 4) + SourceIndex(0) -2 >Emitted(76, 31) Source(81, 10) + SourceIndex(0) -3 >Emitted(76, 32) Source(81, 11) + SourceIndex(0) -4 >Emitted(76, 36) Source(81, 15) + SourceIndex(0) -5 >Emitted(76, 37) Source(81, 16) + SourceIndex(0) +1 >Emitted(74, 25) Source(81, 4) + SourceIndex(0) +2 >Emitted(74, 31) Source(81, 10) + SourceIndex(0) +3 >Emitted(74, 32) Source(81, 11) + SourceIndex(0) +4 >Emitted(74, 36) Source(81, 15) + SourceIndex(0) +5 >Emitted(74, 37) Source(81, 16) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1523,8 +1449,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(77, 21) Source(82, 3) + SourceIndex(0) -2 >Emitted(77, 22) Source(82, 4) + SourceIndex(0) +1 >Emitted(75, 21) Source(82, 3) + SourceIndex(0) +2 >Emitted(75, 22) Source(82, 4) + SourceIndex(0) --- >>> State.prototype.equals = function (other) { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1539,11 +1465,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > public equals( 5 > other:IState -1->Emitted(78, 21) Source(84, 10) + SourceIndex(0) -2 >Emitted(78, 43) Source(84, 16) + SourceIndex(0) -3 >Emitted(78, 46) Source(84, 3) + SourceIndex(0) -4 >Emitted(78, 56) Source(84, 17) + SourceIndex(0) -5 >Emitted(78, 61) Source(84, 29) + SourceIndex(0) +1->Emitted(76, 21) Source(84, 10) + SourceIndex(0) +2 >Emitted(76, 43) Source(84, 16) + SourceIndex(0) +3 >Emitted(76, 46) Source(84, 3) + SourceIndex(0) +4 >Emitted(76, 56) Source(84, 17) + SourceIndex(0) +5 >Emitted(76, 61) Source(84, 29) + SourceIndex(0) --- >>> return this === other; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1561,13 +1487,13 @@ sourceFile:recursiveClassReferenceTest.ts 5 > === 6 > other 7 > ; -1 >Emitted(79, 25) Source(85, 4) + SourceIndex(0) -2 >Emitted(79, 31) Source(85, 10) + SourceIndex(0) -3 >Emitted(79, 32) Source(85, 11) + SourceIndex(0) -4 >Emitted(79, 36) Source(85, 15) + SourceIndex(0) -5 >Emitted(79, 41) Source(85, 20) + SourceIndex(0) -6 >Emitted(79, 46) Source(85, 25) + SourceIndex(0) -7 >Emitted(79, 47) Source(85, 26) + SourceIndex(0) +1 >Emitted(77, 25) Source(85, 4) + SourceIndex(0) +2 >Emitted(77, 31) Source(85, 10) + SourceIndex(0) +3 >Emitted(77, 32) Source(85, 11) + SourceIndex(0) +4 >Emitted(77, 36) Source(85, 15) + SourceIndex(0) +5 >Emitted(77, 41) Source(85, 20) + SourceIndex(0) +6 >Emitted(77, 46) Source(85, 25) + SourceIndex(0) +7 >Emitted(77, 47) Source(85, 26) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1576,8 +1502,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(80, 21) Source(86, 3) + SourceIndex(0) -2 >Emitted(80, 22) Source(86, 4) + SourceIndex(0) +1 >Emitted(78, 21) Source(86, 3) + SourceIndex(0) +2 >Emitted(78, 22) Source(86, 4) + SourceIndex(0) --- >>> State.prototype.getMode = function () { return mode; }; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1602,16 +1528,16 @@ sourceFile:recursiveClassReferenceTest.ts 8 > ; 9 > 10> } -1->Emitted(81, 21) Source(88, 10) + SourceIndex(0) -2 >Emitted(81, 44) Source(88, 17) + SourceIndex(0) -3 >Emitted(81, 47) Source(88, 3) + SourceIndex(0) -4 >Emitted(81, 61) Source(88, 29) + SourceIndex(0) -5 >Emitted(81, 67) Source(88, 35) + SourceIndex(0) -6 >Emitted(81, 68) Source(88, 36) + SourceIndex(0) -7 >Emitted(81, 72) Source(88, 40) + SourceIndex(0) -8 >Emitted(81, 73) Source(88, 41) + SourceIndex(0) -9 >Emitted(81, 74) Source(88, 42) + SourceIndex(0) -10>Emitted(81, 75) Source(88, 43) + SourceIndex(0) +1->Emitted(79, 21) Source(88, 10) + SourceIndex(0) +2 >Emitted(79, 44) Source(88, 17) + SourceIndex(0) +3 >Emitted(79, 47) Source(88, 3) + SourceIndex(0) +4 >Emitted(79, 61) Source(88, 29) + SourceIndex(0) +5 >Emitted(79, 67) Source(88, 35) + SourceIndex(0) +6 >Emitted(79, 68) Source(88, 36) + SourceIndex(0) +7 >Emitted(79, 72) Source(88, 40) + SourceIndex(0) +8 >Emitted(79, 73) Source(88, 41) + SourceIndex(0) +9 >Emitted(79, 74) Source(88, 42) + SourceIndex(0) +10>Emitted(79, 75) Source(88, 43) + SourceIndex(0) --- >>> return State; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1619,8 +1545,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(82, 21) Source(89, 2) + SourceIndex(0) -2 >Emitted(82, 33) Source(89, 3) + SourceIndex(0) +1 >Emitted(80, 21) Source(89, 2) + SourceIndex(0) +2 >Emitted(80, 33) Source(89, 3) + SourceIndex(0) --- >>> }()); 1 >^^^^^^^^^^^^^^^^ @@ -1643,10 +1569,10 @@ sourceFile:recursiveClassReferenceTest.ts > > public getMode(): IMode { return mode; } > } -1 >Emitted(83, 17) Source(89, 2) + SourceIndex(0) -2 >Emitted(83, 18) Source(89, 3) + SourceIndex(0) -3 >Emitted(83, 18) Source(78, 2) + SourceIndex(0) -4 >Emitted(83, 22) Source(89, 3) + SourceIndex(0) +1 >Emitted(81, 17) Source(89, 2) + SourceIndex(0) +2 >Emitted(81, 18) Source(89, 3) + SourceIndex(0) +3 >Emitted(81, 18) Source(78, 2) + SourceIndex(0) +4 >Emitted(81, 22) Source(89, 3) + SourceIndex(0) --- >>> PlainText.State = State; 1->^^^^^^^^^^^^^^^^ @@ -1669,10 +1595,10 @@ sourceFile:recursiveClassReferenceTest.ts > public getMode(): IMode { return mode; } > } 4 > -1->Emitted(84, 17) Source(78, 15) + SourceIndex(0) -2 >Emitted(84, 32) Source(78, 20) + SourceIndex(0) -3 >Emitted(84, 40) Source(89, 3) + SourceIndex(0) -4 >Emitted(84, 41) Source(89, 3) + SourceIndex(0) +1->Emitted(82, 17) Source(78, 15) + SourceIndex(0) +2 >Emitted(82, 32) Source(78, 20) + SourceIndex(0) +3 >Emitted(82, 40) Source(89, 3) + SourceIndex(0) +4 >Emitted(82, 41) Source(89, 3) + SourceIndex(0) --- >>> var Mode = (function (_super) { 1->^^^^^^^^^^^^^^^^ @@ -1680,29 +1606,29 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > > -1->Emitted(85, 17) Source(91, 2) + SourceIndex(0) +1->Emitted(83, 17) Source(91, 2) + SourceIndex(0) --- >>> __extends(Mode, _super); 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^ 1->export class Mode extends 2 > AbstractMode -1->Emitted(86, 21) Source(91, 28) + SourceIndex(0) -2 >Emitted(86, 45) Source(91, 40) + SourceIndex(0) +1->Emitted(84, 21) Source(91, 28) + SourceIndex(0) +2 >Emitted(84, 45) Source(91, 40) + SourceIndex(0) --- >>> function Mode() { 1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(87, 21) Source(91, 2) + SourceIndex(0) +1 >Emitted(85, 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) +1->Emitted(86, 25) Source(91, 28) + SourceIndex(0) +2 >Emitted(86, 55) Source(91, 40) + SourceIndex(0) --- >>> } 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1718,8 +1644,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(89, 21) Source(99, 2) + SourceIndex(0) -2 >Emitted(89, 22) Source(99, 3) + SourceIndex(0) +1 >Emitted(87, 21) Source(99, 2) + SourceIndex(0) +2 >Emitted(87, 22) Source(99, 3) + SourceIndex(0) --- >>> // scenario 2 1->^^^^^^^^^^^^^^^^^^^^ @@ -1727,8 +1653,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > // scenario 2 -1->Emitted(90, 21) Source(93, 3) + SourceIndex(0) -2 >Emitted(90, 34) Source(93, 16) + SourceIndex(0) +1->Emitted(88, 21) Source(93, 3) + SourceIndex(0) +2 >Emitted(88, 34) Source(93, 16) + SourceIndex(0) --- >>> Mode.prototype.getInitialState = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1738,9 +1664,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getInitialState 3 > -1->Emitted(91, 21) Source(94, 10) + SourceIndex(0) -2 >Emitted(91, 51) Source(94, 25) + SourceIndex(0) -3 >Emitted(91, 54) Source(94, 3) + SourceIndex(0) +1->Emitted(89, 21) Source(94, 10) + SourceIndex(0) +2 >Emitted(89, 51) Source(94, 25) + SourceIndex(0) +3 >Emitted(89, 54) Source(94, 3) + SourceIndex(0) --- >>> return new State(self); 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1762,15 +1688,15 @@ sourceFile:recursiveClassReferenceTest.ts 7 > self 8 > ) 9 > ; -1 >Emitted(92, 25) Source(95, 4) + SourceIndex(0) -2 >Emitted(92, 31) Source(95, 10) + SourceIndex(0) -3 >Emitted(92, 32) Source(95, 11) + SourceIndex(0) -4 >Emitted(92, 36) Source(95, 15) + SourceIndex(0) -5 >Emitted(92, 41) Source(95, 20) + SourceIndex(0) -6 >Emitted(92, 42) Source(95, 21) + SourceIndex(0) -7 >Emitted(92, 46) Source(95, 25) + SourceIndex(0) -8 >Emitted(92, 47) Source(95, 26) + SourceIndex(0) -9 >Emitted(92, 48) Source(95, 27) + SourceIndex(0) +1 >Emitted(90, 25) Source(95, 4) + SourceIndex(0) +2 >Emitted(90, 31) Source(95, 10) + SourceIndex(0) +3 >Emitted(90, 32) Source(95, 11) + SourceIndex(0) +4 >Emitted(90, 36) Source(95, 15) + SourceIndex(0) +5 >Emitted(90, 41) Source(95, 20) + SourceIndex(0) +6 >Emitted(90, 42) Source(95, 21) + SourceIndex(0) +7 >Emitted(90, 46) Source(95, 25) + SourceIndex(0) +8 >Emitted(90, 47) Source(95, 26) + SourceIndex(0) +9 >Emitted(90, 48) Source(95, 27) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1779,8 +1705,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(93, 21) Source(96, 3) + SourceIndex(0) -2 >Emitted(93, 22) Source(96, 4) + SourceIndex(0) +1 >Emitted(91, 21) Source(96, 3) + SourceIndex(0) +2 >Emitted(91, 22) Source(96, 4) + SourceIndex(0) --- >>> return Mode; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1791,8 +1717,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(94, 21) Source(99, 2) + SourceIndex(0) -2 >Emitted(94, 32) Source(99, 3) + SourceIndex(0) +1->Emitted(92, 21) Source(99, 2) + SourceIndex(0) +2 >Emitted(92, 32) Source(99, 3) + SourceIndex(0) --- >>> }(AbstractMode)); 1->^^^^^^^^^^^^^^^^ @@ -1816,12 +1742,12 @@ sourceFile:recursiveClassReferenceTest.ts > > > } -1->Emitted(95, 17) Source(99, 2) + SourceIndex(0) -2 >Emitted(95, 18) Source(99, 3) + SourceIndex(0) -3 >Emitted(95, 18) Source(91, 2) + SourceIndex(0) -4 >Emitted(95, 19) Source(91, 28) + SourceIndex(0) -5 >Emitted(95, 31) Source(91, 40) + SourceIndex(0) -6 >Emitted(95, 34) Source(99, 3) + SourceIndex(0) +1->Emitted(93, 17) Source(99, 2) + SourceIndex(0) +2 >Emitted(93, 18) Source(99, 3) + SourceIndex(0) +3 >Emitted(93, 18) Source(91, 2) + SourceIndex(0) +4 >Emitted(93, 19) Source(91, 28) + SourceIndex(0) +5 >Emitted(93, 31) Source(91, 40) + SourceIndex(0) +6 >Emitted(93, 34) Source(99, 3) + SourceIndex(0) --- >>> PlainText.Mode = Mode; 1->^^^^^^^^^^^^^^^^ @@ -1841,10 +1767,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(96, 17) Source(91, 15) + SourceIndex(0) -2 >Emitted(96, 31) Source(91, 19) + SourceIndex(0) -3 >Emitted(96, 38) Source(99, 3) + SourceIndex(0) -4 >Emitted(96, 39) Source(99, 3) + SourceIndex(0) +1->Emitted(94, 17) Source(91, 15) + SourceIndex(0) +2 >Emitted(94, 31) Source(91, 19) + SourceIndex(0) +3 >Emitted(94, 38) Source(99, 3) + SourceIndex(0) +4 >Emitted(94, 39) Source(99, 3) + SourceIndex(0) --- >>> })(PlainText = Languages.PlainText || (Languages.PlainText = {})); 1->^^^^^^^^^^^^ @@ -1890,15 +1816,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(97, 13) Source(100, 1) + SourceIndex(0) -2 >Emitted(97, 14) Source(100, 2) + SourceIndex(0) -3 >Emitted(97, 16) Source(76, 31) + SourceIndex(0) -4 >Emitted(97, 25) Source(76, 40) + SourceIndex(0) -5 >Emitted(97, 28) Source(76, 31) + SourceIndex(0) -6 >Emitted(97, 47) Source(76, 40) + SourceIndex(0) -7 >Emitted(97, 52) Source(76, 31) + SourceIndex(0) -8 >Emitted(97, 71) Source(76, 40) + SourceIndex(0) -9 >Emitted(97, 79) Source(100, 2) + SourceIndex(0) +1->Emitted(95, 13) Source(100, 1) + SourceIndex(0) +2 >Emitted(95, 14) Source(100, 2) + SourceIndex(0) +3 >Emitted(95, 16) Source(76, 31) + SourceIndex(0) +4 >Emitted(95, 25) Source(76, 40) + SourceIndex(0) +5 >Emitted(95, 28) Source(76, 31) + SourceIndex(0) +6 >Emitted(95, 47) Source(76, 40) + SourceIndex(0) +7 >Emitted(95, 52) Source(76, 31) + SourceIndex(0) +8 >Emitted(95, 71) Source(76, 40) + SourceIndex(0) +9 >Emitted(95, 79) Source(100, 2) + SourceIndex(0) --- >>> })(Languages = Thing.Languages || (Thing.Languages = {})); 1 >^^^^^^^^ @@ -1943,15 +1869,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(98, 9) Source(100, 1) + SourceIndex(0) -2 >Emitted(98, 10) Source(100, 2) + SourceIndex(0) -3 >Emitted(98, 12) Source(76, 21) + SourceIndex(0) -4 >Emitted(98, 21) Source(76, 30) + SourceIndex(0) -5 >Emitted(98, 24) Source(76, 21) + SourceIndex(0) -6 >Emitted(98, 39) Source(76, 30) + SourceIndex(0) -7 >Emitted(98, 44) Source(76, 21) + SourceIndex(0) -8 >Emitted(98, 59) Source(76, 30) + SourceIndex(0) -9 >Emitted(98, 67) Source(100, 2) + SourceIndex(0) +1 >Emitted(96, 9) Source(100, 1) + SourceIndex(0) +2 >Emitted(96, 10) Source(100, 2) + SourceIndex(0) +3 >Emitted(96, 12) Source(76, 21) + SourceIndex(0) +4 >Emitted(96, 21) Source(76, 30) + SourceIndex(0) +5 >Emitted(96, 24) Source(76, 21) + SourceIndex(0) +6 >Emitted(96, 39) Source(76, 30) + SourceIndex(0) +7 >Emitted(96, 44) Source(76, 21) + SourceIndex(0) +8 >Emitted(96, 59) Source(76, 30) + SourceIndex(0) +9 >Emitted(96, 67) Source(100, 2) + SourceIndex(0) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -1996,15 +1922,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(99, 5) Source(100, 1) + SourceIndex(0) -2 >Emitted(99, 6) Source(100, 2) + SourceIndex(0) -3 >Emitted(99, 8) Source(76, 15) + SourceIndex(0) -4 >Emitted(99, 13) Source(76, 20) + SourceIndex(0) -5 >Emitted(99, 16) Source(76, 15) + SourceIndex(0) -6 >Emitted(99, 28) Source(76, 20) + SourceIndex(0) -7 >Emitted(99, 33) Source(76, 15) + SourceIndex(0) -8 >Emitted(99, 45) Source(76, 20) + SourceIndex(0) -9 >Emitted(99, 53) Source(100, 2) + SourceIndex(0) +1 >Emitted(97, 5) Source(100, 1) + SourceIndex(0) +2 >Emitted(97, 6) Source(100, 2) + SourceIndex(0) +3 >Emitted(97, 8) Source(76, 15) + SourceIndex(0) +4 >Emitted(97, 13) Source(76, 20) + SourceIndex(0) +5 >Emitted(97, 16) Source(76, 15) + SourceIndex(0) +6 >Emitted(97, 28) Source(76, 20) + SourceIndex(0) +7 >Emitted(97, 33) Source(76, 15) + SourceIndex(0) +8 >Emitted(97, 45) Source(76, 20) + SourceIndex(0) +9 >Emitted(97, 53) Source(100, 2) + SourceIndex(0) --- >>>})(Sample || (Sample = {})); 1 > @@ -2046,12 +1972,12 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(100, 1) Source(100, 1) + SourceIndex(0) -2 >Emitted(100, 2) Source(100, 2) + SourceIndex(0) -3 >Emitted(100, 4) Source(76, 8) + SourceIndex(0) -4 >Emitted(100, 10) Source(76, 14) + SourceIndex(0) -5 >Emitted(100, 15) Source(76, 8) + SourceIndex(0) -6 >Emitted(100, 21) Source(76, 14) + SourceIndex(0) -7 >Emitted(100, 29) Source(100, 2) + SourceIndex(0) +1 >Emitted(98, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(98, 2) Source(100, 2) + SourceIndex(0) +3 >Emitted(98, 4) Source(76, 8) + SourceIndex(0) +4 >Emitted(98, 10) Source(76, 14) + SourceIndex(0) +5 >Emitted(98, 15) Source(76, 8) + SourceIndex(0) +6 >Emitted(98, 21) Source(76, 14) + SourceIndex(0) +7 >Emitted(98, 29) Source(100, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=recursiveClassReferenceTest.js.map \ No newline at end of file diff --git a/tests/baselines/reference/recursiveCloduleReference.js b/tests/baselines/reference/recursiveCloduleReference.js index 07d80e6011a..3d261a4f9ae 100644 --- a/tests/baselines/reference/recursiveCloduleReference.js +++ b/tests/baselines/reference/recursiveCloduleReference.js @@ -19,7 +19,6 @@ var M; return C; }()); M.C = C; - var C; (function (C_1) { C_1.C = M.C; })(C = M.C || (M.C = {})); diff --git a/tests/baselines/reference/recursiveMods.js b/tests/baselines/reference/recursiveMods.js index 86b3d47a48e..6f8304df658 100644 --- a/tests/baselines/reference/recursiveMods.js +++ b/tests/baselines/reference/recursiveMods.js @@ -35,7 +35,6 @@ var Foo; }()); Foo.C = C; })(Foo = exports.Foo || (exports.Foo = {})); -var Foo; (function (Foo) { function Bar() { if (true) { diff --git a/tests/baselines/reference/reservedWords2.js b/tests/baselines/reference/reservedWords2.js index a5f8a680bcc..a79a0564c78 100644 --- a/tests/baselines/reference/reservedWords2.js +++ b/tests/baselines/reference/reservedWords2.js @@ -34,7 +34,6 @@ debugger; if () ; [1, 2]; -var ; (function () { })( || ( = {})); void {}; diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index 6e621a18805..dafdb82ff5f 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -2302,7 +2302,6 @@ var quasiater; }()); quasiater.bobrinskoi = bobrinskoi; })(quasiater || (quasiater = {})); -var ruatanica; (function (ruatanica) { var americanus = (function (_super) { __extends(americanus, _super); @@ -3225,7 +3224,6 @@ var panglima; }(argurus.dauricus)); panglima.abidi = abidi; })(panglima || (panglima = {})); -var quasiater; (function (quasiater) { var carolinensis = (function () { function carolinensis() { @@ -3459,7 +3457,6 @@ var daubentonii; }()); daubentonii.nesiotes = nesiotes; })(daubentonii || (daubentonii = {})); -var nigra; (function (nigra) { var thalia = (function () { function thalia() { @@ -3533,7 +3530,6 @@ var sagitta; }(minutus.portoricensis)); sagitta.walkeri = walkeri; })(sagitta || (sagitta = {})); -var minutus; (function (minutus) { var inez = (function (_super) { __extends(inez, _super); @@ -3550,7 +3546,6 @@ var minutus; }(samarensis.pelurus)); minutus.inez = inez; })(minutus || (minutus = {})); -var macrorhinos; (function (macrorhinos) { var konganensis = (function (_super) { __extends(konganensis, _super); @@ -3626,7 +3621,6 @@ var panamensis; }(ruatanica.hector)); panamensis.linulus = linulus; })(panamensis || (panamensis = {})); -var nigra; (function (nigra) { var gracilis = (function () { function gracilis() { @@ -3960,7 +3954,6 @@ var samarensis; }()); samarensis.cahirinus = cahirinus; })(samarensis || (samarensis = {})); -var sagitta; (function (sagitta) { var leptoceros = (function (_super) { __extends(leptoceros, _super); @@ -4001,7 +3994,6 @@ var sagitta; }(caurinus.johorensis)); sagitta.leptoceros = leptoceros; })(sagitta || (sagitta = {})); -var daubentonii; (function (daubentonii) { var nigricans = (function (_super) { __extends(nigricans, _super); @@ -4027,7 +4019,6 @@ var dammermani; }()); dammermani.siberu = siberu; })(dammermani || (dammermani = {})); -var argurus; (function (argurus) { var pygmaea = (function (_super) { __extends(pygmaea, _super); @@ -4109,7 +4100,6 @@ var chrysaeolus; }(caurinus.psilurus)); chrysaeolus.sarasinorum = sarasinorum; })(chrysaeolus || (chrysaeolus = {})); -var argurus; (function (argurus) { var wetmorei = (function () { function wetmorei() { @@ -4160,7 +4150,6 @@ var argurus; }()); argurus.wetmorei = wetmorei; })(argurus || (argurus = {})); -var argurus; (function (argurus) { var oreas = (function (_super) { __extends(oreas, _super); @@ -4219,7 +4208,6 @@ var argurus; }(lavali.wilsoni)); argurus.oreas = oreas; })(argurus || (argurus = {})); -var daubentonii; (function (daubentonii) { var arboreus = (function () { function arboreus() { @@ -4410,7 +4398,6 @@ var provocax; }(lavali.wilsoni)); provocax.melanoleuca = melanoleuca; })(provocax || (provocax = {})); -var sagitta; (function (sagitta) { var sicarius = (function () { function sicarius() { @@ -4431,7 +4418,6 @@ var sagitta; }()); sagitta.sicarius = sicarius; })(sagitta || (sagitta = {})); -var howi; (function (howi) { var marcanoi = (function (_super) { __extends(marcanoi, _super); @@ -4526,7 +4512,6 @@ var howi; }(Lanthanum.megalonyx)); howi.marcanoi = marcanoi; })(howi || (howi = {})); -var argurus; (function (argurus) { var gilbertii = (function () { function gilbertii() { @@ -4616,7 +4601,6 @@ var petrophilus; }()); petrophilus.minutilla = minutilla; })(petrophilus || (petrophilus = {})); -var lutreolus; (function (lutreolus) { var punicus = (function () { function punicus() { @@ -4703,7 +4687,6 @@ var lutreolus; }()); lutreolus.punicus = punicus; })(lutreolus || (lutreolus = {})); -var macrorhinos; (function (macrorhinos) { var daphaenodon = (function () { function daphaenodon() { @@ -4748,7 +4731,6 @@ var macrorhinos; }()); macrorhinos.daphaenodon = daphaenodon; })(macrorhinos || (macrorhinos = {})); -var sagitta; (function (sagitta) { var cinereus = (function () { function cinereus() { @@ -4829,7 +4811,6 @@ var sagitta; }()); sagitta.cinereus = cinereus; })(sagitta || (sagitta = {})); -var nigra; (function (nigra) { var caucasica = (function () { function caucasica() { @@ -5070,7 +5051,6 @@ var imperfecta; }(dogramacii.robustulus)); imperfecta.ciliolabrum = ciliolabrum; })(imperfecta || (imperfecta = {})); -var quasiater; (function (quasiater) { var wattsi = (function () { function wattsi() { @@ -5103,7 +5083,6 @@ var quasiater; }()); quasiater.wattsi = wattsi; })(quasiater || (quasiater = {})); -var petrophilus; (function (petrophilus) { var sodyi = (function (_super) { __extends(sodyi, _super); @@ -5168,7 +5147,6 @@ var petrophilus; }(quasiater.bobrinskoi)); petrophilus.sodyi = sodyi; })(petrophilus || (petrophilus = {})); -var caurinus; (function (caurinus) { var megaphyllus = (function (_super) { __extends(megaphyllus, _super); @@ -5227,7 +5205,6 @@ var caurinus; }(imperfecta.lasiurus)); caurinus.megaphyllus = megaphyllus; })(caurinus || (caurinus = {})); -var minutus; (function (minutus) { var portoricensis = (function () { function portoricensis() { @@ -5254,7 +5231,6 @@ var minutus; }()); minutus.portoricensis = portoricensis; })(minutus || (minutus = {})); -var lutreolus; (function (lutreolus) { var foina = (function () { function foina() { @@ -5341,7 +5317,6 @@ var lutreolus; }()); lutreolus.foina = foina; })(lutreolus || (lutreolus = {})); -var lutreolus; (function (lutreolus) { var cor = (function (_super) { __extends(cor, _super); @@ -5412,7 +5387,6 @@ var lutreolus; }(panglima.fundatus)); lutreolus.cor = cor; })(lutreolus || (lutreolus = {})); -var howi; (function (howi) { var coludo = (function () { function coludo() { @@ -5433,7 +5407,6 @@ var howi; }()); howi.coludo = coludo; })(howi || (howi = {})); -var argurus; (function (argurus) { var germaini = (function (_super) { __extends(germaini, _super); @@ -5456,7 +5429,6 @@ var argurus; }(gabriellae.amicus)); argurus.germaini = germaini; })(argurus || (argurus = {})); -var sagitta; (function (sagitta) { var stolzmanni = (function () { function stolzmanni() { @@ -5531,7 +5503,6 @@ var sagitta; }()); sagitta.stolzmanni = stolzmanni; })(sagitta || (sagitta = {})); -var dammermani; (function (dammermani) { var melanops = (function (_super) { __extends(melanops, _super); @@ -5620,7 +5591,6 @@ var dammermani; }(minutus.inez)); dammermani.melanops = melanops; })(dammermani || (dammermani = {})); -var argurus; (function (argurus) { var peninsulae = (function (_super) { __extends(peninsulae, _super); @@ -5679,7 +5649,6 @@ var argurus; }(patas.uralensis)); argurus.peninsulae = peninsulae; })(argurus || (argurus = {})); -var argurus; (function (argurus) { var netscheri = (function () { function netscheri() { @@ -5766,7 +5735,6 @@ var argurus; }()); argurus.netscheri = netscheri; })(argurus || (argurus = {})); -var ruatanica; (function (ruatanica) { var Praseodymium = (function (_super) { __extends(Praseodymium, _super); @@ -5855,7 +5823,6 @@ var ruatanica; }(ruatanica.hector)); ruatanica.Praseodymium = Praseodymium; })(ruatanica || (ruatanica = {})); -var caurinus; (function (caurinus) { var johorensis = (function (_super) { __extends(johorensis, _super); @@ -5872,7 +5839,6 @@ var caurinus; }(lutreolus.punicus)); caurinus.johorensis = johorensis; })(caurinus || (caurinus = {})); -var argurus; (function (argurus) { var luctuosa = (function () { function luctuosa() { @@ -5887,7 +5853,6 @@ var argurus; }()); argurus.luctuosa = luctuosa; })(argurus || (argurus = {})); -var panamensis; (function (panamensis) { var setulosus = (function () { function setulosus() { @@ -5944,7 +5909,6 @@ var panamensis; }()); panamensis.setulosus = setulosus; })(panamensis || (panamensis = {})); -var petrophilus; (function (petrophilus) { var rosalia = (function () { function rosalia() { @@ -5983,7 +5947,6 @@ var petrophilus; }()); petrophilus.rosalia = rosalia; })(petrophilus || (petrophilus = {})); -var caurinus; (function (caurinus) { var psilurus = (function (_super) { __extends(psilurus, _super); diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.js b/tests/baselines/reference/sourcemapValidationDuplicateNames.js index 360635fe74d..34804cc8227 100644 --- a/tests/baselines/reference/sourcemapValidationDuplicateNames.js +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.js @@ -19,7 +19,6 @@ var m1; }()); m1.c = c; })(m1 || (m1 = {})); -var m1; (function (m1) { var b = new m1.c(); })(m1 || (m1 = {})); diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.js.map b/tests/baselines/reference/sourcemapValidationDuplicateNames.js.map index 10225f979e5..2e1a02da8dd 100644 --- a/tests/baselines/reference/sourcemapValidationDuplicateNames.js.map +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.js.map @@ -1,2 +1,2 @@ //// [sourcemapValidationDuplicateNames.js.map] -{"version":3,"file":"sourcemapValidationDuplicateNames.js","sourceRoot":"","sources":["sourcemapValidationDuplicateNames.ts"],"names":[],"mappings":"AAAA,IAAO,EAAE,CAIR;AAJD,WAAO,EAAE;IACL,IAAI,CAAC,GAAG,EAAE,CAAC;IACX;QAAA;QACA,CAAC;QAAD,QAAC;IAAD,CAAC,AADD,IACC;IADY,IAAC,IACb,CAAA;AACL,CAAC,EAJM,EAAE,KAAF,EAAE,QAIR;AACD,IAAO,EAAE,CAER;AAFD,WAAO,EAAE;IACL,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AACvB,CAAC,EAFM,EAAE,KAAF,EAAE,QAER"} \ No newline at end of file +{"version":3,"file":"sourcemapValidationDuplicateNames.js","sourceRoot":"","sources":["sourcemapValidationDuplicateNames.ts"],"names":[],"mappings":"AAAA,IAAO,EAAE,CAIR;AAJD,WAAO,EAAE;IACL,IAAI,CAAC,GAAG,EAAE,CAAC;IACX;QAAA;QACA,CAAC;QAAD,QAAC;IAAD,CAAC,AADD,IACC;IADY,IAAC,IACb,CAAA;AACL,CAAC,EAJM,EAAE,KAAF,EAAE,QAIR;AACD,WAAO,EAAE;IACL,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AACvB,CAAC,EAFM,EAAE,KAAF,EAAE,QAER"} \ No newline at end of file diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt b/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt index 5ae487440ee..d4b98001a57 100644 --- a/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt @@ -152,35 +152,18 @@ sourceFile:sourcemapValidationDuplicateNames.ts 6 >Emitted(10, 13) Source(1, 10) + SourceIndex(0) 7 >Emitted(10, 21) Source(5, 2) + SourceIndex(0) --- ->>>var m1; -1 > -2 >^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> -1 > - > -2 >module -3 > m1 -4 > { - > var b = new m1.c(); - > } -1 >Emitted(11, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(11, 5) Source(6, 8) + SourceIndex(0) -3 >Emitted(11, 7) Source(6, 10) + SourceIndex(0) -4 >Emitted(11, 8) Source(8, 2) + SourceIndex(0) ---- >>>(function (m1) { -1-> +1 > 2 >^^^^^^^^^^^ 3 > ^^ 4 > ^^^^^^^^^^^-> -1-> +1 > + > 2 >module 3 > m1 -1->Emitted(12, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(12, 12) Source(6, 8) + SourceIndex(0) -3 >Emitted(12, 14) Source(6, 10) + SourceIndex(0) +1 >Emitted(11, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(11, 12) Source(6, 8) + SourceIndex(0) +3 >Emitted(11, 14) Source(6, 10) + SourceIndex(0) --- >>> var b = new m1.c(); 1->^^^^ @@ -204,16 +187,16 @@ sourceFile:sourcemapValidationDuplicateNames.ts 8 > c 9 > () 10> ; -1->Emitted(13, 5) Source(7, 5) + SourceIndex(0) -2 >Emitted(13, 9) Source(7, 9) + SourceIndex(0) -3 >Emitted(13, 10) Source(7, 10) + SourceIndex(0) -4 >Emitted(13, 13) Source(7, 13) + SourceIndex(0) -5 >Emitted(13, 17) Source(7, 17) + SourceIndex(0) -6 >Emitted(13, 19) Source(7, 19) + SourceIndex(0) -7 >Emitted(13, 20) Source(7, 20) + SourceIndex(0) -8 >Emitted(13, 21) Source(7, 21) + SourceIndex(0) -9 >Emitted(13, 23) Source(7, 23) + SourceIndex(0) -10>Emitted(13, 24) Source(7, 24) + SourceIndex(0) +1->Emitted(12, 5) Source(7, 5) + SourceIndex(0) +2 >Emitted(12, 9) Source(7, 9) + SourceIndex(0) +3 >Emitted(12, 10) Source(7, 10) + SourceIndex(0) +4 >Emitted(12, 13) Source(7, 13) + SourceIndex(0) +5 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +6 >Emitted(12, 19) Source(7, 19) + SourceIndex(0) +7 >Emitted(12, 20) Source(7, 20) + SourceIndex(0) +8 >Emitted(12, 21) Source(7, 21) + SourceIndex(0) +9 >Emitted(12, 23) Source(7, 23) + SourceIndex(0) +10>Emitted(12, 24) Source(7, 24) + SourceIndex(0) --- >>>})(m1 || (m1 = {})); 1 > @@ -234,12 +217,12 @@ sourceFile:sourcemapValidationDuplicateNames.ts 7 > { > var b = new m1.c(); > } -1 >Emitted(14, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(8, 2) + SourceIndex(0) -3 >Emitted(14, 4) Source(6, 8) + SourceIndex(0) -4 >Emitted(14, 6) Source(6, 10) + SourceIndex(0) -5 >Emitted(14, 11) Source(6, 8) + SourceIndex(0) -6 >Emitted(14, 13) Source(6, 10) + SourceIndex(0) -7 >Emitted(14, 21) Source(8, 2) + SourceIndex(0) +1 >Emitted(13, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(8, 2) + SourceIndex(0) +3 >Emitted(13, 4) Source(6, 8) + SourceIndex(0) +4 >Emitted(13, 6) Source(6, 10) + SourceIndex(0) +5 >Emitted(13, 11) Source(6, 8) + SourceIndex(0) +6 >Emitted(13, 13) Source(6, 10) + SourceIndex(0) +7 >Emitted(13, 21) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourcemapValidationDuplicateNames.js.map \ No newline at end of file diff --git a/tests/baselines/reference/staticMemberExportAccess.js b/tests/baselines/reference/staticMemberExportAccess.js index 58fddf445ee..b0261e79c8e 100644 --- a/tests/baselines/reference/staticMemberExportAccess.js +++ b/tests/baselines/reference/staticMemberExportAccess.js @@ -30,7 +30,6 @@ var Sammy = (function () { }; return Sammy; }()); -var Sammy; (function (Sammy) { Sammy.x = 1; })(Sammy || (Sammy = {})); diff --git a/tests/baselines/reference/staticPropertyNotInClassType.js b/tests/baselines/reference/staticPropertyNotInClassType.js index 60fd3b808ca..6caa108a710 100644 --- a/tests/baselines/reference/staticPropertyNotInClassType.js +++ b/tests/baselines/reference/staticPropertyNotInClassType.js @@ -56,7 +56,6 @@ var NonGeneric; }); return C; }()); - var C; (function (C) { C.bar = ''; // not reflected in class type })(C || (C = {})); @@ -82,7 +81,6 @@ var Generic; }); return C; }()); - var C; (function (C) { C.bar = ''; // not reflected in class type })(C || (C = {})); diff --git a/tests/baselines/reference/staticsNotInScopeInClodule.js b/tests/baselines/reference/staticsNotInScopeInClodule.js index e10ed2b31d3..ccaace996cd 100644 --- a/tests/baselines/reference/staticsNotInScopeInClodule.js +++ b/tests/baselines/reference/staticsNotInScopeInClodule.js @@ -14,7 +14,6 @@ var Clod = (function () { return Clod; }()); Clod.x = 10; -var Clod; (function (Clod) { var p = x; // x isn't in scope here })(Clod || (Clod = {})); diff --git a/tests/baselines/reference/subtypesOfAny.js b/tests/baselines/reference/subtypesOfAny.js index 0b2965cb820..c07da732c1e 100644 --- a/tests/baselines/reference/subtypesOfAny.js +++ b/tests/baselines/reference/subtypesOfAny.js @@ -150,7 +150,6 @@ var E; E[E["A"] = 0] = "A"; })(E || (E = {})); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -159,7 +158,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index 10d9e3e42ec..f87fec1ddfc 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -143,7 +143,6 @@ var E; E[E["A"] = 0] = "A"; })(E || (E = {})); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -152,7 +151,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js index 771c2ef74f5..a41ab1d4e2e 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js @@ -200,7 +200,6 @@ var E; E[E["A"] = 0] = "A"; })(E || (E = {})); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -209,7 +208,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/subtypesOfUnion.js b/tests/baselines/reference/subtypesOfUnion.js index cc0fdea7346..8168798bce2 100644 --- a/tests/baselines/reference/subtypesOfUnion.js +++ b/tests/baselines/reference/subtypesOfUnion.js @@ -69,7 +69,6 @@ var A2 = (function () { return A2; }()); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -78,7 +77,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/systemModuleDeclarationMerging.js b/tests/baselines/reference/systemModuleDeclarationMerging.js index d5994bc9f22..4dac69c2641 100644 --- a/tests/baselines/reference/systemModuleDeclarationMerging.js +++ b/tests/baselines/reference/systemModuleDeclarationMerging.js @@ -14,7 +14,7 @@ System.register([], function (exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; function F() { } - var F, C, C, E, E; + var C, E; exports_1("F", F); return { setters: [], diff --git a/tests/baselines/reference/tsxEmit3.js b/tests/baselines/reference/tsxEmit3.js index 33e1975cdbc..bf368f9b262 100644 --- a/tests/baselines/reference/tsxEmit3.js +++ b/tests/baselines/reference/tsxEmit3.js @@ -62,7 +62,6 @@ var M; // Foo, ; })(S = M.S || (M.S = {})); })(M || (M = {})); -var M; (function (M) { // Emit M.Foo M.Foo, ; @@ -74,12 +73,10 @@ var M; S.Bar, ; })(S = M.S || (M.S = {})); })(M || (M = {})); -var M; (function (M) { // Emit M.S.Bar M.S.Bar, ; })(M || (M = {})); -var M; (function (M_1) { var M = 100; // Emit M_1.Foo diff --git a/tests/baselines/reference/tsxEmit3.js.map b/tests/baselines/reference/tsxEmit3.js.map index 051be56f256..6e12addfb6b 100644 --- a/tests/baselines/reference/tsxEmit3.js.map +++ b/tests/baselines/reference/tsxEmit3.js.map @@ -1,2 +1,2 @@ //// [file.jsx.map] -{"version":3,"file":"file.jsx","sourceRoot":"","sources":["file.tsx"],"names":[],"mappings":"AAMA,IAAO,CAAC,CAQP;AARD,WAAO,CAAC;IACP;QAAmB;QAAgB,CAAC;QAAC,UAAC;IAAD,CAAC,AAAtC,IAAsC;IAAzB,KAAG,MAAsB,CAAA;IACtC,IAAc,CAAC,CAKd;IALD,WAAc,CAAC;QACd;YAAA;YAAmB,CAAC;YAAD,UAAC;QAAD,CAAC,AAApB,IAAoB;QAAP,KAAG,MAAI,CAAA;QAEpB,WAAW;QACX,gBAAgB;IACjB,CAAC,EALa,CAAC,GAAD,GAAC,KAAD,GAAC,QAKd;AACF,CAAC,EARM,CAAC,KAAD,CAAC,QAQP;AAED,IAAO,CAAC,CAYP;AAZD,WAAO,CAAC;IACP,aAAa;IACb,EAAA,GAAG,EAAE,CAAC,EAAA,GAAG,GAAG,CAAC;IAEb,IAAc,CAAC,CAMd;IAND,WAAc,CAAC;QACd,aAAa;QACb,EAAA,GAAG,EAAE,CAAC,EAAA,GAAG,GAAG,CAAC;QAEb,aAAa;QACb,EAAA,GAAG,EAAE,CAAC,EAAA,GAAG,GAAG,CAAC;IACd,CAAC,EANa,CAAC,GAAD,GAAC,KAAD,GAAC,QAMd;AAEF,CAAC,EAZM,CAAC,KAAD,CAAC,QAYP;AAED,IAAO,CAAC,CAGP;AAHD,WAAO,CAAC;IACP,eAAe;IACf,EAAA,CAAC,CAAC,GAAG,EAAE,CAAC,EAAA,CAAC,CAAC,GAAG,GAAG,CAAC;AAClB,CAAC,EAHM,CAAC,KAAD,CAAC,QAGP;AAED,IAAO,CAAC,CAIP;AAJD,WAAO,GAAC;IACP,IAAI,CAAC,GAAG,GAAG,CAAC;IACZ,eAAe;IACf,IAAA,GAAG,EAAE,CAAC,IAAA,GAAG,GAAG,CAAC;AACd,CAAC,EAJM,CAAC,KAAD,CAAC,QAIP"} \ No newline at end of file +{"version":3,"file":"file.jsx","sourceRoot":"","sources":["file.tsx"],"names":[],"mappings":"AAMA,IAAO,CAAC,CAQP;AARD,WAAO,CAAC;IACP;QAAmB;QAAgB,CAAC;QAAC,UAAC;IAAD,CAAC,AAAtC,IAAsC;IAAzB,KAAG,MAAsB,CAAA;IACtC,IAAc,CAAC,CAKd;IALD,WAAc,CAAC;QACd;YAAA;YAAmB,CAAC;YAAD,UAAC;QAAD,CAAC,AAApB,IAAoB;QAAP,KAAG,MAAI,CAAA;QAEpB,WAAW;QACX,gBAAgB;IACjB,CAAC,EALa,CAAC,GAAD,GAAC,KAAD,GAAC,QAKd;AACF,CAAC,EARM,CAAC,KAAD,CAAC,QAQP;AAED,WAAO,CAAC;IACP,aAAa;IACb,EAAA,GAAG,EAAE,CAAC,EAAA,GAAG,GAAG,CAAC;IAEb,IAAc,CAAC,CAMd;IAND,WAAc,CAAC;QACd,aAAa;QACb,EAAA,GAAG,EAAE,CAAC,EAAA,GAAG,GAAG,CAAC;QAEb,aAAa;QACb,EAAA,GAAG,EAAE,CAAC,EAAA,GAAG,GAAG,CAAC;IACd,CAAC,EANa,CAAC,GAAD,GAAC,KAAD,GAAC,QAMd;AAEF,CAAC,EAZM,CAAC,KAAD,CAAC,QAYP;AAED,WAAO,CAAC;IACP,eAAe;IACf,EAAA,CAAC,CAAC,GAAG,EAAE,CAAC,EAAA,CAAC,CAAC,GAAG,GAAG,CAAC;AAClB,CAAC,EAHM,CAAC,KAAD,CAAC,QAGP;AAED,WAAO,GAAC;IACP,IAAI,CAAC,GAAG,GAAG,CAAC;IACZ,eAAe;IACf,IAAA,GAAG,EAAE,CAAC,IAAA,GAAG,GAAG,CAAC;AACd,CAAC,EAJM,CAAC,KAAD,CAAC,QAIP"} \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit3.sourcemap.txt b/tests/baselines/reference/tsxEmit3.sourcemap.txt index 02fec081e4c..d2ccdb264ba 100644 --- a/tests/baselines/reference/tsxEmit3.sourcemap.txt +++ b/tests/baselines/reference/tsxEmit3.sourcemap.txt @@ -288,46 +288,19 @@ sourceFile:file.tsx 6 >Emitted(20, 11) Source(7, 9) + SourceIndex(0) 7 >Emitted(20, 19) Source(15, 2) + SourceIndex(0) --- ->>>var M; +>>>(function (M) { 1 > -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^-> +2 >^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^-> 1 > > > 2 >module -3 > M -4 > { - > // Emit M.Foo - > Foo, ; - > - > export module S { - > // Emit M.Foo - > Foo, ; - > - > // Emit S.Bar - > Bar, ; - > } - > - > } -1 >Emitted(21, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(21, 5) Source(17, 8) + SourceIndex(0) -3 >Emitted(21, 6) Source(17, 9) + SourceIndex(0) -4 >Emitted(21, 7) Source(29, 2) + SourceIndex(0) ---- ->>>(function (M) { -1-> -2 >^^^^^^^^^^^ -3 > ^ -4 > ^^^^^^-> -1-> -2 >module 3 > M -1->Emitted(22, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(22, 12) Source(17, 8) + SourceIndex(0) -3 >Emitted(22, 13) Source(17, 9) + SourceIndex(0) +1 >Emitted(21, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(21, 12) Source(17, 8) + SourceIndex(0) +3 >Emitted(21, 13) Source(17, 9) + SourceIndex(0) --- >>> // Emit M.Foo 1->^^^^ @@ -336,8 +309,8 @@ sourceFile:file.tsx 1-> { > 2 > // Emit M.Foo -1->Emitted(23, 5) Source(18, 2) + SourceIndex(0) -2 >Emitted(23, 18) Source(18, 15) + SourceIndex(0) +1->Emitted(22, 5) Source(18, 2) + SourceIndex(0) +2 >Emitted(22, 18) Source(18, 15) + SourceIndex(0) --- >>> M.Foo, ; 1->^^^^ @@ -359,15 +332,15 @@ sourceFile:file.tsx 7 > Foo 8 > /> 9 > ; -1->Emitted(24, 5) Source(19, 2) + SourceIndex(0) -2 >Emitted(24, 7) Source(19, 2) + SourceIndex(0) -3 >Emitted(24, 10) Source(19, 5) + SourceIndex(0) -4 >Emitted(24, 12) Source(19, 7) + SourceIndex(0) -5 >Emitted(24, 13) Source(19, 8) + SourceIndex(0) -6 >Emitted(24, 15) Source(19, 8) + SourceIndex(0) -7 >Emitted(24, 18) Source(19, 11) + SourceIndex(0) -8 >Emitted(24, 21) Source(19, 14) + SourceIndex(0) -9 >Emitted(24, 22) Source(19, 15) + SourceIndex(0) +1->Emitted(23, 5) Source(19, 2) + SourceIndex(0) +2 >Emitted(23, 7) Source(19, 2) + SourceIndex(0) +3 >Emitted(23, 10) Source(19, 5) + SourceIndex(0) +4 >Emitted(23, 12) Source(19, 7) + SourceIndex(0) +5 >Emitted(23, 13) Source(19, 8) + SourceIndex(0) +6 >Emitted(23, 15) Source(19, 8) + SourceIndex(0) +7 >Emitted(23, 18) Source(19, 11) + SourceIndex(0) +8 >Emitted(23, 21) Source(19, 14) + SourceIndex(0) +9 >Emitted(23, 22) Source(19, 15) + SourceIndex(0) --- >>> var S; 1 >^^^^ @@ -387,10 +360,10 @@ sourceFile:file.tsx > // Emit S.Bar > Bar, ; > } -1 >Emitted(25, 5) Source(21, 2) + SourceIndex(0) -2 >Emitted(25, 9) Source(21, 16) + SourceIndex(0) -3 >Emitted(25, 10) Source(21, 17) + SourceIndex(0) -4 >Emitted(25, 11) Source(27, 3) + SourceIndex(0) +1 >Emitted(24, 5) Source(21, 2) + SourceIndex(0) +2 >Emitted(24, 9) Source(21, 16) + SourceIndex(0) +3 >Emitted(24, 10) Source(21, 17) + SourceIndex(0) +4 >Emitted(24, 11) Source(27, 3) + SourceIndex(0) --- >>> (function (S) { 1->^^^^ @@ -400,9 +373,9 @@ sourceFile:file.tsx 1-> 2 > export module 3 > S -1->Emitted(26, 5) Source(21, 2) + SourceIndex(0) -2 >Emitted(26, 16) Source(21, 16) + SourceIndex(0) -3 >Emitted(26, 17) Source(21, 17) + SourceIndex(0) +1->Emitted(25, 5) Source(21, 2) + SourceIndex(0) +2 >Emitted(25, 16) Source(21, 16) + SourceIndex(0) +3 >Emitted(25, 17) Source(21, 17) + SourceIndex(0) --- >>> // Emit M.Foo 1->^^^^^^^^ @@ -411,8 +384,8 @@ sourceFile:file.tsx 1-> { > 2 > // Emit M.Foo -1->Emitted(27, 9) Source(22, 3) + SourceIndex(0) -2 >Emitted(27, 22) Source(22, 16) + SourceIndex(0) +1->Emitted(26, 9) Source(22, 3) + SourceIndex(0) +2 >Emitted(26, 22) Source(22, 16) + SourceIndex(0) --- >>> M.Foo, ; 1->^^^^^^^^ @@ -434,15 +407,15 @@ sourceFile:file.tsx 7 > Foo 8 > /> 9 > ; -1->Emitted(28, 9) Source(23, 3) + SourceIndex(0) -2 >Emitted(28, 11) Source(23, 3) + SourceIndex(0) -3 >Emitted(28, 14) Source(23, 6) + SourceIndex(0) -4 >Emitted(28, 16) Source(23, 8) + SourceIndex(0) -5 >Emitted(28, 17) Source(23, 9) + SourceIndex(0) -6 >Emitted(28, 19) Source(23, 9) + SourceIndex(0) -7 >Emitted(28, 22) Source(23, 12) + SourceIndex(0) -8 >Emitted(28, 25) Source(23, 15) + SourceIndex(0) -9 >Emitted(28, 26) Source(23, 16) + SourceIndex(0) +1->Emitted(27, 9) Source(23, 3) + SourceIndex(0) +2 >Emitted(27, 11) Source(23, 3) + SourceIndex(0) +3 >Emitted(27, 14) Source(23, 6) + SourceIndex(0) +4 >Emitted(27, 16) Source(23, 8) + SourceIndex(0) +5 >Emitted(27, 17) Source(23, 9) + SourceIndex(0) +6 >Emitted(27, 19) Source(23, 9) + SourceIndex(0) +7 >Emitted(27, 22) Source(23, 12) + SourceIndex(0) +8 >Emitted(27, 25) Source(23, 15) + SourceIndex(0) +9 >Emitted(27, 26) Source(23, 16) + SourceIndex(0) --- >>> // Emit S.Bar 1 >^^^^^^^^ @@ -452,8 +425,8 @@ sourceFile:file.tsx > > 2 > // Emit S.Bar -1 >Emitted(29, 9) Source(25, 3) + SourceIndex(0) -2 >Emitted(29, 22) Source(25, 16) + SourceIndex(0) +1 >Emitted(28, 9) Source(25, 3) + SourceIndex(0) +2 >Emitted(28, 22) Source(25, 16) + SourceIndex(0) --- >>> S.Bar, ; 1->^^^^^^^^ @@ -476,15 +449,15 @@ sourceFile:file.tsx 7 > Bar 8 > /> 9 > ; -1->Emitted(30, 9) Source(26, 3) + SourceIndex(0) -2 >Emitted(30, 11) Source(26, 3) + SourceIndex(0) -3 >Emitted(30, 14) Source(26, 6) + SourceIndex(0) -4 >Emitted(30, 16) Source(26, 8) + SourceIndex(0) -5 >Emitted(30, 17) Source(26, 9) + SourceIndex(0) -6 >Emitted(30, 19) Source(26, 9) + SourceIndex(0) -7 >Emitted(30, 22) Source(26, 12) + SourceIndex(0) -8 >Emitted(30, 25) Source(26, 15) + SourceIndex(0) -9 >Emitted(30, 26) Source(26, 16) + SourceIndex(0) +1->Emitted(29, 9) Source(26, 3) + SourceIndex(0) +2 >Emitted(29, 11) Source(26, 3) + SourceIndex(0) +3 >Emitted(29, 14) Source(26, 6) + SourceIndex(0) +4 >Emitted(29, 16) Source(26, 8) + SourceIndex(0) +5 >Emitted(29, 17) Source(26, 9) + SourceIndex(0) +6 >Emitted(29, 19) Source(26, 9) + SourceIndex(0) +7 >Emitted(29, 22) Source(26, 12) + SourceIndex(0) +8 >Emitted(29, 25) Source(26, 15) + SourceIndex(0) +9 >Emitted(29, 26) Source(26, 16) + SourceIndex(0) --- >>> })(S = M.S || (M.S = {})); 1->^^^^ @@ -512,15 +485,15 @@ sourceFile:file.tsx > // Emit S.Bar > Bar, ; > } -1->Emitted(31, 5) Source(27, 2) + SourceIndex(0) -2 >Emitted(31, 6) Source(27, 3) + SourceIndex(0) -3 >Emitted(31, 8) Source(21, 16) + SourceIndex(0) -4 >Emitted(31, 9) Source(21, 17) + SourceIndex(0) -5 >Emitted(31, 12) Source(21, 16) + SourceIndex(0) -6 >Emitted(31, 15) Source(21, 17) + SourceIndex(0) -7 >Emitted(31, 20) Source(21, 16) + SourceIndex(0) -8 >Emitted(31, 23) Source(21, 17) + SourceIndex(0) -9 >Emitted(31, 31) Source(27, 3) + SourceIndex(0) +1->Emitted(30, 5) Source(27, 2) + SourceIndex(0) +2 >Emitted(30, 6) Source(27, 3) + SourceIndex(0) +3 >Emitted(30, 8) Source(21, 16) + SourceIndex(0) +4 >Emitted(30, 9) Source(21, 17) + SourceIndex(0) +5 >Emitted(30, 12) Source(21, 16) + SourceIndex(0) +6 >Emitted(30, 15) Source(21, 17) + SourceIndex(0) +7 >Emitted(30, 20) Source(21, 16) + SourceIndex(0) +8 >Emitted(30, 23) Source(21, 17) + SourceIndex(0) +9 >Emitted(30, 31) Source(27, 3) + SourceIndex(0) --- >>>})(M || (M = {})); 1 > @@ -551,45 +524,27 @@ sourceFile:file.tsx > } > > } -1 >Emitted(32, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(32, 2) Source(29, 2) + SourceIndex(0) -3 >Emitted(32, 4) Source(17, 8) + SourceIndex(0) -4 >Emitted(32, 5) Source(17, 9) + SourceIndex(0) -5 >Emitted(32, 10) Source(17, 8) + SourceIndex(0) -6 >Emitted(32, 11) Source(17, 9) + SourceIndex(0) -7 >Emitted(32, 19) Source(29, 2) + SourceIndex(0) +1 >Emitted(31, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(31, 2) Source(29, 2) + SourceIndex(0) +3 >Emitted(31, 4) Source(17, 8) + SourceIndex(0) +4 >Emitted(31, 5) Source(17, 9) + SourceIndex(0) +5 >Emitted(31, 10) Source(17, 8) + SourceIndex(0) +6 >Emitted(31, 11) Source(17, 9) + SourceIndex(0) +7 >Emitted(31, 19) Source(29, 2) + SourceIndex(0) --- ->>>var M; +>>>(function (M) { 1 > -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^-> +2 >^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^-> 1 > > > 2 >module -3 > M -4 > { - > // Emit M.S.Bar - > S.Bar, ; - > } -1 >Emitted(33, 1) Source(31, 1) + SourceIndex(0) -2 >Emitted(33, 5) Source(31, 8) + SourceIndex(0) -3 >Emitted(33, 6) Source(31, 9) + SourceIndex(0) -4 >Emitted(33, 7) Source(34, 2) + SourceIndex(0) ---- ->>>(function (M) { -1-> -2 >^^^^^^^^^^^ -3 > ^ -4 > ^^^^^^^^-> -1-> -2 >module 3 > M -1->Emitted(34, 1) Source(31, 1) + SourceIndex(0) -2 >Emitted(34, 12) Source(31, 8) + SourceIndex(0) -3 >Emitted(34, 13) Source(31, 9) + SourceIndex(0) +1 >Emitted(32, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(32, 12) Source(31, 8) + SourceIndex(0) +3 >Emitted(32, 13) Source(31, 9) + SourceIndex(0) --- >>> // Emit M.S.Bar 1->^^^^ @@ -598,8 +553,8 @@ sourceFile:file.tsx 1-> { > 2 > // Emit M.S.Bar -1->Emitted(35, 5) Source(32, 2) + SourceIndex(0) -2 >Emitted(35, 20) Source(32, 17) + SourceIndex(0) +1->Emitted(33, 5) Source(32, 2) + SourceIndex(0) +2 >Emitted(33, 20) Source(32, 17) + SourceIndex(0) --- >>> M.S.Bar, ; 1->^^^^ @@ -629,19 +584,19 @@ sourceFile:file.tsx 11> Bar 12> /> 13> ; -1->Emitted(36, 5) Source(33, 2) + SourceIndex(0) -2 >Emitted(36, 7) Source(33, 2) + SourceIndex(0) -3 >Emitted(36, 8) Source(33, 3) + SourceIndex(0) -4 >Emitted(36, 9) Source(33, 4) + SourceIndex(0) -5 >Emitted(36, 12) Source(33, 7) + SourceIndex(0) -6 >Emitted(36, 14) Source(33, 9) + SourceIndex(0) -7 >Emitted(36, 15) Source(33, 10) + SourceIndex(0) -8 >Emitted(36, 17) Source(33, 10) + SourceIndex(0) -9 >Emitted(36, 18) Source(33, 11) + SourceIndex(0) -10>Emitted(36, 19) Source(33, 12) + SourceIndex(0) -11>Emitted(36, 22) Source(33, 15) + SourceIndex(0) -12>Emitted(36, 25) Source(33, 18) + SourceIndex(0) -13>Emitted(36, 26) Source(33, 19) + SourceIndex(0) +1->Emitted(34, 5) Source(33, 2) + SourceIndex(0) +2 >Emitted(34, 7) Source(33, 2) + SourceIndex(0) +3 >Emitted(34, 8) Source(33, 3) + SourceIndex(0) +4 >Emitted(34, 9) Source(33, 4) + SourceIndex(0) +5 >Emitted(34, 12) Source(33, 7) + SourceIndex(0) +6 >Emitted(34, 14) Source(33, 9) + SourceIndex(0) +7 >Emitted(34, 15) Source(33, 10) + SourceIndex(0) +8 >Emitted(34, 17) Source(33, 10) + SourceIndex(0) +9 >Emitted(34, 18) Source(33, 11) + SourceIndex(0) +10>Emitted(34, 19) Source(33, 12) + SourceIndex(0) +11>Emitted(34, 22) Source(33, 15) + SourceIndex(0) +12>Emitted(34, 25) Source(33, 18) + SourceIndex(0) +13>Emitted(34, 26) Source(33, 19) + SourceIndex(0) --- >>>})(M || (M = {})); 1 > @@ -662,46 +617,27 @@ sourceFile:file.tsx > // Emit M.S.Bar > S.Bar, ; > } -1 >Emitted(37, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(37, 2) Source(34, 2) + SourceIndex(0) -3 >Emitted(37, 4) Source(31, 8) + SourceIndex(0) -4 >Emitted(37, 5) Source(31, 9) + SourceIndex(0) -5 >Emitted(37, 10) Source(31, 8) + SourceIndex(0) -6 >Emitted(37, 11) Source(31, 9) + SourceIndex(0) -7 >Emitted(37, 19) Source(34, 2) + SourceIndex(0) +1 >Emitted(35, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(34, 2) + SourceIndex(0) +3 >Emitted(35, 4) Source(31, 8) + SourceIndex(0) +4 >Emitted(35, 5) Source(31, 9) + SourceIndex(0) +5 >Emitted(35, 10) Source(31, 8) + SourceIndex(0) +6 >Emitted(35, 11) Source(31, 9) + SourceIndex(0) +7 >Emitted(35, 19) Source(34, 2) + SourceIndex(0) --- ->>>var M; +>>>(function (M_1) { 1 > -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^-> +2 >^^^^^^^^^^^ +3 > ^^^ +4 > ^^^-> 1 > > > 2 >module -3 > M -4 > { - > var M = 100; - > // Emit M_1.Foo - > Foo, ; - > } -1 >Emitted(38, 1) Source(36, 1) + SourceIndex(0) -2 >Emitted(38, 5) Source(36, 8) + SourceIndex(0) -3 >Emitted(38, 6) Source(36, 9) + SourceIndex(0) -4 >Emitted(38, 7) Source(40, 2) + SourceIndex(0) ---- ->>>(function (M_1) { -1-> -2 >^^^^^^^^^^^ -3 > ^^^ -4 > ^^^-> -1-> -2 >module 3 > M -1->Emitted(39, 1) Source(36, 1) + SourceIndex(0) -2 >Emitted(39, 12) Source(36, 8) + SourceIndex(0) -3 >Emitted(39, 15) Source(36, 9) + SourceIndex(0) +1 >Emitted(36, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(36, 12) Source(36, 8) + SourceIndex(0) +3 >Emitted(36, 15) Source(36, 9) + SourceIndex(0) --- >>> var M = 100; 1->^^^^ @@ -718,12 +654,12 @@ sourceFile:file.tsx 4 > = 5 > 100 6 > ; -1->Emitted(40, 5) Source(37, 2) + SourceIndex(0) -2 >Emitted(40, 9) Source(37, 6) + SourceIndex(0) -3 >Emitted(40, 10) Source(37, 7) + SourceIndex(0) -4 >Emitted(40, 13) Source(37, 10) + SourceIndex(0) -5 >Emitted(40, 16) Source(37, 13) + SourceIndex(0) -6 >Emitted(40, 17) Source(37, 14) + SourceIndex(0) +1->Emitted(37, 5) Source(37, 2) + SourceIndex(0) +2 >Emitted(37, 9) Source(37, 6) + SourceIndex(0) +3 >Emitted(37, 10) Source(37, 7) + SourceIndex(0) +4 >Emitted(37, 13) Source(37, 10) + SourceIndex(0) +5 >Emitted(37, 16) Source(37, 13) + SourceIndex(0) +6 >Emitted(37, 17) Source(37, 14) + SourceIndex(0) --- >>> // Emit M_1.Foo 1->^^^^ @@ -732,8 +668,8 @@ sourceFile:file.tsx 1-> > 2 > // Emit M_1.Foo -1->Emitted(41, 5) Source(38, 2) + SourceIndex(0) -2 >Emitted(41, 20) Source(38, 17) + SourceIndex(0) +1->Emitted(38, 5) Source(38, 2) + SourceIndex(0) +2 >Emitted(38, 20) Source(38, 17) + SourceIndex(0) --- >>> M_1.Foo, ; 1->^^^^ @@ -755,15 +691,15 @@ sourceFile:file.tsx 7 > Foo 8 > /> 9 > ; -1->Emitted(42, 5) Source(39, 2) + SourceIndex(0) -2 >Emitted(42, 9) Source(39, 2) + SourceIndex(0) -3 >Emitted(42, 12) Source(39, 5) + SourceIndex(0) -4 >Emitted(42, 14) Source(39, 7) + SourceIndex(0) -5 >Emitted(42, 15) Source(39, 8) + SourceIndex(0) -6 >Emitted(42, 19) Source(39, 8) + SourceIndex(0) -7 >Emitted(42, 22) Source(39, 11) + SourceIndex(0) -8 >Emitted(42, 25) Source(39, 14) + SourceIndex(0) -9 >Emitted(42, 26) Source(39, 15) + SourceIndex(0) +1->Emitted(39, 5) Source(39, 2) + SourceIndex(0) +2 >Emitted(39, 9) Source(39, 2) + SourceIndex(0) +3 >Emitted(39, 12) Source(39, 5) + SourceIndex(0) +4 >Emitted(39, 14) Source(39, 7) + SourceIndex(0) +5 >Emitted(39, 15) Source(39, 8) + SourceIndex(0) +6 >Emitted(39, 19) Source(39, 8) + SourceIndex(0) +7 >Emitted(39, 22) Source(39, 11) + SourceIndex(0) +8 >Emitted(39, 25) Source(39, 14) + SourceIndex(0) +9 >Emitted(39, 26) Source(39, 15) + SourceIndex(0) --- >>>})(M || (M = {})); 1 > @@ -786,12 +722,12 @@ sourceFile:file.tsx > // Emit M_1.Foo > Foo, ; > } -1 >Emitted(43, 1) Source(40, 1) + SourceIndex(0) -2 >Emitted(43, 2) Source(40, 2) + SourceIndex(0) -3 >Emitted(43, 4) Source(36, 8) + SourceIndex(0) -4 >Emitted(43, 5) Source(36, 9) + SourceIndex(0) -5 >Emitted(43, 10) Source(36, 8) + SourceIndex(0) -6 >Emitted(43, 11) Source(36, 9) + SourceIndex(0) -7 >Emitted(43, 19) Source(40, 2) + SourceIndex(0) +1 >Emitted(40, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(40, 2) Source(40, 2) + SourceIndex(0) +3 >Emitted(40, 4) Source(36, 8) + SourceIndex(0) +4 >Emitted(40, 5) Source(36, 9) + SourceIndex(0) +5 >Emitted(40, 10) Source(36, 8) + SourceIndex(0) +6 >Emitted(40, 11) Source(36, 9) + SourceIndex(0) +7 >Emitted(40, 19) Source(40, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=file.jsx.map \ No newline at end of file diff --git a/tests/baselines/reference/tsxPreserveEmit1.js b/tests/baselines/reference/tsxPreserveEmit1.js index b9a7d369fc0..feb314ee2e6 100644 --- a/tests/baselines/reference/tsxPreserveEmit1.js +++ b/tests/baselines/reference/tsxPreserveEmit1.js @@ -41,7 +41,6 @@ define(["require", "exports", "react", "react-router"], function (require, expor var M; (function (M) { })(M || (M = {})); - var M; (function (M) { // Should emit 'M.X' in both opening and closing tags var y = ; diff --git a/tests/baselines/reference/tsxReactEmit6.js b/tests/baselines/reference/tsxReactEmit6.js index a85c6baa687..85aa8c123c9 100644 --- a/tests/baselines/reference/tsxReactEmit6.js +++ b/tests/baselines/reference/tsxReactEmit6.js @@ -39,7 +39,6 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { var M; (function (M) { })(M || (M = {})); -var M; (function (M) { // Should emit M.React.createElement // and M.React.__spread diff --git a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.js b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.js index 391c9c1679a..b803071d27f 100644 --- a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.js +++ b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.js @@ -15,7 +15,6 @@ var E; (function (E) { E[E["a"] = 0] = "a"; })(E || (E = {})); -var E; (function (E) { E[E["b"] = 1] = "b"; })(E || (E = {})); diff --git a/tests/baselines/reference/typeofANonExportedType.js b/tests/baselines/reference/typeofANonExportedType.js index 76e908e622d..5c99948e9c9 100644 --- a/tests/baselines/reference/typeofANonExportedType.js +++ b/tests/baselines/reference/typeofANonExportedType.js @@ -77,7 +77,6 @@ var E; E[E["A"] = 0] = "A"; })(E || (E = {})); function foo() { } -var foo; (function (foo) { foo.y = 1; var C = (function () { diff --git a/tests/baselines/reference/typeofAnExportedType.js b/tests/baselines/reference/typeofAnExportedType.js index 0930039d253..91b19d9bebd 100644 --- a/tests/baselines/reference/typeofAnExportedType.js +++ b/tests/baselines/reference/typeofAnExportedType.js @@ -80,7 +80,6 @@ exports.Z = M; var E = exports.E; function foo() { } exports.foo = foo; -var foo; (function (foo) { foo.y = 1; var C = (function () { diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js index 513464daa85..2f78fd11797 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -250,7 +250,6 @@ var D11 = (function (_super) { return D11; }(Base)); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -266,7 +265,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/undefinedTypeAssignment4.js b/tests/baselines/reference/undefinedTypeAssignment4.js index a5d7a117a9d..575042b72c0 100644 --- a/tests/baselines/reference/undefinedTypeAssignment4.js +++ b/tests/baselines/reference/undefinedTypeAssignment4.js @@ -18,7 +18,6 @@ var undefined = (function () { } return undefined; }()); -var undefined; (function (undefined) { undefined.x = 42; })(undefined || (undefined = {})); diff --git a/tests/baselines/reference/unexportedInstanceClassVariables.js b/tests/baselines/reference/unexportedInstanceClassVariables.js index 7ac4f6d1b16..5cb0723931a 100644 --- a/tests/baselines/reference/unexportedInstanceClassVariables.js +++ b/tests/baselines/reference/unexportedInstanceClassVariables.js @@ -21,7 +21,6 @@ var M; return A; }()); })(M || (M = {})); -var M; (function (M) { var A = (function () { function A() { diff --git a/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.js b/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.js index c1c6918c770..a8cc0e12d27 100644 --- a/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.js +++ b/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.js @@ -164,7 +164,6 @@ var E2; E2[E2["A"] = 0] = "A"; })(E2 || (E2 = {})); function f() { } -var f; (function (f) { f.bar = 1; })(f || (f = {})); @@ -173,7 +172,6 @@ var c = (function () { } return c; }()); -var c; (function (c) { c.bar = 1; })(c || (c = {})); diff --git a/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.js b/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.js index 870b01eda8e..db5bad4009a 100644 --- a/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.js +++ b/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.js @@ -13,7 +13,6 @@ var M1; M1.q = 5; M1.s = ''; })(M1 || (M1 = {})); -var M1; (function (M1) { M1.q = M1.s; // Should be an error but isn't })(M1 || (M1 = {})); diff --git a/tests/cases/compiler/es6modulekindWithES5Target12.ts b/tests/cases/compiler/es6modulekindWithES5Target12.ts new file mode 100644 index 00000000000..3bca121a57d --- /dev/null +++ b/tests/cases/compiler/es6modulekindWithES5Target12.ts @@ -0,0 +1,39 @@ +// @target: es5 +// @module: es2015 + +export class C { +} + +export namespace C { + export const x = 1; +} + +export enum E { + w = 1 +} + +export enum E { + x = 2 +} + +export namespace E { + export const y = 1; +} + +export namespace E { + export const z = 1; +} + +export namespace N { +} + +export namespace N { + export const x = 1; +} + +export function F() { +} + +export namespace F { + export const x = 1; +} \ No newline at end of file