summaryrefslogtreecommitdiff
path: root/src/tty_wrap.cc
diff options
context:
space:
mode:
authorJeremiah Senkpiel <fishrock123@rocketmail.com>2016-03-21 15:59:31 -0400
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2016-04-07 12:44:19 -0400
commit7d8882ba9a8cfc8f0e2126deb3f3df7456de0ffa (patch)
tree44388842ee46106b5887707c6ae75db7155649a6 /src/tty_wrap.cc
parent1879e1ef178197fd3593fdbbe65c23224c0d256d (diff)
downloadandroid-node-v8-7d8882ba9a8cfc8f0e2126deb3f3df7456de0ffa.tar.gz
android-node-v8-7d8882ba9a8cfc8f0e2126deb3f3df7456de0ffa.tar.bz2
android-node-v8-7d8882ba9a8cfc8f0e2126deb3f3df7456de0ffa.zip
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/tty_wrap.cc')
-rw-r--r--src/tty_wrap.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index a78d231145..567a504276 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -37,6 +37,7 @@ void TTYWrap::Initialize(Local<Object> target,
env->SetProtoMethod(t, "close", HandleWrap::Close);
env->SetProtoMethod(t, "unref", HandleWrap::Unref);
+ env->SetProtoMethod(t, "isRefed", HandleWrap::IsRefed);
StreamWrap::AddMethods(env, t, StreamBase::kFlagNoShutdown);