diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-03-08 11:47:45 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-03-11 11:32:40 +0300 |
commit | 560466c7738c1b66f2a74381bff41bdd7bde1eef (patch) | |
tree | b3178025cb4fa519b34bb273e987d02d62ec2c24 /src/stream_pipe.cc | |
parent | a445244a0c7e25e9b3dcfa48f622ce51f5815dcd (diff) |
lib,src: remove usage of _externalStream
Since 4697e1b0d792f50863bbbcad25a95b84e6746501, it is no longer
necessary to use `v8::External`s to pass `StreamBase` instances
to native functions.
PR-URL: https://github.com/nodejs/node/pull/26510
Refs: https://github.com/nodejs/node/pull/25142
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/stream_pipe.cc')
-rw-r--r-- | src/stream_pipe.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc index 1a9d34b133b..a57ce274fad 100644 --- a/src/stream_pipe.cc +++ b/src/stream_pipe.cc @@ -3,7 +3,6 @@ #include "node_buffer.h" using v8::Context; -using v8::External; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; @@ -226,10 +225,10 @@ void StreamPipe::WritableListener::OnStreamRead(ssize_t nread, void StreamPipe::New(const FunctionCallbackInfo<Value>& args) { CHECK(args.IsConstructCall()); - CHECK(args[0]->IsExternal()); - CHECK(args[1]->IsExternal()); - auto source = static_cast<StreamBase*>(args[0].As<External>()->Value()); - auto sink = static_cast<StreamBase*>(args[1].As<External>()->Value()); + CHECK(args[0]->IsObject()); + CHECK(args[1]->IsObject()); + StreamBase* source = StreamBase::FromObject(args[0].As<Object>()); + StreamBase* sink = StreamBase::FromObject(args[1].As<Object>()); new StreamPipe(source, sink, args.This()); } |