Add NodeVisitor1 to js_ast

R=sra@google.com

Review-Url: https://codereview.chromium.org/2969873002 .
This commit is contained in:
Johnni Winther 2017-07-06 10:24:50 +02:00
parent ca8d646ce1
commit 436eefbb33
3 changed files with 768 additions and 119 deletions

View file

@ -116,7 +116,8 @@ class TokenCounter extends BaseVisitor {
}
}
void countTokens(Node node) => node.accept(this);
// TODO(28763): Remove `<dynamic>` when issue 28763 is fixed.
void countTokens(Node node) => node.accept<dynamic>(this);
}
abstract class ReferenceCountedAstNode implements Node {

View file

@ -363,14 +363,16 @@ abstract class AsyncRewriterBase extends js.NodeVisitor {
/// If the return value of visiting [node] is an expression guaranteed to have
/// no side effect, it is dropped.
void visitExpressionIgnoreResult(js.Expression node) {
js.Expression result = node.accept(this);
// TODO(28763): Remove `<dynamic>` when issue 28763 is fixed.
js.Expression result = node.accept<dynamic>(this);
if (!(result is js.Literal || result is js.VariableUse)) {
addExpressionStatement(result);
}
}
js.Expression visitExpression(js.Expression node) {
return node.accept(this);
// TODO(28763): Remove `<dynamic>` when issue 28763 is fixed.
return node.accept<dynamic>(this);
}
/// Calls [fn] with the value of evaluating [node1] and [node2].

File diff suppressed because it is too large Load diff