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