Browse Source

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.
v0.11.5-release
Ben Noordhuis 12 years ago
parent
commit
45d056ee69
  1. 4
      src/node_wrap.h

4
src/node_wrap.h

@ -40,7 +40,7 @@ extern v8::Persistent<v8::FunctionTemplate> tcpConstructorTmpl;
do { \ do { \
if (!tcpConstructorTmpl.IsEmpty() && \ if (!tcpConstructorTmpl.IsEmpty() && \
HasInstance(tcpConstructorTmpl, obj)) { \ HasInstance(tcpConstructorTmpl, obj)) { \
PipeWrap* wrap = PipeWrap::Unwrap(obj); \ TCPWrap* wrap = TCPWrap::Unwrap(obj); \
BODY \ BODY \
} else if (!ttyConstructorTmpl.IsEmpty() && \ } else if (!ttyConstructorTmpl.IsEmpty() && \
HasInstance(ttyConstructorTmpl, obj)) { \ HasInstance(ttyConstructorTmpl, obj)) { \
@ -48,7 +48,7 @@ extern v8::Persistent<v8::FunctionTemplate> tcpConstructorTmpl;
BODY \ BODY \
} else if (!pipeConstructorTmpl.IsEmpty() && \ } else if (!pipeConstructorTmpl.IsEmpty() && \
HasInstance(pipeConstructorTmpl, obj)) { \ HasInstance(pipeConstructorTmpl, obj)) { \
TCPWrap* wrap = TCPWrap::Unwrap(obj); \ PipeWrap* wrap = PipeWrap::Unwrap(obj); \
BODY \ BODY \
} \ } \
} while (0) } while (0)

Loading…
Cancel
Save