aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-07-26 16:31:08 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-26 16:31:08 -0700
commit1a558ef7538a19545e5934dfc99edf86ec436892 (patch)
treee59975b2d2803fee123feadb09533cfc39dec10d /test
parentf3200ac0ca2f15cce329be8f9652958240367934 (diff)
downloadbun-1a558ef7538a19545e5934dfc99edf86ec436892.tar.gz
bun-1a558ef7538a19545e5934dfc99edf86ec436892.tar.zst
bun-1a558ef7538a19545e5934dfc99edf86ec436892.zip
fix decorator and declare (#3828)
* return the prop if there are decorators * test and comment
Diffstat (limited to 'test')
-rw-r--r--test/transpiler/decorators.test.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/transpiler/decorators.test.ts b/test/transpiler/decorators.test.ts
index 100ecc3bc..885391800 100644
--- a/test/transpiler/decorators.test.ts
+++ b/test/transpiler/decorators.test.ts
@@ -998,3 +998,23 @@ test("export default class Named works", () => {
test("export default class works (anonymous name)", () => {
expect(new DecoratedAnonClass()["methoddecorated"]).toBe(true);
});
+
+test("decorator and declare", () => {
+ let counter = 0;
+ function d1(t) {
+ t();
+ }
+ class A {
+ @d1(() => {
+ counter++;
+ })
+ declare a: number;
+
+ m() {
+ counter++;
+ }
+ }
+
+ new A();
+ expect(counter).toBe(1);
+});