From 45d056ee69568fd3d5758e3eb2e0252e17063a53 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 6 Aug 2013 15:47:42 +0200 Subject: [PATCH] src: fix WITH_GENERIC_STREAM() type check bug The handle object was checked against the wrong constructor template. Put another way, it was unwrapped as the wrong StreamWrap type. --- src/node_wrap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_wrap.h b/src/node_wrap.h index c03b30eb4d..7c3f63fb20 100644 --- a/src/node_wrap.h +++ b/src/node_wrap.h @@ -40,7 +40,7 @@ extern v8::Persistent tcpConstructorTmpl; do { \ if (!tcpConstructorTmpl.IsEmpty() && \ HasInstance(tcpConstructorTmpl, obj)) { \ - PipeWrap* wrap = PipeWrap::Unwrap(obj); \ + TCPWrap* wrap = TCPWrap::Unwrap(obj); \ BODY \ } else if (!ttyConstructorTmpl.IsEmpty() && \ HasInstance(ttyConstructorTmpl, obj)) { \ @@ -48,7 +48,7 @@ extern v8::Persistent tcpConstructorTmpl; BODY \ } else if (!pipeConstructorTmpl.IsEmpty() && \ HasInstance(pipeConstructorTmpl, obj)) { \ - TCPWrap* wrap = TCPWrap::Unwrap(obj); \ + PipeWrap* wrap = PipeWrap::Unwrap(obj); \ BODY \ } \ } while (0)