From 0603c0a53fc7051260f3f3d3de9582bc3e6af7c9 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Wed, 7 Nov 2018 07:09:40 -0500 Subject: src: bundle persistent-to-local methods as class Create a class `PersistentToLocal` which contains three methods, `Strong`, `Weak`, and `Default`: * `Strong` returns a `Local` from a strong persistent reference, * `Weak` returns a `Local` from a weak persistent reference, and * `Default` decides based on `IsWeak()` which of the above two to call. These replace `node::StrongPersistentToLocal()`, `node::WeakPersistentToLocal()`, and `node::PersistentToLocal()`, respectively. PR-URL: https://github.com/nodejs/node/pull/24276 Reviewed-By: Joyee Cheung Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Refael Ackermann --- src/node_zlib.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/node_zlib.cc') diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 6b050fcb40..f476c554d4 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -313,8 +313,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { UpdateWriteResult(); // call the write() cb - Local cb = PersistentToLocal(env()->isolate(), - write_js_callback_); + Local cb = PersistentToLocal::Default(env()->isolate(), + write_js_callback_); MakeCallback(cb, 0, nullptr); if (pending_close_) -- cgit v1.2.3