| 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 class Constant implements Hashable { | 5 class Constant implements Hashable { |
| 6 const Constant(); | 6 const Constant(); |
| 7 | 7 |
| 8 bool isNull() => false; | 8 bool isNull() => false; |
| 9 bool isBool() => false; | 9 bool isBool() => false; |
| 10 bool isTrue() => false; | 10 bool isTrue() => false; |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 // TODO(floitsch): this should be a List<String> type. | 768 // TODO(floitsch): this should be a List<String> type. |
| 769 Type keysType = null; | 769 Type keysType = null; |
| 770 ListConstant keysList = new ListConstant(keysType, keys); | 770 ListConstant keysList = new ListConstant(keysType, keys); |
| 771 compiler.constantHandler.registerCompileTimeConstant(keysList); | 771 compiler.constantHandler.registerCompileTimeConstant(keysList); |
| 772 SourceString className = hasProtoKey | 772 SourceString className = hasProtoKey |
| 773 ? MapConstant.DART_PROTO_CLASS | 773 ? MapConstant.DART_PROTO_CLASS |
| 774 : MapConstant.DART_CLASS; | 774 : MapConstant.DART_CLASS; |
| 775 ClassElement classElement = compiler.jsHelperLibrary.find(className); | 775 ClassElement classElement = compiler.jsHelperLibrary.find(className); |
| 776 classElement.ensureResolved(compiler); | 776 classElement.ensureResolved(compiler); |
| 777 // TODO(floitsch): copy over the generic type. | 777 // TODO(floitsch): copy over the generic type. |
| 778 Type type = new InterfaceType(classElement.name, classElement); | 778 Type type = new InterfaceType(classElement); |
| 779 compiler.registerInstantiatedClass(classElement); | 779 compiler.registerInstantiatedClass(classElement); |
| 780 Constant constant = new MapConstant(type, keysList, values, protoValue); | 780 Constant constant = new MapConstant(type, keysList, values, protoValue); |
| 781 compiler.constantHandler.registerCompileTimeConstant(constant); | 781 compiler.constantHandler.registerCompileTimeConstant(constant); |
| 782 return constant; | 782 return constant; |
| 783 } | 783 } |
| 784 | 784 |
| 785 Constant visitLiteralNull(LiteralNull node) { | 785 Constant visitLiteralNull(LiteralNull node) { |
| 786 return new NullConstant(); | 786 return new NullConstant(); |
| 787 } | 787 } |
| 788 | 788 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 Constant fieldValue = fieldValues[field]; | 1147 Constant fieldValue = fieldValues[field]; |
| 1148 if (fieldValue === null) { | 1148 if (fieldValue === null) { |
| 1149 // Use the default value. | 1149 // Use the default value. |
| 1150 fieldValue = compiler.compileVariable(field); | 1150 fieldValue = compiler.compileVariable(field); |
| 1151 } | 1151 } |
| 1152 jsNewArguments.add(fieldValue); | 1152 jsNewArguments.add(fieldValue); |
| 1153 }); | 1153 }); |
| 1154 return jsNewArguments; | 1154 return jsNewArguments; |
| 1155 } | 1155 } |
| 1156 } | 1156 } |
| OLD | NEW |