| 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 dart2js.constants.expressions; | 5 library dart2js.constants.expressions; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../common_elements.dart'; | 9 import '../common_elements.dart'; |
| 10 import '../elements/entities.dart'; | 10 import '../elements/entities.dart'; |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 value._createStructuredText(sb); | 553 value._createStructuredText(sb); |
| 554 delimiter = ','; | 554 delimiter = ','; |
| 555 } | 555 } |
| 556 sb.write('])'); | 556 sb.write('])'); |
| 557 } | 557 } |
| 558 | 558 |
| 559 Map<FieldEntity, ConstantExpression> computeInstanceFields( | 559 Map<FieldEntity, ConstantExpression> computeInstanceFields( |
| 560 EvaluationEnvironment environment) { | 560 EvaluationEnvironment environment) { |
| 561 ConstantConstructor constantConstructor = | 561 ConstantConstructor constantConstructor = |
| 562 environment.getConstructorConstant(target); | 562 environment.getConstructorConstant(target); |
| 563 assert(invariant(target, constantConstructor != null, | 563 assert(constantConstructor != null, |
| 564 message: "No constant constructor computed for $target.")); | 564 failedAt(target, "No constant constructor computed for $target.")); |
| 565 return constantConstructor.computeInstanceFields( | 565 return constantConstructor.computeInstanceFields( |
| 566 environment, arguments, callStructure); | 566 environment, arguments, callStructure); |
| 567 } | 567 } |
| 568 | 568 |
| 569 InterfaceType computeInstanceType(EvaluationEnvironment environment) { | 569 InterfaceType computeInstanceType(EvaluationEnvironment environment) { |
| 570 return environment | 570 return environment |
| 571 .getConstructorConstant(target) | 571 .getConstructorConstant(target) |
| 572 .computeInstanceType(environment, type); | 572 .computeInstanceType(environment, type); |
| 573 } | 573 } |
| 574 | 574 |
| (...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1925 visit(exp.name); | 1925 visit(exp.name); |
| 1926 if (exp.defaultValue != null) { | 1926 if (exp.defaultValue != null) { |
| 1927 sb.write(', defaultValue: '); | 1927 sb.write(', defaultValue: '); |
| 1928 visit(exp.defaultValue); | 1928 visit(exp.defaultValue); |
| 1929 } | 1929 } |
| 1930 sb.write(')'); | 1930 sb.write(')'); |
| 1931 } | 1931 } |
| 1932 | 1932 |
| 1933 String toString() => sb.toString(); | 1933 String toString() => sb.toString(); |
| 1934 } | 1934 } |
| OLD | NEW |