| 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 if (Elements.isStaticOrTopLevelField(element)) { | 419 if (Elements.isStaticOrTopLevelField(element)) { |
| 420 visitor.addDeferredAction(element, () { | 420 visitor.addDeferredAction(element, () { |
| 421 if (element.modifiers.isConst) { | 421 if (element.modifiers.isConst) { |
| 422 element.constant = constantCompiler.compileConstant(element); | 422 element.constant = constantCompiler.compileConstant(element); |
| 423 } else { | 423 } else { |
| 424 element.constant = constantCompiler.compileVariable(element); | 424 element.constant = constantCompiler.compileVariable(element); |
| 425 } | 425 } |
| 426 }); | 426 }); |
| 427 if (initializer != null) { | 427 if (initializer != null) { |
| 428 if (!element.modifiers.isConst) { | 428 if (!element.modifiers.isConst && |
| 429 initializer.asLiteralNull() == null) { |
| 429 // TODO(johnniwinther): Determine the const-ness eagerly to avoid | 430 // TODO(johnniwinther): Determine the const-ness eagerly to avoid |
| 430 // unnecessary registrations. | 431 // unnecessary registrations. |
| 431 registry.registerFeature(Feature.LAZY_FIELD); | 432 registry.registerFeature(Feature.LAZY_FIELD); |
| 432 } | 433 } |
| 433 } | 434 } |
| 434 } | 435 } |
| 435 | 436 |
| 436 // Perform various checks as side effect of "computing" the type. | 437 // Perform various checks as side effect of "computing" the type. |
| 437 element.computeType(resolution); | 438 element.computeType(resolution); |
| 438 | 439 |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 TreeElements get treeElements { | 1138 TreeElements get treeElements { |
| 1138 assert(invariant(this, _treeElements != null, | 1139 assert(invariant(this, _treeElements != null, |
| 1139 message: "TreeElements have not been computed for $this.")); | 1140 message: "TreeElements have not been computed for $this.")); |
| 1140 return _treeElements; | 1141 return _treeElements; |
| 1141 } | 1142 } |
| 1142 | 1143 |
| 1143 void reuseElement() { | 1144 void reuseElement() { |
| 1144 _treeElements = null; | 1145 _treeElements = null; |
| 1145 } | 1146 } |
| 1146 } | 1147 } |
| OLD | NEW |