diff options
author | 2023-01-23 17:39:40 -0800 | |
---|---|---|
committer | 2023-01-23 17:39:40 -0800 | |
commit | 73961a1494c544843e1145e28d4a4fcf2e45c36a (patch) | |
tree | 5f3b58d896f5cb912fc7cf9eae51d51a5dd28e79 | |
parent | d7b5e4b9018a10313149847499ee84ad2ec25a5f (diff) | |
download | bun-73961a1494c544843e1145e28d4a4fcf2e45c36a.tar.gz bun-73961a1494c544843e1145e28d4a4fcf2e45c36a.tar.zst bun-73961a1494c544843e1145e28d4a4fcf2e45c36a.zip |
missing test
Diffstat (limited to '')
-rw-r--r-- | test/bun.js/decorators.test.ts | 23 |
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); + }); }); |