| 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 library analyzer.src.generated.constant; | 5 library analyzer.src.generated.constant; | 
| 6 | 6 | 
| 7 import 'package:analyzer/context/declared_variables.dart'; | 7 import 'package:analyzer/context/declared_variables.dart'; | 
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; | 
| 9 import 'package:analyzer/error/listener.dart'; | 9 import 'package:analyzer/error/listener.dart'; | 
| 10 import 'package:analyzer/src/dart/constant/evaluation.dart'; | 10 import 'package:analyzer/src/dart/constant/evaluation.dart'; | 
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 90 /// >   evaluates to a boolean value. | 90 /// >   evaluates to a boolean value. | 
| 91 /// >   </span> | 91 /// >   </span> | 
| 92 /// | 92 /// | 
| 93 /// The values returned by instances of this class are therefore `null` and | 93 /// The values returned by instances of this class are therefore `null` and | 
| 94 /// instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and | 94 /// instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and | 
| 95 /// `DartObject`. | 95 /// `DartObject`. | 
| 96 /// | 96 /// | 
| 97 /// In addition, this class defines several values that can be returned to | 97 /// In addition, this class defines several values that can be returned to | 
| 98 /// indicate various conditions encountered during evaluation. These are | 98 /// indicate various conditions encountered during evaluation. These are | 
| 99 /// documented with the static fields that define those values. | 99 /// documented with the static fields that define those values. | 
| 100 @deprecated |  | 
| 101 class ConstantEvaluator { | 100 class ConstantEvaluator { | 
| 102   /** | 101   /** | 
| 103    * The source containing the expression(s) that will be evaluated. | 102    * The source containing the expression(s) that will be evaluated. | 
| 104    */ | 103    */ | 
| 105   final Source _source; | 104   final Source _source; | 
| 106 | 105 | 
| 107   /** | 106   /** | 
| 108    * The type provider used to access the known types. | 107    * The type provider used to access the known types. | 
| 109    */ | 108    */ | 
| 110   final TypeProvider _typeProvider; | 109   final TypeProvider _typeProvider; | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 128     DartObjectImpl result = expression.accept(new ConstantVisitor( | 127     DartObjectImpl result = expression.accept(new ConstantVisitor( | 
| 129         new ConstantEvaluationEngine(_typeProvider, new DeclaredVariables(), | 128         new ConstantEvaluationEngine(_typeProvider, new DeclaredVariables(), | 
| 130             typeSystem: _typeSystem), | 129             typeSystem: _typeSystem), | 
| 131         errorReporter)); | 130         errorReporter)); | 
| 132     if (result != null) { | 131     if (result != null) { | 
| 133       return EvaluationResult.forValue(result); | 132       return EvaluationResult.forValue(result); | 
| 134     } | 133     } | 
| 135     return EvaluationResult.forErrors(errorListener.errors); | 134     return EvaluationResult.forErrors(errorListener.errors); | 
| 136   } | 135   } | 
| 137 } | 136 } | 
| OLD | NEW | 
|---|