| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 List<js.Expression> arguments = visitArguments(node.arguments); | 204 List<js.Expression> arguments = visitArguments(node.arguments); |
| 205 | 205 |
| 206 String methodName = glue.invocationName(node.selector); | 206 String methodName = glue.invocationName(node.selector); |
| 207 registerMethodInvoke(node); | 207 registerMethodInvoke(node); |
| 208 | 208 |
| 209 return js.propertyCall(receiver, methodName, arguments); | 209 return js.propertyCall(receiver, methodName, arguments); |
| 210 } | 210 } |
| 211 | 211 |
| 212 @override | 212 @override |
| 213 js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) { | 213 js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) { |
| 214 if (node.target is! FunctionElement) { |
| 215 giveup(node, 'static getters and setters are not supported.'); |
| 216 } |
| 214 return buildStaticInvoke(node.selector, | 217 return buildStaticInvoke(node.selector, |
| 215 node.target, | 218 node.target, |
| 216 visitArguments(node.arguments)); | 219 visitArguments(node.arguments)); |
| 217 } | 220 } |
| 218 | 221 |
| 219 @override | 222 @override |
| 220 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { | 223 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { |
| 221 return giveup(node); | 224 return giveup(node); |
| 222 // TODO: implement visitInvokeSuperMethod | 225 // TODO: implement visitInvokeSuperMethod |
| 223 } | 226 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 accumulator.add( | 413 accumulator.add( |
| 411 buildWhile(new js.LiteralBool(true), node.body, node.label, node)); | 414 buildWhile(new js.LiteralBool(true), node.body, node.label, node)); |
| 412 } | 415 } |
| 413 | 416 |
| 414 @override | 417 @override |
| 415 void visitReturn(tree_ir.Return node) { | 418 void visitReturn(tree_ir.Return node) { |
| 416 accumulator.add(new js.Return(visitExpression(node.value))); | 419 accumulator.add(new js.Return(visitExpression(node.value))); |
| 417 } | 420 } |
| 418 | 421 |
| 419 } | 422 } |
| OLD | NEW |