Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: #119
Refs: nodejs/node#22531
Refs: #116
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
richardlau committed Jan 22, 2019
commit 26f88d05db39d33401e8b69619f29be764397ac2
18 changes: 15 additions & 3 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,11 @@ static void PrintJavaScriptErrorStack(std::ostream& out, Isolate* isolate, Maybe
}
// Print the stack trace, samples are not available as the exception isn't from the current stack.
for (int i = 0; i < stack->GetFrameCount(); i++) {
PrintStackFrame(out, isolate, stack->GetFrame(i), i, nullptr);
PrintStackFrame(out, isolate, stack->GetFrame(
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 7)
isolate,
#endif
i), i, nullptr);
}
}

Expand Down Expand Up @@ -545,9 +549,17 @@ static void PrintStackFromStackTrace(std::ostream& out, Isolate* isolate, DumpEv
// Print the stack trace, adding in the pc values from GetStackSample() if available
for (int i = 0; i < stack->GetFrameCount(); i++) {
if (static_cast<size_t>(i) < info.frames_count) {
PrintStackFrame(out, isolate, stack->GetFrame(i), i, samples[i]);
PrintStackFrame(out, isolate, stack->GetFrame(
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 7)
isolate,
#endif
i), i, samples[i]);
} else {
PrintStackFrame(out, isolate, stack->GetFrame(i), i, nullptr);
PrintStackFrame(out, isolate, stack->GetFrame(
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 7)
isolate,
#endif
i), i, nullptr);
}
}
}
Expand Down