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

Unified Diff: runtime/vm/parser.cc

Issue 10883071: - Change "static final" to "static const" in the runtime/ directory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 11416)
+++ runtime/vm/parser.cc (working copy)
@@ -2565,7 +2565,7 @@
if (has_initializer) {
ConsumeToken();
init_value = Object::sentinel();
- // For static final fields, the initialization expression
+ // For static const fields, the initialization expression
// will be parsed through the kConstImplicitGetter method
// invocation/compilation.
// For instance fields, the expression is parsed when a constructor
@@ -2602,7 +2602,7 @@
class_field.set_has_initializer(has_initializer);
members->AddField(class_field);
- // For static final fields, set value to "uninitialized" and
+ // For static const fields, set value to "uninitialized" and
// create a kConstImplicitGetter getter method.
if (field->has_static && has_initializer) {
class_field.set_value(init_value);
@@ -3633,8 +3633,13 @@
var_name.ToCString());
}
- field = Field::New(
- var_name, is_static, is_final, is_const, current_class(), name_pos);
+ // TODO(hausner): const and final are equivalent at the moment.
+ field = Field::New(var_name,
+ is_static,
+ is_final || is_const, // Const fields are also final.
+ is_const || is_final,
+ current_class(),
+ name_pos);
field.set_type(type);
field.set_value(Instance::Handle(Instance::null()));
top_level->fields.Add(field);
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698