| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 | 194 |
| 195 @override | 195 @override |
| 196 js.Expression visitReifyTypeVar(tree_ir.ReifyTypeVar node) { | 196 js.Expression visitReifyTypeVar(tree_ir.ReifyTypeVar node) { |
| 197 return giveup(node); | 197 return giveup(node); |
| 198 // TODO: implement visitReifyTypeVar | 198 // TODO: implement visitReifyTypeVar |
| 199 } | 199 } |
| 200 | 200 |
| 201 @override | 201 @override |
| 202 js.Expression visitThis(tree_ir.This node) { | 202 js.Expression visitThis(tree_ir.This node) { |
| 203 return giveup(node); | 203 // TODO(sigurdm): Inside a js closure this will not work. |
| 204 // TODO: implement visitThis | 204 return new js.This(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 @override | 207 @override |
| 208 js.Expression visitTypeOperator(tree_ir.TypeOperator node) { | 208 js.Expression visitTypeOperator(tree_ir.TypeOperator node) { |
| 209 return giveup(node); | 209 return giveup(node); |
| 210 // TODO: implement visitTypeOperator | 210 // TODO: implement visitTypeOperator |
| 211 } | 211 } |
| 212 | 212 |
| 213 @override | 213 @override |
| 214 js.Expression visitVariable(tree_ir.Variable node) { | 214 js.Expression visitVariable(tree_ir.Variable node) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 @override | 283 @override |
| 284 void visitReturn(tree_ir.Return node) { | 284 void visitReturn(tree_ir.Return node) { |
| 285 if (node.value != null) { | 285 if (node.value != null) { |
| 286 accumulator.add(new js.Return(visitExpression(node.value))); | 286 accumulator.add(new js.Return(visitExpression(node.value))); |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 | 289 |
| 290 bool isNullLiteral(js.Expression exp) => exp is js.LiteralNull; | 290 bool isNullLiteral(js.Expression exp) => exp is js.LiteralNull; |
| 291 | 291 |
| 292 } | 292 } |
| OLD | NEW |