Add a userland way to hide stack frames

This commit is contained in:
Jarred Sumner
2022-12-02 19:33:59 -08:00
parent 2f917f7030
commit 33cf491fea

View File

@@ -1639,7 +1639,9 @@ pub const VirtualMachine = struct {
if (this.hide_bun_stackframes) {
var start_index: ?usize = null;
for (frames) |frame, i| {
if (frame.source_url.eqlComptime("bun:wrap")) {
if (frame.source_url.eqlComptime("bun:wrap") or
frame.function_name.eqlComptime("::bunternal::"))
{
start_index = i;
break;
}
@@ -1650,7 +1652,9 @@ pub const VirtualMachine = struct {
var i: usize = k;
while (i < frames.len) : (i += 1) {
const frame = frames[i];
if (frame.source_url.eqlComptime("bun:wrap")) {
if (frame.source_url.eqlComptime("bun:wrap") or
frame.function_name.eqlComptime("::bunternal::"))
{
continue;
}
frames[j] = frame;