Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index bb59b5e7dce4a0c45d9b2606565d9f1631852675..b62fb8d0df4fb7b8b1b0277a039e7c483487413e 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -3341,6 +3341,21 @@ void Isolate::DebugStateUpdated() { |
promise_hook_or_debug_is_active_ = promise_hook_ || debug()->is_active(); |
} |
+void Isolate::RunHostImportModuleDynamicallyCallback( |
+ Handle<String> source_url, Handle<String> specifier, |
+ Handle<JSPromise> promise) { |
+ if (host_import_module_dynamically_callback_ == nullptr) return; |
neis
2017/03/17 10:36:32
I think we talked about this case. Didn't we agree
gsathya
2017/03/17 21:47:59
I'm not sure tbh. there could be cases where the e
neis
2017/03/20 09:36:03
Hmm, I would imagine that if an embedder for some
gsathya
2017/03/22 03:08:34
Jochen --
For dynamic import to work, we require
|
+ |
+ host_import_module_dynamically_callback_( |
+ reinterpret_cast<v8::Isolate*>(this), v8::Utils::ToLocal(source_url), |
+ v8::Utils::ToLocal(specifier), v8::Utils::PromiseToLocal(promise)); |
+} |
+ |
+void Isolate::SetHostImportModuleDynamicallyCallback( |
+ HostImportModuleDynamicallyCallback callback) { |
+ host_import_module_dynamically_callback_ = callback; |
+} |
+ |
void Isolate::SetPromiseHook(PromiseHook hook) { |
promise_hook_ = hook; |
DebugStateUpdated(); |