diff --git a/common.gypi b/common.gypi index 88764c8f6b75a8..d4f1d425f83958 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.18', + 'v8_embedder_string': '-node.19', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index cbdca19367d766..101e3c8accfa07 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -6796,6 +6796,17 @@ class V8_EXPORT FunctionTemplate : public Template { * API call, see the comment above the class declaration. */ void SetCallHandler( + FunctionCallback callback, Local data = Local(), + SideEffectType side_effect_type = SideEffectType::kHasSideEffect, + const CFunction* c_function = nullptr); + + /** + * Set the call-handler callback for a FunctionTemplate. This + * callback is called whenever the function created from this + * FunctionTemplate is called. The 'c_function' represents a fast + * API call, see the comment above the class declaration. + */ + void SetCallHandlerV8_92( FunctionCallback callback, Local data = Local(), SideEffectType side_effect_type = SideEffectType::kHasSideEffect, const MemorySpan& c_function_overloads = {}); diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index 2c1223afedc5c0..031d4244f7f80b 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -1244,8 +1244,8 @@ static Local FunctionTemplateNew( if (behavior == ConstructorBehavior::kThrow) raw.set_remove_prototype(true); } if (callback != nullptr) { - Utils::ToLocal(obj)->SetCallHandler(callback, data, side_effect_type, - c_function_overloads); + Utils::ToLocal(obj)->SetCallHandlerV8_92(callback, data, side_effect_type, + c_function_overloads); } return Utils::ToLocal(obj); } @@ -1308,6 +1308,16 @@ Local AccessorSignature::New( } while (false) void FunctionTemplate::SetCallHandler( + FunctionCallback callback, v8::Local data, + SideEffectType side_effect_type, + const CFunction* c_function) { + SetCallHandlerV8_92( + callback, data, side_effect_type, + c_function ? MemorySpan{c_function, 1} + : MemorySpan{}); +} + +void FunctionTemplate::SetCallHandlerV8_92( FunctionCallback callback, v8::Local data, SideEffectType side_effect_type, const MemorySpan& c_function_overloads) {