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

Unified Diff: src/d8.cc

Issue 2366773002: [modules] Allow Module::Instantiate to throw exceptions (Closed)
Patch Set: Rebased Created 4 years, 3 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/counters.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 43049499ab7a7f5b115c41b99fba13da61c44852..a38e8f5abd3cc2631bc002168b5c6e86ed4f635d 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -641,11 +641,11 @@ bool Shell::ExecuteModule(Isolate* isolate, const char* file_name) {
Local<Context> realm = data->realms_[data->realm_current_].Get(isolate);
Context::Scope context_scope(realm);
- // This can't fail until we support linking.
- CHECK(root_module->Instantiate(realm, ResolveModuleCallback,
- External::New(isolate, &module_map)));
- maybe_result = root_module->Evaluate(realm);
- EmptyMessageQueues(isolate);
+ if (root_module->Instantiate(realm, ResolveModuleCallback,
+ External::New(isolate, &module_map))) {
+ maybe_result = root_module->Evaluate(realm);
+ EmptyMessageQueues(isolate);
+ }
}
Local<Value> result;
if (!maybe_result.ToLocal(&result)) {
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698