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

Side by Side Diff: runtime/vm/ast.cc

Issue 19287003: Use proper internal name for implicit static final getters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/ast.h" 5 #include "vm/ast.h"
6 #include "vm/compiler.h" 6 #include "vm/compiler.h"
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 #include "vm/resolver.h" 10 #include "vm/resolver.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // Attempting to assign to a final variable will cause a NoSuchMethodError 488 // Attempting to assign to a final variable will cause a NoSuchMethodError
489 // to be thrown. Change static getter to non-existent static setter in 489 // to be thrown. Change static getter to non-existent static setter in
490 // order to trigger the throw at runtime. 490 // order to trigger the throw at runtime.
491 return new StaticSetterNode(token_pos(), NULL, cls(), field_name(), rhs); 491 return new StaticSetterNode(token_pos(), NULL, cls(), field_name(), rhs);
492 } 492 }
493 #if defined(DEBUG) 493 #if defined(DEBUG)
494 const String& getter_name = String::Handle(Field::GetterName(field_name())); 494 const String& getter_name = String::Handle(Field::GetterName(field_name()));
495 const Function& getter = 495 const Function& getter =
496 Function::Handle(cls().LookupStaticFunction(getter_name)); 496 Function::Handle(cls().LookupStaticFunction(getter_name));
497 ASSERT(!getter.IsNull() && 497 ASSERT(!getter.IsNull() &&
498 (getter.kind() == RawFunction::kConstImplicitGetter)); 498 (getter.kind() == RawFunction::kImplicitStaticFinalGetter));
499 #endif 499 #endif
500 return new StoreStaticFieldNode(token_pos(), field, rhs); 500 return new StoreStaticFieldNode(token_pos(), field, rhs);
501 } 501 }
502 // Didn't find a static setter or a static field. 502 // Didn't find a static setter or a static field.
503 // If this static getter is in an instance function where 503 // If this static getter is in an instance function where
504 // a receiver is available, we turn this static getter 504 // a receiver is available, we turn this static getter
505 // into an instance setter (and will get an error at runtime if an 505 // into an instance setter (and will get an error at runtime if an
506 // instance setter cannot be found either). 506 // instance setter cannot be found either).
507 if (receiver() != NULL) { 507 if (receiver() != NULL) {
508 return new InstanceSetterNode(token_pos(), receiver(), field_name(), rhs); 508 return new InstanceSetterNode(token_pos(), receiver(), field_name(), rhs);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 if (result.IsError() || result.IsNull()) { 550 if (result.IsError() || result.IsNull()) {
551 // TODO(turnidge): We could get better error messages by returning 551 // TODO(turnidge): We could get better error messages by returning
552 // the Error object directly to the parser. This will involve 552 // the Error object directly to the parser. This will involve
553 // replumbing all of the EvalConstExpr methods. 553 // replumbing all of the EvalConstExpr methods.
554 return NULL; 554 return NULL;
555 } 555 }
556 return &Instance::ZoneHandle(Instance::Cast(result).raw()); 556 return &Instance::ZoneHandle(Instance::Cast(result).raw());
557 } 557 }
558 558
559 } // namespace dart 559 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698