diff options
author | Ian Sutherland <ian@iansutherland.ca> | 2018-10-12 19:19:35 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-10-14 23:24:05 +0300 |
commit | c19ab565ca888bace37980d2bc990b3e7936f716 (patch) | |
tree | c6ed3ac0849c636493398d1e027a2a90d0208e0e /src/stream_base-inl.h | |
parent | 20b3698ac14fdd9664654fa90302a5f8b6b58193 (diff) |
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>
Diffstat (limited to 'src/stream_base-inl.h')
-rw-r--r-- | src/stream_base-inl.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 027b938d30d..0209281f942 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -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(), |