denoland / deno

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

JavaScript doesn't support decorators #24745

Open garethj2 opened 4 months ago

garethj2 commented 4 months 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 3 months 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 3 months ago

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