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

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

Issue 10879003: Const variables handled as final (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment shortened Created 8 years, 4 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 2687ca8176785f70f5e23f0a258f481bb6e56c69..014c86a4f659e47f0447971178786ed1a2ba63a5 100644
--- a/lib/compiler/implementation/tree/nodes.dart
+++ b/lib/compiler/implementation/tree/nodes.dart
@@ -1140,6 +1140,12 @@ class Modifiers extends Node {
bool isFactory() => (flags & FLAG_FACTORY) != 0;
bool isExternal() => (flags & FLAG_EXTERNAL) != 0;
+ /**
+ * Use this to check if the declaration is either explicitly or implicitly
+ * final.
+ */
+ bool isFinalOrConst() => isFinal() || isConst();
+
String toString() {
LinkBuilder<String> builder = new LinkBuilder<String>();
if (isStatic()) builder.addLast('static');

Powered by Google App Engine
This is Rietveld 408576698