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 <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
targos committed Sep 3, 2018
1 parent 3dc9cfc commit 9478f29
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 9478f29

Please sign in to comment.