From c19ab565ca888bace37980d2bc990b3e7936f716 Mon Sep 17 00:00:00 2001 From: Ian Sutherland Date: Fri, 12 Oct 2018 09:19:35 -0700 Subject: src: change constructor behavior in stream_base-inl.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change ConstructorBehavior from kAllow to kThrow. Co-authored-by: Bruce A. MacNaughton Refs: https://github.com/nodejs/node/pull/23453 PR-URL: https://github.com/nodejs/node/pull/23447 Reviewed-By: Tobias Nießen Reviewed-By: Gireesh Punathil Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/stream_base-inl.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/stream_base-inl.h') diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 027b938d30..0209281f94 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -275,29 +275,28 @@ void StreamBase::AddMethods(Environment* env, Local t) { Local signature = Signature::New(env->isolate(), t); - // TODO(TimothyGu): None of these should have ConstructorBehavior::kAllow. Local get_fd_templ = env->NewFunctionTemplate(GetFD, signature, - v8::ConstructorBehavior::kAllow, + v8::ConstructorBehavior::kThrow, v8::SideEffectType::kHasNoSideEffect); Local get_external_templ = env->NewFunctionTemplate(GetExternal, signature, - v8::ConstructorBehavior::kAllow, + v8::ConstructorBehavior::kThrow, v8::SideEffectType::kHasNoSideEffect); Local get_bytes_read_templ = env->NewFunctionTemplate(GetBytesRead, signature, - v8::ConstructorBehavior::kAllow, + v8::ConstructorBehavior::kThrow, v8::SideEffectType::kHasNoSideEffect); Local get_bytes_written_templ = env->NewFunctionTemplate(GetBytesWritten, signature, - v8::ConstructorBehavior::kAllow, + v8::ConstructorBehavior::kThrow, v8::SideEffectType::kHasNoSideEffect); t->PrototypeTemplate()->SetAccessorProperty(env->fd_string(), -- cgit v1.2.3