Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-03-08 11:47:45 +0300
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-03-11 11:32:40 +0300
commit560466c7738c1b66f2a74381bff41bdd7bde1eef (patch)
treeb3178025cb4fa519b34bb273e987d02d62ec2c24 /src/stream_base.cc
parenta445244a0c7e25e9b3dcfa48f622ce51f5815dcd (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_base.cc')
-rw-r--r--src/stream_base.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stream_base.cc b/src/stream_base.cc
index bf7003e1276..8eccca1a3e8 100644
--- a/src/stream_base.cc
+++ b/src/stream_base.cc
@@ -17,6 +17,7 @@ namespace node {
using v8::Array;
using v8::ArrayBuffer;
using v8::Context;
+using v8::External;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Integer;
@@ -368,6 +369,9 @@ void StreamBase::AddMethods(Environment* env, Local<FunctionTemplate> t) {
t, "writeUcs2String", JSMethod<&StreamBase::WriteString<UCS2>>);
env->SetProtoMethod(
t, "writeLatin1String", JSMethod<&StreamBase::WriteString<LATIN1>>);
+ t->PrototypeTemplate()->Set(FIXED_ONE_BYTE_STRING(env->isolate(),
+ "isStreamBase"),
+ True(env->isolate()));
}
void StreamBase::GetFD(const FunctionCallbackInfo<Value>& args) {