| 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 analyzer2dart.cps_generator; | 5 library analyzer2dart.cps_generator; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 | 8 |
| 9 import 'package:compiler/implementation/elements/elements.dart' as dart2js; | 9 import 'package:compiler/implementation/elements/elements.dart' as dart2js; |
| 10 import 'package:analyzer/src/generated/source.dart'; | 10 import 'package:analyzer/src/generated/source.dart'; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 switch (op) { | 214 switch (op) { |
| 215 case '||': | 215 case '||': |
| 216 case '&&': | 216 case '&&': |
| 217 return handleLazyOperator(node, isLazyOr: op == '||'); | 217 return handleLazyOperator(node, isLazyOr: op == '||'); |
| 218 case '!=': | 218 case '!=': |
| 219 return irBuilder.buildNegation(handleBinaryExpression(node, '==')); | 219 return irBuilder.buildNegation(handleBinaryExpression(node, '==')); |
| 220 default: | 220 default: |
| 221 return handleBinaryExpression(node, op); | 221 return handleBinaryExpression(node, op); |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 |
| 225 @override |
| 226 visitIfStatement(IfStatement node) { |
| 227 ir.Primitive condition = node.condition.accept(this); |
| 228 |
| 229 void buildThenPart(IrBuilder thenBuilder) { |
| 230 withBuilder(thenBuilder, () => node.thenStatement.accept(this)); |
| 231 } |
| 232 |
| 233 void buildElsePart(IrBuilder elseBuilder) { |
| 234 if (node.elseStatement != null) { |
| 235 withBuilder(elseBuilder, () => node.elseStatement.accept(this)); |
| 236 } |
| 237 } |
| 238 |
| 239 irBuilder.buildIf(condition, buildThenPart, buildElsePart); |
| 240 } |
| 224 } | 241 } |
| OLD | NEW |