| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |