mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
43 lines
758 B
TypeScript
43 lines
758 B
TypeScript
|
// deno-lint-ignore-file
|
||
|
function A() {
|
||
|
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();
|
||
|
};
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function B() {
|
||
|
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 {
|
||
|
@A()
|
||
|
@B()
|
||
|
static test() {
|
||
|
console.log("C.test() called");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
C.test();
|