| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library code_generator; | 5 library code_generator; |
| 6 | 6 |
| 7 import 'glue.dart'; | 7 import 'glue.dart'; |
| 8 | 8 |
| 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; | 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; |
| 10 import '../../js/js.dart' as js; | 10 import '../../js/js.dart' as js; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 @override | 111 @override |
| 112 js.Expression visitInvokeMethod(tree_ir.InvokeMethod node) { | 112 js.Expression visitInvokeMethod(tree_ir.InvokeMethod node) { |
| 113 return giveup(node); | 113 return giveup(node); |
| 114 // TODO: implement visitInvokeMethod | 114 // TODO: implement visitInvokeMethod |
| 115 } | 115 } |
| 116 | 116 |
| 117 @override | 117 @override |
| 118 js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) { | 118 js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) { |
| 119 return giveup(node); | 119 Element element = node.target; |
| 120 // TODO: implement visitInvokeStatic | 120 |
| 121 registry.registerStaticInvocation(element); |
| 122 |
| 123 js.Expression elementAccess = glue.elementAccess(node.target); |
| 124 return new js.Call(elementAccess, visitArguments(node.arguments)); |
| 121 } | 125 } |
| 122 | 126 |
| 123 @override | 127 @override |
| 124 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { | 128 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { |
| 125 return giveup(node); | 129 return giveup(node); |
| 126 // TODO: implement visitInvokeSuperMethod | 130 // TODO: implement visitInvokeSuperMethod |
| 127 } | 131 } |
| 128 | 132 |
| 129 @override | 133 @override |
| 130 js.Expression visitLiteralList(tree_ir.LiteralList node) { | 134 js.Expression visitLiteralList(tree_ir.LiteralList node) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // TODO: implement visitWhileTrue | 233 // TODO: implement visitWhileTrue |
| 230 } | 234 } |
| 231 | 235 |
| 232 @override | 236 @override |
| 233 void visitReturn(tree_ir.Return node) { | 237 void visitReturn(tree_ir.Return node) { |
| 234 if (node.value != null) { | 238 if (node.value != null) { |
| 235 accumulator.add(new js.Return(visitExpression(node.value))); | 239 accumulator.add(new js.Return(visitExpression(node.value))); |
| 236 } | 240 } |
| 237 } | 241 } |
| 238 } | 242 } |
| OLD | NEW |