| 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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 if (enclosingClass != compiler.objectClass) { | 1131 if (enclosingClass != compiler.objectClass) { |
| 1132 assert(superClass !== null); | 1132 assert(superClass !== null); |
| 1133 assert(superClass.resolutionState == ClassElement.STATE_DONE); | 1133 assert(superClass.resolutionState == ClassElement.STATE_DONE); |
| 1134 FunctionElement targetConstructor = | 1134 FunctionElement targetConstructor = |
| 1135 superClass.lookupConstructor(superClass.name); | 1135 superClass.lookupConstructor(superClass.name); |
| 1136 if (targetConstructor === null) { | 1136 if (targetConstructor === null) { |
| 1137 compiler.internalError("no default constructor available", | 1137 compiler.internalError("no default constructor available", |
| 1138 node: functionNode); | 1138 node: functionNode); |
| 1139 } | 1139 } |
| 1140 | 1140 |
| 1141 evaluateSuperOrRedirectSend(Selector.INVOCATION_0, | 1141 Selector selector = new Selector.call(superClass.name, |
| 1142 enclosingClass.getLibrary(), |
| 1143 0); |
| 1144 evaluateSuperOrRedirectSend(selector, |
| 1142 const EmptyLink<Node>(), | 1145 const EmptyLink<Node>(), |
| 1143 targetConstructor); | 1146 targetConstructor); |
| 1144 } | 1147 } |
| 1145 } | 1148 } |
| 1146 } | 1149 } |
| 1147 | 1150 |
| 1148 /** | 1151 /** |
| 1149 * Simulates the execution of the [constructor] with the given | 1152 * Simulates the execution of the [constructor] with the given |
| 1150 * [arguments] to obtain the field values that need to be passed to the | 1153 * [arguments] to obtain the field values that need to be passed to the |
| 1151 * native JavaScript constructor. | 1154 * native JavaScript constructor. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1166 Constant fieldValue = fieldValues[field]; | 1169 Constant fieldValue = fieldValues[field]; |
| 1167 if (fieldValue === null) { | 1170 if (fieldValue === null) { |
| 1168 // Use the default value. | 1171 // Use the default value. |
| 1169 fieldValue = compiler.compileVariable(field); | 1172 fieldValue = compiler.compileVariable(field); |
| 1170 } | 1173 } |
| 1171 jsNewArguments.add(fieldValue); | 1174 jsNewArguments.add(fieldValue); |
| 1172 }); | 1175 }); |
| 1173 return jsNewArguments; | 1176 return jsNewArguments; |
| 1174 } | 1177 } |
| 1175 } | 1178 } |
| OLD | NEW |