From a77a065e844a14c3db3924fe5a4ab511502e5e93 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 6 Jun 2019 16:04:09 -0700 Subject: [PATCH 1/3] chore: replace BooleanValue with Nan::To https://chromium-review.googlesource.com/c/v8/v8/+/1585735 --- src/unix/pty.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/pty.cc b/src/unix/pty.cc index b2084dccd..106ab3c9f 100644 --- a/src/unix/pty.cc +++ b/src/unix/pty.cc @@ -192,7 +192,7 @@ NAN_METHOD(PtyFork) { struct termios t = termios(); struct termios *term = &t; term->c_iflag = ICRNL | IXON | IXANY | IMAXBEL | BRKINT; - if (info[8]->BooleanValue(Nan::GetCurrentContext()).FromJust()) { + if (Nan::To(info[8]).FromJust()) { #if defined(IUTF8) term->c_iflag |= IUTF8; #endif From d4efa931f821492a04a98184b7f57b950b2f4c8c Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 6 Jun 2019 16:11:15 -0700 Subject: [PATCH 2/3] chore: replace deprecated Nan::Call api --- src/unix/pty.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/pty.cc b/src/unix/pty.cc index 106ab3c9f..83620b69c 100644 --- a/src/unix/pty.cc +++ b/src/unix/pty.cc @@ -492,7 +492,8 @@ pty_after_waitpid(uv_async_t *async, int unhelpful) { v8::Local cb = Nan::New(baton->cb); baton->cb.Reset(); memset(&baton->cb, -1, sizeof(baton->cb)); - Nan::Callback(cb).Call(Nan::GetCurrentContext()->Global(), 2, argv); + Nan::AsyncResource resource("pty_after_waitpid"); + resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), cb, 2, argv); uv_close((uv_handle_t *)async, pty_after_close); } From 5db10ca4e3970a65492ee0bb7c1f02766d7d6628 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 6 Jun 2019 16:13:05 -0700 Subject: [PATCH 3/3] chore: remove support for really old node versions --- src/unix/pty.cc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/unix/pty.cc b/src/unix/pty.cc index 83620b69c..be0021d71 100644 --- a/src/unix/pty.cc +++ b/src/unix/pty.cc @@ -34,15 +34,7 @@ #if defined(__GLIBC__) || defined(__CYGWIN__) #include #elif defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) -/** - * From node v0.10.28 (at least?) there is also a "util.h" in node/src, which - * would confuse the compiler when looking for "util.h". - */ -#if NODE_VERSION_AT_LEAST(0, 10, 28) -#include <../include/util.h> -#else #include -#endif #elif defined(__FreeBSD__) #include #elif defined(__sun) @@ -120,11 +112,7 @@ static void pty_waitpid(void *); static void -#if NODE_VERSION_AT_LEAST(0, 11, 0) pty_after_waitpid(uv_async_t *); -#else -pty_after_waitpid(uv_async_t *, int); -#endif static void pty_after_close(uv_handle_t *); @@ -476,11 +464,7 @@ pty_waitpid(void *data) { */ static void -#if NODE_VERSION_AT_LEAST(0, 11, 0) pty_after_waitpid(uv_async_t *async) { -#else -pty_after_waitpid(uv_async_t *async, int unhelpful) { -#endif Nan::HandleScope scope; pty_baton *baton = static_cast(async->data);