Skip to content

Commit ec7375a

Browse files
iansubmacnaughton
authored andcommitted
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: #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>
1 parent b5f5585 commit ec7375a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/stream_base-inl.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -275,29 +275,28 @@ void StreamBase::AddMethods(Environment* env, Local<FunctionTemplate> t) {
275275

276276
Local<Signature> signature = Signature::New(env->isolate(), t);
277277

278-
// TODO(TimothyGu): None of these should have ConstructorBehavior::kAllow.
279278
Local<FunctionTemplate> get_fd_templ =
280279
env->NewFunctionTemplate(GetFD<Base>,
281280
signature,
282-
v8::ConstructorBehavior::kAllow,
281+
v8::ConstructorBehavior::kThrow,
283282
v8::SideEffectType::kHasNoSideEffect);
284283

285284
Local<FunctionTemplate> get_external_templ =
286285
env->NewFunctionTemplate(GetExternal<Base>,
287286
signature,
288-
v8::ConstructorBehavior::kAllow,
287+
v8::ConstructorBehavior::kThrow,
289288
v8::SideEffectType::kHasNoSideEffect);
290289

291290
Local<FunctionTemplate> get_bytes_read_templ =
292291
env->NewFunctionTemplate(GetBytesRead<Base>,
293292
signature,
294-
v8::ConstructorBehavior::kAllow,
293+
v8::ConstructorBehavior::kThrow,
295294
v8::SideEffectType::kHasNoSideEffect);
296295

297296
Local<FunctionTemplate> get_bytes_written_templ =
298297
env->NewFunctionTemplate(GetBytesWritten<Base>,
299298
signature,
300-
v8::ConstructorBehavior::kAllow,
299+
v8::ConstructorBehavior::kThrow,
301300
v8::SideEffectType::kHasNoSideEffect);
302301

303302
t->PrototypeTemplate()->SetAccessorProperty(env->fd_string(),

0 commit comments

Comments
 (0)