Skip to content

Commit bf151e9

Browse files
committed
fix: replace additional usages of SetPrototype
https://chromium-review.googlesource.com/c/v8/v8/+/6983465
1 parent a6fc338 commit bf151e9

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

patches/node/.patches

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ test_accomodate_v8_thenable_stack_trace_change_in_snapshot.patch
5151
chore_exclude_electron_node_folder_from_exit-time-destructors.patch
5252
api_remove_deprecated_getisolate.patch
5353
src_switch_from_get_setprototype_to_get_setprototypev2.patch
54+
fix_replace_deprecated_setprototype.patch
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Samuel Maddock <smaddock@slack-corp.com>
3+
Date: Mon, 6 Oct 2025 16:34:43 -0400
4+
Subject: fix: replace deprecated SetPrototype
5+
6+
https://chromium-review.googlesource.com/c/v8/v8/+/6983465
7+
8+
This is already applied in newer versions of Node so we can drop
9+
this patch once we upgrade.
10+
11+
diff --git a/src/api/environment.cc b/src/api/environment.cc
12+
index d3f02f4b56f035e7fa2a596a029795cd84b71c28..43838863294e954f10bb01f9b2de1b0e9f5ed7af 100644
13+
--- a/src/api/environment.cc
14+
+++ b/src/api/environment.cc
15+
@@ -801,7 +801,7 @@ MaybeLocal<Object> InitializePrivateSymbols(Local<Context> context,
16+
17+
Local<Object> private_symbols_object;
18+
if (!private_symbols->NewInstance(context).ToLocal(&private_symbols_object) ||
19+
- private_symbols_object->SetPrototype(context, Null(isolate))
20+
+ private_symbols_object->SetPrototypeV2(context, Null(isolate))
21+
.IsNothing()) {
22+
return MaybeLocal<Object>();
23+
}
24+
@@ -827,7 +827,7 @@ MaybeLocal<Object> InitializePerIsolateSymbols(Local<Context> context,
25+
Local<Object> per_isolate_symbols_object;
26+
if (!per_isolate_symbols->NewInstance(context).ToLocal(
27+
&per_isolate_symbols_object) ||
28+
- per_isolate_symbols_object->SetPrototype(context, Null(isolate))
29+
+ per_isolate_symbols_object->SetPrototypeV2(context, Null(isolate))
30+
.IsNothing()) {
31+
return MaybeLocal<Object>();
32+
}

0 commit comments

Comments
 (0)