From 6964467af6a89c39e1ece35da391f83278c3057f Mon Sep 17 00:00:00 2001 From: Bong Nguyen Date: Fri, 11 Nov 2022 08:33:59 +1100 Subject: [PATCH] Use NAN_MODULE_WORKER_ENABLED to make module context aware All native modules used Electron be context-ware before when upgrading to Electron 14. [ref](https://github.com/electron/electron/issues/18397). `superstring` is still one of the module that isn't context-aware. This commit uses NAN_MODULE_WORKER_ENABLED instead of `NODE_MODULE` to make the module context-aware. Please check https://github.com/electron/electron/issues/18397 and https://github.com/nodejs/nan/pull/792 for more detail. --- .gitignore | 1 + src/bindings/bindings.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 51f142db..68f3391d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules build +bin .DS_Store .clang_complete diff --git a/src/bindings/bindings.cc b/src/bindings/bindings.cc index fc9b31e1..e00328f5 100644 --- a/src/bindings/bindings.cc +++ b/src/bindings/bindings.cc @@ -21,4 +21,4 @@ void Init(Local exports) { TextBufferSnapshotWrapper::init(); } -NODE_MODULE(superstring, Init) +NAN_MODULE_WORKER_ENABLED(superstring, Init)