mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
fixup advance deprecation of v8::ReturnValue<void>::Set(Local<S>)
This commit is contained in:
@@ -8,10 +8,10 @@ v8::ReturnValue<void>::Set(Local<S>) is now deprecated.
|
||||
See http://crbug.com/348660658 for details.
|
||||
|
||||
diff --git a/nan_callbacks_12_inl.h b/nan_callbacks_12_inl.h
|
||||
index e40383c095ab329b2e20b7e68ade507788a79fb6..9688e933a7d8e31629b507def483024ba7705b26 100644
|
||||
index e40383c095ab329b2e20b7e68ade507788a79fb6..24979fb0d66595f5e80f493c78291d6600bfc34a 100644
|
||||
--- a/nan_callbacks_12_inl.h
|
||||
+++ b/nan_callbacks_12_inl.h
|
||||
@@ -26,7 +26,23 @@ class ReturnValue {
|
||||
@@ -26,7 +26,24 @@ class ReturnValue {
|
||||
// Handle setters
|
||||
template <typename S> inline void Set(const v8::Local<S> &handle) {
|
||||
TYPE_CHECK(T, S);
|
||||
@@ -22,7 +22,8 @@ index e40383c095ab329b2e20b7e68ade507788a79fb6..9688e933a7d8e31629b507def483024b
|
||||
+ // For V8 14.4.230+, avoid deprecated Set method for ReturnValue<void>
|
||||
+ if constexpr (std::is_void_v<T>) {
|
||||
+ if (handle.IsEmpty()) {
|
||||
+ value_.SetDefaultValue();
|
||||
+ // For void return type, do nothing to indicate success
|
||||
+ // as per V8 deprecation guidance
|
||||
+ } else {
|
||||
+ value_.Set(handle->BooleanValue(value_.GetIsolate()));
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user