Skip to content

Commit

Permalink
Merge pull request #59 from oven-sh/jarred/instead-of-module
Browse files Browse the repository at this point in the history
Print module source URL instead of `<module>` in sampling profiler & debugger
  • Loading branch information
Jarred-Sumner authored Jun 25, 2024
2 parents 5bbfe7e + 9c9a584 commit 5ace260
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Source/JavaScriptCore/bytecode/CodeBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,22 @@ CString CodeBlock::inferredName() const
return "<eval>"_span;
case FunctionCode:
return jsCast<FunctionExecutable*>(ownerExecutable())->ecmaName().utf8();
case ModuleCode:
case ModuleCode: {
#if USE(BUN_JSC_ADDITIONS)
if (m_ownerExecutable) {
auto *provider = ownerExecutable()->source().provider();
if (provider && !provider->sourceURL().isEmpty()) {
return provider->sourceURL().utf8();
}
}
#endif
return "<module>"_span;
default:
}
default: {
CRASH();
return ""_span;
}
}
}

bool CodeBlock::hasHash() const
Expand Down

0 comments on commit 5ace260

Please sign in to comment.