| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.constant; | 8 library engine.constant; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 } else { | 1191 } else { |
| 1192 // This may happen for invalid code (e.g. failing to pass arguments | 1192 // This may happen for invalid code (e.g. failing to pass arguments |
| 1193 // to an annotation which references a const constructor). The error | 1193 // to an annotation which references a const constructor). The error |
| 1194 // is detected elsewhere, so just silently ignore it here. | 1194 // is detected elsewhere, so just silently ignore it here. |
| 1195 elementAnnotation.evaluationResult = | 1195 elementAnnotation.evaluationResult = |
| 1196 new EvaluationResultImpl.con1(null); | 1196 new EvaluationResultImpl.con1(null); |
| 1197 } | 1197 } |
| 1198 } | 1198 } |
| 1199 } else { | 1199 } else { |
| 1200 // Should not happen. | 1200 // Should not happen. |
| 1201 assert(false); |
| 1201 AnalysisEngine.instance.logger.logError( | 1202 AnalysisEngine.instance.logger.logError( |
| 1202 "Constant value computer trying to compute the value of a node which i
s not a VariableDeclaration, InstanceCreationExpression, FormalParameter, or Con
structorDeclaration"); | 1203 "Constant value computer trying to compute the value of a node which i
s not a VariableDeclaration, InstanceCreationExpression, FormalParameter, or Con
structorDeclaration"); |
| 1203 return; | 1204 return; |
| 1204 } | 1205 } |
| 1205 } | 1206 } |
| 1206 | 1207 |
| 1207 /** | 1208 /** |
| 1208 * Generate an error indicating that the given [constNode] is not a valid | 1209 * Generate an error indicating that the given [constNode] is not a valid |
| 1209 * compile-time constant because it references at least one of the constants | 1210 * compile-time constant because it references at least one of the constants |
| 1210 * in the given [cycle], each of which directly or indirectly references the | 1211 * in the given [cycle], each of which directly or indirectly references the |
| (...skipping 3703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4914 ConstructorElement constructor) => _constructorDeclarationMap[ | 4915 ConstructorElement constructor) => _constructorDeclarationMap[ |
| 4915 ConstantEvaluationEngine._getConstructorBase(constructor)]; | 4916 ConstantEvaluationEngine._getConstructorBase(constructor)]; |
| 4916 | 4917 |
| 4917 @override | 4918 @override |
| 4918 Object visitInstanceCreationExpression(InstanceCreationExpression node) { | 4919 Object visitInstanceCreationExpression(InstanceCreationExpression node) { |
| 4919 if (node.isConst) { | 4920 if (node.isConst) { |
| 4920 ConstructorElement constructor = node.staticElement; | 4921 ConstructorElement constructor = node.staticElement; |
| 4921 if (constructor != null) { | 4922 if (constructor != null) { |
| 4922 ConstructorDeclaration declaration = | 4923 ConstructorDeclaration declaration = |
| 4923 findConstructorDeclaration(constructor); | 4924 findConstructorDeclaration(constructor); |
| 4924 _referenceGraph.addEdge(_source, declaration); | 4925 if (declaration != null) { |
| 4926 _referenceGraph.addEdge(_source, declaration); |
| 4927 } |
| 4925 } | 4928 } |
| 4926 } | 4929 } |
| 4927 return super.visitInstanceCreationExpression(node); | 4930 return super.visitInstanceCreationExpression(node); |
| 4928 } | 4931 } |
| 4929 | 4932 |
| 4930 @override | 4933 @override |
| 4931 Object visitRedirectingConstructorInvocation( | 4934 Object visitRedirectingConstructorInvocation( |
| 4932 RedirectingConstructorInvocation node) { | 4935 RedirectingConstructorInvocation node) { |
| 4933 super.visitRedirectingConstructorInvocation(node); | 4936 super.visitRedirectingConstructorInvocation(node); |
| 4934 ConstructorElement target = node.staticElement; | 4937 ConstructorElement target = node.staticElement; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5194 return BoolState.from(_element == rightElement); | 5197 return BoolState.from(_element == rightElement); |
| 5195 } else if (rightOperand is DynamicState) { | 5198 } else if (rightOperand is DynamicState) { |
| 5196 return BoolState.UNKNOWN_VALUE; | 5199 return BoolState.UNKNOWN_VALUE; |
| 5197 } | 5200 } |
| 5198 return BoolState.FALSE_STATE; | 5201 return BoolState.FALSE_STATE; |
| 5199 } | 5202 } |
| 5200 | 5203 |
| 5201 @override | 5204 @override |
| 5202 String toString() => _element == null ? "-unknown-" : _element.name; | 5205 String toString() => _element == null ? "-unknown-" : _element.name; |
| 5203 } | 5206 } |
| OLD | NEW |