From be78569c508ec3653189c590ac2ab033b64fb3a9 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 19 Mar 2025 21:25:37 -0400 Subject: [PATCH] Fix hierarchy tracking in runtimesyntax transformer --- internal/transformers/runtimesyntax.go | 9 +-- internal/transformers/runtimesyntax_test.go | 7 +++ .../accessOverriddenBaseClassMember1.js | 2 +- .../accessOverriddenBaseClassMember1.js.diff | 2 +- .../reference/submodule/compiler/autolift4.js | 2 +- .../submodule/compiler/autolift4.js.diff | 2 +- .../reference/submodule/compiler/baseCheck.js | 6 +- .../submodule/compiler/baseCheck.js.diff | 6 +- .../compiler/classSideInheritance3.js | 2 +- .../compiler/classSideInheritance3.js.diff | 2 +- .../submodule/compiler/classUpdateTests.js | 8 +-- .../compiler/classUpdateTests.js.diff | 8 +-- ...perAndPropertyNameAsConstuctorParameter.js | 4 +- ...dPropertyNameAsConstuctorParameter.js.diff | 4 +- .../submodule/compiler/constructorArgs.js | 2 +- .../compiler/constructorArgs.js.diff | 2 +- ...BeforeEmitParameterPropertyDeclaration1.js | 2 +- ...eEmitParameterPropertyDeclaration1.js.diff | 2 +- ...oreEmitParameterPropertyDeclaration1ES6.js | 2 +- ...itParameterPropertyDeclaration1ES6.js.diff | 4 +- ...arationAndParameterPropertyDeclaration1.js | 2 +- ...onAndParameterPropertyDeclaration1.js.diff | 2 +- ...tionAndParameterPropertyDeclaration1ES6.js | 2 +- ...ndParameterPropertyDeclaration1ES6.js.diff | 3 +- .../submodule/compiler/es6ClassTest.js | 2 +- .../submodule/compiler/es6ClassTest.js.diff | 2 +- ...objectCreationOfElementAccessExpression.js | 12 ++-- ...tCreationOfElementAccessExpression.js.diff | 12 ++-- .../compiler/optionalParameterProperty.js | 2 +- .../optionalParameterProperty.js.diff | 2 +- ...meterPropertyInConstructorWithPrologues.js | 4 +- ...PropertyInConstructorWithPrologues.js.diff | 4 +- .../submodule/compiler/superAccess2.js | 2 +- .../submodule/compiler/superAccess2.js.diff | 2 +- .../submodule/compiler/thisInSuperCall.js | 2 +- .../compiler/thisInSuperCall.js.diff | 2 +- .../submodule/compiler/thisInSuperCall1.js | 2 +- .../compiler/thisInSuperCall1.js.diff | 2 +- .../compiler/unspecializedConstraints.js | 6 +- .../compiler/unspecializedConstraints.js.diff | 6 +- .../classConstructorAccessibility2.js | 6 +- .../classConstructorAccessibility2.js.diff | 6 +- ...lassConstructorParametersAccessibility3.js | 2 +- ...onstructorParametersAccessibility3.js.diff | 2 +- .../conformance/defineProperty(target=es5).js | 2 +- .../defineProperty(target=es5).js.diff | 2 +- .../defineProperty(target=esnext).js | 2 +- .../defineProperty(target=esnext).js.diff | 12 ---- .../derivedClassParameterProperties.js | 4 +- .../derivedClassParameterProperties.js.diff | 4 +- .../derivedClassSuperCallsWithThisArg.js | 6 +- .../derivedClassSuperCallsWithThisArg.js.diff | 6 +- .../emitStatementsBeforeSuperCall.js | 4 +- .../emitStatementsBeforeSuperCall.js.diff | 9 +-- ...atementsBeforeSuperCallWithDefineFields.js | 4 +- ...ntsBeforeSuperCallWithDefineFields.js.diff | 4 +- .../conformance/mixinClassesAnnotated.js | 2 +- .../conformance/mixinClassesAnnotated.js.diff | 2 +- .../conformance/mixinClassesAnonymous.js | 2 +- .../conformance/mixinClassesAnonymous.js.diff | 2 +- .../submodule/conformance/override11.js | 2 +- .../submodule/conformance/override11.js.diff | 2 +- .../submodule/conformance/override6.js | 2 +- .../submodule/conformance/override6.js.diff | 2 +- .../submodule/conformance/override8.js | 4 +- .../submodule/conformance/override8.js.diff | 4 +- .../conformance/overrideParameterProperty.js | 8 +-- .../overrideParameterProperty.js.diff | 8 +-- .../conformance/parserRealSource10.js | 12 ++-- .../conformance/parserRealSource10.js.diff | 12 ++-- .../conformance/parserRealSource11.js | 62 +++++++++---------- .../conformance/parserRealSource11.js.diff | 62 +++++++++---------- .../propertyOverridesAccessors5.js | 2 +- .../propertyOverridesAccessors5.js.diff | 11 ---- .../readonlyConstructorAssignment.js | 4 +- .../readonlyConstructorAssignment.js.diff | 4 +- .../redefinedPararameterProperty.js | 2 +- .../redefinedPararameterProperty.js.diff | 11 ---- .../submodule/conformance/superCalls.js | 2 +- .../submodule/conformance/superCalls.js.diff | 2 +- .../conformance/typeGuardOfFormThisMember.js | 2 +- .../typeGuardOfFormThisMember.js.diff | 2 +- .../typeGuardOfFormThisMemberErrors.js | 2 +- .../typeGuardOfFormThisMemberErrors.js.diff | 2 +- .../conformance/usingDeclarations.11.js | 4 +- .../conformance/usingDeclarations.11.js.diff | 4 +- 86 files changed, 214 insertions(+), 254 deletions(-) delete mode 100644 testdata/baselines/reference/submodule/conformance/defineProperty(target=esnext).js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/propertyOverridesAccessors5.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/redefinedPararameterProperty.js.diff diff --git a/internal/transformers/runtimesyntax.go b/internal/transformers/runtimesyntax.go index bb28bca6e2..101750b276 100644 --- a/internal/transformers/runtimesyntax.go +++ b/internal/transformers/runtimesyntax.go @@ -80,6 +80,8 @@ func (tx *RuntimeSyntaxTransformer) popScope(savedCurrentScope *ast.Node, savedC func (tx *RuntimeSyntaxTransformer) visit(node *ast.Node) *ast.Node { savedCurrentScope, savedCurrentScopeFirstDeclarationsOfName := tx.pushScope(node) grandparentNode := tx.pushNode(node) + defer tx.popNode(grandparentNode) + defer tx.popScope(savedCurrentScope, savedCurrentScopeFirstDeclarationsOfName) switch node.Kind { // TypeScript parameter property modifiers are elided @@ -88,7 +90,7 @@ func (tx *RuntimeSyntaxTransformer) visit(node *ast.Node) *ast.Node { ast.KindProtectedKeyword, ast.KindReadonlyKeyword, ast.KindOverrideKeyword: - return nil + node = nil case ast.KindEnumDeclaration: node = tx.visitEnumDeclaration(node.AsEnumDeclaration()) case ast.KindModuleDeclaration: @@ -112,9 +114,6 @@ func (tx *RuntimeSyntaxTransformer) visit(node *ast.Node) *ast.Node { default: node = tx.visitor.VisitEachChild(node) } - - tx.popNode(grandparentNode) - tx.popScope(savedCurrentScope, savedCurrentScopeFirstDeclarationsOfName) return node } @@ -830,7 +829,6 @@ func (tx *RuntimeSyntaxTransformer) visitConstructorBody(body *ast.Block, constr return tx.emitContext.VisitFunctionBody(body.AsNode(), tx.visitor) } - grandparentOfConstructor := tx.pushNode(constructor) grandparentOfBody := tx.pushNode(body.AsNode()) savedCurrentScope, savedCurrentScopeFirstDeclarationsOfName := tx.pushScope(body.AsNode()) @@ -896,7 +894,6 @@ func (tx *RuntimeSyntaxTransformer) visitConstructorBody(body *ast.Block, constr tx.popScope(savedCurrentScope, savedCurrentScopeFirstDeclarationsOfName) tx.popNode(grandparentOfBody) - tx.popNode(grandparentOfConstructor) updated := tx.factory.NewBlock(statementList /*multiline*/, true) tx.emitContext.SetOriginal(updated, body.AsNode()) updated.Loc = body.Loc diff --git a/internal/transformers/runtimesyntax_test.go b/internal/transformers/runtimesyntax_test.go index 49df59fb3c..ab15428f7d 100644 --- a/internal/transformers/runtimesyntax_test.go +++ b/internal/transformers/runtimesyntax_test.go @@ -431,6 +431,13 @@ func TestParameterPropertyTransformer(t *testing.T) { constructor(x) { this.x = x; } +}`}, + {title: "parameter properties #2", input: "class C extends B { constructor(public x) { super(); } }", output: `class C extends B { + x; + constructor(x) { + super(); + this.x = x; + } }`}, } diff --git a/testdata/baselines/reference/submodule/compiler/accessOverriddenBaseClassMember1.js b/testdata/baselines/reference/submodule/compiler/accessOverriddenBaseClassMember1.js index b8766fae3b..fb58e5c8b1 100644 --- a/testdata/baselines/reference/submodule/compiler/accessOverriddenBaseClassMember1.js +++ b/testdata/baselines/reference/submodule/compiler/accessOverriddenBaseClassMember1.js @@ -32,8 +32,8 @@ class Point { class ColoredPoint extends Point { color; constructor(x, y, color) { - this.color = color; super(x, y); + this.color = color; } toString() { return super.toString() + " color=" + this.color; diff --git a/testdata/baselines/reference/submodule/compiler/accessOverriddenBaseClassMember1.js.diff b/testdata/baselines/reference/submodule/compiler/accessOverriddenBaseClassMember1.js.diff index 35643ce7cd..13b0bd5ee6 100644 --- a/testdata/baselines/reference/submodule/compiler/accessOverriddenBaseClassMember1.js.diff +++ b/testdata/baselines/reference/submodule/compiler/accessOverriddenBaseClassMember1.js.diff @@ -50,8 +50,8 @@ +class ColoredPoint extends Point { + color; + constructor(x, y, color) { -+ this.color = color; + super(x, y); ++ this.color = color; + } + toString() { + return super.toString() + " color=" + this.color; diff --git a/testdata/baselines/reference/submodule/compiler/autolift4.js b/testdata/baselines/reference/submodule/compiler/autolift4.js index 5dd338714a..48938fc955 100644 --- a/testdata/baselines/reference/submodule/compiler/autolift4.js +++ b/testdata/baselines/reference/submodule/compiler/autolift4.js @@ -41,8 +41,8 @@ class Point { class Point3D extends Point { z; constructor(x, y, z, m) { - this.z = z; super(x, y); + this.z = z; } getDist() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.m); diff --git a/testdata/baselines/reference/submodule/compiler/autolift4.js.diff b/testdata/baselines/reference/submodule/compiler/autolift4.js.diff index 5086b64c22..c916c9aaae 100644 --- a/testdata/baselines/reference/submodule/compiler/autolift4.js.diff +++ b/testdata/baselines/reference/submodule/compiler/autolift4.js.diff @@ -48,8 +48,8 @@ +class Point3D extends Point { + z; + constructor(x, y, z, m) { -+ this.z = z; + super(x, y); ++ this.z = z; + } + getDist() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.m); diff --git a/testdata/baselines/reference/submodule/compiler/baseCheck.js b/testdata/baselines/reference/submodule/compiler/baseCheck.js index edd75e7b35..576e0887c0 100644 --- a/testdata/baselines/reference/submodule/compiler/baseCheck.js +++ b/testdata/baselines/reference/submodule/compiler/baseCheck.js @@ -51,22 +51,22 @@ class ELocVar extends C { class D extends C { z; constructor(z) { - this.z = z; super(this.z); + this.z = z; } } // too few params class E extends C { z; constructor(z) { - this.z = z; super(0, this.z); + this.z = z; } } class F extends C { z; constructor(z) { - this.z = z; super("hello", this.z); + this.z = z; } } // first param type function f() { diff --git a/testdata/baselines/reference/submodule/compiler/baseCheck.js.diff b/testdata/baselines/reference/submodule/compiler/baseCheck.js.diff index aa27516a5b..246cd1090d 100644 --- a/testdata/baselines/reference/submodule/compiler/baseCheck.js.diff +++ b/testdata/baselines/reference/submodule/compiler/baseCheck.js.diff @@ -71,8 +71,8 @@ +class D extends C { + z; + constructor(z) { -+ this.z = z; + super(this.z); ++ this.z = z; } - return E; -}(C)); @@ -86,8 +86,8 @@ +class E extends C { + z; + constructor(z) { -+ this.z = z; + super(0, this.z); ++ this.z = z; } - return F; -}(C)); // first param type @@ -95,8 +95,8 @@ +class F extends C { + z; + constructor(z) { -+ this.z = z; + super("hello", this.z); ++ this.z = z; + } +} // first param type function f() { diff --git a/testdata/baselines/reference/submodule/compiler/classSideInheritance3.js b/testdata/baselines/reference/submodule/compiler/classSideInheritance3.js index cec10e1b43..10474f1498 100644 --- a/testdata/baselines/reference/submodule/compiler/classSideInheritance3.js +++ b/testdata/baselines/reference/submodule/compiler/classSideInheritance3.js @@ -30,8 +30,8 @@ class A { class B extends A { data; constructor(x, data) { - this.data = data; super(x); + this.data = data; } } class C extends A { diff --git a/testdata/baselines/reference/submodule/compiler/classSideInheritance3.js.diff b/testdata/baselines/reference/submodule/compiler/classSideInheritance3.js.diff index 49389bbf37..f95e2a999a 100644 --- a/testdata/baselines/reference/submodule/compiler/classSideInheritance3.js.diff +++ b/testdata/baselines/reference/submodule/compiler/classSideInheritance3.js.diff @@ -38,8 +38,8 @@ +class B extends A { + data; + constructor(x, data) { -+ this.data = data; + super(x); ++ this.data = data; } - return B; -}(A)); diff --git a/testdata/baselines/reference/submodule/compiler/classUpdateTests.js b/testdata/baselines/reference/submodule/compiler/classUpdateTests.js index bebc54b847..b807f4f074 100644 --- a/testdata/baselines/reference/submodule/compiler/classUpdateTests.js +++ b/testdata/baselines/reference/submodule/compiler/classUpdateTests.js @@ -162,31 +162,31 @@ class I extends Object { class J extends G { p1; constructor(p1) { - this.p1 = p1; super(); // NO ERROR + this.p1 = p1; } } class K extends G { p1; constructor(p1) { - this.p1 = p1; var i = 0; super(); + this.p1 = p1; } } class L extends G { p1; constructor(p1) { - this.p1 = p1; super(); // NO ERROR + this.p1 = p1; } } class M extends G { p1; constructor(p1) { - this.p1 = p1; var i = 0; super(); + this.p1 = p1; } } // diff --git a/testdata/baselines/reference/submodule/compiler/classUpdateTests.js.diff b/testdata/baselines/reference/submodule/compiler/classUpdateTests.js.diff index 2f90b443ca..ae93ab642f 100644 --- a/testdata/baselines/reference/submodule/compiler/classUpdateTests.js.diff +++ b/testdata/baselines/reference/submodule/compiler/classUpdateTests.js.diff @@ -88,8 +88,8 @@ +class J extends G { + p1; + constructor(p1) { -+ this.p1 = p1; + super(); // NO ERROR ++ this.p1 = p1; } - return D; -}()); @@ -149,12 +149,12 @@ +class K extends G { + p1; + constructor(p1) { -+ this.p1 = p1; var i = 0; - _this = _super.call(this) || this; - _this.p1 = p1; - return _this; + super(); ++ this.p1 = p1; } - return K; -}(G)); @@ -168,8 +168,8 @@ +class L extends G { + p1; + constructor(p1) { -+ this.p1 = p1; + super(); // NO ERROR ++ this.p1 = p1; } - return L; -}(G)); @@ -181,12 +181,12 @@ +class M extends G { + p1; + constructor(p1) { -+ this.p1 = p1; var i = 0; - _this = _super.call(this) || this; - _this.p1 = p1; - return _this; + super(); ++ this.p1 = p1; } - return M; -}(G)); diff --git a/testdata/baselines/reference/submodule/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.js b/testdata/baselines/reference/submodule/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.js index bbf66dbd08..cf78bf277c 100644 --- a/testdata/baselines/reference/submodule/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/testdata/baselines/reference/submodule/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -43,8 +43,8 @@ class b1 extends a { class b2 extends a { _super; constructor(_super) { - this._super = _super; super(); + this._super = _super; } } class b3 extends a { @@ -55,7 +55,7 @@ class b3 extends a { class b4 extends a { _super; constructor(_super) { - this._super = _super; super(); + this._super = _super; } } diff --git a/testdata/baselines/reference/submodule/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.js.diff b/testdata/baselines/reference/submodule/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.js.diff index 0578a11653..800ddca754 100644 --- a/testdata/baselines/reference/submodule/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.js.diff +++ b/testdata/baselines/reference/submodule/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.js.diff @@ -37,8 +37,8 @@ +class b2 extends a { + _super; + constructor(_super) { -+ this._super = _super; + super(); ++ this._super = _super; } - return b1; -}(a)); @@ -63,8 +63,8 @@ +class b4 extends a { + _super; + constructor(_super) { -+ this._super = _super; + super(); ++ this._super = _super; } - return b3; -}(a)); diff --git a/testdata/baselines/reference/submodule/compiler/constructorArgs.js b/testdata/baselines/reference/submodule/compiler/constructorArgs.js index d0d788c4cb..a2b8155268 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorArgs.js +++ b/testdata/baselines/reference/submodule/compiler/constructorArgs.js @@ -25,7 +25,7 @@ class Super { class Sub extends Super { options; constructor(options) { - this.options = options; super(options.value); + this.options = options; } } diff --git a/testdata/baselines/reference/submodule/compiler/constructorArgs.js.diff b/testdata/baselines/reference/submodule/compiler/constructorArgs.js.diff index b9d5e5f28f..f0a0ffbfbe 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorArgs.js.diff +++ b/testdata/baselines/reference/submodule/compiler/constructorArgs.js.diff @@ -36,8 +36,8 @@ +class Sub extends Super { + options; + constructor(options) { -+ this.options = options; + super(options.value); ++ this.options = options; } - return Sub; -}(Super)); diff --git a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index d535fc0232..06d18caa72 100644 --- a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -26,7 +26,7 @@ class B extends A { 'someStringForEgngInject'; "use strict"; 'someStringForEgngInject'; - this.x = x; super(); + this.x = x; } } diff --git a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js.diff b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js.diff index 9393fceddd..aef5bc1375 100644 --- a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js.diff +++ b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js.diff @@ -41,8 +41,8 @@ - return _this; + "use strict"; + 'someStringForEgngInject'; -+ this.x = x; + super(); ++ this.x = x; } - return B; -}(A)); diff --git a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js index e8e798821a..5be2f066d1 100644 --- a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js +++ b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js @@ -26,7 +26,7 @@ class B extends A { 'someStringForEgngInject'; "use strict"; 'someStringForEgngInject'; - this.x = x; super(); + this.x = x; } } diff --git a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js.diff b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js.diff index 6264f24eb9..0456ffd36c 100644 --- a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js.diff +++ b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.js.diff @@ -14,10 +14,8 @@ constructor(x) { "use strict"; 'someStringForEgngInject'; -- super(); + "use strict"; + 'someStringForEgngInject'; + super(); this.x = x; -+ super(); } - } diff --git a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js index b259bde735..a4abe58369 100644 --- a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -27,7 +27,7 @@ class B extends A { 'someStringForEgngInject'; "use strict"; 'someStringForEgngInject'; - this.x = x; super(); + this.x = x; } } diff --git a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js.diff b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js.diff index 69e681bb70..7b212fe347 100644 --- a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js.diff +++ b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js.diff @@ -43,8 +43,8 @@ - return _this; + "use strict"; + 'someStringForEgngInject'; -+ this.x = x; + super(); ++ this.x = x; } - return B; -}(A)); diff --git a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js index e9289d90bf..59e9a7401f 100644 --- a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js +++ b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js @@ -27,7 +27,7 @@ class B extends A { 'someStringForEgngInject'; "use strict"; 'someStringForEgngInject'; - this.x = x; super(); + this.x = x; } } diff --git a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js.diff b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js.diff index 806dae1b76..22a516dcba 100644 --- a/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js.diff +++ b/testdata/baselines/reference/submodule/compiler/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.js.diff @@ -15,11 +15,10 @@ constructor(x) { "use strict"; 'someStringForEgngInject'; -- super(); + "use strict"; + 'someStringForEgngInject'; + super(); this.x = x; - this.blah = 2; -+ super(); } } diff --git a/testdata/baselines/reference/submodule/compiler/es6ClassTest.js b/testdata/baselines/reference/submodule/compiler/es6ClassTest.js index 1eebb53af9..63613680e5 100644 --- a/testdata/baselines/reference/submodule/compiler/es6ClassTest.js +++ b/testdata/baselines/reference/submodule/compiler/es6ClassTest.js @@ -106,9 +106,9 @@ class Foo extends Bar { boo(x) { return x; } static statVal = 0; constructor(x, y, z = 0) { + super(x); this.y = y; this.z = z; - super(x); this.x = x; this.gar = 5; } diff --git a/testdata/baselines/reference/submodule/compiler/es6ClassTest.js.diff b/testdata/baselines/reference/submodule/compiler/es6ClassTest.js.diff index e47c6e1754..1a32da4519 100644 --- a/testdata/baselines/reference/submodule/compiler/es6ClassTest.js.diff +++ b/testdata/baselines/reference/submodule/compiler/es6ClassTest.js.diff @@ -57,9 +57,9 @@ + boo(x) { return x; } + static statVal = 0; + constructor(x, y, z = 0) { ++ super(x); + this.y = y; + this.z = z; -+ super(x); + this.x = x; + this.gar = 5; } diff --git a/testdata/baselines/reference/submodule/compiler/objectCreationOfElementAccessExpression.js b/testdata/baselines/reference/submodule/compiler/objectCreationOfElementAccessExpression.js index cefae94fc9..544d65e0ba 100644 --- a/testdata/baselines/reference/submodule/compiler/objectCreationOfElementAccessExpression.js +++ b/testdata/baselines/reference/submodule/compiler/objectCreationOfElementAccessExpression.js @@ -79,48 +79,48 @@ class Food { class MonsterFood extends Food { flavor; constructor(name, flavor) { - this.flavor = flavor; super(name); + this.flavor = flavor; } } class IceCream extends MonsterFood { flavor; isDairyFree; constructor(flavor) { - this.flavor = flavor; super("Ice Cream", flavor); + this.flavor = flavor; } } class Cookie extends MonsterFood { flavor; isGlutenFree; constructor(flavor, isGlutenFree) { + super("Cookie", flavor); this.flavor = flavor; this.isGlutenFree = isGlutenFree; - super("Cookie", flavor); } } class PetFood extends Food { whereToBuy; constructor(name, whereToBuy) { - this.whereToBuy = whereToBuy; super(name); + this.whereToBuy = whereToBuy; } } class ExpensiveOrganicDogFood extends PetFood { whereToBuy; constructor(whereToBuy) { - this.whereToBuy = whereToBuy; super("Origen", whereToBuy); + this.whereToBuy = whereToBuy; } } class ExpensiveOrganicCatFood extends PetFood { whereToBuy; containsFish; constructor(whereToBuy, containsFish) { + super("Nature's Logic", whereToBuy); this.whereToBuy = whereToBuy; this.containsFish = containsFish; - super("Nature's Logic", whereToBuy); } } class Slug { diff --git a/testdata/baselines/reference/submodule/compiler/objectCreationOfElementAccessExpression.js.diff b/testdata/baselines/reference/submodule/compiler/objectCreationOfElementAccessExpression.js.diff index 329715353c..e7aaf97366 100644 --- a/testdata/baselines/reference/submodule/compiler/objectCreationOfElementAccessExpression.js.diff +++ b/testdata/baselines/reference/submodule/compiler/objectCreationOfElementAccessExpression.js.diff @@ -59,8 +59,8 @@ +class MonsterFood extends Food { + flavor; + constructor(name, flavor) { -+ this.flavor = flavor; + super(name); ++ this.flavor = flavor; } - return IceCream; -}(MonsterFood)); @@ -76,8 +76,8 @@ + flavor; + isDairyFree; + constructor(flavor) { -+ this.flavor = flavor; + super("Ice Cream", flavor); ++ this.flavor = flavor; } - return Cookie; -}(MonsterFood)); @@ -92,9 +92,9 @@ + flavor; + isGlutenFree; + constructor(flavor, isGlutenFree) { ++ super("Cookie", flavor); + this.flavor = flavor; + this.isGlutenFree = isGlutenFree; -+ super("Cookie", flavor); } - return PetFood; -}(Food)); @@ -108,8 +108,8 @@ +class PetFood extends Food { + whereToBuy; + constructor(name, whereToBuy) { -+ this.whereToBuy = whereToBuy; + super(name); ++ this.whereToBuy = whereToBuy; } - return ExpensiveOrganicDogFood; -}(PetFood)); @@ -124,8 +124,8 @@ +class ExpensiveOrganicDogFood extends PetFood { + whereToBuy; + constructor(whereToBuy) { -+ this.whereToBuy = whereToBuy; + super("Origen", whereToBuy); ++ this.whereToBuy = whereToBuy; } - return ExpensiveOrganicCatFood; -}(PetFood)); @@ -136,9 +136,9 @@ + whereToBuy; + containsFish; + constructor(whereToBuy, containsFish) { ++ super("Nature's Logic", whereToBuy); + this.whereToBuy = whereToBuy; + this.containsFish = containsFish; -+ super("Nature's Logic", whereToBuy); } - return Slug; -}()); diff --git a/testdata/baselines/reference/submodule/compiler/optionalParameterProperty.js b/testdata/baselines/reference/submodule/compiler/optionalParameterProperty.js index 07abf6566b..79f5512d94 100644 --- a/testdata/baselines/reference/submodule/compiler/optionalParameterProperty.js +++ b/testdata/baselines/reference/submodule/compiler/optionalParameterProperty.js @@ -19,7 +19,7 @@ class C { class D extends C { p; constructor(p) { - this.p = p; super(); + this.p = p; } } diff --git a/testdata/baselines/reference/submodule/compiler/optionalParameterProperty.js.diff b/testdata/baselines/reference/submodule/compiler/optionalParameterProperty.js.diff index 21e52898f2..7b24204c10 100644 --- a/testdata/baselines/reference/submodule/compiler/optionalParameterProperty.js.diff +++ b/testdata/baselines/reference/submodule/compiler/optionalParameterProperty.js.diff @@ -27,8 +27,8 @@ +class D extends C { + p; + constructor(p) { -+ this.p = p; + super(); ++ this.p = p; } - return C; -}()); diff --git a/testdata/baselines/reference/submodule/compiler/parameterPropertyInConstructorWithPrologues.js b/testdata/baselines/reference/submodule/compiler/parameterPropertyInConstructorWithPrologues.js index 79c7963258..630d51d13a 100644 --- a/testdata/baselines/reference/submodule/compiler/parameterPropertyInConstructorWithPrologues.js +++ b/testdata/baselines/reference/submodule/compiler/parameterPropertyInConstructorWithPrologues.js @@ -159,8 +159,8 @@ class Foo7 extends C { constructor(member) { "ngInject1"; "ngInject1"; - this.member = member; super(); + this.member = member; console.log("hi"); } } @@ -169,8 +169,8 @@ class Foo8 extends C { constructor(member) { "ngInject1"; "ngInject1"; - this.member = member; super(); + this.member = member; this.m(); console.log("hi"); } diff --git a/testdata/baselines/reference/submodule/compiler/parameterPropertyInConstructorWithPrologues.js.diff b/testdata/baselines/reference/submodule/compiler/parameterPropertyInConstructorWithPrologues.js.diff index 05f202ea85..95261a2238 100644 --- a/testdata/baselines/reference/submodule/compiler/parameterPropertyInConstructorWithPrologues.js.diff +++ b/testdata/baselines/reference/submodule/compiler/parameterPropertyInConstructorWithPrologues.js.diff @@ -130,8 +130,8 @@ - var _this = _super.call(this) || this; - _this.member = member; + "ngInject1"; -+ this.member = member; + super(); ++ this.member = member; console.log("hi"); - return _this; } @@ -149,8 +149,8 @@ - _this.member = member; - _this.m(); + "ngInject1"; -+ this.member = member; + super(); ++ this.member = member; + this.m(); console.log("hi"); - return _this; diff --git a/testdata/baselines/reference/submodule/compiler/superAccess2.js b/testdata/baselines/reference/submodule/compiler/superAccess2.js index 5718b5b419..d5e41457ff 100644 --- a/testdata/baselines/reference/submodule/compiler/superAccess2.js +++ b/testdata/baselines/reference/submodule/compiler/superAccess2.js @@ -37,8 +37,8 @@ class Q extends P { static yy = super.; // error for static initializer accessing super // Super is not allowed in constructor args constructor(z = super., zz = super., zzz = () => super.) { - this.z = z; super(); + this.z = z; } foo(zz = super.) { super.x(); diff --git a/testdata/baselines/reference/submodule/compiler/superAccess2.js.diff b/testdata/baselines/reference/submodule/compiler/superAccess2.js.diff index 856b899757..2d2f418993 100644 --- a/testdata/baselines/reference/submodule/compiler/superAccess2.js.diff +++ b/testdata/baselines/reference/submodule/compiler/superAccess2.js.diff @@ -46,8 +46,8 @@ - _this.xx = _super.prototype.; - return _this; + constructor(z = super., zz = super., zzz = () => super.) { -+ this.z = z; + super(); ++ this.z = z; } - Q.prototype.foo = function (zz) { - if (zz === void 0) { zz = _super.prototype.; } diff --git a/testdata/baselines/reference/submodule/compiler/thisInSuperCall.js b/testdata/baselines/reference/submodule/compiler/thisInSuperCall.js index dec92d96e0..1baf4a1a73 100644 --- a/testdata/baselines/reference/submodule/compiler/thisInSuperCall.js +++ b/testdata/baselines/reference/submodule/compiler/thisInSuperCall.js @@ -42,7 +42,7 @@ class Foo2 extends Base { class Foo3 extends Base { p; constructor(p) { - this.p = p; super(this); // error + this.p = p; } } diff --git a/testdata/baselines/reference/submodule/compiler/thisInSuperCall.js.diff b/testdata/baselines/reference/submodule/compiler/thisInSuperCall.js.diff index 153d88a01f..fb7e77b516 100644 --- a/testdata/baselines/reference/submodule/compiler/thisInSuperCall.js.diff +++ b/testdata/baselines/reference/submodule/compiler/thisInSuperCall.js.diff @@ -53,8 +53,8 @@ +class Foo3 extends Base { + p; + constructor(p) { -+ this.p = p; + super(this); // error ++ this.p = p; } - return Foo2; -}(Base)); diff --git a/testdata/baselines/reference/submodule/compiler/thisInSuperCall1.js b/testdata/baselines/reference/submodule/compiler/thisInSuperCall1.js index 3b8e6b769d..145658eb3e 100644 --- a/testdata/baselines/reference/submodule/compiler/thisInSuperCall1.js +++ b/testdata/baselines/reference/submodule/compiler/thisInSuperCall1.js @@ -19,7 +19,7 @@ class Base { class Foo extends Base { x; constructor(x) { - this.x = x; super(this); + this.x = x; } } diff --git a/testdata/baselines/reference/submodule/compiler/thisInSuperCall1.js.diff b/testdata/baselines/reference/submodule/compiler/thisInSuperCall1.js.diff index 02fc934b04..ba2b4c73de 100644 --- a/testdata/baselines/reference/submodule/compiler/thisInSuperCall1.js.diff +++ b/testdata/baselines/reference/submodule/compiler/thisInSuperCall1.js.diff @@ -27,8 +27,8 @@ +class Foo extends Base { + x; + constructor(x) { -+ this.x = x; + super(this); ++ this.x = x; } - return Base; -}()); diff --git a/testdata/baselines/reference/submodule/compiler/unspecializedConstraints.js b/testdata/baselines/reference/submodule/compiler/unspecializedConstraints.js index 2c8f42317c..d927a8f91c 100644 --- a/testdata/baselines/reference/submodule/compiler/unspecializedConstraints.js +++ b/testdata/baselines/reference/submodule/compiler/unspecializedConstraints.js @@ -224,10 +224,10 @@ var ts; type; flags; constructor(name, type, flags) { + super(); this.name = name; this.type = type; this.flags = flags; - super(); } equals(other) { return this.name === other.name && @@ -245,10 +245,10 @@ var ts; parameters; returnType; constructor(typeParameters, parameters, returnType) { + super(); this.typeParameters = typeParameters; this.parameters = parameters; this.returnType = returnType; - super(); } equalsNoReturn(other) { return this.parameters.length === other.parameters.length && @@ -266,10 +266,10 @@ var ts; type; flags; constructor(name, type, flags) { + super(); this.name = name; this.type = type; this.flags = flags; - super(); } equals(other) { return this.name === other.name && diff --git a/testdata/baselines/reference/submodule/compiler/unspecializedConstraints.js.diff b/testdata/baselines/reference/submodule/compiler/unspecializedConstraints.js.diff index c272563109..d4258fda11 100644 --- a/testdata/baselines/reference/submodule/compiler/unspecializedConstraints.js.diff +++ b/testdata/baselines/reference/submodule/compiler/unspecializedConstraints.js.diff @@ -116,10 +116,10 @@ + type; + flags; + constructor(name, type, flags) { ++ super(); + this.name = name; + this.type = type; + this.flags = flags; -+ super(); + } + equals(other) { return this.name === other.name && @@ -149,10 +149,10 @@ + parameters; + returnType; + constructor(typeParameters, parameters, returnType) { ++ super(); + this.typeParameters = typeParameters; + this.parameters = parameters; + this.returnType = returnType; -+ super(); } - Signature.prototype.equalsNoReturn = function (other) { + equalsNoReturn(other) { @@ -185,10 +185,10 @@ + type; + flags; + constructor(name, type, flags) { ++ super(); + this.name = name; + this.type = type; + this.flags = flags; -+ super(); + } + equals(other) { return this.name === other.name && diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js index c8e98dc568..496989f41a 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js @@ -73,8 +73,8 @@ class BaseC { class DerivedA extends BaseA { x; constructor(x) { - this.x = x; super(x); + this.x = x; } createInstance() { new DerivedA(5); } createBaseInstance() { new BaseA(6); } @@ -83,8 +83,8 @@ class DerivedA extends BaseA { class DerivedB extends BaseB { x; constructor(x) { - this.x = x; super(x); + this.x = x; } createInstance() { new DerivedB(7); } createBaseInstance() { new BaseB(8); } // ok @@ -93,8 +93,8 @@ class DerivedB extends BaseB { class DerivedC extends BaseC { x; constructor(x) { - this.x = x; super(x); + this.x = x; } createInstance() { new DerivedC(9); } createBaseInstance() { new BaseC(10); } // error diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js.diff b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js.diff index e8924c3389..89eb16a7fb 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js.diff @@ -66,8 +66,8 @@ +class DerivedA extends BaseA { + x; + constructor(x) { -+ this.x = x; + super(x); ++ this.x = x; } - DerivedA.prototype.createInstance = function () { new DerivedA(5); }; - DerivedA.prototype.createBaseInstance = function () { new BaseA(6); }; @@ -87,8 +87,8 @@ +class DerivedB extends BaseB { + x; + constructor(x) { -+ this.x = x; + super(x); ++ this.x = x; } - DerivedB.prototype.createInstance = function () { new DerivedB(7); }; - DerivedB.prototype.createBaseInstance = function () { new BaseB(8); }; // ok @@ -108,8 +108,8 @@ +class DerivedC extends BaseC { + x; + constructor(x) { -+ this.x = x; + super(x); ++ this.x = x; } - DerivedC.prototype.createInstance = function () { new DerivedC(9); }; - DerivedC.prototype.createBaseInstance = function () { new BaseC(10); }; // error diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js b/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js index 93de6d6f2e..97cc42ff71 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js +++ b/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js @@ -25,8 +25,8 @@ class Base { class Derived extends Base { p; constructor(p) { - this.p = p; super(p); + this.p = p; this.p; // OK } } diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js.diff b/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js.diff index 60bee96c01..5ab7a3296e 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js.diff +++ b/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js.diff @@ -39,8 +39,8 @@ +class Derived extends Base { + p; + constructor(p) { -+ this.p = p; + super(p); ++ this.p = p; + this.p; // OK } - return Derived; diff --git a/testdata/baselines/reference/submodule/conformance/defineProperty(target=es5).js b/testdata/baselines/reference/submodule/conformance/defineProperty(target=es5).js index 0725fa7e01..69d2e99c75 100644 --- a/testdata/baselines/reference/submodule/conformance/defineProperty(target=es5).js +++ b/testdata/baselines/reference/submodule/conformance/defineProperty(target=es5).js @@ -48,8 +48,8 @@ class C extends B { ka; z = this.ka; constructor(ka) { - this.ka = ka; super(); + this.ka = ka; } ki = this.ka; } diff --git a/testdata/baselines/reference/submodule/conformance/defineProperty(target=es5).js.diff b/testdata/baselines/reference/submodule/conformance/defineProperty(target=es5).js.diff index 5f56dc8a8e..f2da8a0f8a 100644 --- a/testdata/baselines/reference/submodule/conformance/defineProperty(target=es5).js.diff +++ b/testdata/baselines/reference/submodule/conformance/defineProperty(target=es5).js.diff @@ -102,8 +102,8 @@ + ka; + z = this.ka; + constructor(ka) { -+ this.ka = ka; + super(); ++ this.ka = ka; } - return B; -}()); diff --git a/testdata/baselines/reference/submodule/conformance/defineProperty(target=esnext).js b/testdata/baselines/reference/submodule/conformance/defineProperty(target=esnext).js index 0725fa7e01..69d2e99c75 100644 --- a/testdata/baselines/reference/submodule/conformance/defineProperty(target=esnext).js +++ b/testdata/baselines/reference/submodule/conformance/defineProperty(target=esnext).js @@ -48,8 +48,8 @@ class C extends B { ka; z = this.ka; constructor(ka) { - this.ka = ka; super(); + this.ka = ka; } ki = this.ka; } diff --git a/testdata/baselines/reference/submodule/conformance/defineProperty(target=esnext).js.diff b/testdata/baselines/reference/submodule/conformance/defineProperty(target=esnext).js.diff deleted file mode 100644 index d216af986a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/defineProperty(target=esnext).js.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.defineProperty(target=esnext).js -+++ new.defineProperty(target=esnext).js -@@= skipped -47, +47 lines =@@ - ka; - z = this.ka; - constructor(ka) { -- super(); - this.ka = ka; -+ super(); - } - ki = this.ka; - } diff --git a/testdata/baselines/reference/submodule/conformance/derivedClassParameterProperties.js b/testdata/baselines/reference/submodule/conformance/derivedClassParameterProperties.js index c2f64f02cd..1e0cc02ff3 100644 --- a/testdata/baselines/reference/submodule/conformance/derivedClassParameterProperties.js +++ b/testdata/baselines/reference/submodule/conformance/derivedClassParameterProperties.js @@ -110,16 +110,16 @@ class Derived extends Base { class Derived2 extends Base { y; constructor(y) { - this.y = y; var a = 1; super(); + this.y = y; } } class Derived3 extends Base { y; constructor(y) { - this.y = y; super(); + this.y = y; var a = 1; } } diff --git a/testdata/baselines/reference/submodule/conformance/derivedClassParameterProperties.js.diff b/testdata/baselines/reference/submodule/conformance/derivedClassParameterProperties.js.diff index dd750fccf0..b7868463b3 100644 --- a/testdata/baselines/reference/submodule/conformance/derivedClassParameterProperties.js.diff +++ b/testdata/baselines/reference/submodule/conformance/derivedClassParameterProperties.js.diff @@ -46,12 +46,12 @@ +class Derived2 extends Base { + y; + constructor(y) { -+ this.y = y; var a = 1; - _this = _super.call(this) || this; - _this.y = y; - return _this; + super(); ++ this.y = y; } - return Derived2; -}(Base)); @@ -64,8 +64,8 @@ +class Derived3 extends Base { + y; + constructor(y) { -+ this.y = y; + super(); ++ this.y = y; var a = 1; - return _this; } diff --git a/testdata/baselines/reference/submodule/conformance/derivedClassSuperCallsWithThisArg.js b/testdata/baselines/reference/submodule/conformance/derivedClassSuperCallsWithThisArg.js index 949041c47f..c937a54f64 100644 --- a/testdata/baselines/reference/submodule/conformance/derivedClassSuperCallsWithThisArg.js +++ b/testdata/baselines/reference/submodule/conformance/derivedClassSuperCallsWithThisArg.js @@ -43,21 +43,21 @@ class Derived extends Base { class Derived2 extends Base { a; constructor(a) { - this.a = a; super(this); // error + this.a = a; } } class Derived3 extends Base { a; constructor(a) { - this.a = a; super(() => this); // error + this.a = a; } } class Derived4 extends Base { a; constructor(a) { - this.a = a; super(function () { return this; }); // ok + this.a = a; } } diff --git a/testdata/baselines/reference/submodule/conformance/derivedClassSuperCallsWithThisArg.js.diff b/testdata/baselines/reference/submodule/conformance/derivedClassSuperCallsWithThisArg.js.diff index 1e2abfaba7..7b09ad268c 100644 --- a/testdata/baselines/reference/submodule/conformance/derivedClassSuperCallsWithThisArg.js.diff +++ b/testdata/baselines/reference/submodule/conformance/derivedClassSuperCallsWithThisArg.js.diff @@ -40,8 +40,8 @@ +class Derived2 extends Base { + a; + constructor(a) { -+ this.a = a; + super(this); // error ++ this.a = a; } - return Derived; -}(Base)); @@ -55,8 +55,8 @@ +class Derived3 extends Base { + a; + constructor(a) { -+ this.a = a; + super(() => this); // error ++ this.a = a; } - return Derived2; -}(Base)); @@ -70,8 +70,8 @@ +class Derived4 extends Base { + a; + constructor(a) { -+ this.a = a; + super(function () { return this; }); // ok ++ this.a = a; } - return Derived3; -}(Base)); diff --git a/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCall.js b/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCall.js index 2d3b3a3f2f..37c325111d 100644 --- a/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCall.js +++ b/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCall.js @@ -30,9 +30,9 @@ class Sub extends Base { p; // @ts-ignore constructor(p) { - this.p = p; console.log('hi'); // should emit before super super(); + this.p = p; } field = 0; } @@ -41,9 +41,9 @@ class Test extends Base { prop; // @ts-ignore constructor(p) { - this.p = p; 1; // should emit before super super(); + this.p = p; this.prop = 1; } } diff --git a/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCall.js.diff b/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCall.js.diff index 0139e7ebed..d531bd6dc8 100644 --- a/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCall.js.diff +++ b/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCall.js.diff @@ -7,10 +7,9 @@ + p; // @ts-ignore constructor(p) { -+ this.p = p; console.log('hi'); // should emit before super super(); -- this.p = p; + this.p = p; - this.field = 0; } + field = 0; @@ -20,10 +19,4 @@ + prop; // @ts-ignore constructor(p) { -+ this.p = p; 1; // should emit before super - super(); -- this.p = p; - this.prop = 1; - } - } diff --git a/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCallWithDefineFields.js b/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCallWithDefineFields.js index 03bc3782da..930b91c88b 100644 --- a/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCallWithDefineFields.js +++ b/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCallWithDefineFields.js @@ -30,9 +30,9 @@ class Sub extends Base { p; // @ts-ignore constructor(p) { - this.p = p; console.log('hi'); super(); + this.p = p; } field = 0; } @@ -41,9 +41,9 @@ class Test extends Base { prop; // @ts-ignore constructor(p) { - this.p = p; 1; super(); + this.p = p; this.prop = 1; } } diff --git a/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCallWithDefineFields.js.diff b/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCallWithDefineFields.js.diff index d56bcfcf00..e151d3ee66 100644 --- a/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCallWithDefineFields.js.diff +++ b/testdata/baselines/reference/submodule/conformance/emitStatementsBeforeSuperCallWithDefineFields.js.diff @@ -7,7 +7,6 @@ + p; // @ts-ignore constructor(p) { -+ this.p = p; console.log('hi'); super(); - Object.defineProperty(this, "p", { @@ -22,6 +21,7 @@ - writable: true, - value: 0 - }); ++ this.p = p; } + field = 0; } @@ -30,7 +30,6 @@ + prop; // @ts-ignore constructor(p) { -+ this.p = p; 1; super(); - Object.defineProperty(this, "p", { @@ -45,6 +44,7 @@ - writable: true, - value: void 0 - }); ++ this.p = p; this.prop = 1; } } diff --git a/testdata/baselines/reference/submodule/conformance/mixinClassesAnnotated.js b/testdata/baselines/reference/submodule/conformance/mixinClassesAnnotated.js index 8c22768cdb..9956a8761a 100644 --- a/testdata/baselines/reference/submodule/conformance/mixinClassesAnnotated.js +++ b/testdata/baselines/reference/submodule/conformance/mixinClassesAnnotated.js @@ -80,8 +80,8 @@ class Base { class Derived extends Base { z; constructor(x, y, z) { - this.z = z; super(x, y); + this.z = z; } } const Printable = (superClass) => class extends superClass { diff --git a/testdata/baselines/reference/submodule/conformance/mixinClassesAnnotated.js.diff b/testdata/baselines/reference/submodule/conformance/mixinClassesAnnotated.js.diff index 3a4179fed8..8beb115aef 100644 --- a/testdata/baselines/reference/submodule/conformance/mixinClassesAnnotated.js.diff +++ b/testdata/baselines/reference/submodule/conformance/mixinClassesAnnotated.js.diff @@ -40,8 +40,8 @@ +class Derived extends Base { + z; + constructor(x, y, z) { -+ this.z = z; + super(x, y); ++ this.z = z; } - return Derived; -}(Base)); diff --git a/testdata/baselines/reference/submodule/conformance/mixinClassesAnonymous.js b/testdata/baselines/reference/submodule/conformance/mixinClassesAnonymous.js index c987d34d0e..3dc7f4f624 100644 --- a/testdata/baselines/reference/submodule/conformance/mixinClassesAnonymous.js +++ b/testdata/baselines/reference/submodule/conformance/mixinClassesAnonymous.js @@ -79,8 +79,8 @@ class Base { class Derived extends Base { z; constructor(x, y, z) { - this.z = z; super(x, y); + this.z = z; } } const Printable = (superClass) => class extends superClass { diff --git a/testdata/baselines/reference/submodule/conformance/mixinClassesAnonymous.js.diff b/testdata/baselines/reference/submodule/conformance/mixinClassesAnonymous.js.diff index ef6157488e..ef0b0cf560 100644 --- a/testdata/baselines/reference/submodule/conformance/mixinClassesAnonymous.js.diff +++ b/testdata/baselines/reference/submodule/conformance/mixinClassesAnonymous.js.diff @@ -40,8 +40,8 @@ +class Derived extends Base { + z; + constructor(x, y, z) { -+ this.z = z; + super(x, y); ++ this.z = z; } - return Derived; -}(Base)); diff --git a/testdata/baselines/reference/submodule/conformance/override11.js b/testdata/baselines/reference/submodule/conformance/override11.js index c38127fdab..28f993d57b 100644 --- a/testdata/baselines/reference/submodule/conformance/override11.js +++ b/testdata/baselines/reference/submodule/conformance/override11.js @@ -19,7 +19,7 @@ class Base { class Sub extends Base { foo; constructor(foo) { - this.foo = foo; super(); + this.foo = foo; } } diff --git a/testdata/baselines/reference/submodule/conformance/override11.js.diff b/testdata/baselines/reference/submodule/conformance/override11.js.diff index d25ced7d26..d7fa42ed8c 100644 --- a/testdata/baselines/reference/submodule/conformance/override11.js.diff +++ b/testdata/baselines/reference/submodule/conformance/override11.js.diff @@ -28,8 +28,8 @@ +class Sub extends Base { + foo; + constructor(foo) { -+ this.foo = foo; + super(); ++ this.foo = foo; } - return Base; -}()); diff --git a/testdata/baselines/reference/submodule/conformance/override6.js b/testdata/baselines/reference/submodule/conformance/override6.js index fe11c1102c..adf95bcee0 100644 --- a/testdata/baselines/reference/submodule/conformance/override6.js +++ b/testdata/baselines/reference/submodule/conformance/override6.js @@ -31,8 +31,8 @@ class D extends B { baz; bar = 1; constructor(foo, baz) { + super(foo, 42); this.foo = foo; this.baz = baz; - super(foo, 42); } } diff --git a/testdata/baselines/reference/submodule/conformance/override6.js.diff b/testdata/baselines/reference/submodule/conformance/override6.js.diff index 2c34350ec5..eccd158f65 100644 --- a/testdata/baselines/reference/submodule/conformance/override6.js.diff +++ b/testdata/baselines/reference/submodule/conformance/override6.js.diff @@ -46,9 +46,9 @@ + baz; + bar = 1; + constructor(foo, baz) { ++ super(foo, 42); + this.foo = foo; + this.baz = baz; -+ super(foo, 42); } - return D; -}(B)); diff --git a/testdata/baselines/reference/submodule/conformance/override8.js b/testdata/baselines/reference/submodule/conformance/override8.js index 560f2eff27..8eb4604e1e 100644 --- a/testdata/baselines/reference/submodule/conformance/override8.js +++ b/testdata/baselines/reference/submodule/conformance/override8.js @@ -40,9 +40,9 @@ class D extends B { a; b; constructor(a, b) { + super(); this.a = a; this.b = b; - super(); } } class BB { @@ -54,8 +54,8 @@ class BB { class DD extends BB { a; constructor(a) { - this.a = a; super(a); + this.a = a; } } class DDD extends BB { diff --git a/testdata/baselines/reference/submodule/conformance/override8.js.diff b/testdata/baselines/reference/submodule/conformance/override8.js.diff index 2864f1bfcb..e765cff885 100644 --- a/testdata/baselines/reference/submodule/conformance/override8.js.diff +++ b/testdata/baselines/reference/submodule/conformance/override8.js.diff @@ -28,9 +28,9 @@ + a; + b; + constructor(a, b) { ++ super(); + this.a = a; + this.b = b; -+ super(); } - return B; -}()); @@ -55,8 +55,8 @@ +class DD extends BB { + a; + constructor(a) { - this.a = a; + super(a); + this.a = a; } - return BB; -}()); diff --git a/testdata/baselines/reference/submodule/conformance/overrideParameterProperty.js b/testdata/baselines/reference/submodule/conformance/overrideParameterProperty.js index eb622aed38..fc733a0a6b 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideParameterProperty.js +++ b/testdata/baselines/reference/submodule/conformance/overrideParameterProperty.js @@ -41,24 +41,24 @@ class Base { class C1 extends Base { p1; constructor(p1) { - this.p1 = p1; super(); + this.p1 = p1; this.p1; } } class C2 extends Base { p1; constructor(p1) { - this.p1 = p1; super(); + this.p1 = p1; this.p1; } } class C3 extends Base { p1; constructor(p1) { - this.p1 = p1; super(); + this.p1 = p1; this.p1; } m(p1) { } @@ -66,7 +66,7 @@ class C3 extends Base { class C4 extends Base { p2; constructor(p2) { - this.p2 = p2; super(); + this.p2 = p2; } } diff --git a/testdata/baselines/reference/submodule/conformance/overrideParameterProperty.js.diff b/testdata/baselines/reference/submodule/conformance/overrideParameterProperty.js.diff index b42474e2c5..8c02ca374c 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideParameterProperty.js.diff +++ b/testdata/baselines/reference/submodule/conformance/overrideParameterProperty.js.diff @@ -27,8 +27,8 @@ +class C1 extends Base { + p1; + constructor(p1) { -+ this.p1 = p1; + super(); ++ this.p1 = p1; + this.p1; } - return Base; @@ -44,8 +44,8 @@ +class C2 extends Base { + p1; + constructor(p1) { -+ this.p1 = p1; + super(); ++ this.p1 = p1; + this.p1; } - return C1; @@ -61,8 +61,8 @@ +class C3 extends Base { + p1; + constructor(p1) { -+ this.p1 = p1; + super(); ++ this.p1 = p1; + this.p1; } - return C2; @@ -79,8 +79,8 @@ +class C4 extends Base { + p2; + constructor(p2) { -+ this.p2 = p2; + super(); ++ this.p2 = p2; } - C3.prototype.m = function (p1) { }; - return C3; diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.js b/testdata/baselines/reference/submodule/conformance/parserRealSource10.js index adc363a950..0067dc7431 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource10.js +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource10.js @@ -834,9 +834,9 @@ var TypeScript; value; hasEmptyFraction; constructor(value, hasEmptyFraction) { + super(TokenID.NumberLiteral); this.value = value; this.hasEmptyFraction = hasEmptyFraction; - super(TokenID.NumberLiteral); } getText() { return this.hasEmptyFraction ? this.value.toString() + ".0" : this.value.toString(); @@ -849,8 +849,8 @@ var TypeScript; class StringLiteralToken extends Token { value; constructor(value) { - this.value = value; super(TokenID.StringLiteral); + this.value = value; } getText() { return this.value; @@ -864,9 +864,9 @@ var TypeScript; value; hasEscapeSequence; constructor(value, hasEscapeSequence) { + super(TokenID.Identifier); this.value = value; this.hasEscapeSequence = hasEscapeSequence; - super(TokenID.Identifier); } getText() { return this.value; @@ -879,8 +879,8 @@ var TypeScript; class WhitespaceToken extends Token { value; constructor(tokenId, value) { - this.value = value; super(tokenId); + this.value = value; } getText() { return this.value; @@ -897,12 +897,12 @@ var TypeScript; line; endsLine; constructor(tokenID, value, isBlock, startPos, line, endsLine) { + super(tokenID); this.value = value; this.isBlock = isBlock; this.startPos = startPos; this.line = line; this.endsLine = endsLine; - super(tokenID); } getText() { return this.value; @@ -915,8 +915,8 @@ var TypeScript; class RegularExpressionLiteralToken extends Token { regex; constructor(regex) { - this.regex = regex; super(TokenID.RegularExpressionLiteral); + this.regex = regex; } getText() { return this.regex.toString(); diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.js.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource10.js.diff index f977709784..203968d9c2 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource10.js.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource10.js.diff @@ -154,9 +154,9 @@ + value; + hasEmptyFraction; + constructor(value, hasEmptyFraction) { ++ super(TokenID.NumberLiteral); + this.value = value; + this.hasEmptyFraction = hasEmptyFraction; -+ super(TokenID.NumberLiteral); } - NumberLiteralToken.prototype.getText = function () { + getText() { @@ -181,8 +181,8 @@ + class StringLiteralToken extends Token { + value; + constructor(value) { -+ this.value = value; + super(TokenID.StringLiteral); ++ this.value = value; } - StringLiteralToken.prototype.getText = function () { + getText() { @@ -209,9 +209,9 @@ + value; + hasEscapeSequence; + constructor(value, hasEscapeSequence) { ++ super(TokenID.Identifier); + this.value = value; + this.hasEscapeSequence = hasEscapeSequence; -+ super(TokenID.Identifier); } - IdentifierToken.prototype.getText = function () { + getText() { @@ -236,8 +236,8 @@ + class WhitespaceToken extends Token { + value; + constructor(tokenId, value) { -+ this.value = value; + super(tokenId); ++ this.value = value; } - WhitespaceToken.prototype.getText = function () { + getText() { @@ -270,12 +270,12 @@ + line; + endsLine; + constructor(tokenID, value, isBlock, startPos, line, endsLine) { ++ super(tokenID); + this.value = value; + this.isBlock = isBlock; + this.startPos = startPos; + this.line = line; + this.endsLine = endsLine; -+ super(tokenID); } - CommentToken.prototype.getText = function () { + getText() { @@ -300,8 +300,8 @@ + class RegularExpressionLiteralToken extends Token { + regex; + constructor(regex) { -+ this.regex = regex; + super(TokenID.RegularExpressionLiteral); ++ this.regex = regex; } - RegularExpressionLiteralToken.prototype.getText = function () { + getText() { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource11.js b/testdata/baselines/reference/submodule/conformance/parserRealSource11.js index 8d29e5f6fa..9b06fcfa42 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource11.js +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource11.js @@ -2388,8 +2388,8 @@ var TypeScript; postComments = null; isParenthesized = false; constructor(nodeType) { - this.nodeType = nodeType; super(); + this.nodeType = nodeType; } isExpression() { return false; } isStatementOrExpression() { return false; } @@ -2613,9 +2613,9 @@ var TypeScript; // To change text, and to avoid running into a situation where 'actualText' does not // match 'text', always use setText. constructor(actualText, hasEscapeSequence) { + super(NodeType.Name); this.actualText = actualText; this.hasEscapeSequence = hasEscapeSequence; - super(NodeType.Name); this.setText(actualText, hasEscapeSequence); } setText(actualText, hasEscapeSequence) { @@ -2666,8 +2666,8 @@ var TypeScript; class Label extends AST { id; constructor(id) { - this.id = id; super(NodeType.Label); + this.id = id; } printLabel() { return this.id.actualText + ":"; } typeCheck(typeFlow) { @@ -2699,8 +2699,8 @@ var TypeScript; targetType = null; // Target type for an object literal (null if no target type) castTerm = null; constructor(nodeType, operand) { - this.operand = operand; super(nodeType); + this.operand = operand; } addToControlFlow(context) { super.addToControlFlow(context); @@ -2841,9 +2841,9 @@ var TypeScript; target; arguments; constructor(nodeType, target, arguments) { + super(nodeType); this.target = target; this.arguments = arguments; - super(nodeType); this.minChar = this.target.minChar; } signature = null; @@ -2873,9 +2873,9 @@ var TypeScript; operand1; operand2; constructor(nodeType, operand1, operand2) { + super(nodeType); this.operand1 = operand1; this.operand2 = operand2; - super(nodeType); } typeCheck(typeFlow) { switch (this.nodeType) { @@ -3026,10 +3026,10 @@ var TypeScript; operand2; operand3; constructor(operand1, operand2, operand3) { + super(NodeType.ConditionalExpression); this.operand1 = operand1; this.operand2 = operand2; this.operand3 = operand3; - super(NodeType.ConditionalExpression); } typeCheck(typeFlow) { return typeFlow.typeCheckQMark(this); @@ -3051,9 +3051,9 @@ var TypeScript; value; hasEmptyFraction; constructor(value, hasEmptyFraction) { + super(NodeType.NumberLit); this.value = value; this.hasEmptyFraction = hasEmptyFraction; - super(NodeType.NumberLit); } isNegativeZero = false; typeCheck(typeFlow) { @@ -3091,8 +3091,8 @@ var TypeScript; class RegexLiteral extends Expression { regex; constructor(regex) { - this.regex = regex; super(NodeType.Regex); + this.regex = regex; } typeCheck(typeFlow) { this.type = typeFlow.regexType; @@ -3110,8 +3110,8 @@ var TypeScript; class StringLiteral extends Expression { text; constructor(text) { - this.text = text; super(NodeType.QString); + this.text = text; } emit(emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3145,9 +3145,9 @@ var TypeScript; varFlags = VarFlags.None; isDynamicImport = false; constructor(id, alias) { + super(NodeType.ImportDeclaration); this.id = id; this.alias = alias; - super(NodeType.ImportDeclaration); } emit(emitter, tokenId, startLine) { var mod = this.alias.type; @@ -3204,9 +3204,9 @@ var TypeScript; varFlags = VarFlags.None; sym = null; constructor(id, nodeType, nestingLevel) { + super(nodeType); this.id = id; this.nestingLevel = nestingLevel; - super(nodeType); } isStatementOrExpression() { return true; } isPrivate() { return hasFlag(this.varFlags, VarFlags.Private); } @@ -3289,6 +3289,7 @@ var TypeScript; scopeType = null; // Type of the FuncDecl, before target typing endingToken = null; constructor(name, bod, isConstructor, arguments, vars, scopes, statics, nodeType) { + super(nodeType); this.name = name; this.bod = bod; this.isConstructor = isConstructor; @@ -3296,7 +3297,6 @@ var TypeScript; this.vars = vars; this.scopes = scopes; this.statics = statics; - super(nodeType); } internalName() { if (this.internalNameCache == null) { @@ -3480,9 +3480,9 @@ var TypeScript; leftCurlyCount = 0; rightCurlyCount = 0; constructor(nodeType, name, members) { + super(nodeType); this.name = name; this.members = members; - super(nodeType); } } TypeScript.NamedDeclaration = NamedDeclaration; @@ -3498,8 +3498,8 @@ var TypeScript; containsUnicodeChar = false; containsUnicodeCharInComment = false; constructor(name, members, vars, scopes, endingToken) { - this.endingToken = endingToken; super(NodeType.ModuleDeclaration, name, members); + this.endingToken = endingToken; this.vars = vars; this.scopes = scopes; this.prettyName = this.name.actualText; @@ -3529,9 +3529,9 @@ var TypeScript; implementsList; varFlags = VarFlags.None; constructor(nodeType, name, extendsList, implementsList, members) { + super(nodeType, name, members); this.extendsList = extendsList; this.implementsList = implementsList; - super(nodeType, name, members); } isExported() { return hasFlag(this.varFlags, VarFlags.Exported); @@ -3586,9 +3586,9 @@ var TypeScript; labels; stmt; constructor(labels, stmt) { + super(NodeType.LabeledStatement); this.labels = labels; this.stmt = stmt; - super(NodeType.LabeledStatement); } emit(emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3620,9 +3620,9 @@ var TypeScript; statements; isStatementBlock; constructor(statements, isStatementBlock) { + super(NodeType.Block); this.statements = statements; this.isStatementBlock = isStatementBlock; - super(NodeType.Block); } emit(emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -3724,8 +3724,8 @@ var TypeScript; cond; body = null; constructor(cond) { - this.cond = cond; super(NodeType.While); + this.cond = cond; } isLoop() { return true; } emit(emitter, tokenId, startLine) { @@ -3831,8 +3831,8 @@ var TypeScript; elseBod = null; statement = new ASTSpan(); constructor(cond) { - this.cond = cond; super(NodeType.If); + this.cond = cond; } isCompoundStatement() { return true; } emit(emitter, tokenId, startLine) { @@ -3942,9 +3942,9 @@ var TypeScript; lval; obj; constructor(lval, obj) { + super(NodeType.ForIn); this.lval = lval; this.obj = obj; - super(NodeType.ForIn); if (this.lval && (this.lval.nodeType == NodeType.VarDecl)) { this.lval.varFlags |= VarFlags.AutoInit; } @@ -4060,8 +4060,8 @@ var TypeScript; body; incr; constructor(init) { - this.init = init; super(NodeType.For); + this.init = init; } isLoop() { return true; } emit(emitter, tokenId, startLine) { @@ -4153,8 +4153,8 @@ var TypeScript; isCompoundStatement() { return true; } withSym = null; constructor(expr) { - this.expr = expr; super(NodeType.With); + this.expr = expr; } emit(emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4179,8 +4179,8 @@ var TypeScript; defaultCase = null; statement = new ASTSpan(); constructor(val) { - this.val = val; super(NodeType.Switch); + this.val = val; } isCompoundStatement() { return true; } emit(emitter, tokenId, startLine) { @@ -4301,9 +4301,9 @@ var TypeScript; term; arrayCount; constructor(term, arrayCount) { + super(NodeType.TypeRef); this.term = term; this.arrayCount = arrayCount; - super(NodeType.TypeRef); } emit(emitter, tokenId, startLine) { throw new Error("should not emit a type ref"); @@ -4331,9 +4331,9 @@ var TypeScript; tryNode; finallyNode; constructor(tryNode, finallyNode) { + super(NodeType.TryFinally); this.tryNode = tryNode; this.finallyNode = finallyNode; - super(NodeType.TryFinally); } isCompoundStatement() { return true; } emit(emitter, tokenId, startLine) { @@ -4376,9 +4376,9 @@ var TypeScript; tryNode; catchNode; constructor(tryNode, catchNode) { + super(NodeType.TryCatch); this.tryNode = tryNode; this.catchNode = catchNode; - super(NodeType.TryCatch); } isCompoundStatement() { return true; } emit(emitter, tokenId, startLine) { @@ -4425,8 +4425,8 @@ var TypeScript; class Try extends Statement { body; constructor(body) { - this.body = body; super(NodeType.Try); + this.body = body; } emit(emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4453,9 +4453,9 @@ var TypeScript; param; body; constructor(param, body) { + super(NodeType.Catch); this.param = param; this.body = body; - super(NodeType.Catch); if (this.param) { this.param.varFlags |= VarFlags.AutoInit; } @@ -4525,8 +4525,8 @@ var TypeScript; class Finally extends Statement { body; constructor(body) { - this.body = body; super(NodeType.Finally); + this.body = body; } emit(emitter, tokenId, startLine) { emitter.emitParensAndCommentsInPlace(this, true); @@ -4555,10 +4555,10 @@ var TypeScript; endsLine; text = null; constructor(content, isBlockComment, endsLine) { + super(NodeType.Comment); this.content = content; this.isBlockComment = isBlockComment; this.endsLine = endsLine; - super(NodeType.Comment); } getText() { if (this.text == null) { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource11.js.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource11.js.diff index 3c0a7e6644..65ad87c562 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource11.js.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource11.js.diff @@ -61,8 +61,8 @@ + postComments = null; + isParenthesized = false; + constructor(nodeType) { -+ this.nodeType = nodeType; + super(); ++ this.nodeType = nodeType; } - AST.prototype.isExpression = function () { return false; }; - AST.prototype.isStatementOrExpression = function () { return false; }; @@ -250,9 +250,9 @@ - _this.setText(actualText, hasEscapeSequence); - return _this; + constructor(actualText, hasEscapeSequence) { ++ super(NodeType.Name); + this.actualText = actualText; + this.hasEscapeSequence = hasEscapeSequence; -+ super(NodeType.Name); + this.setText(actualText, hasEscapeSequence); } - Identifier.prototype.setText = function (actualText, hasEscapeSequence) { @@ -335,8 +335,8 @@ + class Label extends AST { + id; + constructor(id) { -+ this.id = id; + super(NodeType.Label); ++ this.id = id; } - Label.prototype.printLabel = function () { return this.id.actualText + ":"; }; - Label.prototype.typeCheck = function (typeFlow) { @@ -390,8 +390,8 @@ + targetType = null; // Target type for an object literal (null if no target type) + castTerm = null; + constructor(nodeType, operand) { -+ this.operand = operand; + super(nodeType); ++ this.operand = operand; } - UnaryExpression.prototype.addToControlFlow = function (context) { - _super.prototype.addToControlFlow.call(this, context); @@ -442,9 +442,9 @@ + target; + arguments; + constructor(nodeType, target, arguments) { ++ super(nodeType); + this.target = target; + this.arguments = arguments; -+ super(nodeType); + this.minChar = this.target.minChar; } - CallExpression.prototype.typeCheck = function (typeFlow) { @@ -484,9 +484,9 @@ + operand1; + operand2; + constructor(nodeType, operand1, operand2) { ++ super(nodeType); + this.operand1 = operand1; + this.operand2 = operand2; -+ super(nodeType); } - BinaryExpression.prototype.typeCheck = function (typeFlow) { + typeCheck(typeFlow) { @@ -527,10 +527,10 @@ + operand2; + operand3; + constructor(operand1, operand2, operand3) { ++ super(NodeType.ConditionalExpression); + this.operand1 = operand1; + this.operand2 = operand2; + this.operand3 = operand3; -+ super(NodeType.ConditionalExpression); } - ConditionalExpression.prototype.typeCheck = function (typeFlow) { + typeCheck(typeFlow) { @@ -564,9 +564,9 @@ + value; + hasEmptyFraction; + constructor(value, hasEmptyFraction) { ++ super(NodeType.NumberLit); + this.value = value; + this.hasEmptyFraction = hasEmptyFraction; -+ super(NodeType.NumberLit); } - NumberLiteral.prototype.typeCheck = function (typeFlow) { + isNegativeZero = false; @@ -615,8 +615,8 @@ + class RegexLiteral extends Expression { + regex; + constructor(regex) { -+ this.regex = regex; + super(NodeType.Regex); ++ this.regex = regex; } - RegexLiteral.prototype.typeCheck = function (typeFlow) { + typeCheck(typeFlow) { @@ -646,8 +646,8 @@ + class StringLiteral extends Expression { + text; + constructor(text) { -+ this.text = text; + super(NodeType.QString); ++ this.text = text; } - StringLiteral.prototype.emit = function (emitter, tokenId, startLine) { + emit(emitter, tokenId, startLine) { @@ -706,9 +706,9 @@ + varFlags = VarFlags.None; + isDynamicImport = false; + constructor(id, alias) { ++ super(NodeType.ImportDeclaration); + this.id = id; + this.alias = alias; -+ super(NodeType.ImportDeclaration); } - ImportDeclaration.prototype.isStatementOrExpression = function () { return true; }; - ImportDeclaration.prototype.emit = function (emitter, tokenId, startLine) { @@ -773,9 +773,9 @@ + varFlags = VarFlags.None; + sym = null; + constructor(id, nodeType, nestingLevel) { ++ super(nodeType); + this.id = id; + this.nestingLevel = nestingLevel; -+ super(nodeType); } - BoundDecl.prototype.isStatementOrExpression = function () { return true; }; - BoundDecl.prototype.isPrivate = function () { return hasFlag(this.varFlags, VarFlags.Private); }; @@ -929,6 +929,7 @@ + scopeType = null; // Type of the FuncDecl, before target typing + endingToken = null; + constructor(name, bod, isConstructor, arguments, vars, scopes, statics, nodeType) { ++ super(nodeType); + this.name = name; + this.bod = bod; + this.isConstructor = isConstructor; @@ -936,7 +937,6 @@ + this.vars = vars; + this.scopes = scopes; + this.statics = statics; -+ super(nodeType); } - FuncDecl.prototype.internalName = function () { + internalName() { @@ -1173,9 +1173,9 @@ + leftCurlyCount = 0; + rightCurlyCount = 0; + constructor(nodeType, name, members) { ++ super(nodeType); + this.name = name; + this.members = members; -+ super(nodeType); } - return NamedDeclaration; - }(ModuleElement)); @@ -1207,8 +1207,8 @@ + containsUnicodeChar = false; + containsUnicodeCharInComment = false; + constructor(name, members, vars, scopes, endingToken) { -+ this.endingToken = endingToken; + super(NodeType.ModuleDeclaration, name, members); ++ this.endingToken = endingToken; + this.vars = vars; + this.scopes = scopes; + this.prettyName = this.name.actualText; @@ -1257,9 +1257,9 @@ + implementsList; + varFlags = VarFlags.None; + constructor(nodeType, name, extendsList, implementsList, members) { ++ super(nodeType, name, members); + this.extendsList = extendsList; + this.implementsList = implementsList; -+ super(nodeType, name, members); } - TypeDeclaration.prototype.isExported = function () { + isExported() { @@ -1365,9 +1365,9 @@ + labels; + stmt; + constructor(labels, stmt) { ++ super(NodeType.LabeledStatement); + this.labels = labels; + this.stmt = stmt; -+ super(NodeType.LabeledStatement); } - LabeledStatement.prototype.emit = function (emitter, tokenId, startLine) { + emit(emitter, tokenId, startLine) { @@ -1410,9 +1410,9 @@ + statements; + isStatementBlock; + constructor(statements, isStatementBlock) { ++ super(NodeType.Block); + this.statements = statements; + this.isStatementBlock = isStatementBlock; -+ super(NodeType.Block); } - Block.prototype.emit = function (emitter, tokenId, startLine) { + emit(emitter, tokenId, startLine) { @@ -1510,8 +1510,8 @@ + cond; + body = null; + constructor(cond) { -+ this.cond = cond; + super(NodeType.While); ++ this.cond = cond; } - WhileStatement.prototype.isLoop = function () { return true; }; - WhileStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -1608,8 +1608,8 @@ + elseBod = null; + statement = new ASTSpan(); + constructor(cond) { -+ this.cond = cond; + super(NodeType.If); ++ this.cond = cond; } - IfStatement.prototype.isCompoundStatement = function () { return true; }; - IfStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -1707,9 +1707,9 @@ + lval; + obj; + constructor(lval, obj) { ++ super(NodeType.ForIn); + this.lval = lval; + this.obj = obj; -+ super(NodeType.ForIn); + if (this.lval && (this.lval.nodeType == NodeType.VarDecl)) { + this.lval.varFlags |= VarFlags.AutoInit; } @@ -1778,8 +1778,8 @@ + body; + incr; + constructor(init) { -+ this.init = init; + super(NodeType.For); ++ this.init = init; } - ForStatement.prototype.isLoop = function () { return true; }; - ForStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -1827,8 +1827,8 @@ + isCompoundStatement() { return true; } + withSym = null; + constructor(expr) { -+ this.expr = expr; + super(NodeType.With); ++ this.expr = expr; } - WithStatement.prototype.isCompoundStatement = function () { return true; }; - WithStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -1865,8 +1865,8 @@ + defaultCase = null; + statement = new ASTSpan(); + constructor(val) { -+ this.val = val; + super(NodeType.Switch); ++ this.val = val; } - SwitchStatement.prototype.isCompoundStatement = function () { return true; }; - SwitchStatement.prototype.emit = function (emitter, tokenId, startLine) { @@ -1967,9 +1967,9 @@ + term; + arrayCount; + constructor(term, arrayCount) { ++ super(NodeType.TypeRef); + this.term = term; + this.arrayCount = arrayCount; -+ super(NodeType.TypeRef); } - TypeReference.prototype.emit = function (emitter, tokenId, startLine) { + emit(emitter, tokenId, startLine) { @@ -2002,9 +2002,9 @@ + tryNode; + finallyNode; + constructor(tryNode, finallyNode) { ++ super(NodeType.TryFinally); + this.tryNode = tryNode; + this.finallyNode = finallyNode; -+ super(NodeType.TryFinally); } - TryFinally.prototype.isCompoundStatement = function () { return true; }; - TryFinally.prototype.emit = function (emitter, tokenId, startLine) { @@ -2050,9 +2050,9 @@ + tryNode; + catchNode; + constructor(tryNode, catchNode) { ++ super(NodeType.TryCatch); + this.tryNode = tryNode; + this.catchNode = catchNode; -+ super(NodeType.TryCatch); } - TryCatch.prototype.isCompoundStatement = function () { return true; }; - TryCatch.prototype.emit = function (emitter, tokenId, startLine) { @@ -2098,8 +2098,8 @@ + class Try extends Statement { + body; + constructor(body) { -+ this.body = body; + super(NodeType.Try); ++ this.body = body; } - Try.prototype.emit = function (emitter, tokenId, startLine) { + emit(emitter, tokenId, startLine) { @@ -2144,9 +2144,9 @@ + param; + body; + constructor(param, body) { ++ super(NodeType.Catch); + this.param = param; + this.body = body; -+ super(NodeType.Catch); + if (this.param) { + this.param.varFlags |= VarFlags.AutoInit; } @@ -2200,8 +2200,8 @@ + class Finally extends Statement { + body; + constructor(body) { -+ this.body = body; + super(NodeType.Finally); ++ this.body = body; } - Finally.prototype.emit = function (emitter, tokenId, startLine) { + emit(emitter, tokenId, startLine) { @@ -2247,10 +2247,10 @@ + endsLine; + text = null; + constructor(content, isBlockComment, endsLine) { ++ super(NodeType.Comment); + this.content = content; + this.isBlockComment = isBlockComment; + this.endsLine = endsLine; -+ super(NodeType.Comment); } - Comment.prototype.getText = function () { + getText() { diff --git a/testdata/baselines/reference/submodule/conformance/propertyOverridesAccessors5.js b/testdata/baselines/reference/submodule/conformance/propertyOverridesAccessors5.js index 80ab4fac6a..79741c3ce3 100644 --- a/testdata/baselines/reference/submodule/conformance/propertyOverridesAccessors5.js +++ b/testdata/baselines/reference/submodule/conformance/propertyOverridesAccessors5.js @@ -18,7 +18,7 @@ class A { class B extends A { p; constructor(p) { - this.p = p; super(); + this.p = p; } } diff --git a/testdata/baselines/reference/submodule/conformance/propertyOverridesAccessors5.js.diff b/testdata/baselines/reference/submodule/conformance/propertyOverridesAccessors5.js.diff deleted file mode 100644 index 95e1ceef4f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/propertyOverridesAccessors5.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.propertyOverridesAccessors5.js -+++ new.propertyOverridesAccessors5.js -@@= skipped -17, +17 lines =@@ - class B extends A { - p; - constructor(p) { -- super(); - this.p = p; -+ super(); - } - } diff --git a/testdata/baselines/reference/submodule/conformance/readonlyConstructorAssignment.js b/testdata/baselines/reference/submodule/conformance/readonlyConstructorAssignment.js index 5bc3d9787b..37c7f4eb89 100644 --- a/testdata/baselines/reference/submodule/conformance/readonlyConstructorAssignment.js +++ b/testdata/baselines/reference/submodule/conformance/readonlyConstructorAssignment.js @@ -62,8 +62,8 @@ class C extends A { // This is the usual behavior of readonly properties: // if one is redeclared in a base class, then it can be assigned to. constructor(x) { - this.x = x; super(x); + this.x = x; this.x = 1; } } @@ -78,8 +78,8 @@ class D { class E extends D { x; constructor(x) { - this.x = x; super(x); + this.x = x; this.x = 1; } } diff --git a/testdata/baselines/reference/submodule/conformance/readonlyConstructorAssignment.js.diff b/testdata/baselines/reference/submodule/conformance/readonlyConstructorAssignment.js.diff index e81578a948..93f252bb74 100644 --- a/testdata/baselines/reference/submodule/conformance/readonlyConstructorAssignment.js.diff +++ b/testdata/baselines/reference/submodule/conformance/readonlyConstructorAssignment.js.diff @@ -57,8 +57,8 @@ - _this.x = 1; - return _this; + constructor(x) { -+ this.x = x; + super(x); ++ this.x = x; + this.x = 1; } - return C; @@ -86,8 +86,8 @@ +class E extends D { + x; + constructor(x) { -+ this.x = x; + super(x); ++ this.x = x; + this.x = 1; } - return E; diff --git a/testdata/baselines/reference/submodule/conformance/redefinedPararameterProperty.js b/testdata/baselines/reference/submodule/conformance/redefinedPararameterProperty.js index 5b7d89dd11..ab9213302b 100644 --- a/testdata/baselines/reference/submodule/conformance/redefinedPararameterProperty.js +++ b/testdata/baselines/reference/submodule/conformance/redefinedPararameterProperty.js @@ -22,7 +22,7 @@ class Derived extends Base { a; b = this.a /*undefined*/; constructor(a) { - this.a = a; super(); + this.a = a; } } diff --git a/testdata/baselines/reference/submodule/conformance/redefinedPararameterProperty.js.diff b/testdata/baselines/reference/submodule/conformance/redefinedPararameterProperty.js.diff deleted file mode 100644 index 5864669cc5..0000000000 --- a/testdata/baselines/reference/submodule/conformance/redefinedPararameterProperty.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.redefinedPararameterProperty.js -+++ new.redefinedPararameterProperty.js -@@= skipped -21, +21 lines =@@ - a; - b = this.a /*undefined*/; - constructor(a) { -- super(); - this.a = a; -+ super(); - } - } diff --git a/testdata/baselines/reference/submodule/conformance/superCalls.js b/testdata/baselines/reference/submodule/conformance/superCalls.js index 6790aa7591..b990f0e603 100644 --- a/testdata/baselines/reference/submodule/conformance/superCalls.js +++ b/testdata/baselines/reference/submodule/conformance/superCalls.js @@ -43,8 +43,8 @@ class Derived extends Base { q; //super call in class constructor of derived type constructor(q) { - this.q = q; super(''); + this.q = q; //type of super call expression is void var p = super(''); var p = v(); diff --git a/testdata/baselines/reference/submodule/conformance/superCalls.js.diff b/testdata/baselines/reference/submodule/conformance/superCalls.js.diff index efbbb4c557..b820465c2c 100644 --- a/testdata/baselines/reference/submodule/conformance/superCalls.js.diff +++ b/testdata/baselines/reference/submodule/conformance/superCalls.js.diff @@ -39,8 +39,8 @@ - var _this = _super.call(this, '') || this; - _this.q = q; + constructor(q) { -+ this.q = q; + super(''); ++ this.q = q; //type of super call expression is void - var p = _this = _super.call(this, '') || this; + var p = super(''); diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMember.js b/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMember.js index 55831630b9..13ed16948b 100644 --- a/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMember.js +++ b/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMember.js @@ -109,8 +109,8 @@ var Test; class File extends FileSystemObject { content; constructor(path, content) { - this.content = content; super(path); + this.content = content; } } Test.File = File; diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMember.js.diff b/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMember.js.diff index ebc6736a69..a1406058d6 100644 --- a/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMember.js.diff +++ b/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMember.js.diff @@ -70,8 +70,8 @@ + class File extends FileSystemObject { + content; + constructor(path, content) { -+ this.content = content; + super(path); ++ this.content = content; } - return File; - }(FileSystemObject)); diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMemberErrors.js b/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMemberErrors.js index df3a4bf90c..fe08f76d77 100644 --- a/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMemberErrors.js +++ b/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMemberErrors.js @@ -59,8 +59,8 @@ var Test; class File extends FileSystemObject { content; constructor(path, content) { - this.content = content; super(path); + this.content = content; } } Test.File = File; diff --git a/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMemberErrors.js.diff b/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMemberErrors.js.diff index 7b2fce2104..2fc6361ae7 100644 --- a/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMemberErrors.js.diff +++ b/testdata/baselines/reference/submodule/conformance/typeGuardOfFormThisMemberErrors.js.diff @@ -70,8 +70,8 @@ + class File extends FileSystemObject { + content; + constructor(path, content) { -+ this.content = content; + super(path); ++ this.content = content; } - return File; - }(FileSystemObject)); diff --git a/testdata/baselines/reference/submodule/conformance/usingDeclarations.11.js b/testdata/baselines/reference/submodule/conformance/usingDeclarations.11.js index 4b54375789..d1d847a9f8 100644 --- a/testdata/baselines/reference/submodule/conformance/usingDeclarations.11.js +++ b/testdata/baselines/reference/submodule/conformance/usingDeclarations.11.js @@ -61,17 +61,17 @@ class C3 extends A { class C4 extends A { y; constructor(y) { - this.y = y; using x = null; super(); + this.y = y; } } class C5 extends A { y; z = 1; constructor(y) { - this.y = y; using x = null; super(); + this.y = y; } } diff --git a/testdata/baselines/reference/submodule/conformance/usingDeclarations.11.js.diff b/testdata/baselines/reference/submodule/conformance/usingDeclarations.11.js.diff index f376eb74bc..a1e16e6872 100644 --- a/testdata/baselines/reference/submodule/conformance/usingDeclarations.11.js.diff +++ b/testdata/baselines/reference/submodule/conformance/usingDeclarations.11.js.diff @@ -114,9 +114,9 @@ +class C4 extends A { + y; + constructor(y) { -+ this.y = y; + using x = null; + super(); ++ this.y = y; } - return C1; -}(A)); @@ -142,9 +142,9 @@ + y; + z = 1; + constructor(y) { -+ this.y = y; + using x = null; + super(); ++ this.y = y; } - return C2; -}(A));