summaryrefslogtreecommitdiff
path: root/src/stream_base-inl.h
diff options
context:
space:
mode:
authorIan Sutherland <ian@iansutherland.ca>2018-10-12 09:19:35 -0700
committerAnna Henningsen <anna@addaleax.net>2018-10-14 22:24:05 +0200
commitc19ab565ca888bace37980d2bc990b3e7936f716 (patch)
treec6ed3ac0849c636493398d1e027a2a90d0208e0e /src/stream_base-inl.h
parent20b3698ac14fdd9664654fa90302a5f8b6b58193 (diff)
downloadandroid-node-v8-c19ab565ca888bace37980d2bc990b3e7936f716.tar.gz
android-node-v8-c19ab565ca888bace37980d2bc990b3e7936f716.tar.bz2
android-node-v8-c19ab565ca888bace37980d2bc990b3e7936f716.zip
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.h9
1 files changed, 4 insertions, 5 deletions
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<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(),