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

Unified Diff: runtime/vm/ast.cc

Issue 11363012: Prevent mutation of final variables (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 | « pkg/pkg.status ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.cc
===================================================================
--- runtime/vm/ast.cc (revision 14350)
+++ runtime/vm/ast.cc (working copy)
@@ -315,6 +315,9 @@
AstNode* LoadStaticFieldNode::MakeAssignmentNode(AstNode* rhs) {
+ if (field().is_final()) {
+ return NULL;
+ }
return new StoreStaticFieldNode(token_pos(), field(), rhs);
}
@@ -362,6 +365,9 @@
const Field& field =
Field::ZoneHandle(cls().LookupStaticField(field_name()));
if (!field.IsNull()) {
+ if (field.is_final()) {
+ return NULL;
+ }
#if defined(DEBUG)
const String& getter_name =
String::Handle(Field::GetterName(field_name()));
« no previous file with comments | « pkg/pkg.status ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698