The classic static block proposal adds the ability for JavaScript classes to have one or more static initialization blocks. These blocks are initialized once per evaluation of the class definition. ``` class C { static s_field; static { this.s_field = doSomeInitialization(); } } ```
None; this is a new syntax feature.
Contact emails
s...@chromium.orgExplainer
NoneSpecification
https://tc39.es/proposal-class-static-block/Summary
This is a Stage 3 TC39 proposal.The classic static block proposal adds the ability for JavaScript classes to have one or more static initialization blocks. These blocks are initialized once per evaluation of the class definition. ``` class C { static s_field; static { this.s_field = doSomeInitialization(); } } ```
Blink component
Blink>JavaScript>LanguageTAG review
NoneTAG review status
Not applicableRisks
Interoperability and Compatibility
None; this is a new syntax feature.
Gecko: Positive (https://bugzilla.mozilla.org/show_bug.cgi?id=1670018) Firefox is tracking the implementation of the feature. Also, see https://github.com/mozilla/standards-positions/issues/498#issuecomment-796586704 for evidence that Mozilla considers all Stage 3 TC39 proposals to be "positive".
WebKit: No signal (https://lists.webkit.org/pipermail/webkit-dev/2021-March/031729.html) No response yet.
Web developers: No signalsIs this feature fully tested by web-platform-tests?
No
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/0f825095-b850-44b7-85a0-40fd935d0d3an%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw-7Yc3pSoNTSU_uHdTqjijcA8NeCx5NSyk3DnUmnFpvFQ%40mail.gmail.com.
It's actually not yet tested in test262. Bocoup is working on it so it should be soon, and presence of test262 tests is an entry requirement to Stage 4.