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

Unified Diff: vm/object.cc

Issue 10021072: Remove the deprecated method invocation and field access apis from the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/object.h ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 6767)
+++ vm/object.cc (working copy)
@@ -4687,6 +4687,35 @@
}
+RawField* Library::LookupFieldAllowPrivate(const String& name) const {
+ // First check if name is found in the local scope of the library.
+ Field& field = Field::Handle(LookupLocalField(name));
+ if (!field.IsNull()) {
+ return field.raw();
+ }
+
+ // Do not look up private names in imported libraries.
+ if (ShouldBePrivate(name)) {
+ return Field::null();
+ }
+
+ // Now check if name is found in the top level scope of any imported
+ // libs.
+ const Array& imports = Array::Handle(this->imports());
+ Library& import_lib = Library::Handle();
+ for (intptr_t j = 0; j < this->num_imports(); j++) {
+ import_lib ^= imports.At(j);
+
+
+ field = import_lib.LookupLocalField(name);
+ if (!field.IsNull()) {
+ return field.raw();
+ }
+ }
+ return Field::null();
+}
+
+
RawField* Library::LookupLocalField(const String& name) const {
Isolate* isolate = Isolate::Current();
Field& field = Field::Handle(isolate, Field::null());
@@ -4708,6 +4737,35 @@
}
+RawFunction* Library::LookupFunctionAllowPrivate(const String& name) const {
+ // First check if name is found in the local scope of the library.
+ Function& function = Function::Handle(LookupLocalFunction(name));
+ if (!function.IsNull()) {
+ return function.raw();
+ }
+
+ // Do not look up private names in imported libraries.
+ if (ShouldBePrivate(name)) {
+ return Function::null();
+ }
+
+ // Now check if name is found in the top level scope of any imported
+ // libs.
+ const Array& imports = Array::Handle(this->imports());
+ Library& import_lib = Library::Handle();
+ for (intptr_t j = 0; j < this->num_imports(); j++) {
+ import_lib ^= imports.At(j);
+
+
+ function = import_lib.LookupLocalFunction(name);
+ if (!function.IsNull()) {
+ return function.raw();
+ }
+ }
+ return Function::null();
+}
+
+
RawFunction* Library::LookupLocalFunction(const String& name) const {
Isolate* isolate = Isolate::Current();
Function& function = Function::Handle(isolate, Function::null());
« no previous file with comments | « vm/object.h ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698