aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-01-23 17:39:40 -0800
committerGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-01-23 17:39:40 -0800
commit73961a1494c544843e1145e28d4a4fcf2e45c36a (patch)
tree5f3b58d896f5cb912fc7cf9eae51d51a5dd28e79
parentd7b5e4b9018a10313149847499ee84ad2ec25a5f (diff)
downloadbun-73961a1494c544843e1145e28d4a4fcf2e45c36a.tar.gz
bun-73961a1494c544843e1145e28d4a4fcf2e45c36a.tar.zst
bun-73961a1494c544843e1145e28d4a4fcf2e45c36a.zip
missing test
Diffstat (limited to '')
-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);
+ });
});