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

Unified Diff: src/objects.cc

Issue 2827733002: [modules] Allow resolve-callback to signal failure. (Closed)
Patch Set: Cleanup. Created 3 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 | « src/objects.h ('k') | test/cctest/test-modules.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index ba56261c9991a48efc3d5f838630c06c058ebae7..ca001ccff843eeb041fa51611b5d1cf3e88c309b 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -20334,15 +20334,10 @@ bool Module::PrepareInstantiate(Handle<Module> module,
for (int i = 0, length = module_requests->length(); i < length; ++i) {
Handle<String> specifier(String::cast(module_requests->get(i)), isolate);
v8::Local<v8::Module> api_requested_module;
- // TODO(adamk): Revisit these failure cases once d8 knows how to
- // persist a module_map across multiple top-level module loads, as
- // the current module is left in a "half-instantiated" state.
if (!callback(context, v8::Utils::ToLocal(specifier),
v8::Utils::ToLocal(module))
.ToLocal(&api_requested_module)) {
- // TODO(adamk): Give this a better error message. But this is a
- // misuse of the API anyway.
- isolate->ThrowIllegalOperation();
+ isolate->PromoteScheduledException();
return false;
}
Handle<Module> requested_module = Utils::OpenHandle(*api_requested_module);
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-modules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698