From 463586a6c57e3ae49d6b730e00eb724bfb05371f Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 20 Sep 2023 15:37:10 +0200 Subject: [PATCH] chore(deps): roll nan to pick up upstreams (#39916) --- DEPS | 2 +- package.json | 2 +- patches/nan/.patches | 2 - ...e_fix_v8_data_internal_field_casting.patch | 265 ------------------ ...remove_deprecated_accessorsignatures.patch | 45 --- spec/package.json | 2 +- 6 files changed, 3 insertions(+), 315 deletions(-) delete mode 100644 patches/nan/chore_fix_v8_data_internal_field_casting.patch delete mode 100644 patches/nan/chore_remove_deprecated_accessorsignatures.patch diff --git a/DEPS b/DEPS index 2407be7916a7..1a4195cc4154 100644 --- a/DEPS +++ b/DEPS @@ -6,7 +6,7 @@ vars = { 'node_version': 'v18.17.1', 'nan_version': - '16fa32231e2ccd89d2804b3f765319128b20c4ac', + 'e14bdcd1f72d62bca1d541b66da43130384ec213', 'squirrel.mac_version': '0e5d146ba13101a1302d59ea6e6e0b3cace4ae38', 'reactiveobjc_version': diff --git a/package.json b/package.json index 4fc8bfaaa076..71595f639e51 100644 --- a/package.json +++ b/package.json @@ -152,6 +152,6 @@ ] }, "resolutions": { - "nan": "nodejs/nan#4290e23af108328269fcd4fe174ad657ad7cdd96" + "nan": "nodejs/nan#e14bdcd1f72d62bca1d541b66da43130384ec213" } } diff --git a/patches/nan/.patches b/patches/nan/.patches index 768b37ca2a5a..3b26a944836c 100644 --- a/patches/nan/.patches +++ b/patches/nan/.patches @@ -1,3 +1 @@ use_new_constructor_for_scriptorigin_when_17_x.patch -chore_remove_deprecated_accessorsignatures.patch -chore_fix_v8_data_internal_field_casting.patch diff --git a/patches/nan/chore_fix_v8_data_internal_field_casting.patch b/patches/nan/chore_fix_v8_data_internal_field_casting.patch deleted file mode 100644 index 730e4464a84c..000000000000 --- a/patches/nan/chore_fix_v8_data_internal_field_casting.patch +++ /dev/null @@ -1,265 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Mon, 11 Sep 2023 23:39:55 +0200 -Subject: chore: fix v8::Data internal field casting - -Changed in https://chromium-review.googlesource.com/c/v8/v8/+/4834471 - -Adapt to upstream changes in v8::Object::GetInternalField() and -v8::Object::SetInternalField() to accept v8::Data instead of just -v8::Value. - -diff --git a/nan_callbacks_12_inl.h b/nan_callbacks_12_inl.h -index c27b18d80d1299ff2142606d333804696bc17f93..2c734137fa1a5f8c6341e045f488fdcde5d040ef 100644 ---- a/nan_callbacks_12_inl.h -+++ b/nan_callbacks_12_inl.h -@@ -170,9 +170,9 @@ void FunctionCallbackWrapper(const v8::FunctionCallbackInfo &info) { - v8::Local obj = info.Data().As(); - FunctionCallback callback = reinterpret_cast( - reinterpret_cast( -- obj->GetInternalField(kFunctionIndex).As()->Value())); -+ obj->GetInternalField(kFunctionIndex).As().As()->Value())); - FunctionCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - callback(cbinfo); - } - -@@ -185,10 +185,10 @@ void GetterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - GetterCallback callback = reinterpret_cast( - reinterpret_cast( -- obj->GetInternalField(kGetterIndex).As()->Value())); -+ obj->GetInternalField(kGetterIndex).As().As()->Value())); - callback(property.As(), cbinfo); - } - -@@ -202,10 +202,10 @@ void SetterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - SetterCallback callback = reinterpret_cast( - reinterpret_cast( -- obj->GetInternalField(kSetterIndex).As()->Value())); -+ obj->GetInternalField(kSetterIndex).As().As()->Value())); - callback(property.As(), value, cbinfo); - } - -@@ -220,10 +220,10 @@ void GetterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - GetterCallback callback = reinterpret_cast( - reinterpret_cast( -- obj->GetInternalField(kGetterIndex).As()->Value())); -+ obj->GetInternalField(kGetterIndex).As().As()->Value())); - callback(property, cbinfo); - } - -@@ -237,10 +237,10 @@ void SetterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - SetterCallback callback = reinterpret_cast( - reinterpret_cast( -- obj->GetInternalField(kSetterIndex).As()->Value())); -+ obj->GetInternalField(kSetterIndex).As().As()->Value())); - callback(property, value, cbinfo); - } - -@@ -257,11 +257,11 @@ void PropertyGetterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - PropertyGetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyGetterIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(property.As(), cbinfo); - } - -@@ -275,11 +275,11 @@ void PropertySetterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - PropertySetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertySetterIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(property.As(), value, cbinfo); - } - -@@ -293,11 +293,11 @@ void PropertyEnumeratorCallbackWrapper( - const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - PropertyEnumeratorCallback callback = - reinterpret_cast(reinterpret_cast( - obj->GetInternalField(kPropertyEnumeratorIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(cbinfo); - } - -@@ -310,11 +310,11 @@ void PropertyDeleterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - PropertyDeleterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyDeleterIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(property.As(), cbinfo); - } - -@@ -327,11 +327,11 @@ void PropertyQueryCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - PropertyQueryCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyQueryIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(property.As(), cbinfo); - } - -@@ -344,11 +344,11 @@ void PropertyGetterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - PropertyGetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyGetterIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(property, cbinfo); - } - -@@ -384,7 +384,7 @@ void PropertyEnumeratorCallbackWrapper( - PropertyEnumeratorCallback callback = - reinterpret_cast(reinterpret_cast( - obj->GetInternalField(kPropertyEnumeratorIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(cbinfo); - } - -@@ -401,7 +401,7 @@ void PropertyDeleterCallbackWrapper( - PropertyDeleterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyDeleterIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(property, cbinfo); - } - -@@ -414,11 +414,11 @@ void PropertyQueryCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - PropertyQueryCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyQueryIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(property, cbinfo); - } - -@@ -431,11 +431,11 @@ void IndexGetterCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - IndexGetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyGetterIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(index, cbinfo); - } - -@@ -449,11 +449,11 @@ void IndexSetterCallbackWrapper( - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - IndexSetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertySetterIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(index, value, cbinfo); - } - -@@ -467,11 +467,11 @@ void IndexEnumeratorCallbackWrapper( - const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - IndexEnumeratorCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField( -- kIndexPropertyEnumeratorIndex).As()->Value())); -+ kIndexPropertyEnumeratorIndex).As().As()->Value())); - callback(cbinfo); - } - -@@ -483,11 +483,11 @@ void IndexDeleterCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - IndexDeleterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyDeleterIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(index, cbinfo); - } - -@@ -499,11 +499,11 @@ void IndexQueryCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As()); - IndexQueryCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyQueryIndex) -- .As()->Value())); -+ .As().As()->Value())); - callback(index, cbinfo); - } - diff --git a/patches/nan/chore_remove_deprecated_accessorsignatures.patch b/patches/nan/chore_remove_deprecated_accessorsignatures.patch deleted file mode 100644 index 8cd9f2000153..000000000000 --- a/patches/nan/chore_remove_deprecated_accessorsignatures.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Thu, 2 Jun 2022 15:45:21 +0200 -Subject: chore: remove deprecated AccessorSignatures - -Removed in https://chromium-review.googlesource.com/c/v8/v8/+/3654096 -Upstreamed to nan: https://github.com/nodejs/nan/pull/941 - -diff --git a/nan.h b/nan.h -index df5496c1a001120d10cd7c4b87d5e7bce8169f38..c29a99b79970421a15c5520a94ab65b1c3c473ff 100644 ---- a/nan.h -+++ b/nan.h -@@ -2516,8 +2516,7 @@ inline void SetAccessor( - , SetterCallback setter = 0 - , v8::Local data = v8::Local() - , v8::AccessControl settings = v8::DEFAULT -- , v8::PropertyAttribute attribute = v8::None -- , imp::Sig signature = imp::Sig()) { -+ , v8::PropertyAttribute attribute = v8::None) { - HandleScope scope; - - imp::NativeGetter getter_ = -@@ -2550,9 +2549,6 @@ inline void SetAccessor( - , obj - , settings - , attribute --#if (NODE_MODULE_VERSION < NODE_18_0_MODULE_VERSION) -- , signature --#endif - ); - } - -diff --git a/nan_callbacks.h b/nan_callbacks.h -index 53ede846ac9a865a737218dabbbd48305d3d6b63..ea81e452d364e3d3c15a121dc69ae21134bfb586 100644 ---- a/nan_callbacks.h -+++ b/nan_callbacks.h -@@ -52,8 +52,6 @@ typedef void(*IndexQueryCallback)( - const PropertyCallbackInfo&); - - namespace imp { --typedef v8::Local Sig; -- - static const int kDataIndex = 0; - - static const int kFunctionIndex = 1; diff --git a/spec/package.json b/spec/package.json index 8048087796e5..34e7e5ee0e83 100644 --- a/spec/package.json +++ b/spec/package.json @@ -39,7 +39,7 @@ "yargs": "^16.0.3" }, "resolutions": { - "nan": "nodejs/nan#4290e23af108328269fcd4fe174ad657ad7cdd96", + "nan": "nodejs/nan#e14bdcd1f72d62bca1d541b66da43130384ec213", "dbus-native/optimist/minimist": "1.2.7", "dbus-native/xml2js": "0.5.0" }