Implement the Static class features proposal
Categories
(Core :: JavaScript Engine, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: alex.fdm, 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•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Reporter | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
I'm super excited for this feature. When do folks think this will be shipped?
Assignee | ||
Comment 3•5 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•5 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•5 years ago
|
||
yield
is always a name when parsing a class field initialiser, therefore we
don't need to passYieldHandling
around.this
is always defined when class initialisers run, therefore we don't need
to passHasHeritage
around.- Also change
FunctionBox::initFieldInitializer
to 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•5 years ago
|
||
Parser.{h,cpp}:
- Add a new
ClassFields
struct to count class fields to avoid passing
another twosize_t
parameters pair to various functions.
BytecodeEmitter.{h,cpp}:
- Use a separate enum class instead of a plain
bool isStatic
for 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 ensureemitFieldInitializerHomeObject
won't be called out of order.
Depends on D53638
Assignee | ||
Comment 7•5 years ago
|
||
Depends on D53639
Assignee | ||
Comment 8•5 years ago
|
||
Depends on D53640
Assignee | ||
Comment 9•5 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•5 years ago
|
||
Test262 doesn't cover these tests.
Depends on D53642
Assignee | ||
Comment 11•5 years ago
|
||
NI to make sure the review request didn't fall through the cracks. :-)
Assignee | ||
Comment 12•5 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•5 years ago
|
Assignee | ||
Comment 13•5 years ago
|
||
Decrease the nesting level to improve the readibility a bit.
Depends on D63509
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 14•5 years ago
|
||
Comment 15•5 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•5 years ago
|
||
\o/
Comment 18•5 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•5 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•5 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•5 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•4 years ago
|
Description
•