src: change constructor behavior in stream_base-inl.h

Change ConstructorBehavior from kAllow to kThrow.

Co-authored-by: Bruce A. MacNaughton <bmacnaughton@gmail.com>
Refs: https://github.com/nodejs/node/pull/23453
PR-URL: https://github.com/nodejs/node/pull/23447
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ian Sutherland 2018-10-12 09:19:35 -07:00 committed by Anna Henningsen
parent 20b3698ac1
commit c19ab565ca
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -275,29 +275,28 @@ void StreamBase::AddMethods(Environment* env, Local<FunctionTemplate> t) {
Local<Signature> signature = Signature::New(env->isolate(), t);
// TODO(TimothyGu): None of these should have ConstructorBehavior::kAllow.
Local<FunctionTemplate> get_fd_templ =
env->NewFunctionTemplate(GetFD<Base>,
signature,
v8::ConstructorBehavior::kAllow,
v8::ConstructorBehavior::kThrow,
v8::SideEffectType::kHasNoSideEffect);
Local<FunctionTemplate> get_external_templ =
env->NewFunctionTemplate(GetExternal<Base>,
signature,
v8::ConstructorBehavior::kAllow,
v8::ConstructorBehavior::kThrow,
v8::SideEffectType::kHasNoSideEffect);
Local<FunctionTemplate> get_bytes_read_templ =
env->NewFunctionTemplate(GetBytesRead<Base>,
signature,
v8::ConstructorBehavior::kAllow,
v8::ConstructorBehavior::kThrow,
v8::SideEffectType::kHasNoSideEffect);
Local<FunctionTemplate> get_bytes_written_templ =
env->NewFunctionTemplate(GetBytesWritten<Base>,
signature,
v8::ConstructorBehavior::kAllow,
v8::ConstructorBehavior::kThrow,
v8::SideEffectType::kHasNoSideEffect);
t->PrototypeTemplate()->SetAccessorProperty(env->fd_string(),