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

Unified Diff: runtime/vm/parser.cc

Issue 15987003: Small code cleanup in the parser. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | 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 23211)
+++ runtime/vm/parser.cc (working copy)
@@ -1573,8 +1573,9 @@
ASSERT(!super_class.IsNull());
super_op =
new LoadIndexedNode(operator_pos, receiver, index_expr, super_class);
- } else if (Token::CanBeOverloaded(CurrentToken()) ||
- (CurrentToken() == Token::kNE)) {
+ } else {
+ ASSERT(Token::CanBeOverloaded(CurrentToken()) ||
+ (CurrentToken() == Token::kNE));
Token::Kind op = CurrentToken();
ConsumeToken();
@@ -1656,28 +1657,24 @@
String::ZoneHandle(Field::SetterName(field_name));
const Function& super_setter = Function::ZoneHandle(
Resolver::ResolveDynamicAnyArgs(super_class, setter_name));
- if (!super_setter.IsNull()) {
- return new StaticGetterNode(
- field_pos, implicit_argument, true, super_class, field_name);
+ if (super_setter.IsNull()) {
+ // Check if this is an access to an implicit closure using 'super'.
+ // If a function exists of the specified field_name then try
+ // accessing it as a getter, at runtime we will handle this by
+ // creating an implicit closure of the function and returning it.
+ const Function& super_function = Function::ZoneHandle(
+ Resolver::ResolveDynamicAnyArgs(super_class, field_name));
+ if (!super_function.IsNull()) {
+ // In case CreateAssignmentNode is called later on this
+ // CreateImplicitClosureNode, it will be replaced by a StaticSetterNode.
+ return CreateImplicitClosureNode(super_function,
+ field_pos,
+ implicit_argument);
+ }
+ // No function or field exists of the specified field_name.
+ // Emit a StaticGetterNode anyway, so that noSuchMethod gets called.
}
}
- if (super_getter.IsNull()) {
- // Check if this is an access to an implicit closure using 'super'.
- // If a function exists of the specified field_name then try
- // accessing it as a getter, at runtime we will handle this by
- // creating an implicit closure of the function and returning it.
- const Function& super_function = Function::ZoneHandle(
- Resolver::ResolveDynamicAnyArgs(super_class, field_name));
- if (!super_function.IsNull()) {
- // In case CreateAssignmentNode is called later on this
- // CreateImplicitClosureNode, it will be replaced by a StaticSetterNode.
- return CreateImplicitClosureNode(super_function,
- field_pos,
- implicit_argument);
- }
- // No function or field exists of the specified field_name.
- // Emit a StaticGetterNode anyway, so that noSuchMethod gets called.
- }
return new StaticGetterNode(
field_pos, implicit_argument, true, super_class, field_name);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698