← Back to release summary

JavaScript decorators

Category
JavaScript
Type
Chromium catches up
Status
No active development (Chrome No active development)
Intent stage
None

Summary

Adds support for decorating classes and class elements using functions preceded with the "@" symbol, these functions are called during definition to replace the value that is being decorated, provide access to it via accessor functions, or initialize it by running additional code after the value has been fully defined. Adds support for the "accessor" keyword, used in front of class fields to define auto-accessors which, unlike regular fields, define a getter and a setter on the class prototype.

Motivation

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

Standards & signals

Ecosystem

View on chromestatus.com