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

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: Comments from Peter. 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
Index: lib/compiler/implementation/tree/nodes.dart
diff --git a/lib/compiler/implementation/tree/nodes.dart b/lib/compiler/implementation/tree/nodes.dart
index 5fcd0eadcd7cd09d3b79318adc5105c1a4113e26..addc4fd318fac0880b2284d1d84a3b0fd4824609 100644
--- a/lib/compiler/implementation/tree/nodes.dart
+++ b/lib/compiler/implementation/tree/nodes.dart
@@ -1169,6 +1169,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();
@@ -1184,6 +1195,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.

Powered by Google App Engine
This is Rietveld 408576698