diff options
author | 2022-09-17 21:56:30 -0700 | |
---|---|---|
committer | 2022-09-17 21:56:30 -0700 | |
commit | a08b323e617c6e2db6c6bc2e1731f447b43ccb50 (patch) | |
tree | 58068b571282a1d194a716a59c819ac04cfca714 /src/bun.js/bindings/ZigGlobalObject.h | |
parent | 745cc5c65502f1c1bcd69392e526d63f04653e11 (diff) | |
download | bun-a08b323e617c6e2db6c6bc2e1731f447b43ccb50.tar.gz bun-a08b323e617c6e2db6c6bc2e1731f447b43ccb50.tar.zst bun-a08b323e617c6e2db6c6bc2e1731f447b43ccb50.zip |
Fix napi module registration
Fixes https://github.com/oven-sh/bun/issues/1240
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.h')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.h b/src/bun.js/bindings/ZigGlobalObject.h index bd065ee36..41c304e10 100644 --- a/src/bun.js/bindings/ZigGlobalObject.h +++ b/src/bun.js/bindings/ZigGlobalObject.h @@ -353,7 +353,11 @@ public: JSC::Structure* pendingVirtualModuleResultStructure() { return m_pendingVirtualModuleResultStructure.get(this); } // When a napi module initializes on dlopen, we need to know what the value is + // This value is not observed by GC. It should be extremely ephemeral. JSValue pendingNapiModule = JSValue {}; + // We need to know if the napi module registered itself or we registered it. + // To do that, we count the number of times we register a module. + int napiModuleRegisterCallCount = 0; #include "ZigGeneratedClasses+lazyStructureHeader.h" |