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

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

Issue 11230061: Fix resolution of super getters and setters (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/co19/co19-dart2dart.status » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 ErrorMsg("class '%s' does not have a superclass", 1535 ErrorMsg("class '%s' does not have a superclass",
1536 String::Handle(current_class().Name()).ToCString()); 1536 String::Handle(current_class().Name()).ToCString());
1537 } 1537 }
1538 AstNode* implicit_argument = LoadReceiver(field_pos); 1538 AstNode* implicit_argument = LoadReceiver(field_pos);
1539 1539
1540 const String& getter_name = 1540 const String& getter_name =
1541 String::ZoneHandle(Field::GetterName(field_name)); 1541 String::ZoneHandle(Field::GetterName(field_name));
1542 const Function& super_getter = Function::ZoneHandle( 1542 const Function& super_getter = Function::ZoneHandle(
1543 Resolver::ResolveDynamicAnyArgs(super_class, getter_name)); 1543 Resolver::ResolveDynamicAnyArgs(super_class, getter_name));
1544 if (super_getter.IsNull()) { 1544 if (super_getter.IsNull()) {
1545 const String& setter_name =
1546 String::ZoneHandle(Field::SetterName(field_name));
1547 const Function& super_setter = Function::ZoneHandle(
1548 Resolver::ResolveDynamicAnyArgs(super_class, setter_name));
1549 if (!super_setter.IsNull()) {
1550 return new StaticGetterNode(
1551 field_pos, implicit_argument, true, super_class, field_name);
1552 }
1553 }
1554 if (super_getter.IsNull()) {
1545 // Check if this is an access to an implicit closure using 'super'. 1555 // Check if this is an access to an implicit closure using 'super'.
1546 // If a function exists of the specified field_name then try 1556 // If a function exists of the specified field_name then try
1547 // accessing it as a getter, at runtime we will handle this by 1557 // accessing it as a getter, at runtime we will handle this by
1548 // creating an implicit closure of the function and returning it. 1558 // creating an implicit closure of the function and returning it.
1549 const Function& super_function = Function::ZoneHandle( 1559 const Function& super_function = Function::ZoneHandle(
1550 Resolver::ResolveDynamicAnyArgs(super_class, field_name)); 1560 Resolver::ResolveDynamicAnyArgs(super_class, field_name));
1551 if (super_function.IsNull()) { 1561 if (super_function.IsNull()) {
1552 ErrorMsg(field_pos, "field or getter '%s' not found in superclass", 1562 ErrorMsg(field_pos, "field or getter '%s' not found in superclass",
1553 field_name.ToCString()); 1563 field_name.ToCString());
1554 } 1564 }
(...skipping 8199 matching lines...) Expand 10 before | Expand all | Expand 10 after
9754 void Parser::SkipQualIdent() { 9764 void Parser::SkipQualIdent() {
9755 ASSERT(IsIdentifier()); 9765 ASSERT(IsIdentifier());
9756 ConsumeToken(); 9766 ConsumeToken();
9757 if (CurrentToken() == Token::kPERIOD) { 9767 if (CurrentToken() == Token::kPERIOD) {
9758 ConsumeToken(); // Consume the kPERIOD token. 9768 ConsumeToken(); // Consume the kPERIOD token.
9759 ExpectIdentifier("identifier expected after '.'"); 9769 ExpectIdentifier("identifier expected after '.'");
9760 } 9770 }
9761 } 9771 }
9762 9772
9763 } // namespace dart 9773 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698