Remove unnecessary Parser functions
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox76 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(6 files)
|
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 |
Parser::checkLexicalDeclarationDirectlyWithinBlock()isn't needed anymore, because we no longer parse lexical declarations inParser::statement(), but instead only inParser::statementListItem().Parser::isValidSimpleAssignmentTarget()is only called within a single assertion, but the nodes checked withinisValidSimpleAssignmentTarget()are also already processed within the function which contains that assertion.- Plus some additional small changes.
| Assignee | ||
Comment 1•6 years ago
|
||
| Assignee | ||
Comment 2•6 years ago
|
||
Lexical declarations are nowadays only parsed within statementListItem() and
statementListItem() implies we're within a braced block. That means the error
condition which is checked in checkLexicalDeclarationDirectlyWithinBlock() can
never occur when parsing.
Depends on D66467
| Assignee | ||
Comment 3•6 years ago
|
||
DeclarationKind::{Import,SimpleCatchParameter,CatchParameter} implies we can't
be directly within the function body scope, so the parameter redeclaration check
can't occur for these declaration kinds.
Depends on D66468
| Assignee | ||
Comment 4•6 years ago
|
||
StatementKind::Class is more or less just a parsing artifact for
ClassStatement, so it seems confusing to test for this statement kind when
checking for braced blocks for function declarations.
Depends on D66469
Updated•6 years ago
|
| Assignee | ||
Comment 5•6 years ago
|
||
The enclosing if-condition means p always coerces to true.
Depends on D66470
| Assignee | ||
Comment 6•6 years ago
|
||
This function is only called within a single assertion and the function
containing that assertion already covers exactly the same conditions which
are tested within isValidSimpleAssignmentTarget(), so it doesn't seem
useful anymore to keep isValidSimpleAssignmentTarget().
Depends on D66471
Comment 8•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e846e4bbae2a
https://hg.mozilla.org/mozilla-central/rev/f8cb3f9627f2
https://hg.mozilla.org/mozilla-central/rev/d541fa04ac97
https://hg.mozilla.org/mozilla-central/rev/fc81719b2244
https://hg.mozilla.org/mozilla-central/rev/776dd7f14e1a
https://hg.mozilla.org/mozilla-central/rev/672e6b9a0823
Description
•