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_internals.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/node_internals.h') diff --git a/src/node_internals.h b/src/node_internals.h index b83c23681b..b026a96843 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -182,14 +182,6 @@ extern std::shared_ptr per_process_opts; // Forward declaration class Environment; -// If persistent.IsWeak() == false, then do not call persistent.Reset() -// while the returned Local is still in scope, it will destroy the -// reference to the object. -template -inline v8::Local PersistentToLocal( - v8::Isolate* isolate, - const Persistent& persistent); - // Convert a struct sockaddr to a { address: '1.2.3.4', port: 1234 } JS object. // Sets address and port properties on the info object and returns it. // If |info| is omitted, a new object is returned. -- cgit v1.2.3