Skip to content

Commit

Permalink
src: change constructor behavior in stream_base-inl.h
Browse files Browse the repository at this point in the history
Change ConstructorBehavior from kAllow to kThrow.

Co-authored-by: Bruce A. MacNaughton <bmacnaughton@gmail.com>
Refs: #23453
PR-URL: #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>
  • Loading branch information
2 people authored and jasnell committed Oct 17, 2018
1 parent b5f5585 commit ec7375a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/stream_base-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit ec7375a

Please sign in to comment.