From 2b5b37a3abdff5a2e02207ab1a68b8b462331563 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 10 Aug 2013 23:25:38 +0200 Subject: [PATCH] stream_wrap: use v8::Integer::NewFromUnsigned() Use v8::Integer::NewFromUnsigned() when updating the writeQueueSize field. Before this commit, it used v8::Integer::New() but that takes an int32_t. It's unlikely for a write queue to grow beyond 2**31-1 bytes but let's use the unsigned integer constructor anyway, just in case. --- src/stream_wrap.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 0a3ba2c..6eb6763 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -92,8 +92,9 @@ void StreamWrap::GetFD(Local, const PropertyCallbackInfo& args) { void StreamWrap::UpdateWriteQueueSize() { HandleScope scope(node_isolate); - object()->Set(write_queue_size_sym, - Integer::New(stream()->write_queue_size, node_isolate)); + Local write_queue_size = + Integer::NewFromUnsigned(stream()->write_queue_size, node_isolate); + object()->Set(write_queue_size_sym, write_queue_size); } -- 2.7.4