mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: replace deprecated usage of SetPrototype
https://chromium-review.googlesource.com/c/v8/v8/+/6983465
This commit is contained in:
@@ -6,3 +6,4 @@ apply_allcan_read_write.patch
|
||||
fix_support_new_variant_of_namedpropertyhandlerconfiguration_and.patch
|
||||
fix_correct_usages_of_v8_returnvalue_void_set_nonempty_for_new.patch
|
||||
chore_remove_deprecated_functioncallbackinfo_holder.patch
|
||||
fix_replace_deprecated_get_setprototype.patch
|
||||
|
||||
35
patches/nan/fix_replace_deprecated_get_setprototype.patch
Normal file
35
patches/nan/fix_replace_deprecated_get_setprototype.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Maddock <smaddock@slack-corp.com>
|
||||
Date: Thu, 9 Oct 2025 23:25:59 -0400
|
||||
Subject: fix: replace deprecated Get/SetPrototype
|
||||
|
||||
https://chromium-review.googlesource.com/c/v8/v8/+/6983465
|
||||
|
||||
Replaces the deprecated usage of SetPrototype.
|
||||
|
||||
diff --git a/nan_maybe_43_inl.h b/nan_maybe_43_inl.h
|
||||
index c04ce30d2fa3bfb555c96754d93de64e8a83e36b..aa06dbad2f0b3d564917dbcd29ac608ad468327b 100644
|
||||
--- a/nan_maybe_43_inl.h
|
||||
+++ b/nan_maybe_43_inl.h
|
||||
@@ -207,7 +207,7 @@ inline Maybe<bool> SetPrototype(
|
||||
, v8::Local<v8::Value> prototype) {
|
||||
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
||||
v8::HandleScope scope(isolate);
|
||||
- return obj->SetPrototype(isolate->GetCurrentContext(), prototype);
|
||||
+ return obj->SetPrototypeV2(isolate->GetCurrentContext(), prototype);
|
||||
}
|
||||
|
||||
inline MaybeLocal<v8::String> ObjectProtoToString(
|
||||
diff --git a/nan_maybe_pre_43_inl.h b/nan_maybe_pre_43_inl.h
|
||||
index 83325ae0897f95f2fe5354e9ab720796a7cefd7c..c309ace8c69feb6d01f136d4c0a33443886c467a 100644
|
||||
--- a/nan_maybe_pre_43_inl.h
|
||||
+++ b/nan_maybe_pre_43_inl.h
|
||||
@@ -174,7 +174,7 @@ MaybeLocal<v8::Array> GetOwnPropertyNames(v8::Handle<v8::Object> obj) {
|
||||
inline Maybe<bool> SetPrototype(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::Value> prototype) {
|
||||
- return Just<bool>(obj->SetPrototype(prototype));
|
||||
+ return Just<bool>(obj->SetPrototypeV2(prototype));
|
||||
}
|
||||
|
||||
inline MaybeLocal<v8::String> ObjectProtoToString(
|
||||
Reference in New Issue
Block a user