diff options
author | Timothy Gu <timothygu99@gmail.com> | 2018-06-22 08:25:12 +0300 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2018-06-26 06:15:35 +0300 |
commit | 65f617314d1ea2df8b9e16fb7e7078b5913c749c (patch) | |
tree | 719a8cf6099c336eddf75af226ca1bfbd0b73965 /src/stream_base-inl.h | |
parent | cd8adfaf98613fb0ae4ba71018a236906f67f286 (diff) |
src: start annotating native code side effect
PR-URL: https://github.com/nodejs/node/pull/21458
Refs: https://github.com/nodejs/node/issues/20977
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@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 | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 4509825a60d..bd451031737 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -277,29 +277,30 @@ void StreamBase::AddMethods(Environment* env, Local<Signature> signature = Signature::New(env->isolate(), t); + // TODO(TimothyGu): None of these should have ConstructorBehavior::kAllow. Local<FunctionTemplate> get_fd_templ = - FunctionTemplate::New(env->isolate(), - GetFD<Base>, - env->as_external(), - signature); + env->NewFunctionTemplate(GetFD<Base>, + signature, + v8::ConstructorBehavior::kAllow, + v8::SideEffectType::kHasNoSideEffect); Local<FunctionTemplate> get_external_templ = - FunctionTemplate::New(env->isolate(), - GetExternal<Base>, - env->as_external(), - signature); + env->NewFunctionTemplate(GetExternal<Base>, + signature, + v8::ConstructorBehavior::kAllow, + v8::SideEffectType::kHasNoSideEffect); Local<FunctionTemplate> get_bytes_read_templ = - FunctionTemplate::New(env->isolate(), - GetBytesRead<Base>, - env->as_external(), - signature); + env->NewFunctionTemplate(GetBytesRead<Base>, + signature, + v8::ConstructorBehavior::kAllow, + v8::SideEffectType::kHasNoSideEffect); Local<FunctionTemplate> get_bytes_written_templ = - FunctionTemplate::New(env->isolate(), - GetBytesWritten<Base>, - env->as_external(), - signature); + env->NewFunctionTemplate(GetBytesWritten<Base>, + signature, + v8::ConstructorBehavior::kAllow, + v8::SideEffectType::kHasNoSideEffect); t->PrototypeTemplate()->SetAccessorProperty(env->fd_string(), get_fd_templ, |