Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/objects/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
2 changes: 1 addition & 1 deletion src/objects/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,6 @@ NODE_METHOD(Statement::JS_columns) {
}

NODE_GETTER(Statement::JS_busy) {
Statement* stmt = Unwrap<Statement>(info.Holder());
Statement* stmt = Unwrap<Statement>(PROPERTY_HOLDER(info));
info.GetReturnValue().Set(stmt->alive && stmt->locked);
}
13 changes: 13 additions & 0 deletions src/util/macros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
#define GET_PROTOTYPE(obj) ((obj)->GetPrototype())
#endif

// PropertyCallbackInfo::This() and Holder() were removed; use HolderV2().
// Tracking bug for V8 API removals: http://crbug.com/333672197
// V8 head has since restored Holder() and deprecated HolderV2():
// https://chromium.googlesource.com/v8/v8/+/main/include/v8-function-callback.h
// V8_INLINE Local<Object> Holder() const;
// V8_DEPRECATE_SOON("Use Holder().")
// V8_INLINE Local<Object> HolderV2() const;
#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >= 13
#define PROPERTY_HOLDER(info) (info).HolderV2()
#else
#define PROPERTY_HOLDER(info) (info).This()
#endif

#define EasyIsolate v8::Isolate* isolate = v8::Isolate::GetCurrent()
#define OnlyIsolate info.GetIsolate()
#define OnlyContext isolate->GetCurrentContext()
Expand Down
Loading