Skip to content

Commit 3091295

Browse files
committed
deps: revert ABI-breaking change from V8 9.2
Refs: v8/v8@a7980d4 Refs: v8/v8@ad4eab0 Fixes: #39623 PR-URL: #39624 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
1 parent 06d7b8e commit 3091295

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

Diff for: common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.18',
39+
'v8_embedder_string': '-node.19',
4040

4141
##### V8 defaults for Node.js #####
4242

Diff for: deps/v8/include/v8.h

+11
Original file line numberDiff line numberDiff line change
@@ -6796,6 +6796,17 @@ class V8_EXPORT FunctionTemplate : public Template {
67966796
* API call, see the comment above the class declaration.
67976797
*/
67986798
void SetCallHandler(
6799+
FunctionCallback callback, Local<Value> data = Local<Value>(),
6800+
SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
6801+
const CFunction* c_function = nullptr);
6802+
6803+
/**
6804+
* Set the call-handler callback for a FunctionTemplate. This
6805+
* callback is called whenever the function created from this
6806+
* FunctionTemplate is called. The 'c_function' represents a fast
6807+
* API call, see the comment above the class declaration.
6808+
*/
6809+
void SetCallHandlerV8_92(
67996810
FunctionCallback callback, Local<Value> data = Local<Value>(),
68006811
SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
68016812
const MemorySpan<const CFunction>& c_function_overloads = {});

Diff for: deps/v8/src/api/api.cc

+12-2
Original file line numberDiff line numberDiff line change
@@ -1244,8 +1244,8 @@ static Local<FunctionTemplate> FunctionTemplateNew(
12441244
if (behavior == ConstructorBehavior::kThrow) raw.set_remove_prototype(true);
12451245
}
12461246
if (callback != nullptr) {
1247-
Utils::ToLocal(obj)->SetCallHandler(callback, data, side_effect_type,
1248-
c_function_overloads);
1247+
Utils::ToLocal(obj)->SetCallHandlerV8_92(callback, data, side_effect_type,
1248+
c_function_overloads);
12491249
}
12501250
return Utils::ToLocal(obj);
12511251
}
@@ -1308,6 +1308,16 @@ Local<AccessorSignature> AccessorSignature::New(
13081308
} while (false)
13091309

13101310
void FunctionTemplate::SetCallHandler(
1311+
FunctionCallback callback, v8::Local<Value> data,
1312+
SideEffectType side_effect_type,
1313+
const CFunction* c_function) {
1314+
SetCallHandlerV8_92(
1315+
callback, data, side_effect_type,
1316+
c_function ? MemorySpan<const CFunction>{c_function, 1}
1317+
: MemorySpan<const CFunction>{});
1318+
}
1319+
1320+
void FunctionTemplate::SetCallHandlerV8_92(
13111321
FunctionCallback callback, v8::Local<Value> data,
13121322
SideEffectType side_effect_type,
13131323
const MemorySpan<const CFunction>& c_function_overloads) {

0 commit comments

Comments
 (0)