Intent to prototype: JavaScript decorators proposal

284 views
Skip to first unread message

Daniel Minor

unread,
Aug 17, 2022, 3:23:46 PM8/17/22
to dev-platform
Summary:

Decorators are functions called on classes, class elements, or other JavaScript syntax forms during definition that provide for a metaprogramming capability in JavaScript. This proposal recently reached stage 3 at TC39. Prototyping it in SpiderMonkey will provide valuable feedback to the TC39 committee and ensure our implementation does not fall behind the standard.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1781212

Specification:

- https://github.com/tc39/proposal-decorators

Standards Body:

- Part of TC39

Platform coverage: All

Preference: Enabled using the `--enable-decorators` build flag in configure.

DevTools bug: n/a

Other browsers:

- V8: Feature tracked by https://bugs.chromium.org/p/v8/issues/detail?id=12763
- JavaScriptCore: I'm not sure.

web-platform-tests:

- Test262 has some initial tests here: https://github.com/tc39/test262/tree/main/src/decorator
- Because of the limited test262 coverage at the moment, I'm adding tests here: https://searchfox.org/mozilla-central/source/js/src/jit-test/tests/decorators

Thanks,

Dan

Nicolas Chevobbe

unread,
Aug 22, 2022, 2:40:21 AM8/22/22
to dev-pl...@mozilla.org, Daniel Minor
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1786238 for DevTools support, as we scripts with decorators might break a few things in the debugger and webconsole
Reply all
Reply to author
Forward
0 new messages