| Index: src/debug/debug.cc
|
| diff --git a/src/debug/debug.cc b/src/debug/debug.cc
|
| index adf3659c68fdf560f267037772bf9baa38efd747..c617c19e54b874ba66c7b4dc422ce0f87a4bb9b1 100644
|
| --- a/src/debug/debug.cc
|
| +++ b/src/debug/debug.cc
|
| @@ -1894,6 +1894,39 @@ void Debug::OnAfterCompile(Handle<Script> script) {
|
| ProcessCompileEvent(v8::AfterCompile, script);
|
| }
|
|
|
| +void Debug::OnModuleResolved(Handle<Module> referer, Handle<Module> requested,
|
| + Handle<String> specifier) {
|
| + if (!debug_delegate_) return;
|
| + if (!referer->script()->IsScript() || !requested->script()->IsScript())
|
| + return;
|
| + debug_delegate_->ModuleResolved(
|
| + ToApiHandle<debug::Script>(handle(Script::cast(referer->script()))),
|
| + ToApiHandle<debug::Script>(handle(Script::cast(requested->script()))),
|
| + Utils::ToLocal(specifier));
|
| +}
|
| +
|
| +void Debug::ReportExistingModules() {
|
| + if (!debug_delegate_) return;
|
| + HandleScope handle_scope(isolate_);
|
| + Handle<FixedArray> scripts = GetLoadedScripts();
|
| + for (int i = 0; i < scripts->length(); ++i) {
|
| + Handle<Script> script(Script::cast(scripts->get(i)), isolate_);
|
| + if (!script->module()->IsModule()) continue;
|
| + Handle<Module> module(i::Module::cast(script->module()));
|
| + if (!module->evaluated()) continue;
|
| + Handle<FixedArray> requested_modules(module->requested_modules(), isolate_);
|
| + Handle<FixedArray> module_requests(module->info()->module_requests(),
|
| + isolate_);
|
| + for (int j = 0, length = requested_modules->length(); j < length; ++j) {
|
| + Handle<Module> import(i::Module::cast(requested_modules->get(j)),
|
| + isolate_);
|
| + Handle<String> request(i::String::cast(module_requests->get(j)),
|
| + isolate_);
|
| + OnModuleResolved(module, import, request);
|
| + }
|
| + }
|
| +}
|
| +
|
| namespace {
|
| struct CollectedCallbackData {
|
| Object** location;
|
|
|