forked from tree-sitter/node-tree-sitter
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make the native addon to be context-aware
Since Electron 14, all native addons must be context-aware. Therefore, in order to make node-tree-sitter run with Electron >= 14, it has to be context-aware. Ref: electron/electron#18397 In this commit, NAN_MODULE_WORKER_ENABLED is used to make the native addon context-aware. It will allow context as the third param but will ignore it. This change doesn't mean that the addon will be safe to be initialised multiple times so can be run on worker threads though. Perhaps, someone with better understanding of the library need to implement AddEnvironmentCleanupHook to clean up resources. Ref: https://nodejs.org/api/addons.html#context-aware-addons
- Loading branch information
Bong Nguyen
committed
Nov 15, 2022
1 parent
16f7319
commit 7a0883e
Showing
3 changed files
with
3 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters