| 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.resolution; | 5 library dart2js.resolution; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } else { | 369 } else { |
| 370 // TODO(johnniwinther): Register a feature instead. | 370 // TODO(johnniwinther): Register a feature instead. |
| 371 registry.registerTypeUse(new TypeUse.instantiation(coreTypes.nullType)); | 371 registry.registerTypeUse(new TypeUse.instantiation(coreTypes.nullType)); |
| 372 } | 372 } |
| 373 | 373 |
| 374 if (Elements.isStaticOrTopLevelField(element)) { | 374 if (Elements.isStaticOrTopLevelField(element)) { |
| 375 visitor.addDeferredAction(element, () { | 375 visitor.addDeferredAction(element, () { |
| 376 if (element.modifiers.isConst) { | 376 if (element.modifiers.isConst) { |
| 377 element.constant = constantCompiler.compileConstant(element); | 377 element.constant = constantCompiler.compileConstant(element); |
| 378 } else { | 378 } else { |
| 379 constantCompiler.compileVariable(element); | 379 element.constant = constantCompiler.compileVariable(element); |
| 380 } | 380 } |
| 381 }); | 381 }); |
| 382 if (initializer != null) { | 382 if (initializer != null) { |
| 383 if (!element.modifiers.isConst) { | 383 if (!element.modifiers.isConst) { |
| 384 // TODO(johnniwinther): Determine the const-ness eagerly to avoid | 384 // TODO(johnniwinther): Determine the const-ness eagerly to avoid |
| 385 // unnecessary registrations. | 385 // unnecessary registrations. |
| 386 registry.registerFeature(Feature.LAZY_FIELD); | 386 registry.registerFeature(Feature.LAZY_FIELD); |
| 387 } | 387 } |
| 388 } | 388 } |
| 389 } | 389 } |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 TreeElements get treeElements { | 1090 TreeElements get treeElements { |
| 1091 assert(invariant(this, _treeElements != null, | 1091 assert(invariant(this, _treeElements != null, |
| 1092 message: "TreeElements have not been computed for $this.")); | 1092 message: "TreeElements have not been computed for $this.")); |
| 1093 return _treeElements; | 1093 return _treeElements; |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 void reuseElement() { | 1096 void reuseElement() { |
| 1097 _treeElements = null; | 1097 _treeElements = null; |
| 1098 } | 1098 } |
| 1099 } | 1099 } |
| OLD | NEW |