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

Unified Diff: pkg/compiler/lib/src/elements/common.dart

Issue 1888393002: Fix some issues in element serialization. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix comment. Created 4 years, 8 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/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/common.dart
diff --git a/pkg/compiler/lib/src/elements/common.dart b/pkg/compiler/lib/src/elements/common.dart
index bbc682ae996c942ff6771d0a0cae7323a669d9d0..9cdce47251bceacdd2678c0d8217a5b1e0005106 100644
--- a/pkg/compiler/lib/src/elements/common.dart
+++ b/pkg/compiler/lib/src/elements/common.dart
@@ -88,6 +88,13 @@ abstract class ElementCommon implements Element {
bool get impliesType => (kind.category & ElementCategory.IMPLIES_TYPE) != 0;
@override
+ bool get isAssignable {
+ if (isFinal || isConst) return false;
+ if (isFunction || isConstructor) return false;
+ return true;
+ }
+
+ @override
Element get declaration => this;
@override
@@ -130,6 +137,20 @@ abstract class ElementCommon implements Element {
}
return cls;
}
+
+ @override
+ Element get outermostEnclosingMemberOrTopLevel {
+ // TODO(lrn): Why is this called "Outermost"?
+ // TODO(johnniwinther): Clean up this method: This method does not return
+ // the outermost for elements in closure classses, but some call-sites rely
+ // on that behavior.
+ for (Element e = this; e != null; e = e.enclosingElement) {
+ if (e.isClassMember || e.isTopLevel) {
+ return e;
+ }
+ }
+ return null;
+ }
}
abstract class LibraryElementCommon implements LibraryElement {
@@ -455,8 +476,6 @@ abstract class FunctionSignatureCommon implements FunctionSignature {
optionalParameters.forEach(function);
}
- Element get firstOptionalParameter => optionalParameters.first;
-
void forEachParameter(void function(Element parameter)) {
forEachRequiredParameter(function);
forEachOptionalParameter(function);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698