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

Unified Diff: lib/compiler/implementation/tree/nodes.dart

Issue 11087025: Fix to dartbug.com/5170, explictly static library variables now get an appropriate error message. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase with master Created 8 years, 2 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 | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/tree/nodes.dart
diff --git a/lib/compiler/implementation/tree/nodes.dart b/lib/compiler/implementation/tree/nodes.dart
index 72467acf9edb737f639d35ab13a9a95ef5871f0a..c31df5a2a4c1d9d279d96eb42fc74cbecb2bcb78 100644
--- a/lib/compiler/implementation/tree/nodes.dart
+++ b/lib/compiler/implementation/tree/nodes.dart
@@ -1171,6 +1171,17 @@ class Modifiers extends Node {
}
return flags;
}
+
+ Node findModifier(String modifier) {
+ Link<Node> nodeList = nodes.nodes;
+ for (; !nodeList.isEmpty(); nodeList = nodeList.tail) {
+ String value = nodeList.head.asIdentifier().source.stringValue;
+ if(value === modifier) {
+ return nodeList.head;
+ }
+ }
+ return null;
+ }
Modifiers asModifiers() => this;
Token getBeginToken() => nodes.getBeginToken();
@@ -1186,6 +1197,8 @@ class Modifiers extends Node {
bool isFactory() => (flags & FLAG_FACTORY) != 0;
bool isExternal() => (flags & FLAG_EXTERNAL) != 0;
+ Node getStatic() => findModifier('static');
+
/**
* Use this to check if the declaration is either explicitly or implicitly
* final.
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698