From 65d5e336e2e76b0a8398baea787638c803d20c41 Mon Sep 17 00:00:00 2001 From: Fedor Indutnyy Date: Thu, 25 Aug 2022 09:49:47 -0700 Subject: [PATCH] Fix electron 20 build errors --- binding.gyp | 4 ++-- package.json | 1 + src/better_sqlite3.cpp | 5 ++--- src/util/binder.lzz | 2 +- src/util/macros.lzz | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/binding.gyp b/binding.gyp index 59fa0a8..d937fd2 100644 --- a/binding.gyp +++ b/binding.gyp @@ -9,9 +9,9 @@ 'target_name': 'better_sqlite3', 'dependencies': ['deps/sqlite3.gyp:sqlite3'], 'sources': ['src/better_sqlite3.cpp'], - 'cflags': ['-std=c++14'], + 'cflags': ['-std=c++17'], 'xcode_settings': { - 'OTHER_CPLUSPLUSFLAGS': ['-std=c++14', '-stdlib=libc++'], + 'OTHER_CPLUSPLUSFLAGS': ['-std=c++17', '-stdlib=libc++'], }, 'conditions': [ ['OS=="linux"', { diff --git a/package.json b/package.json index 5373989..516e3bf 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "cli-color": "^2.0.0", "fs-extra": "^10.0.0", "mocha": "^8.3.2", + "node-gyp": "^9.1.0", "nodemark": "^0.3.0", "sqlite": "^4.0.23", "sqlite3": "^5.0.2" diff --git a/src/better_sqlite3.cpp b/src/better_sqlite3.cpp index 777c8b8..0cfaf51 100644 --- a/src/better_sqlite3.cpp +++ b/src/better_sqlite3.cpp @@ -104,8 +104,7 @@ void SetPrototypeGetter (v8::Isolate * isolate, v8::Local data, v 0, data, v8::AccessControl::DEFAULT, - v8::PropertyAttribute::None, - v8::AccessorSignature::New(isolate, recv) + v8::PropertyAttribute::None ); } #line 4 "./src/util/constants.lzz" @@ -1949,7 +1948,7 @@ bool Binder::IsPlainObject (v8::Isolate * isolate, v8::Local obj) #line 35 "./src/util/binder.lzz" { v8::Local proto = obj->GetPrototype(); - v8::Local ctx = obj->CreationContext(); + v8::Local ctx = obj->GetCreationContext().ToLocalChecked(); ctx->Enter(); v8::Local baseProto = v8::Object::New(isolate)->GetPrototype(); ctx->Exit(); diff --git a/src/util/binder.lzz b/src/util/binder.lzz index 364a0d8..5122496 100644 --- a/src/util/binder.lzz +++ b/src/util/binder.lzz @@ -34,7 +34,7 @@ private: static bool IsPlainObject(v8::Isolate* isolate, v8::Local obj) { v8::Local proto = obj->GetPrototype(); - v8::Local ctx = obj->CreationContext(); + v8::Local ctx = obj->GetCreationContext().ToLocalChecked(); ctx->Enter(); v8::Local baseProto = v8::Object::New(isolate)->GetPrototype(); ctx->Exit(); diff --git a/src/util/macros.lzz b/src/util/macros.lzz index f8f6ce4..666488c 100644 --- a/src/util/macros.lzz +++ b/src/util/macros.lzz @@ -153,7 +153,6 @@ void SetPrototypeGetter( 0, data, v8::AccessControl::DEFAULT, - v8::PropertyAttribute::None, - v8::AccessorSignature::New(isolate, recv) + v8::PropertyAttribute::None ); }