Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Fix use of deprecated methods removed in V8 7.0 #124

Merged
merged 1 commit into from Mar 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/module.cc
Expand Up @@ -212,7 +212,11 @@ static void PrintStackFromStackTrace(Isolate* isolate, FILE* fp) {
StackTrace::kDetailed);
// Print the JavaScript function name and source information for each frame
for (int i = 0; i < stack->GetFrameCount(); i++) {
Local<StackFrame> frame = stack->GetFrame(i);
Local<StackFrame> frame = stack->GetFrame(
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are versions of V8 that don't define V8_MAJOR_VERSION?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not in any versions of Node.js this module has ever supported. It may be true in long outdated versions of Node.js (e.g. deps/v8/include/v8-version.h (where V8_MAJOR_VERSION is currently defined) doesn't exist in Node.js' v0.10 branch).

For reference, nan does similar checks: https://github.com/nodejs/nan/blob/19f08c2394b19a5dbe854020fed0446606d68955/nan.h#L215-L216

isolate,
#endif
i);
Nan::Utf8String fn_name_s(frame->GetFunctionName());
Nan::Utf8String script_name(frame->GetScriptName());
const int line_number = frame->GetLineNumber();
Expand Down