From b66f5ed00e83927a976ffdbe45c2ace9641de086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 24 Jan 2024 14:16:23 +0100 Subject: feat: TC39 decorator proposal support (#22040) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for [TC39 Decorator Proposal](https://github.com/tc39/proposal-decorators). These decorators are only available in transpiled sources - ie. non-JavaScript files (because of lack of support in V8). This entails that "experimental TypeScript decorators" are not available by default and require to be configured, with a configuration like this: ``` { "compilerOptions": { "experimentalDecorators": true } } ``` Closes https://github.com/denoland/deno/issues/19160 --------- Signed-off-by: Bartek IwaƄczuk Co-authored-by: crowlkats Co-authored-by: Divy Srivastava --- cli/tests/testdata/run/runtime_decorators.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/tests/testdata/run/runtime_decorators.ts') diff --git a/cli/tests/testdata/run/runtime_decorators.ts b/cli/tests/testdata/run/runtime_decorators.ts index 5da109110..40a26bbd4 100644 --- a/cli/tests/testdata/run/runtime_decorators.ts +++ b/cli/tests/testdata/run/runtime_decorators.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file -function A() { +function a() { console.log("@A evaluated"); return function ( target: any, @@ -15,7 +15,7 @@ function A() { }; } -function B() { +function b() { console.log("@B evaluated"); return function ( target: any, @@ -32,8 +32,8 @@ function B() { } class C { - @A() - @B() + @a() + @b() static test() { console.log("C.test() called"); } -- cgit v1.2.3