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

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

Issue 1752203002: Fix issues in name resolution (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/language/language.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 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 11614 matching lines...) Expand 10 before | Expand all | Expand 10 after
11625 Object& obj = Object::Handle(Z); 11625 Object& obj = Object::Handle(Z);
11626 const bool is_private_name = 11626 const bool is_private_name =
11627 (extractor_name.CharAt(0) == Library::kPrivateIdentifierStart); 11627 (extractor_name.CharAt(0) == Library::kPrivateIdentifierStart);
11628 if (!is_private_name) { 11628 if (!is_private_name) {
11629 // Private names are not exported by libraries. The name mangling 11629 // Private names are not exported by libraries. The name mangling
11630 // of private names with a library-specific suffix usually ensures 11630 // of private names with a library-specific suffix usually ensures
11631 // that _x in library A is not found when looked up from library B. 11631 // that _x in library A is not found when looked up from library B.
11632 // In the pathological case where a library imports itself with 11632 // In the pathological case where a library imports itself with
11633 // a prefix, the name mangling does not help in hiding the private 11633 // a prefix, the name mangling does not help in hiding the private
11634 // name, so we explicitly prevent lookup of private names here. 11634 // name, so we explicitly prevent lookup of private names here.
11635 obj = prefix.LookupObject(extractor_name); 11635 if (is_setter_name) {
11636 String& setter_name =
11637 String::Handle(Z, Field::SetterName(extractor_name));
11638 obj = prefix.LookupObject(setter_name);
11639 }
11640 if (obj.IsNull()) {
11641 obj = prefix.LookupObject(extractor_name);
11642 }
11636 } 11643 }
11637 if (!prefix.is_loaded() && (parsed_function() != NULL)) { 11644 if (!prefix.is_loaded() && (parsed_function() != NULL)) {
11638 // Remember that this function depends on an import prefix of an 11645 // Remember that this function depends on an import prefix of an
11639 // unloaded deferred library. 11646 // unloaded deferred library.
11640 parsed_function()->AddDeferredPrefix(prefix); 11647 parsed_function()->AddDeferredPrefix(prefix);
11641 } 11648 }
11642 11649
11643 if (obj.IsFunction()) { 11650 if (obj.IsFunction()) {
11644 const Function& func = Function::Cast(obj); 11651 const Function& func = Function::Cast(obj);
11645 if (!func.IsSetterFunction() || is_setter_name) { 11652 if (!func.IsSetterFunction() || is_setter_name) {
(...skipping 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after
14440 const ArgumentListNode& function_args, 14447 const ArgumentListNode& function_args,
14441 const LocalVariable* temp_for_last_arg, 14448 const LocalVariable* temp_for_last_arg,
14442 bool is_super_invocation) { 14449 bool is_super_invocation) {
14443 UNREACHABLE(); 14450 UNREACHABLE();
14444 return NULL; 14451 return NULL;
14445 } 14452 }
14446 14453
14447 } // namespace dart 14454 } // namespace dart
14448 14455
14449 #endif // DART_PRECOMPILED_RUNTIME 14456 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698