Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1355773002: Make type system changes backwards compatible (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments, rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/constant.dart
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index 8508e5c525c0d48d0f78dd40e91b274bfa73f1a6..afed930d7e53c1031ecb486032a359205fa41604 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -242,12 +242,12 @@ class ConstantEvaluationEngine {
* given, is used to verify correct dependency analysis when running unit
* tests.
*/
- ConstantEvaluationEngine(
- this.typeProvider, this.typeSystem, this._declaredVariables,
- {ConstantEvaluationValidator validator})
+ ConstantEvaluationEngine(this.typeProvider, this._declaredVariables,
+ {ConstantEvaluationValidator validator, TypeSystem typeSystem})
: validator = validator != null
? validator
- : new ConstantEvaluationValidator_ForProduction();
+ : new ConstantEvaluationValidator_ForProduction(),
+ typeSystem = typeSystem != null ? typeSystem : new TypeSystemImpl();
/**
* Check that the arguments to a call to fromEnvironment() are correct. The
@@ -1159,14 +1159,15 @@ class ConstantEvaluator {
* [source]. The [typeProvider] is the type provider used to access known
* types.
*/
- ConstantEvaluator(this._source, this._typeProvider, this._typeSystem);
+ ConstantEvaluator(this._source, this._typeProvider, {TypeSystem typeSystem})
+ : _typeSystem = typeSystem != null ? typeSystem : new TypeSystemImpl();
EvaluationResult evaluate(Expression expression) {
RecordingErrorListener errorListener = new RecordingErrorListener();
ErrorReporter errorReporter = new ErrorReporter(errorListener, _source);
DartObjectImpl result = expression.accept(new ConstantVisitor(
- new ConstantEvaluationEngine(
- _typeProvider, _typeSystem, new DeclaredVariables()),
+ new ConstantEvaluationEngine(_typeProvider, new DeclaredVariables(),
+ typeSystem: _typeSystem),
errorReporter));
if (result != null) {
return EvaluationResult.forValue(result);
@@ -1309,11 +1310,11 @@ class ConstantValueComputer {
* the set of variables declared on the command line using '-D'.
*/
ConstantValueComputer(this._context, TypeProvider typeProvider,
- TypeSystem typeSystem, DeclaredVariables declaredVariables,
- [ConstantEvaluationValidator validator])
+ DeclaredVariables declaredVariables,
+ [ConstantEvaluationValidator validator, TypeSystem typeSystem])
: evaluationEngine = new ConstantEvaluationEngine(
- typeProvider, typeSystem, declaredVariables,
- validator: validator);
+ typeProvider, declaredVariables,
+ validator: validator, typeSystem: typeSystem);
/**
* Add the constants in the given compilation [unit] to the list of constants
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698