diff options
author | 2023-06-25 20:16:25 -0300 | |
---|---|---|
committer | 2023-06-25 16:16:25 -0700 | |
commit | 3ed28f2828a29129a1791b7a4f6935d842d6493c (patch) | |
tree | c23b6e76e32bf9c2f30070af72593aa16289dc86 /src/bun.js/bindings/ZigGeneratedClasses.cpp | |
parent | fcf9f0a7eeb3d462d5c6c2110ecdf5a4460c1736 (diff) | |
download | bun-3ed28f2828a29129a1791b7a4f6935d842d6493c.tar.gz bun-3ed28f2828a29129a1791b7a4f6935d842d6493c.tar.zst bun-3ed28f2828a29129a1791b7a4f6935d842d6493c.zip |
[fs.watch] fix reference/deinit (#3396)
* fix js reference
* fix close oops
* refactor + hasPendingActivity
* fmt
* fix race conditions
* fixup
* add test calling close on error event
* fix close inside close + test
* cleanup
Diffstat (limited to 'src/bun.js/bindings/ZigGeneratedClasses.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGeneratedClasses.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGeneratedClasses.cpp b/src/bun.js/bindings/ZigGeneratedClasses.cpp index e0a3f33d6..387580d54 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses.cpp +++ b/src/bun.js/bindings/ZigGeneratedClasses.cpp @@ -5565,6 +5565,12 @@ void JSFSWatcherPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* glob JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); } +extern "C" bool FSWatcher__hasPendingActivity(void* ptr); +bool JSFSWatcher::hasPendingActivity(void* ctx) +{ + return FSWatcher__hasPendingActivity(ctx); +} + JSFSWatcher::~JSFSWatcher() { if (m_ctx) { @@ -5649,6 +5655,8 @@ void JSFSWatcher::visitChildrenImpl(JSCell* cell, Visitor& visitor) ASSERT_GC_OBJECT_INHERITS(thisObject, info()); Base::visitChildren(thisObject, visitor); visitor.append(thisObject->m_listener); + + visitor.addOpaqueRoot(thisObject->wrapped()); } DEFINE_VISIT_CHILDREN(JSFSWatcher); @@ -5659,6 +5667,8 @@ void JSFSWatcher::visitAdditionalChildren(Visitor& visitor) JSFSWatcher* thisObject = this; ASSERT_GC_OBJECT_INHERITS(thisObject, info()); visitor.append(thisObject->m_listener); + + visitor.addOpaqueRoot(this->wrapped()); } DEFINE_VISIT_ADDITIONAL_CHILDREN(JSFSWatcher); |