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

Unified Diff: pkg/compiler/lib/src/resolution/constructors.dart

Issue 2141023002: Make initializing formal access available by default (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Additional clean-up, now ready to land Created 4 years, 1 month 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 | « pkg/compiler/lib/src/options.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/constructors.dart
diff --git a/pkg/compiler/lib/src/resolution/constructors.dart b/pkg/compiler/lib/src/resolution/constructors.dart
index 4a37428d40de8834832994b0a482dcfc3aad322b..ae51c80018dd6a9d78f4142fc999cf01c73a8048 100644
--- a/pkg/compiler/lib/src/resolution/constructors.dart
+++ b/pkg/compiler/lib/src/resolution/constructors.dart
@@ -294,8 +294,7 @@ class InitializerResolver {
* Resolve all initializers of this constructor. In the case of a redirecting
* constructor, the resolved constructor's function element is returned.
*/
- ConstructorElement resolveInitializers(
- {bool enableInitializingFormalAccess: false}) {
+ ConstructorElement resolveInitializers() {
Map<dynamic /*String|int*/, ConstantExpression> defaultValues =
<dynamic /*String|int*/, ConstantExpression>{};
ConstructedConstantExpression constructorInvocation;
@@ -303,12 +302,10 @@ class InitializerResolver {
// that we can ensure that fields are initialized only once.
FunctionSignature functionParameters = constructor.functionSignature;
Scope oldScope = visitor.scope;
- if (enableInitializingFormalAccess) {
- // In order to get the correct detection of name clashes between all
- // parameters (regular ones and initializing formals) we must extend
- // the parameter scope rather than adding a new nested scope.
- visitor.scope = new ExtensionScope(visitor.scope);
- }
+ // In order to get the correct detection of name clashes between all
+ // parameters (regular ones and initializing formals) we must extend
+ // the parameter scope rather than adding a new nested scope.
+ visitor.scope = new ExtensionScope(visitor.scope);
Link<Node> parameterNodes = (functionNode.parameters == null)
? const Link<Node>()
: functionNode.parameters.nodes;
@@ -349,10 +346,8 @@ class InitializerResolver {
registry.registerStaticUse(new StaticUse.fieldInit(field));
}
checkForDuplicateInitializers(field, element.initializer);
- if (enableInitializingFormalAccess) {
- visitor.defineLocalVariable(parameterNode, initializingFormal);
- visitor.addToScope(initializingFormal);
- }
+ visitor.defineLocalVariable(parameterNode, initializingFormal);
+ visitor.addToScope(initializingFormal);
if (isConst) {
if (element.isNamed) {
fieldInitializers[field] = new NamedArgumentReference(element.name);
« no previous file with comments | « pkg/compiler/lib/src/options.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698