From 197d2480bbfd57c6c5213ae12ce1e71b7d03f896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 21 Feb 2024 23:03:11 +0000 Subject: fix(compile): respect compiler options for emit (#22521) `deno compile` was ignoring configuration file and thus not applying `compilerOptions` to influence the way files were emitted. --- tests/testdata/compile/compiler_options/deno.json | 5 +++ tests/testdata/compile/compiler_options/main.ts | 42 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/testdata/compile/compiler_options/deno.json create mode 100644 tests/testdata/compile/compiler_options/main.ts (limited to 'tests/testdata/compile/compiler_options') diff --git a/tests/testdata/compile/compiler_options/deno.json b/tests/testdata/compile/compiler_options/deno.json new file mode 100644 index 000000000..504cd646e --- /dev/null +++ b/tests/testdata/compile/compiler_options/deno.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } +} diff --git a/tests/testdata/compile/compiler_options/main.ts b/tests/testdata/compile/compiler_options/main.ts new file mode 100644 index 000000000..40a26bbd4 --- /dev/null +++ b/tests/testdata/compile/compiler_options/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(); -- cgit v1.2.3