summaryrefslogtreecommitdiff
path: root/tests/testdata/run/decorators/experimental/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testdata/run/decorators/experimental/runtime')
-rw-r--r--tests/testdata/run/decorators/experimental/runtime/main.out7
-rw-r--r--tests/testdata/run/decorators/experimental/runtime/main.ts42
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/testdata/run/decorators/experimental/runtime/main.out b/tests/testdata/run/decorators/experimental/runtime/main.out
new file mode 100644
index 000000000..0fc1d4590
--- /dev/null
+++ b/tests/testdata/run/decorators/experimental/runtime/main.out
@@ -0,0 +1,7 @@
+@A evaluated
+@B evaluated
+@B called
+@A called
+fn() called from @A
+fn() called from @B
+C.test() called
diff --git a/tests/testdata/run/decorators/experimental/runtime/main.ts b/tests/testdata/run/decorators/experimental/runtime/main.ts
new file mode 100644
index 000000000..40a26bbd4
--- /dev/null
+++ b/tests/testdata/run/decorators/experimental/runtime/main.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();