Closed Bug 1513040 Opened 5 years ago Closed 5 years ago

Minor ParseNode cleanups

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: jorendorff, Assigned: khyperia)

References

Details

Attachments

(2 files)

Split off from bug 1512428 comment 2:

- Rename all ParseNodeKinds that are expressions
  to have names that end with Expr, and all statements to end in Stmt.
  (For now, make an exception for Function and Class, which can occur as either
  declarations or expressions.) Also Star -> MulExpr.

- In a separate changeset, change FOR_EACH_PARSE_NODE_KIND to use a class name
  (like TernaryNode) instead of an arity enum (like PN_TERNARY) as the second argument.
  Each class will have to have something like `static constexpr TernaryNode::arity()`,
  not a big deal. Then move `ParseNodeVisitor::visit_PN_TERNARY_children(ParseNode*& pn)`
  to `TernaryNode::visitChildren<V>(V&)`, and likewise for the other visit_*_children
  methods. This should make some of the `unsafe{Kid,Left,Right,Kid2,Kid3,Blah}Reference()`
  methods unnecessary.
Assignee: nobody → khyperia
Status: NEW → ASSIGNED
Pushed by ahauck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e69ec9477ef8
Rename ParseNodeKinds to end with Stmt or Expr. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/bab13130b3f0
Change FOR_EACH_PARSE_NODE_KIND to use type instead of arity. r=jorendorff
https://hg.mozilla.org/mozilla-central/rev/e69ec9477ef8
https://hg.mozilla.org/mozilla-central/rev/bab13130b3f0
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Quick note: The issue was in the base bug this patch is based off of ( https://bugzilla.mozilla.org/show_bug.cgi?id=1512428 ) so I'm going to land these again with the fix for the base bug. (The try run I mention in the other thread's comments includes these patches).
Flags: needinfo?(khyperia)
Depends on: 1515086
Pushed by ahauck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6356c45cfbb7
Rename ParseNodeKinds to end with Stmt or Expr. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/598f93e37949
Change FOR_EACH_PARSE_NODE_KIND to use type instead of arity. r=jorendorff
https://hg.mozilla.org/mozilla-central/rev/6356c45cfbb7
https://hg.mozilla.org/mozilla-central/rev/598f93e37949
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: