Skip to content

Commit f443475

Browse files
committed
1 parent 94bb41a commit f443475

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

patches/node/fix_replace_deprecated_setprototype.patch

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Subject: fix: replace deprecated SetPrototype
66
https://chromium-review.googlesource.com/c/v8/v8/+/6983465
77

88
This is already applied in newer versions of Node so we can drop
9-
this patch once we upgrade.
9+
this patch once we upgrade to v23.
1010

1111
diff --git a/src/api/environment.cc b/src/api/environment.cc
1212
index d3f02f4b56f035e7fa2a596a029795cd84b71c28..43838863294e954f10bb01f9b2de1b0e9f5ed7af 100644
@@ -30,3 +30,29 @@ index d3f02f4b56f035e7fa2a596a029795cd84b71c28..43838863294e954f10bb01f9b2de1b0e
3030
.IsNothing()) {
3131
return MaybeLocal<Object>();
3232
}
33+
diff --git a/src/node_constants.cc b/src/node_constants.cc
34+
index 428700c91457cd087d6b9fc6fd3db420e103dd92..2029b7835bcf506900ea28fa137316af6c97e655 100644
35+
--- a/src/node_constants.cc
36+
+++ b/src/node_constants.cc
37+
@@ -1311,7 +1311,7 @@ void CreatePerContextProperties(Local<Object> target,
38+
.FromJust());
39+
40+
Local<Object> internal_constants = Object::New(isolate);
41+
- CHECK(internal_constants->SetPrototype(env->context(),
42+
+ CHECK(internal_constants->SetPrototypeV2(env->context(),
43+
Null(env->isolate())).FromJust());
44+
45+
DefineErrnoConstants(err_constants);
46+
diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc
47+
index 62f280c1e0e860ae3a3c8b48eda31a3cc8f0c216..7b3a15f4be4b4cc0b817d60ba8675e553989ec61 100644
48+
--- a/src/node_sqlite.cc
49+
+++ b/src/node_sqlite.cc
50+
@@ -2103,7 +2103,7 @@ void StatementSync::Iterate(const FunctionCallbackInfo<Value>& args) {
51+
if (iter->object()
52+
->GetPrototype()
53+
.As<Object>()
54+
- ->SetPrototype(context, js_iterator_prototype)
55+
+ ->SetPrototypeV2(context, js_iterator_prototype)
56+
.IsNothing()) {
57+
return;
58+
}

0 commit comments

Comments
 (0)