| 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 '../compiler.dart' show | 7 import '../compiler.dart' show |
| 8 Compiler; | 8 Compiler; |
| 9 import '../constants/constant_constructors.dart'; | 9 import '../constants/constant_constructors.dart'; |
| 10 import '../constants/constructors.dart'; | 10 import '../constants/constructors.dart'; |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 } | 1293 } |
| 1294 assert(invariant(this, constantCache != null, | 1294 assert(invariant(this, constantCache != null, |
| 1295 message: "Constant has not been computed for $this.")); | 1295 message: "Constant has not been computed for $this.")); |
| 1296 return constantCache; | 1296 return constantCache; |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 void set constant(ConstantExpression value) { | 1299 void set constant(ConstantExpression value) { |
| 1300 if (isPatch) { | 1300 if (isPatch) { |
| 1301 ConstantVariableMixin originVariable = origin; | 1301 ConstantVariableMixin originVariable = origin; |
| 1302 originVariable.constant = value; | 1302 originVariable.constant = value; |
| 1303 return null; | 1303 return; |
| 1304 } | 1304 } |
| 1305 assert(invariant( | 1305 assert(invariant( |
| 1306 this, constantCache == null || constantCache == value, | 1306 this, constantCache == null || constantCache == value, |
| 1307 message: "Constant has already been computed for $this. " | 1307 message: "Constant has already been computed for $this. " |
| 1308 "Existing constant: " | 1308 "Existing constant: " |
| 1309 "${constantCache != null ? constantCache.getText() : ''}, " | 1309 "${constantCache != null ? constantCache.getText() : ''}, " |
| 1310 "New constant: ${value != null ? value.getText() : ''}.")); | 1310 "New constant: ${value != null ? value.getText() : ''}.")); |
| 1311 constantCache = value; | 1311 constantCache = value; |
| 1312 } | 1312 } |
| 1313 } | 1313 } |
| (...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2967 AstElement get definingElement; | 2967 AstElement get definingElement; |
| 2968 | 2968 |
| 2969 bool get hasResolvedAst => definingElement.hasTreeElements; | 2969 bool get hasResolvedAst => definingElement.hasTreeElements; |
| 2970 | 2970 |
| 2971 ResolvedAst get resolvedAst { | 2971 ResolvedAst get resolvedAst { |
| 2972 return new ResolvedAst(declaration, | 2972 return new ResolvedAst(declaration, |
| 2973 definingElement.node, definingElement.treeElements); | 2973 definingElement.node, definingElement.treeElements); |
| 2974 } | 2974 } |
| 2975 | 2975 |
| 2976 } | 2976 } |
| OLD | NEW |