Index: pkg/compiler/lib/src/js/js_debug.dart |
diff --git a/pkg/compiler/lib/src/js/js_debug.dart b/pkg/compiler/lib/src/js/js_debug.dart |
index 43ec1309d03b492d2feecec4ad84de60f69c2a74..c8cbd0de1636c1b6e7aeb8cb20bcd54bc9209e4a 100644 |
--- a/pkg/compiler/lib/src/js/js_debug.dart |
+++ b/pkg/compiler/lib/src/js/js_debug.dart |
@@ -7,7 +7,12 @@ |
library js.debug; |
import 'package:js_ast/js_ast.dart'; |
-import '../util/util.dart' show Indentation, Tagging; |
+ |
+import '../io/code_output.dart' show |
+ BufferedCodeOutput; |
+import '../util/util.dart' show |
+ Indentation, |
+ Tagging; |
/// Unparse the JavaScript [node]. |
String nodeToString(Node node) { |
@@ -25,8 +30,8 @@ String nodeToString(Node node) { |
class DebugPrinter extends BaseVisitor with Indentation, Tagging<Node> { |
StringBuffer sb = new StringBuffer(); |
- void visitNodeWithChildren(Node node, String type) { |
- openNode(node, type); |
+ void visitNodeWithChildren(Node node, String type, [Map params]) { |
+ openNode(node, type, params); |
node.visitChildren(this); |
closeNode(); |
} |
@@ -42,6 +47,11 @@ class DebugPrinter extends BaseVisitor with Indentation, Tagging<Node> { |
} |
@override |
+ void visitBinary(Binary node) { |
+ visitNodeWithChildren(node, '${node.runtimeType}', {'op': node.op}); |
+ } |
+ |
+ @override |
void visitLiteralString(LiteralString node) { |
openAndCloseNode(node, '${node.runtimeType}', {'value': node.value}); |
} |
@@ -57,7 +67,8 @@ class DebugPrinter extends BaseVisitor with Indentation, Tagging<Node> { |
} |
/// Simple printing context that doesn't throw on errors. |
-class LenientPrintingContext extends SimpleJavaScriptPrintingContext { |
+class LenientPrintingContext extends SimpleJavaScriptPrintingContext |
+ implements BufferedCodeOutput { |
@override |
void error(String message) { |
buffer.write('>>$message<<'); |