denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.92k stars 5.22k forks source link

JavaScript doesn't support decorators #24745

Open garethj2 opened 1 month ago

garethj2 commented 1 month ago

In Deno, JavaScript decorators aren't supported. Obviously they're supported for TypeScript.

This is pretty annoying when one bundles a Deno project into one large JavaScript file to run.

The workaround is to rename the bundled files to ts instead of js.

Decorators should be supported in both TypeScript and JavaScript.

dsherret commented 1 month ago

Yeah, this is just unimplemented because we're waiting for v8 to support it ("Support in pure JavaScript is waiting on implementation in V8." https://deno.com/blog/v1.40#decorators).

bartlomieju commented 1 month ago

Relevant issue in V8 bug tracker: https://issues.chromium.org/issues/42202709