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

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

Issue 1038283004: Evaluate parameters of static calls that throw NSM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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/language/language_analyzer.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 "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/ast_transformer.h" 9 #include "vm/ast_transformer.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 11028 matching lines...) Expand 10 before | Expand all | Expand 10 after
11039 } 11039 }
11040 selector = ParseInstanceCall(LoadReceiver(primary_pos), 11040 selector = ParseInstanceCall(LoadReceiver(primary_pos),
11041 func_name, 11041 func_name,
11042 primary_pos); 11042 primary_pos);
11043 } 11043 }
11044 } else if (primary_node->primary().IsString()) { 11044 } else if (primary_node->primary().IsString()) {
11045 // Primary is an unresolved name. 11045 // Primary is an unresolved name.
11046 if (primary_node->IsSuper()) { 11046 if (primary_node->IsSuper()) {
11047 ReportError(primary_pos, "illegal use of super"); 11047 ReportError(primary_pos, "illegal use of super");
11048 } 11048 }
11049 String& name = String::CheckedZoneHandle( 11049 String& name =
11050 primary_node->primary().raw()); 11050 String::CheckedZoneHandle(primary_node->primary().raw());
11051 if (current_function().is_static()) { 11051 if (current_function().is_static()) {
11052 selector = ThrowNoSuchMethodError(primary_pos, 11052 // The static call will be converted to throwing a NSM error.
11053 current_class(), 11053 selector = ParseStaticCall(current_class(), name, primary_pos);
11054 name,
11055 NULL, // No arguments.
11056 InvocationMirror::kStatic,
11057 InvocationMirror::kMethod,
11058 NULL); // No existing function.
11059 } else { 11054 } else {
11060 // Treat as call to unresolved (instance) method. 11055 // Treat as call to unresolved (instance) method.
11061 selector = ParseInstanceCall(LoadReceiver(primary_pos), 11056 selector = ParseInstanceCall(LoadReceiver(primary_pos),
11062 name, 11057 name,
11063 primary_pos); 11058 primary_pos);
11064 } 11059 }
11065 } else if (primary_node->primary().IsTypeParameter()) { 11060 } else if (primary_node->primary().IsTypeParameter()) {
11066 const String& name = String::ZoneHandle(Z, 11061 const String& name = String::ZoneHandle(Z,
11067 TypeParameter::Cast(primary_node->primary()).name()); 11062 TypeParameter::Cast(primary_node->primary()).name());
11068 if (ParsingStaticMember()) { 11063 if (ParsingStaticMember()) {
(...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after
13418 void Parser::SkipQualIdent() { 13413 void Parser::SkipQualIdent() {
13419 ASSERT(IsIdentifier()); 13414 ASSERT(IsIdentifier());
13420 ConsumeToken(); 13415 ConsumeToken();
13421 if (CurrentToken() == Token::kPERIOD) { 13416 if (CurrentToken() == Token::kPERIOD) {
13422 ConsumeToken(); // Consume the kPERIOD token. 13417 ConsumeToken(); // Consume the kPERIOD token.
13423 ExpectIdentifier("identifier expected after '.'"); 13418 ExpectIdentifier("identifier expected after '.'");
13424 } 13419 }
13425 } 13420 }
13426 13421
13427 } // namespace dart 13422 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_analyzer.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698