Revert "fix(ext/napi): ensure the finalizer callback will be called (… (#30018)
Some checks are pending
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions

…#29710)"

This reverts commit 3c3af1011a.

Going to revert this one, because there are multiple issues reported
that cause panics. We are working on a proper fix, but for the time
being it's better to revert.

Closes https://github.com/denoland/deno/issues/29832
Closes https://github.com/denoland/deno/issues/29874
Closes https://github.com/denoland/deno/issues/29911
Closes https://github.com/denoland/deno/issues/29866
Closes https://github.com/denoland/deno/issues/29973
Closes https://github.com/denoland/deno/issues/29978
This commit is contained in:
Bartek Iwańczuk 2025-07-07 14:44:21 +02:00 committed by GitHub
parent 5ee005c2b5
commit 478121e118
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,11 +111,12 @@ impl Reference {
fn set_weak(&mut self) {
let reference = self as *mut Reference;
if let ReferenceState::Strong(g) = &self.state {
let cb = Box::new(move || Reference::weak_callback(reference));
let cb = Box::new(move |_: &mut v8::Isolate| {
Reference::weak_callback(reference)
});
let isolate = unsafe { (*self.env).isolate() };
self.state = ReferenceState::Weak(v8::Weak::with_guaranteed_finalizer(
isolate, g, cb,
));
self.state =
ReferenceState::Weak(v8::Weak::with_finalizer(isolate, g, cb));
}
}