| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 | 102 |
| 103 @override | 103 @override |
| 104 js.Expression visitInvokeMethod(tree_ir.InvokeMethod node) { | 104 js.Expression visitInvokeMethod(tree_ir.InvokeMethod node) { |
| 105 return giveup(node); | 105 return giveup(node); |
| 106 // TODO: implement visitInvokeMethod | 106 // TODO: implement visitInvokeMethod |
| 107 } | 107 } |
| 108 | 108 |
| 109 @override | 109 @override |
| 110 js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) { | 110 js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) { |
| 111 return giveup(node); | 111 Element element = node.target; |
| 112 // TODO: implement visitInvokeStatic | 112 |
| 113 registry.registerStaticInvocation(element); |
| 114 |
| 115 js.Expression elementAccess = glue.elementAccess(node.target); |
| 116 return new js.Call(elementAccess, visitArguments(node.arguments)); |
| 113 } | 117 } |
| 114 | 118 |
| 115 @override | 119 @override |
| 116 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { | 120 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { |
| 117 return giveup(node); | 121 return giveup(node); |
| 118 // TODO: implement visitInvokeSuperMethod | 122 // TODO: implement visitInvokeSuperMethod |
| 119 } | 123 } |
| 120 | 124 |
| 121 @override | 125 @override |
| 122 js.Expression visitLiteralList(tree_ir.LiteralList node) { | 126 js.Expression visitLiteralList(tree_ir.LiteralList node) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // TODO: implement visitWhileTrue | 225 // TODO: implement visitWhileTrue |
| 222 } | 226 } |
| 223 | 227 |
| 224 @override | 228 @override |
| 225 void visitReturn(tree_ir.Return node) { | 229 void visitReturn(tree_ir.Return node) { |
| 226 if (node.value != null) { | 230 if (node.value != null) { |
| 227 accumulator.add(new js.Return(visitExpression(node.value))); | 231 accumulator.add(new js.Return(visitExpression(node.value))); |
| 228 } | 232 } |
| 229 } | 233 } |
| 230 } | 234 } |
| OLD | NEW |