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

Side by Side Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 2132383002: Renamed isParameter to isRegularParameter. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Review response Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.resolution.members; 5 library dart2js.resolution.members;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show Selectors; 8 import '../common/names.dart' show Selectors;
9 import '../common/resolution.dart' show Feature; 9 import '../common/resolution.dart' show Feature;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 /// the initializer of the variable is implicit and we should not emit an 105 /// the initializer of the variable is implicit and we should not emit an
106 /// error when verifying that all final variables are initialized. 106 /// error when verifying that all final variables are initialized.
107 bool inLoopVariable = false; 107 bool inLoopVariable = false;
108 108
109 /// The nodes for which variable access and mutation must be registered in 109 /// The nodes for which variable access and mutation must be registered in
110 /// order to determine when the static type of variables types is promoted. 110 /// order to determine when the static type of variables types is promoted.
111 Link<Node> promotionScope = const Link<Node>(); 111 Link<Node> promotionScope = const Link<Node>();
112 112
113 bool isPotentiallyMutableTarget(Element target) { 113 bool isPotentiallyMutableTarget(Element target) {
114 if (target == null) return false; 114 if (target == null) return false;
115 return (target.isVariable || target.isParameter) && 115 return (target.isVariable || target.isRegularParameter) &&
116 !(target.isFinal || target.isConst); 116 !(target.isFinal || target.isConst);
117 } 117 }
118 118
119 // TODO(ahe): Find a way to share this with runtime implementation. 119 // TODO(ahe): Find a way to share this with runtime implementation.
120 static final RegExp symbolValidationPattern = 120 static final RegExp symbolValidationPattern =
121 new RegExp(r'^(?:[a-zA-Z$][a-zA-Z$0-9_]*\.)*(?:[a-zA-Z$][a-zA-Z$0-9_]*=?|' 121 new RegExp(r'^(?:[a-zA-Z$][a-zA-Z$0-9_]*\.)*(?:[a-zA-Z$][a-zA-Z$0-9_]*=?|'
122 r'-|' 122 r'-|'
123 r'unary-|' 123 r'unary-|'
124 r'\[\]=|' 124 r'\[\]=|'
125 r'~|' 125 r'~|'
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 message: "Unexpected super setter '$setter'.")); 872 message: "Unexpected super setter '$setter'."));
873 return new CompoundAccessSemantics( 873 return new CompoundAccessSemantics(
874 CompoundAccessKind.SUPER_METHOD_SETTER, getter, setter); 874 CompoundAccessKind.SUPER_METHOD_SETTER, getter, setter);
875 } 875 }
876 } 876 }
877 } 877 }
878 878
879 /// Compute the [AccessSemantics] corresponding to a local access of [target]. 879 /// Compute the [AccessSemantics] corresponding to a local access of [target].
880 AccessSemantics computeLocalAccessSemantics( 880 AccessSemantics computeLocalAccessSemantics(
881 Spannable node, LocalElement target) { 881 Spannable node, LocalElement target) {
882 if (target.isParameter) { 882 if (target.isRegularParameter) {
883 if (target.isFinal || target.isConst) { 883 if (target.isFinal || target.isConst) {
884 return new StaticAccess.finalParameter(target); 884 return new StaticAccess.finalParameter(target);
885 } else { 885 } else {
886 return new StaticAccess.parameter(target); 886 return new StaticAccess.parameter(target);
887 } 887 }
888 } else if (target.isInitializingFormal) { 888 } else if (target.isInitializingFormal) {
889 return new StaticAccess.finalParameter(target); 889 return new StaticAccess.finalParameter(target);
890 } else if (target.isVariable) { 890 } else if (target.isVariable) {
891 if (target.isFinal || target.isConst) { 891 if (target.isFinal || target.isConst) {
892 return new StaticAccess.finalLocalVariable(target); 892 return new StaticAccess.finalLocalVariable(target);
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
2552 2552
2553 registerPotentialAccessInClosure(node, element); 2553 registerPotentialAccessInClosure(node, element);
2554 2554
2555 return result; 2555 return result;
2556 } 2556 }
2557 2557
2558 /// Handle update of a parameter, local variable or local function. 2558 /// Handle update of a parameter, local variable or local function.
2559 ResolutionResult handleLocalUpdate(Send node, Name name, Element element) { 2559 ResolutionResult handleLocalUpdate(Send node, Name name, Element element) {
2560 AccessSemantics semantics; 2560 AccessSemantics semantics;
2561 ErroneousElement error; 2561 ErroneousElement error;
2562 if (element.isParameter) { 2562 if (element.isRegularParameter) {
2563 if (element.isFinal) { 2563 if (element.isFinal) {
2564 error = reportAndCreateErroneousElement(node.selector, name.text, 2564 error = reportAndCreateErroneousElement(node.selector, name.text,
2565 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); 2565 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name});
2566 semantics = new StaticAccess.finalParameter(element); 2566 semantics = new StaticAccess.finalParameter(element);
2567 } else { 2567 } else {
2568 semantics = new StaticAccess.parameter(element); 2568 semantics = new StaticAccess.parameter(element);
2569 } 2569 }
2570 } else if (element.isInitializingFormal && 2570 } else if (element.isInitializingFormal &&
2571 compiler.options.enableInitializingFormalAccess) { 2571 compiler.options.enableInitializingFormalAccess) {
2572 error = reportAndCreateErroneousElement(node.selector, name.text, 2572 error = reportAndCreateErroneousElement(node.selector, name.text,
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
4722 } 4722 }
4723 return const NoneResult(); 4723 return const NoneResult();
4724 } 4724 }
4725 } 4725 }
4726 4726
4727 /// Looks up [name] in [scope] and unwraps the result. 4727 /// Looks up [name] in [scope] and unwraps the result.
4728 Element lookupInScope( 4728 Element lookupInScope(
4729 DiagnosticReporter reporter, Node node, Scope scope, String name) { 4729 DiagnosticReporter reporter, Node node, Scope scope, String name) {
4730 return Elements.unwrap(scope.lookup(name), reporter, node); 4730 return Elements.unwrap(scope.lookup(name), reporter, node);
4731 } 4731 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/serialization/element_serialization.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698