From 5eadac975014dc950c686338d3e47e888c995dbf Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Wed, 1 Apr 2015 11:25:25 +0300 Subject: [PATCH] Minor in JS: use acceptStatement where appropriate --- .../src/com/google/dart/compiler/backend/js/ast/JsCatch.java | 2 +- .../src/com/google/dart/compiler/backend/js/ast/JsFor.java | 2 +- .../com/google/dart/compiler/backend/js/ast/JsFunction.java | 2 +- .../dart/compiler/backend/js/ast/JsProgramFragment.java | 2 +- .../src/com/google/dart/compiler/backend/js/ast/JsTry.java | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java index 8f9758c4b18..2c4092c25df 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java @@ -80,7 +80,7 @@ public class JsCatch extends SourceInfoAwareJsNode implements HasCondition { if (condition != null) { condition = v.accept(condition); } - body = v.accept(body); + body = v.acceptStatement(body); } v.endVisit(this, ctx); } diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsFor.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsFor.java index f526fd4e5fb..54d3fff7579 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsFor.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsFor.java @@ -107,7 +107,7 @@ public class JsFor extends SourceInfoAwareJsNode implements JsStatement { if (initExpression != null) { initExpression = v.accept(initExpression); } else if (initVars != null) { - initVars = v.accept(initVars); + initVars = v.acceptStatement(initVars); } if (condition != null) { diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsFunction.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsFunction.java index d565f06b4c1..f49725a14a6 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsFunction.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsFunction.java @@ -85,7 +85,7 @@ public final class JsFunction extends JsLiteral implements HasName { public void traverse(JsVisitorWithContext v, JsContext ctx) { if (v.visit(this, ctx)) { v.acceptList(getParameters()); - body = v.accept(body); + body = v.acceptStatement(body); } v.endVisit(this, ctx); } diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java index b4cb97d7d57..32a0a8d5ea9 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java @@ -33,7 +33,7 @@ public class JsProgramFragment extends SourceInfoAwareJsNode { @Override public void traverse(JsVisitorWithContext v, JsContext ctx) { if (v.visit(this, ctx)) { - v.accept(globalBlock); + v.acceptStatement(globalBlock); } v.endVisit(this, ctx); } diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsTry.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsTry.java index c5cc847218b..4e904d0c298 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsTry.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsTry.java @@ -74,10 +74,10 @@ public class JsTry extends SourceInfoAwareJsNode implements JsStatement { @Override public void traverse(JsVisitorWithContext v, JsContext ctx) { if (v.visit(this, ctx)) { - tryBlock = v.accept(tryBlock); + tryBlock = v.acceptStatement(tryBlock); v.acceptList(catches); if (finallyBlock != null) { - finallyBlock = v.accept(finallyBlock); + finallyBlock = v.acceptStatement(finallyBlock); } } v.endVisit(this, ctx);