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

Unified Diff: runtime/lib/mirrors.cc

Issue 2758003002: Fix LibraryDependencyMirrors when the target is a native extension. (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 4a68c8667877c15dfb49755e136314e04e47ec3f..1dade418b20d37dcac6e91577b4a9dfe5a4c9293 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -446,7 +446,14 @@ static RawInstance* CreateLibraryDependencyMirror(Thread* thread,
const Array& args = Array::Handle(Array::New(7));
args.SetAt(0, importer);
- args.SetAt(1, importee.Loaded() ? importee_mirror : prefix);
+ if (importee.Loaded() || prefix.IsNull()) {
+ // A native extension is never "loaded" by the embedder. Use the fact that
+ // it doesn't have an prefix where asa deferred import does to distinguish
+ // it from a deferred import. It will appear like an empty library.
+ args.SetAt(1, importee_mirror);
+ } else {
+ args.SetAt(1, prefix);
+ }
args.SetAt(2, combinators);
args.SetAt(3, prefix.IsNull() ? Object::null_object()
: String::Handle(prefix.name()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698