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_incremental.library_updater; | 5 library dart2js_incremental.library_updater; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 Future; | 8 Future; |
9 | 9 |
10 import 'dart:convert' show | 10 import 'dart:convert' show |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 if (element.isInstanceMember) { | 979 if (element.isInstanceMember) { |
980 // Any initializers are inlined in factory methods, and the field is | 980 // Any initializers are inlined in factory methods, and the field is |
981 // declared by adding its class to [_classesWithSchemaChanges]. | 981 // declared by adding its class to [_classesWithSchemaChanges]. |
982 return const <jsAst.Statement>[]; | 982 return const <jsAst.Statement>[]; |
983 } | 983 } |
984 // A static (or top-level) field. | 984 // A static (or top-level) field. |
985 if (backend.constants.lazyStatics.contains(element)) { | 985 if (backend.constants.lazyStatics.contains(element)) { |
986 full.Emitter fullEmitter = emitter.emitter; | 986 full.Emitter fullEmitter = emitter.emitter; |
987 jsAst.Expression init = | 987 jsAst.Expression init = |
988 fullEmitter.buildLazilyInitializedStaticField( | 988 fullEmitter.buildLazilyInitializedStaticField( |
989 element, isolateProperties: namer.currentIsolate); | 989 element, isolateProperties: namer.staticStateHolder); |
990 if (init == null) { | 990 if (init == null) { |
991 throw new StateError("Initializer optimized away for $element"); | 991 throw new StateError("Initializer optimized away for $element"); |
992 } | 992 } |
993 return <jsAst.Statement>[init.toStatement()]; | 993 return <jsAst.Statement>[init.toStatement()]; |
994 } else { | 994 } else { |
995 // TODO(ahe): When a field is referenced it is enqueued. If the field has | 995 // TODO(ahe): When a field is referenced it is enqueued. If the field has |
996 // no initializer, it will not have any associated code, so it will | 996 // no initializer, it will not have any associated code, so it will |
997 // appear as if it was newly enqueued. | 997 // appear as if it was newly enqueued. |
998 if (element.initializer == null) { | 998 if (element.initializer == null) { |
999 return const <jsAst.Statement>[]; | 999 return const <jsAst.Statement>[]; |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 .buildFieldsHackForIncrementalCompilation(classElement); | 1501 .buildFieldsHackForIncrementalCompilation(classElement); |
1502 // TODO(ahe): Rewrite for new emitter. | 1502 // TODO(ahe): Rewrite for new emitter. |
1503 ClassBuilder builder = new ClassBuilder(classElement, namer); | 1503 ClassBuilder builder = new ClassBuilder(classElement, namer); |
1504 classEmitter.emitFields(cls, builder); | 1504 classEmitter.emitFields(cls, builder); |
1505 return builder.fields; | 1505 return builder.fields; |
1506 } | 1506 } |
1507 } | 1507 } |
1508 | 1508 |
1509 // TODO(ahe): Remove this method. | 1509 // TODO(ahe): Remove this method. |
1510 NO_WARN(x) => x; | 1510 NO_WARN(x) => x; |
OLD | NEW |