mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
Add NodeVisitor1 to js_ast
R=sra@google.com Review-Url: https://codereview.chromium.org/2969873002 .
This commit is contained in:
parent
ca8d646ce1
commit
436eefbb33
|
@ -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 {
|
||||
|
|
|
@ -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
Loading…
Reference in a new issue