Skip to content

Commit 9478f29

Browse files
committed
src: use StackFrame::GetFrame with isolate
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>
1 parent 3dc9cfc commit 9478f29

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/env.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void Environment::PrintSyncTrace() const {
320320
uv_os_getpid());
321321

322322
for (int i = 0; i < stack->GetFrameCount() - 1; i++) {
323-
Local<StackFrame> stack_frame = stack->GetFrame(i);
323+
Local<StackFrame> stack_frame = stack->GetFrame(isolate(), i);
324324
node::Utf8Value fn_name_s(isolate(), stack_frame->GetFunctionName());
325325
node::Utf8Value script_name(isolate(), stack_frame->GetScriptName());
326326
const int line_number = stack_frame->GetLineNumber();

src/inspector_agent.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,22 +476,20 @@ class NodeInspectorClient : public V8InspectorClient {
476476
}
477477

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

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

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

485-
if (!stack_trace.IsEmpty() &&
486-
stack_trace->GetFrameCount() > 0 &&
487-
script_id == stack_trace->GetFrame(0)->GetScriptId()) {
486+
if (!stack_trace.IsEmpty() && stack_trace->GetFrameCount() > 0 &&
487+
script_id == stack_trace->GetFrame(isolate, 0)->GetScriptId()) {
488488
script_id = 0;
489489
}
490490

491491
const uint8_t DETAILS[] = "Uncaught";
492492

493-
Isolate* isolate = context->GetIsolate();
494-
495493
client_->exceptionThrown(
496494
context,
497495
StringView(DETAILS, sizeof(DETAILS) - 1),

0 commit comments

Comments
 (0)