Implement the Static class features proposal
Categories
(Core :: JavaScript Engine, enhancement, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox75 | --- | fixed |
People
(Reporter: afmenez, Assigned: anba)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete, parity-chrome)
Attachments
(9 files, 1 obsolete file)
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Bug 1535804 - Part 1: Remove unfinished code to handle non-present class field initialisers. r=arai!
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review |
The proposal is at stage 3, with implementation activity in other engines.
| Reporter | ||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
| Reporter | ||
Updated•6 years ago
|
Comment 2•6 years ago
|
||
I'm super excited for this feature. When do folks think this will be shipped?
| Assignee | ||
Comment 3•6 years ago
|
||
This allows to convert two loops to use std::count_if and will also be used
in later patches. Also amend a loop to use continue to decrease the nesting
levels.
| Assignee | ||
Comment 4•6 years ago
|
||
The previous approach to handle unnecessary .initializers scopes doesn't seem
to work correctly, because dis(class{constructor(){}}) shows that the scope is
still allocated. When moved into the bytecode emitter, the scope was correctly
omitted.
Also add a more descriptive comment to explain why .initializers is added in
its own scope.
Depends on D53636
| Assignee | ||
Comment 5•6 years ago
|
||
yieldis always a name when parsing a class field initialiser, therefore we
don't need to passYieldHandlingaround.thisis always defined when class initialisers run, therefore we don't need
to passHasHeritagearound.- Also change
FunctionBox::initFieldInitializerto only set those members
which are affected by class field initialisers. In all other cases use the
default state set throughinitWithEnclosingParseContext.
Depends on D53637
| Assignee | ||
Comment 6•6 years ago
|
||
Parser.{h,cpp}:
- Add a new
ClassFieldsstruct to count class fields to avoid passing
another twosize_tparameters pair to various functions.
BytecodeEmitter.{h,cpp}:
- Use a separate enum class instead of a plain
bool isStaticfor readability.
ObjectEmitter.{h,cpp}:
- Add a separate state for class field initialisation to avoid duplicating
multiple states for instance vs. static class fields. - Also add an additional state to track when the initialiser expression was
emitted to ensureemitFieldInitializerHomeObjectwon't be called out of order.
Depends on D53638
| Assignee | ||
Comment 7•6 years ago
|
||
Depends on D53639
| Assignee | ||
Comment 8•6 years ago
|
||
Depends on D53640
| Assignee | ||
Comment 9•6 years ago
|
||
Class field initialisers didn't call leaveInnerFunction, which means direct
eval flags weren't properly propagated through PropagateTransitiveParseFlags.
Depends on D53641
| Assignee | ||
Comment 10•6 years ago
|
||
Test262 doesn't cover these tests.
Depends on D53642
| Assignee | ||
Comment 11•6 years ago
|
||
NI to make sure the review request didn't fall through the cracks. :-)
| Assignee | ||
Comment 12•6 years ago
|
||
ClassField::initializer() is never null, because when no initialiser
expression is present, we're synthesising a "raw-undefined" node. There were
plans to optimise this case, but because the current code is unfinished, it
makes more sense to remove the handling for ClassField::initializer()
returning null (for now at least).
Updated•6 years ago
|
| Assignee | ||
Comment 13•6 years ago
|
||
Decrease the nesting level to improve the readibility a bit.
Depends on D63509
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/0b6c1c4cde0b
https://hg.mozilla.org/mozilla-central/rev/da3d3ad76c02
https://hg.mozilla.org/mozilla-central/rev/3aa03a84ae22
https://hg.mozilla.org/mozilla-central/rev/000cc3139baa
https://hg.mozilla.org/mozilla-central/rev/148b48f68f56
https://hg.mozilla.org/mozilla-central/rev/210ed28f7ec4
https://hg.mozilla.org/mozilla-central/rev/2c8e0801719c
https://hg.mozilla.org/mozilla-central/rev/a40744563dc4
https://hg.mozilla.org/mozilla-central/rev/1fd2c781ac64
Comment 16•6 years ago
|
||
\o/
Comment 18•6 years ago
|
||
Does this bug also covers private static class fields? I can't find open bug for them. They also don't seem to work in 75 Nightly.
| Assignee | ||
Comment 19•6 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #17)
Should we send an intent-to-ship?
I've just send an intent-to-ship. It should be appear on dev-platform after moderator approval has been granted.
| Assignee | ||
Comment 20•6 years ago
|
||
(In reply to Sergey Rubanov from comment #18)
Does this bug also covers private static class fields? I can't find open bug for them. They also don't seem to work in 75 Nightly.
No, private class fields (neither instance nor static) aren't yet implemented.
Comment 21•6 years ago
|
||
Doc updates
Compat table
https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Browser_compatibility
(https://github.com/mdn/browser-compat-data/pull/5823)
Reference docs
https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Class_fields#Public_static_fields
Release notes
https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/75#JavaScript
Updated•5 years ago
|
Description
•