| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 | 169 |
| 170 @override | 170 @override |
| 171 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { | 171 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { |
| 172 return giveup(node); | 172 return giveup(node); |
| 173 // TODO: implement visitInvokeSuperMethod | 173 // TODO: implement visitInvokeSuperMethod |
| 174 } | 174 } |
| 175 | 175 |
| 176 @override | 176 @override |
| 177 js.Expression visitLiteralList(tree_ir.LiteralList node) { | 177 js.Expression visitLiteralList(tree_ir.LiteralList node) { |
| 178 return giveup(node); | 178 registry.registerInstantiatedClass(glue.listClass); |
| 179 // TODO: implement visitLiteralList | 179 int length = node.values.length; |
| 180 List<js.ArrayElement> entries = new List<js.ArrayElement>.generate(length, |
| 181 (int i) => new js.ArrayElement(i, visitExpression(node.values[i]))); |
| 182 return new js.ArrayInitializer(length, entries); |
| 180 } | 183 } |
| 181 | 184 |
| 182 @override | 185 @override |
| 183 js.Expression visitLiteralMap(tree_ir.LiteralMap node) { | 186 js.Expression visitLiteralMap(tree_ir.LiteralMap node) { |
| 184 return giveup(node); | 187 return giveup(node); |
| 185 // TODO: implement visitLiteralMap | 188 // TODO: implement visitLiteralMap |
| 186 } | 189 } |
| 187 | 190 |
| 188 @override | 191 @override |
| 189 js.Expression visitLogicalOperator(tree_ir.LogicalOperator node) { | 192 js.Expression visitLogicalOperator(tree_ir.LogicalOperator node) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 284 } |
| 282 | 285 |
| 283 @override | 286 @override |
| 284 void visitReturn(tree_ir.Return node) { | 287 void visitReturn(tree_ir.Return node) { |
| 285 accumulator.add(new js.Return(visitExpression(node.value))); | 288 accumulator.add(new js.Return(visitExpression(node.value))); |
| 286 } | 289 } |
| 287 | 290 |
| 288 bool isNullLiteral(js.Expression exp) => exp is js.LiteralNull; | 291 bool isNullLiteral(js.Expression exp) => exp is js.LiteralNull; |
| 289 | 292 |
| 290 } | 293 } |
| OLD | NEW |