2020-12-02 14:26:04 -05:00
|
|
|
// deno-lint-ignore-file
|
2024-01-24 08:16:23 -05:00
|
|
|
function a() {
|
2020-12-02 14:26:04 -05:00
|
|
|
console.log("@A evaluated");
|
|
|
|
return function (
|
|
|
|
target: any,
|
|
|
|
propertyKey: string,
|
|
|
|
descriptor: PropertyDescriptor,
|
|
|
|
) {
|
|
|
|
console.log("@A called");
|
|
|
|
const fn = descriptor.value;
|
|
|
|
descriptor.value = function () {
|
|
|
|
console.log("fn() called from @A");
|
|
|
|
fn();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2024-01-24 08:16:23 -05:00
|
|
|
function b() {
|
2020-12-02 14:26:04 -05:00
|
|
|
console.log("@B evaluated");
|
|
|
|
return function (
|
|
|
|
target: any,
|
|
|
|
propertyKey: string,
|
|
|
|
descriptor: PropertyDescriptor,
|
|
|
|
) {
|
|
|
|
console.log("@B called");
|
|
|
|
const fn = descriptor.value;
|
|
|
|
descriptor.value = function () {
|
|
|
|
console.log("fn() called from @B");
|
|
|
|
fn();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
class C {
|
2024-01-24 08:16:23 -05:00
|
|
|
@a()
|
|
|
|
@b()
|
2020-12-02 14:26:04 -05:00
|
|
|
static test() {
|
|
|
|
console.log("C.test() called");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
C.test();
|