OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.values; | 5 library dart2js.constants.values; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../core_types.dart'; | 8 import '../core_types.dart'; |
9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
10 import '../elements/elements.dart' | 10 import '../elements/elements.dart' |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 get hashCode => (referenced.hashCode * 17 + prefix.hashCode) & 0x3fffffff; | 744 get hashCode => (referenced.hashCode * 17 + prefix.hashCode) & 0x3fffffff; |
745 | 745 |
746 List<ConstantValue> getDependencies() => <ConstantValue>[referenced]; | 746 List<ConstantValue> getDependencies() => <ConstantValue>[referenced]; |
747 | 747 |
748 accept(ConstantValueVisitor visitor, arg) => visitor.visitDeferred(this, arg); | 748 accept(ConstantValueVisitor visitor, arg) => visitor.visitDeferred(this, arg); |
749 | 749 |
750 DartType getType(CoreTypes types) => referenced.getType(types); | 750 DartType getType(CoreTypes types) => referenced.getType(types); |
751 | 751 |
752 String toDartText() => 'deferred(${referenced.toDartText()})'; | 752 String toDartText() => 'deferred(${referenced.toDartText()})'; |
753 | 753 |
754 String toStructuredText() => 'DeferredConstant($referenced)'; | 754 String toStructuredText() { |
| 755 return 'DeferredConstant(${referenced.toStructuredText()})'; |
| 756 } |
755 } | 757 } |
756 | 758 |
757 /// A constant value resulting from a non constant or erroneous constant | 759 /// A constant value resulting from a non constant or erroneous constant |
758 /// expression. | 760 /// expression. |
759 // TODO(johnniwinther): Expand this to contain the error kind. | 761 // TODO(johnniwinther): Expand this to contain the error kind. |
760 class NonConstantValue extends ConstantValue { | 762 class NonConstantValue extends ConstantValue { |
761 bool get isConstant => false; | 763 bool get isConstant => false; |
762 | 764 |
763 @override | 765 @override |
764 accept(ConstantValueVisitor visitor, arg) { | 766 accept(ConstantValueVisitor visitor, arg) { |
765 // TODO(johnniwinther): Should this be part of the visiting? | 767 // TODO(johnniwinther): Should this be part of the visiting? |
766 } | 768 } |
767 | 769 |
768 @override | 770 @override |
769 List<ConstantValue> getDependencies() => const <ConstantValue>[]; | 771 List<ConstantValue> getDependencies() => const <ConstantValue>[]; |
770 | 772 |
771 @override | 773 @override |
772 DartType getType(CoreTypes types) => const DynamicType(); | 774 DartType getType(CoreTypes types) => const DynamicType(); |
773 | 775 |
774 @override | 776 @override |
775 String toStructuredText() => 'NonConstant'; | 777 String toStructuredText() => 'NonConstant'; |
776 | 778 |
777 @override | 779 @override |
778 String toDartText() => '>>non-constant<<'; | 780 String toDartText() => '>>non-constant<<'; |
779 } | 781 } |
OLD | NEW |