| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show | 8 import '../common/resolution.dart' show |
| 9 Resolution, | 9 Resolution, |
| 10 Parsing; | 10 Parsing; |
| (...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2147 | 2147 |
| 2148 abstract class ConstantConstructorMixin implements ConstructorElement { | 2148 abstract class ConstantConstructorMixin implements ConstructorElement { |
| 2149 ConstantConstructor _constantConstructor; | 2149 ConstantConstructor _constantConstructor; |
| 2150 | 2150 |
| 2151 ConstantConstructor get constantConstructor { | 2151 ConstantConstructor get constantConstructor { |
| 2152 if (isPatch) { | 2152 if (isPatch) { |
| 2153 ConstructorElement originConstructor = origin; | 2153 ConstructorElement originConstructor = origin; |
| 2154 return originConstructor.constantConstructor; | 2154 return originConstructor.constantConstructor; |
| 2155 } | 2155 } |
| 2156 if (!isConst || isFromEnvironmentConstructor) return null; | 2156 if (!isConst || isFromEnvironmentConstructor) return null; |
| 2157 if (_constantConstructor == null) { | 2157 assert(invariant(this, |
| 2158 _constantConstructor != null, |
| 2159 message: "Constant constructor has not been computed for $this.")); |
| 2160 /*if (_constantConstructor == null) { |
| 2158 _constantConstructor = computeConstantConstructor(resolvedAst); | 2161 _constantConstructor = computeConstantConstructor(resolvedAst); |
| 2159 } | 2162 }*/ |
| 2160 return _constantConstructor; | 2163 return _constantConstructor; |
| 2161 } | 2164 } |
| 2162 | 2165 |
| 2163 void set constantConstructor(ConstantConstructor value) { | 2166 void set constantConstructor(ConstantConstructor value) { |
| 2164 if (isPatch) { | 2167 if (isPatch) { |
| 2165 ConstantConstructorMixin originConstructor = origin; | 2168 ConstantConstructorMixin originConstructor = origin; |
| 2166 originConstructor.constantConstructor = value; | 2169 originConstructor.constantConstructor = value; |
| 2167 } else { | 2170 } else { |
| 2168 assert(invariant(this, isConst, | 2171 assert(invariant(this, isConst, |
| 2169 message: "Constant constructor set on non-constant " | 2172 message: "Constant constructor set on non-constant " |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3116 AstElement get definingElement; | 3119 AstElement get definingElement; |
| 3117 | 3120 |
| 3118 bool get hasResolvedAst => definingElement.hasTreeElements; | 3121 bool get hasResolvedAst => definingElement.hasTreeElements; |
| 3119 | 3122 |
| 3120 ResolvedAst get resolvedAst { | 3123 ResolvedAst get resolvedAst { |
| 3121 return new ResolvedAst(declaration, | 3124 return new ResolvedAst(declaration, |
| 3122 definingElement.node, definingElement.treeElements); | 3125 definingElement.node, definingElement.treeElements); |
| 3123 } | 3126 } |
| 3124 | 3127 |
| 3125 } | 3128 } |
| OLD | NEW |