aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/bun.js/decorators.test.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/bun.js/decorators.test.ts b/test/bun.js/decorators.test.ts
index 831d1094d..e132f3ed0 100644
--- a/test/bun.js/decorators.test.ts
+++ b/test/bun.js/decorators.test.ts
@@ -947,4 +947,27 @@ describe("constructor statements", () => {
expect(b.l).toBe(3);
expect(b.e).toBe("hello test");
});
+
+ test("expression with parameter properties and statements", () => {
+ const B = class b {
+ value: number;
+ v2: number;
+ constructor(value: number) {
+ this.value = value;
+ this.v2 = 0;
+ }
+ };
+
+ const A = class a extends B {
+ constructor(value: number, public v: string = "test") {
+ const newValue = value * 10;
+ super(newValue);
+ }
+ };
+
+ const a = new A(10);
+ expect(a.value).toBe(100);
+ expect(a.v).toBe("test");
+ expect(a.v2).toBe(0);
+ });
});