| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart2js.ir_builder; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import '../closure.dart' as closure; | 7 import '../closure.dart' as closure; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/names.dart' show | 9 import '../common/names.dart' show |
| 10 Names, | 10 Names, |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 currentMask, | 1394 currentMask, |
| 1395 emptyArguments)); | 1395 emptyArguments)); |
| 1396 // TODO(johnniwinther): Extract this as a provided strategy. | 1396 // TODO(johnniwinther): Extract this as a provided strategy. |
| 1397 if (Elements.isLocal(variableElement)) { | 1397 if (Elements.isLocal(variableElement)) { |
| 1398 bodyBuilder.buildLocalVariableSet(variableElement, currentValue); | 1398 bodyBuilder.buildLocalVariableSet(variableElement, currentValue); |
| 1399 } else if (Elements.isError(variableElement) || | 1399 } else if (Elements.isError(variableElement) || |
| 1400 Elements.isMalformed(variableElement)) { | 1400 Elements.isMalformed(variableElement)) { |
| 1401 Selector selector = new Selector.setter( | 1401 Selector selector = new Selector.setter( |
| 1402 new Name(variableElement.name, variableElement.library)); | 1402 new Name(variableElement.name, variableElement.library)); |
| 1403 List<ir.Primitive> value = <ir.Primitive>[currentValue]; | 1403 List<ir.Primitive> value = <ir.Primitive>[currentValue]; |
| 1404 // Note the order of the comparisons below. It can be the case that an | 1404 // Note the comparison below. It can be the case that an element isError |
| 1405 // element isError and isMalformed. | 1405 // and isMalformed. |
| 1406 if (Elements.isError(variableElement)) { | 1406 if (Elements.isError(variableElement)) { |
| 1407 bodyBuilder.buildStaticNoSuchMethod(selector, value); | 1407 bodyBuilder.buildStaticNoSuchMethod(selector, value); |
| 1408 } else { | 1408 } else { |
| 1409 bodyBuilder.buildErroneousInvocation(variableElement, selector, value); | 1409 bodyBuilder.buildErroneousInvocation(variableElement, selector, value); |
| 1410 } | 1410 } |
| 1411 } else if (Elements.isStaticOrTopLevel(variableElement)) { | 1411 } else if (Elements.isStaticOrTopLevel(variableElement)) { |
| 1412 if (variableElement.isField) { | 1412 if (variableElement.isField) { |
| 1413 bodyBuilder.addPrimitive( | 1413 bodyBuilder.addPrimitive( |
| 1414 new ir.SetStatic(variableElement, currentValue)); | 1414 new ir.SetStatic(variableElement, currentValue)); |
| 1415 } else { | 1415 } else { |
| (...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2843 this.stackTraceVariable, | 2843 this.stackTraceVariable, |
| 2844 this.buildCatchBlock}); | 2844 this.buildCatchBlock}); |
| 2845 } | 2845 } |
| 2846 | 2846 |
| 2847 class SwitchCaseInfo { | 2847 class SwitchCaseInfo { |
| 2848 final SubbuildFunction buildCondition; | 2848 final SubbuildFunction buildCondition; |
| 2849 final SubbuildFunction buildBody; | 2849 final SubbuildFunction buildBody; |
| 2850 | 2850 |
| 2851 SwitchCaseInfo(this.buildCondition, this.buildBody); | 2851 SwitchCaseInfo(this.buildCondition, this.buildBody); |
| 2852 } | 2852 } |
| OLD | NEW |