Intent to Ship: Class static initializer blocks

194 views
Skip to first unread message

Shu-yu Guo

unread,
Mar 15, 2021, 8:50:48 PM3/15/21
to blink-dev

Contact emails

s...@chromium.org

Explainer

None

Specification

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>Language

TAG review

None

TAG review status

Not applicable

Risks



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 signals


Is this feature fully tested by web-platform-tests?

No

Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=11375

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6482797915013120

Mike West

unread,
Mar 18, 2021, 11:26:17 AM3/18/21
to blink-dev, Shu-yu Guo
This is a stage 3 proposal in TC39, which is a solid indication of support. Assuming that the answer to the testing question below is yes, LGTM1.

-mike

On Tuesday, March 16, 2021 at 1:50:48 AM UTC+1 Shu-yu Guo wrote:

Contact emails

s...@chromium.org

Explainer

None

Specification

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>Language

TAG review

None

TAG review status

Not applicable

Risks



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 signals


Is this feature fully tested by web-platform-tests?

No

Presumably it's tested in test262?

Chris Harrelson

unread,
Mar 18, 2021, 11:35:40 AM3/18/21
to Mike West, blink-dev, Shu-yu Guo
LGTM2

--
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.

Yoav Weiss

unread,
Mar 18, 2021, 11:57:00 AM3/18/21
to Chris Harrelson, Mike West, blink-dev, Shu-yu Guo

Shu-yu Guo

unread,
Mar 18, 2021, 4:05:47 PM3/18/21
to Mike West, blink-dev
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.

On Thu, Mar 18, 2021 at 8:26 AM Mike West <mk...@chromium.org> wrote:

Mike West

unread,
Mar 19, 2021, 3:18:41 AM3/19/21
to Shu-yu Guo, blink-dev
On Thu, Mar 18, 2021 at 9:05 PM Shu-yu Guo <s...@chromium.org> wrote:
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.

From my perspective, a solid and shared test suite should also be a requirement for us to ship. Is "soon" going to happen before the M91 branch point in early April?

-mike

Shu-yu Guo

unread,
Mar 19, 2021, 11:24:14 AM3/19/21
to Mike West, blink-dev
I should hope so. I'll follow up with my Bocoup contacts.
Reply all
Reply to author
Forward
0 new messages