Skip to content

Commit

Permalink
src: use StackFrame::GetFrame with isolate
Browse files Browse the repository at this point in the history
PR-URL: #22531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
targos committed Aug 30, 2018
1 parent fd991cf commit a6af5df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void Environment::PrintSyncTrace() const {
uv_os_getpid());

for (int i = 0; i < stack->GetFrameCount() - 1; i++) {
Local<StackFrame> stack_frame = stack->GetFrame(i);
Local<StackFrame> stack_frame = stack->GetFrame(isolate(), i);
node::Utf8Value fn_name_s(isolate(), stack_frame->GetFunctionName());
node::Utf8Value script_name(isolate(), stack_frame->GetScriptName());
const int line_number = stack_frame->GetLineNumber();
Expand Down
8 changes: 3 additions & 5 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -476,22 +476,20 @@ class NodeInspectorClient : public V8InspectorClient {
}

void FatalException(Local<Value> error, Local<v8::Message> message) {
Isolate* isolate = env_->isolate();
Local<Context> context = env_->context();

int script_id = message->GetScriptOrigin().ScriptID()->Value();

Local<v8::StackTrace> stack_trace = message->GetStackTrace();

if (!stack_trace.IsEmpty() &&
stack_trace->GetFrameCount() > 0 &&
script_id == stack_trace->GetFrame(0)->GetScriptId()) {
if (!stack_trace.IsEmpty() && stack_trace->GetFrameCount() > 0 &&
script_id == stack_trace->GetFrame(isolate, 0)->GetScriptId()) {
script_id = 0;
}

const uint8_t DETAILS[] = "Uncaught";

Isolate* isolate = context->GetIsolate();

client_->exceptionThrown(
context,
StringView(DETAILS, sizeof(DETAILS) - 1),
Expand Down

0 comments on commit a6af5df

Please sign in to comment.