Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/transformers/tstransforms/typeeraser.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (tx *TypeEraserTransformer) visit(node *ast.Node) *ast.Node {
return tx.Factory().UpdateExpressionWithTypeArguments(n, tx.Visitor().VisitNode(n.Expression), nil)

case ast.KindPropertyDeclaration:
if ast.HasSyntacticModifier(node, ast.ModifierFlagsAmbient) {
if ast.HasSyntacticModifier(node, ast.ModifierFlagsAmbient|ast.ModifierFlagsAbstract) {
// TypeScript `declare` fields are elided
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ class C extends B {

//// [abstractPropertyBasics.js]
class B {
prop;
raw;
ro;
}
class C extends B {
get prop() { return "foo"; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
--- old.abstractPropertyBasics.js
+++ new.abstractPropertyBasics.js
@@= skipped -24, +24 lines =@@

//// [abstractPropertyBasics.js]
@@= skipped -26, +26 lines =@@
class B {
+ prop;
+ raw;
+ ro;
}
class C extends B {
- constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ class AbstractClass {
// OK, references are to another instance
other.cb(other.prop);
}
prop;
cb;
other = this.prop;
fn = () => this.prop;
method2() {
Expand Down Expand Up @@ -151,8 +149,6 @@ class User {
}
}
class C1 {
x;
y;
constructor() {
let self = this; // ok
let { x, y: y1 } = this; // error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
// OK, references are to another instance
other.cb(other.prop);
}
+ prop;
+ cb;
+ other = this.prop;
+ fn = () => this.prop;
method2() {
Expand All @@ -29,7 +27,7 @@
// there is no implementation of 'prop' in any base class
this.cb(this.prop.toLowerCase());
this.method(1);
@@= skipped -17, +21 lines =@@
@@= skipped -17, +19 lines =@@
}
}
class Implementation extends DerivedAbstractClass {
Expand All @@ -42,16 +40,7 @@
this.cb(this.prop);
}
method(n) {
@@= skipped -19, +19 lines =@@
}
}
class C1 {
+ x;
+ y;
constructor() {
let self = this; // ok
let { x, y: y1 } = this; // error
@@= skipped -7, +9 lines =@@
@@= skipped -26, +26 lines =@@
}
}
class C2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,13 @@ abstract class AbstractAccessorMismatch {

//// [abstractPropertyNegative.js]
class B {
prop;
ro;
}
class C extends B {
ro = "readonly please";
notAllowed;
}
let c = new C();
c.ro = "error: lhs of assignment can't be readonly";
class WrongTypeProperty {
num;
}
class WrongTypePropertyImpl extends WrongTypeProperty {
num = "nope, wrong";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
--- old.abstractPropertyNegative.js
+++ new.abstractPropertyNegative.js
@@= skipped -46, +46 lines =@@

//// [abstractPropertyNegative.js]
@@= skipped -48, +48 lines =@@
class B {
+ prop;
+ ro;
}
class C extends B {
- constructor() {
Expand All @@ -14,12 +10,10 @@
- }
- get concreteWithNoBody() { }
+ ro = "readonly please";
+ notAllowed;
}
let c = new C();
c.ro = "error: lhs of assignment can't be readonly";
class WrongTypeProperty {
+ num;
}
class WrongTypePropertyImpl extends WrongTypeProperty {
- constructor() {
Expand All @@ -30,7 +24,7 @@
}
class WrongTypeAccessor {
}
@@= skipped -24, +21 lines =@@
@@= skipped -22, +15 lines =@@
get num() { return "nope, wrong"; }
}
class WrongTypeAccessorImpl2 extends WrongTypeAccessor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class C extends A {

//// [abstractProperty.js]
class A {
x;
foo() {
console.log(this.x);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
--- old.abstractProperty(target=es2015).js
+++ new.abstractProperty(target=es2015).js
@@= skipped -18, +18 lines =@@

//// [abstractProperty.js]
class A {
+ x;
foo() {
console.log(this.x);
@@= skipped -23, +23 lines =@@
}
}
class B extends A {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class C extends A {

//// [abstractProperty.js]
class A {
x;
foo() {
console.log(this.x);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ abstract class C {

//// [abstractPropertyInitializer.js]
class C {
prop = 1;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
//// [abstractPropertyInitializer.js]
-"use strict";
class C {
+ prop = 1;
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class B extends A {

//// [accessorsOverrideProperty7.js]
class A {
p = 'yep';
}
class B extends A {
get p() { return 'oh no'; } // error
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class C3 extends C1 {

//// [autoAccessor7.js]
class C1 {
accessor a;
}
class C2 extends C1 {
accessor a = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
-};
-var _C2_a_accessor_storage;
class C1 {
+ accessor a;
}
class C2 extends C1 {
- constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class C3 extends C1 {

//// [autoAccessor7.js]
class C1 {
accessor a;
}
class C2 extends C1 {
accessor a = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
-};
-var _C2_a_accessor_storage;
class C1 {
+ accessor a;
}
class C2 extends C1 {
- constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class C3 extends C1 {

//// [autoAccessor7.js]
class C1 {
accessor a;
}
class C2 extends C1 {
accessor a = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
--- old.autoAccessor7(target=es2022,usedefineforclassfields=false).js
+++ new.autoAccessor7(target=es2022,usedefineforclassfields=false).js
@@= skipped -15, +15 lines =@@

//// [autoAccessor7.js]
@@= skipped -17, +17 lines =@@
class C1 {
+ accessor a;
}
class C2 extends C1 {
- #a_accessor_storage = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class C3 extends C1 {

//// [autoAccessor7.js]
class C1 {
accessor a;
}
class C2 extends C1 {
accessor a = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
--- old.autoAccessor7(target=es2022,usedefineforclassfields=true).js
+++ new.autoAccessor7(target=es2022,usedefineforclassfields=true).js
@@= skipped -15, +15 lines =@@

//// [autoAccessor7.js]
@@= skipped -17, +17 lines =@@
class C1 {
+ accessor a;
}
class C2 extends C1 {
- #a_accessor_storage = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class C3 extends C1 {

//// [autoAccessor7.js]
class C1 {
accessor a;
}
class C2 extends C1 {
accessor a = 1;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class C3 extends C1 {

//// [autoAccessor7.js]
class C1 {
accessor a;
}
class C2 extends C1 {
accessor a = 1;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class C1 {
accessor b;
accessor c;
accessor d;
accessor e;
static accessor f;
static accessor g;
static accessor h;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class C1 {
accessor d;
accessor e;
accessor f;
accessor g;
accessor static h;
accessor i() { }
accessor get j() { return false; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
+ accessor d;
+ accessor e;
+ accessor f;
+ accessor g;
+ accessor static h;
+ accessor i() { }
+ accessor get j() { return false; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class C1 {
accessor d;
accessor e;
accessor f;
accessor g;
accessor static h;
accessor i() { }
accessor get j() { return false; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
--- old.autoAccessorDisallowedModifiers(target=esnext).js
+++ new.autoAccessorDisallowedModifiers(target=esnext).js
@@= skipped -47, +47 lines =@@
accessor d;
accessor e;
accessor f;
+ accessor g;
accessor static h;
@@= skipped -51, +51 lines =@@
accessor i() { }
accessor get j() { return false; }
accessor set k(v) { }
Expand All @@ -14,7 +9,7 @@
accessor l;
accessor m;
}
@@= skipped -13, +14 lines =@@
@@= skipped -9, +9 lines =@@
}
accessor class C3 {
}
Expand Down
Loading