Description[parser] Refactor AstTraversalVisitor (BROKEN)
This is a rewrite of https://codereview.chromium.org/2169833002
taking a slightly different approach. Instead of having the
specific Visit methods in AstTraversalVisitor and using impl()
calls while recursing, this patch takes the specific Visits
methods to the leaf visitors. It breaks for, e.g.,
out/Debug/d8 -e 'class C {}; class D extends C { constructor(){ ((q = super()) => q)(); }; }; new D();'
because the RECURSE_EXPRESSION(VisitVariableProxy...) calls in
VisitSuperCallReference for the parameter initializer Rewriter
fail to call its overriden VisitVariableProxy method.
I don't think that this can be fixed in a nicer way than 2169833002
but I'm uploading this here for archiving.
--- The rest is the CL description of 2169833002
This patch parametrizes AstTraversalVisitor by the actual subclass,
in a similar way as AstVisitor is parametrized. This allows a
subclass to, e.g., override the Visit method and still use the
traversal mechanism. It also allows the subclass to override the
specific visiting methods, without them being virtual.
This patch also removes AstExpressionVisitor, subsuming its
functionality in AstTraversalVisitor.
R=adamk@chromium.org, verwaest@chromium.org
BUG=
LOG=N
Patch Set 1 #
Depends on Patchset: Messages
Total messages: 3 (1 generated)
|