summaryrefslogtreecommitdiff
path: root/src/pipe_wrap.cc
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-06-11 12:52:27 +0200
committerFedor Indutny <fedor.indutny@gmail.com>2013-06-15 21:44:50 +0200
commit6978e998ee7c08b3dd10e4cecd2a167696b74317 (patch)
tree62b4b089a9f3977f18bfde10d570cec0f5200cb4 /src/pipe_wrap.cc
parent0495b7031c9a33821e3a518e93911d2832f59d19 (diff)
downloadandroid-node-v8-6978e998ee7c08b3dd10e4cecd2a167696b74317.tar.gz
android-node-v8-6978e998ee7c08b3dd10e4cecd2a167696b74317.tar.bz2
android-node-v8-6978e998ee7c08b3dd10e4cecd2a167696b74317.zip
process: abstract out HandleToStream
Originally contributed by @tjfontaine, but modified to be faster and more generic.
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r--src/pipe_wrap.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 6449eebab9..6639b8d66c 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -25,6 +25,7 @@
#include "handle_wrap.h"
#include "stream_wrap.h"
#include "pipe_wrap.h"
+#include "node_wrap.h"
namespace node {
@@ -44,7 +45,8 @@ using v8::String;
using v8::TryCatch;
using v8::Value;
-Persistent<Function> pipeConstructor;
+extern Persistent<FunctionTemplate> pipeConstructorTmpl;
+static Persistent<Function> pipeConstructor;
static Persistent<String> onconnection_sym;
static Persistent<String> oncomplete_sym;
@@ -114,6 +116,7 @@ void PipeWrap::Initialize(Handle<Object> target) {
NODE_SET_PROTOTYPE_METHOD(t, "setPendingInstances", SetPendingInstances);
#endif
+ pipeConstructorTmpl = Persistent<FunctionTemplate>::New(node_isolate, t);
pipeConstructor = Persistent<Function>::New(node_isolate, t->GetFunction());
target->Set(String::NewSymbol("Pipe"), pipeConstructor);