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

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

Issue 25842003: VM: Fix bug with evaluation order of static setter invocation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 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-runtime.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 "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 8169 matching lines...) Expand 10 before | Expand all | Expand 10 after
8180 if (primary->IsSuper()) { 8180 if (primary->IsSuper()) {
8181 return primary; 8181 return primary;
8182 } 8182 }
8183 // In a static method, evaluation of an unresolved identifier causes a 8183 // In a static method, evaluation of an unresolved identifier causes a
8184 // NoSuchMethodError to be thrown. 8184 // NoSuchMethodError to be thrown.
8185 // In an instance method, we convert this into a getter call 8185 // In an instance method, we convert this into a getter call
8186 // for a field (which may be defined in a subclass.) 8186 // for a field (which may be defined in a subclass.)
8187 String& name = String::CheckedZoneHandle(primary->primary().raw()); 8187 String& name = String::CheckedZoneHandle(primary->primary().raw());
8188 if (current_function().is_static() || 8188 if (current_function().is_static() ||
8189 current_function().IsInFactoryScope()) { 8189 current_function().IsInFactoryScope()) {
8190 return ThrowNoSuchMethodError(primary->token_pos(), 8190 return new StaticGetterNode(primary->token_pos(),
8191 current_class(), 8191 NULL, // No receiver.
8192 name, 8192 false, // Not a super getter.
8193 NULL, // No arguments. 8193 Class::ZoneHandle(current_class().raw()),
8194 InvocationMirror::kStatic, 8194 name);
8195 InvocationMirror::kField,
8196 NULL); // No existing function.
8197 } else { 8195 } else {
8198 AstNode* receiver = LoadReceiver(primary->token_pos()); 8196 AstNode* receiver = LoadReceiver(primary->token_pos());
8199 return CallGetter(node->token_pos(), receiver, name); 8197 return CallGetter(node->token_pos(), receiver, name);
8200 } 8198 }
8201 } 8199 }
8202 return primary; 8200 return primary;
8203 } 8201 }
8204 8202
8205 8203
8206 AstNode* Parser::LoadClosure(PrimaryNode* primary) { 8204 AstNode* Parser::LoadClosure(PrimaryNode* primary) {
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after
10611 void Parser::SkipQualIdent() { 10609 void Parser::SkipQualIdent() {
10612 ASSERT(IsIdentifier()); 10610 ASSERT(IsIdentifier());
10613 ConsumeToken(); 10611 ConsumeToken();
10614 if (CurrentToken() == Token::kPERIOD) { 10612 if (CurrentToken() == Token::kPERIOD) {
10615 ConsumeToken(); // Consume the kPERIOD token. 10613 ConsumeToken(); // Consume the kPERIOD token.
10616 ExpectIdentifier("identifier expected after '.'"); 10614 ExpectIdentifier("identifier expected after '.'");
10617 } 10615 }
10618 } 10616 }
10619 10617
10620 } // namespace dart 10618 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698