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

Side by Side Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 2626043002: Do not refer to initializing parameters in initializer lists. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong_mode.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 /** 111 /**
112 * The type system primitives. 112 * The type system primitives.
113 */ 113 */
114 final TypeSystem _typeSystem; 114 final TypeSystem _typeSystem;
115 115
116 /** 116 /**
117 * Initialize a newly created evaluator to evaluate expressions in the given 117 * Initialize a newly created evaluator to evaluate expressions in the given
118 * [source]. The [typeProvider] is the type provider used to access known 118 * [source]. The [typeProvider] is the type provider used to access known
119 * types. 119 * types.
120 */ 120 */
121 ConstantEvaluator(this._source, this._typeProvider, {TypeSystem typeSystem}) 121 ConstantEvaluator(this._source, TypeProvider typeProvider,
122 : _typeSystem = typeSystem ?? new TypeSystemImpl(_typeProvider); 122 {TypeSystem typeSystem})
123 : _typeSystem = typeSystem ?? new TypeSystemImpl(typeProvider),
124 _typeProvider = typeProvider;
123 125
124 EvaluationResult evaluate(Expression expression) { 126 EvaluationResult evaluate(Expression expression) {
125 RecordingErrorListener errorListener = new RecordingErrorListener(); 127 RecordingErrorListener errorListener = new RecordingErrorListener();
126 ErrorReporter errorReporter = new ErrorReporter(errorListener, _source); 128 ErrorReporter errorReporter = new ErrorReporter(errorListener, _source);
127 DartObjectImpl result = expression.accept(new ConstantVisitor( 129 DartObjectImpl result = expression.accept(new ConstantVisitor(
128 new ConstantEvaluationEngine(_typeProvider, new DeclaredVariables(), 130 new ConstantEvaluationEngine(_typeProvider, new DeclaredVariables(),
129 typeSystem: _typeSystem), 131 typeSystem: _typeSystem),
130 errorReporter)); 132 errorReporter));
131 if (result != null) { 133 if (result != null) {
132 return EvaluationResult.forValue(result); 134 return EvaluationResult.forValue(result);
133 } 135 }
134 return EvaluationResult.forErrors(errorListener.errors); 136 return EvaluationResult.forErrors(errorListener.errors);
135 } 137 }
136 } 138 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698