fix: use HolderV2() for PropertyCallbackInfo on V8 >= 12.5 (#1459)

fix: use HolderV2() for PropertyCallbackInfo on V8 >= 13

PR #1456 replaced This() with Holder() in NODE_GETTER contexts, but
Electron 41 (V8 14.6) removed both This() and Holder() from
PropertyCallbackInfo. Only HolderV2() remains (to be renamed back to
Holder() in a future V8 version per crbug.com/333672197).

Add a PROPERTY_HOLDER compat macro that uses HolderV2() on V8 >= 13
and falls back to This() on older versions. Same pattern as the
existing GET_PROTOTYPE macro.

Verified: compiles and runs on Electron 41.0.1 (V8 14.6.202).

Fixes #1458
This commit is contained in:
tstone-1
2026-03-13 18:08:07 -05:00
committed by GitHub
parent 8922bcb687
commit 48ad3c8b20
3 changed files with 16 additions and 3 deletions
+2 -2
View File
@@ -408,10 +408,10 @@ NODE_METHOD(Database::JS_unsafeMode) {
}
NODE_GETTER(Database::JS_open) {
info.GetReturnValue().Set(Unwrap<Database>(info.Holder())->open);
info.GetReturnValue().Set(Unwrap<Database>(PROPERTY_HOLDER(info))->open);
}
NODE_GETTER(Database::JS_inTransaction) {
Database* db = Unwrap<Database>(info.Holder());
Database* db = Unwrap<Database>(PROPERTY_HOLDER(info));
info.GetReturnValue().Set(db->open && !static_cast<bool>(sqlite3_get_autocommit(db->db_handle)));
}