| 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 /** | 5 /** |
| 6 * Top level generator object for writing code and keeping track of | 6 * Top level generator object for writing code and keeping track of |
| 7 * dependencies. | 7 * dependencies. |
| 8 * | 8 * |
| 9 * Should have two compilation models, but only one implemented so far. | 9 * Should have two compilation models, but only one implemented so far. |
| 10 * | 10 * |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 if (parentType != null && !parentType.isObject) { | 1059 if (parentType != null && !parentType.isObject) { |
| 1060 // TODO(jmesserly): we could omit this if all supertypes are using | 1060 // TODO(jmesserly): we could omit this if all supertypes are using |
| 1061 // default constructors. | 1061 // default constructors. |
| 1062 initializerCall = new CallExpression( | 1062 initializerCall = new CallExpression( |
| 1063 new SuperExpression(method.span), [], method.span); | 1063 new SuperExpression(method.span), [], method.span); |
| 1064 } | 1064 } |
| 1065 } | 1065 } |
| 1066 | 1066 |
| 1067 if (method.isConstructor && newObject is ObjectValue) { | 1067 if (method.isConstructor && newObject is ObjectValue) { |
| 1068 var fields = newObject.dynamic.fields; | 1068 var fields = newObject.dynamic.fields; |
| 1069 for (var field in fields.getKeys()) { | 1069 for (var field in newObject.dynamic.fieldsInInitOrder) { |
| 1070 var value = fields[field]; | 1070 if (field !== null) { |
| 1071 if (value !== null) { | 1071 var value = fields[field]; |
| 1072 writer.writeln('this.${field.jsname} = ${value.code};'); | 1072 if (value !== null) { |
| 1073 writer.writeln('this.${field.jsname} = ${value.code};'); |
| 1074 } |
| 1073 } | 1075 } |
| 1074 } | 1076 } |
| 1075 } | 1077 } |
| 1076 | 1078 |
| 1077 // TODO(jimhug): Doing this call last does not match spec. | 1079 // TODO(jimhug): Doing this call last does not match spec. |
| 1078 if (initializerCall != null) { | 1080 if (initializerCall != null) { |
| 1079 evalInitializerCall(newObject, initializerCall, fieldsSet); | 1081 evalInitializerCall(newObject, initializerCall, fieldsSet); |
| 1080 } | 1082 } |
| 1081 | 1083 |
| 1082 if (method.isConstructor && newObject !== null && newObject.isConst) { | 1084 if (method.isConstructor && newObject !== null && newObject.isConst) { |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2481 return true; | 2483 return true; |
| 2482 } | 2484 } |
| 2483 | 2485 |
| 2484 } | 2486 } |
| 2485 | 2487 |
| 2486 class ReturnKind { | 2488 class ReturnKind { |
| 2487 static final int IGNORE = 1; | 2489 static final int IGNORE = 1; |
| 2488 static final int POST = 2; | 2490 static final int POST = 2; |
| 2489 static final int PRE = 3; | 2491 static final int PRE = 3; |
| 2490 } | 2492 } |
| OLD | NEW |