diff options
author | Timothy Gu <timothygu99@gmail.com> | 2018-06-22 01:25:12 -0400 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2018-07-14 14:19:12 +0200 |
commit | 51d613db2d3984299fa9f702c96ba2560d040bb9 (patch) | |
tree | d6d96b94d5a3f19ec90b95de729cff7fabc35df5 /src/stream_base-inl.h | |
parent | 466601f47f599e138a18e42c5a0be2dbafd1f8ef (diff) | |
download | node-new-51d613db2d3984299fa9f702c96ba2560d040bb9.tar.gz |
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 b53d3e5979..027b938d30 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -275,29 +275,30 @@ 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 = - 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, |