diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-12 01:55:17 +0300 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-18 17:58:02 +0300 |
commit | d36e1b4fed57b34d93e70d3408d753e00b8ed754 (patch) | |
tree | 03e0a12b194453231ad7391ff16b2c7cf3a489f2 /src/tty_wrap.cc | |
parent | 68c63a9fa362138bed852714862ac37b85c06adb (diff) |
net,src: refactor writeQueueSize tracking
Currently, writeQueueSize is never used in C++ and barely used
within JS. Instead of constantly updating the value on the JS
object, create a getter that will retrieve the most up-to-date
value from C++.
For the vast majority of cases though, create a new prop on
Socket.prototype[kLastWriteQueueSize] using a Symbol. Use this
to track the current write size, entirely in JS land.
PR-URL: https://github.com/nodejs/node/pull/17650
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r-- | src/tty_wrap.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index df512bfcd37..fae39158ef2 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -153,12 +153,11 @@ void TTYWrap::New(const FunctionCallbackInfo<Value>& args) { CHECK_GE(fd, 0); int err = 0; - TTYWrap* wrap = new TTYWrap(env, args.This(), fd, args[1]->IsTrue(), &err); + new TTYWrap(env, args.This(), fd, args[1]->IsTrue(), &err); if (err != 0) { env->CollectUVExceptionInfo(args[2], err, "uv_tty_init"); args.GetReturnValue().SetUndefined(); } - wrap->UpdateWriteQueueSize(); } |