diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2021-08-11 10:20:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-11 10:20:47 -0400 |
| commit | 15a763152f9d392cb80692262f8de5ef8ae15495 (patch) | |
| tree | fcd1a59777f95920bf3502519983d6cc0d882a9a /cli/tests/testdata/runtime_decorators.ts | |
| parent | a0285e2eb88f6254f6494b0ecd1878db3a3b2a58 (diff) | |
chore: move test files to testdata directory (#11601)
Diffstat (limited to 'cli/tests/testdata/runtime_decorators.ts')
| -rw-r--r-- | cli/tests/testdata/runtime_decorators.ts | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/cli/tests/testdata/runtime_decorators.ts b/cli/tests/testdata/runtime_decorators.ts new file mode 100644 index 000000000..5da109110 --- /dev/null +++ b/cli/tests/testdata/runtime_decorators.ts @@ -0,0 +1,42 @@ +// 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(); |
