From 68fba5467ae0d343b0f11be996e37683202e147a Mon Sep 17 00:00:00 2001 From: Ian Sutherland Date: Fri, 12 Oct 2018 09:19:35 -0700 Subject: [PATCH 1/2] src: change constructor behavior in stream_base-inl.h Change ConstructorBehavior from kAllow to kThrow. --- src/stream_base-inl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 027b938d30df1c..ea9f30d6be14d5 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -279,25 +279,25 @@ void StreamBase::AddMethods(Environment* env, Local t) { 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(), From 7a9d72ae10c9abfca09d56b709e583ca498c38dc Mon Sep 17 00:00:00 2001 From: Ian Sutherland Date: Fri, 12 Oct 2018 13:39:39 -0700 Subject: [PATCH 2/2] src: remove TODO comment --- src/stream_base-inl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index ea9f30d6be14d5..0209281f942e1c 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -275,7 +275,6 @@ 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,