mirror of
https://github.com/hanzoai/better-sqlite3.git
synced 2026-09-24 16:57:15 +00:00
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:
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user