Skip to content

Commit 26f88d0

Browse files
committed
Fix use of deprecated methods removed in V8 7.0
StackFrame::GetFrame(uint32_t index) was deprecated in V8 6.9 and removed in V8 7.0. PR-URL: nodejs#119 Refs: nodejs/node#22531 Refs: nodejs#116 Reviewed-By: Michael Dawson <[email protected]>
1 parent a696eb0 commit 26f88d0

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/node_report.cc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,11 @@ static void PrintJavaScriptErrorStack(std::ostream& out, Isolate* isolate, Maybe
509509
}
510510
// Print the stack trace, samples are not available as the exception isn't from the current stack.
511511
for (int i = 0; i < stack->GetFrameCount(); i++) {
512-
PrintStackFrame(out, isolate, stack->GetFrame(i), i, nullptr);
512+
PrintStackFrame(out, isolate, stack->GetFrame(
513+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 7)
514+
isolate,
515+
#endif
516+
i), i, nullptr);
513517
}
514518
}
515519

@@ -545,9 +549,17 @@ static void PrintStackFromStackTrace(std::ostream& out, Isolate* isolate, DumpEv
545549
// Print the stack trace, adding in the pc values from GetStackSample() if available
546550
for (int i = 0; i < stack->GetFrameCount(); i++) {
547551
if (static_cast<size_t>(i) < info.frames_count) {
548-
PrintStackFrame(out, isolate, stack->GetFrame(i), i, samples[i]);
552+
PrintStackFrame(out, isolate, stack->GetFrame(
553+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 7)
554+
isolate,
555+
#endif
556+
i), i, samples[i]);
549557
} else {
550-
PrintStackFrame(out, isolate, stack->GetFrame(i), i, nullptr);
558+
PrintStackFrame(out, isolate, stack->GetFrame(
559+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 7)
560+
isolate,
561+
#endif
562+
i), i, nullptr);
551563
}
552564
}
553565
}

0 commit comments

Comments
 (0)