diff options
author | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2016-03-21 22:59:31 +0300 |
---|---|---|
committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2016-04-07 19:44:19 +0300 |
commit | 7d8882ba9a8cfc8f0e2126deb3f3df7456de0ffa (patch) | |
tree | 44388842ee46106b5887707c6ae75db7155649a6 /src/timer_wrap.cc | |
parent | 1879e1ef178197fd3593fdbbe65c23224c0d256d (diff) |
handle_wrap: expose an `isRefed()` check to JS
This allows third-party tools to check whether or not a handle that
can be unreferenced is unreferenced at a particular time.
Notably, this should be helpful for inspection via AsyncWrap.
Also, this is useful even to node's internals, particularly timers.
Refs: https://github.com/nodejs/node/pull/5828
Refs: https://github.com/nodejs/node/pull/5827
PR-URL: https://github.com/nodejs/node/pull/5834
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'src/timer_wrap.cc')
-rw-r--r-- | src/timer_wrap.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index 79fa86953d4..4a1cd3716a9 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -39,6 +39,7 @@ class TimerWrap : public HandleWrap { env->SetProtoMethod(constructor, "close", HandleWrap::Close); env->SetProtoMethod(constructor, "ref", HandleWrap::Ref); env->SetProtoMethod(constructor, "unref", HandleWrap::Unref); + env->SetProtoMethod(constructor, "isRefed", HandleWrap::IsRefed); env->SetProtoMethod(constructor, "start", Start); env->SetProtoMethod(constructor, "stop", Stop); |