diff --git a/.travis.yml b/.travis.yml
index 3acc282797..fad2e7f0c7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,7 +13,7 @@ matrix:
script:
- make lint
# Lint the first commit in the PR.
- - git log HEAD ^$TRAVIS_BRANCH --pretty=format:'%h' --no-merges | tail -1 | xargs npx core-validate-commit --no-validate-metadata
+ - git log $TRAVIS_COMMIT_RANGE --pretty=format:'%h' --no-merges | tail -1 | xargs npx core-validate-commit --no-validate-metadata
- name: "Test Suite"
install:
- ./configure
diff --git a/BUILDING.md b/BUILDING.md
index b7a8965e76..b8809b7174 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -1,10 +1,10 @@
# Building Node.js
-Depending on what platform or features you require, the build process may
-differ slightly. After you've successfully built a binary, running the
-test suite to validate that the binary works as intended is a good next step.
+Depending on what platform or features you need, the build process may
+differ. After you've built a binary, running the
+test suite to confirm that the binary works as intended is a good next step.
-If you can reproduce a test failure consistently, search for it in the
+If you can reproduce a test failure, search for it in the
[Node.js issue tracker](https://github.com/nodejs/node/issues) or
file a new issue.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5687eed7f8..2be28aa610 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,7 +31,8 @@ release.
-10.11.0
+10.12.0
+10.11.0 10.10.0 10.9.0 10.8.0
diff --git a/README.md b/README.md
index 1192e6532c..47e178845d 100644
--- a/README.md
+++ b/README.md
@@ -11,9 +11,8 @@
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. For
more information on using Node.js, see the [Node.js Website][].
-Node.js contributions, policies, and releases are managed under an
-[open governance model](./GOVERNANCE.md). The [Node.js Foundation][] provides
-support for the project.
+The Node.js project uses an [open governance model](./GOVERNANCE.md). The
+[Node.js Foundation][] provides support for the project.
**This project is bound by a [Code of Conduct][].**
@@ -96,15 +95,15 @@ Binaries, installers, and source tarballs are available at
The [latest](https://nodejs.org/download/release/latest/) directory is an
alias for the latest Current release. The latest-_codename_ directory is an
-alias for the latest release from an LTS line. For example,
- is the latest Carbon
-(Node.js version 8) release.
+alias for the latest release from an LTS line. For example, the
+[latest-carbon](https://nodejs.org/download/release/latest-carbon/) directory
+contains the latest Carbon (Node.js 8) release.
#### Nightly Releases
-Listed under their version string which includes their date (in UTC time) and
-the commit SHA at the HEAD of the release.
+Each directory name and filename contains a date (in UTC time) and the commit
+SHA at the HEAD of the release.
#### API Documentation
@@ -155,9 +154,8 @@ the file's signature.
## Building Node.js
-See [BUILDING.md](BUILDING.md) for instructions on how to build
-Node.js from source. The document also contains a list of
-officially supported platforms.
+See [BUILDING.md](BUILDING.md) for instructions on how to build Node.js from
+source and a list of supported platforms.
## Security
@@ -608,8 +606,8 @@ gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73B
gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D
```
-See the section above on [Verifying Binaries](#verifying-binaries) for details
-on what to do with these keys to verify that a downloaded file is official.
+See the section above on [Verifying Binaries](#verifying-binaries) for how to
+use these keys to verify a downloaded file.
Previous releases may also have been signed with one of the following GPG keys:
diff --git a/benchmark/crypto/get-ciphers.js b/benchmark/crypto/get-ciphers.js
index d4c10a2427..5bbe091531 100644
--- a/benchmark/crypto/get-ciphers.js
+++ b/benchmark/crypto/get-ciphers.js
@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
function main({ n, v }) {
const method = require(v).getCiphers;
var i = 0;
- // First call to getChipers will dominate the results
+ // First call to getCiphers will dominate the results
if (n > 1) {
for (; i < n; i++)
method();
diff --git a/benchmark/http/bench-parser.js b/benchmark/http/bench-parser.js
index 087616f44e..8208df1122 100644
--- a/benchmark/http/bench-parser.js
+++ b/benchmark/http/bench-parser.js
@@ -25,7 +25,7 @@ function main({ len, n }) {
bench.start();
for (var i = 0; i < n; i++) {
parser.execute(header, 0, header.length);
- parser.reinitialize(REQUEST);
+ parser.reinitialize(REQUEST, i > 0);
}
bench.end(n);
}
diff --git a/benchmark/misc/freelist.js b/benchmark/misc/freelist.js
index 8c3281cc40..7fa9af4f3d 100644
--- a/benchmark/misc/freelist.js
+++ b/benchmark/misc/freelist.js
@@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
});
function main({ n }) {
- const FreeList = require('internal/freelist');
+ const { FreeList } = require('internal/freelist');
const poolSize = 1000;
const list = new FreeList('test', poolSize, Object);
var j;
diff --git a/deps/uv/AUTHORS b/deps/uv/AUTHORS
index 6504800766..2fdfbcd532 100644
--- a/deps/uv/AUTHORS
+++ b/deps/uv/AUTHORS
@@ -351,3 +351,4 @@ Jeremiah Senkpiel
Andy Zhang
dmabupt
Ryan Liptak
+Ali Ijaz Sheikh
diff --git a/deps/uv/CMakeLists.txt b/deps/uv/CMakeLists.txt
index 4f13efc8e6..6a631a87c1 100644
--- a/deps/uv/CMakeLists.txt
+++ b/deps/uv/CMakeLists.txt
@@ -193,7 +193,6 @@ if(WIN32)
src/win/poll.c
src/win/process.c
src/win/process-stdio.c
- src/win/req.c
src/win/signal.c
src/win/snprintf.c
src/win/stream.c
diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog
index d01b06f08a..7cb675238d 100644
--- a/deps/uv/ChangeLog
+++ b/deps/uv/ChangeLog
@@ -1,3 +1,41 @@
+2018.10.09, Version 1.23.2 (Stable), 34c12788d2e7308f3ac506c0abcbf74c0d6abd20
+
+Changes since version 1.23.1:
+
+* unix: return 0 retrieving rss on cygwin (cjihrig)
+
+* unix: initialize uv_interface_address_t.phys_addr (cjihrig)
+
+* test: handle uv_os_setpriority() windows edge case (cjihrig)
+
+* tty, win: fix read stop for raw mode (Bartosz Sosnowski)
+
+* Revert "Revert "unix,fs: fix for potential partial reads/writes"" (Jameson
+ Nash)
+
+* unix,readv: always permit partial reads to return (Jameson Nash)
+
+* win,tty: fix uv_tty_close() (Bartosz Sosnowski)
+
+* doc: remove extraneous "on" (Ben Noordhuis)
+
+* unix,win: fix threadpool race condition (Anna Henningsen)
+
+* unix: rework thread barrier implementation (Ben Noordhuis)
+
+* aix: switch to libuv's own thread barrier impl (Ben Noordhuis)
+
+* unix: signal done to last thread barrier waiter (Ben Noordhuis)
+
+* test: add uv_barrier_wait serial thread test (Ali Ijaz Sheikh)
+
+* unix: optimize uv_fs_readlink() memory allocation (Ben Noordhuis)
+
+* win: remove req.c and other cleanup (Carlo Marcelo Arenas Belón)
+
+* aix: don't EISDIR on read from directory fd (Ben Noordhuis)
+
+
2018.09.22, Version 1.23.1 (Stable), d2282b3d67821dc53c907c2155fa8c5c6ce25180
Changes since version 1.23.0:
diff --git a/deps/uv/Makefile.am b/deps/uv/Makefile.am
index a217faab3c..2381425403 100644
--- a/deps/uv/Makefile.am
+++ b/deps/uv/Makefile.am
@@ -68,7 +68,6 @@ libuv_la_SOURCES += src/win/async.c \
src/win/poll.c \
src/win/process-stdio.c \
src/win/process.c \
- src/win/req.c \
src/win/req-inl.h \
src/win/signal.c \
src/win/stream.c \
@@ -340,8 +339,7 @@ libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c
endif
if ANDROID
-uvinclude_HEADERS += include/uv/android-ifaddrs.h \
- include/uv/pthread-barrier.h
+uvinclude_HEADERS += include/uv/android-ifaddrs.h
libuv_la_SOURCES += src/unix/android-ifaddrs.c \
src/unix/pthread-fixes.c
endif
@@ -361,8 +359,7 @@ libuv_la_SOURCES += src/unix/cygwin.c \
endif
if DARWIN
-uvinclude_HEADERS += include/uv/darwin.h \
- include/uv/pthread-barrier.h
+uvinclude_HEADERS += include/uv/darwin.h
libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
libuv_la_CFLAGS += -D_DARWIN_UNLIMITED_SELECT=1
libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
@@ -445,7 +442,6 @@ libuv_la_SOURCES += src/unix/no-proctitle.c \
endif
if OS390
-uvinclude_HEADERS += include/uv/pthread-barrier.h
libuv_la_CFLAGS += -D_UNIX03_THREADS \
-D_UNIX03_SOURCE \
-D_OPEN_SYS_IF_EXT=1 \
diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac
index ce307b1d70..0d9066bb02 100644
--- a/deps/uv/configure.ac
+++ b/deps/uv/configure.ac
@@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_PREREQ(2.57)
-AC_INIT([libuv], [1.23.1], [https://github.com/libuv/libuv/issues])
+AC_INIT([libuv], [1.23.2], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
diff --git a/deps/uv/docs/src/design.rst b/deps/uv/docs/src/design.rst
index 487d08ba62..001b12334d 100644
--- a/deps/uv/docs/src/design.rst
+++ b/deps/uv/docs/src/design.rst
@@ -126,7 +126,7 @@ so the current approach is to run blocking file I/O operations in a thread pool.
For a thorough explanation of the cross-platform file I/O landscape, checkout
`this post `_.
-libuv currently uses a global thread pool on which all loops can queue work on. 3 types of
+libuv currently uses a global thread pool on which all loops can queue work. 3 types of
operations are currently run on this pool:
* File system operations
diff --git a/deps/uv/include/uv/pthread-barrier.h b/deps/uv/include/uv/pthread-barrier.h
deleted file mode 100644
index 07db9b8a6a..0000000000
--- a/deps/uv/include/uv/pthread-barrier.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-Copyright (c) 2016, Kari Tristan Helgason
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
-
-#ifndef _UV_PTHREAD_BARRIER_
-#define _UV_PTHREAD_BARRIER_
-#include
-#include
-#if !defined(__MVS__)
-#include /* sem_t */
-#endif
-
-#define PTHREAD_BARRIER_SERIAL_THREAD 0x12345
-#define UV__PTHREAD_BARRIER_FALLBACK 1
-
-/*
- * To maintain ABI compatibility with
- * libuv v1.x struct is padded according
- * to target platform
- */
-#if defined(__ANDROID__)
-# define UV_BARRIER_STRUCT_PADDING \
- sizeof(pthread_mutex_t) + \
- sizeof(pthread_cond_t) + \
- sizeof(unsigned int) - \
- sizeof(void *)
-#elif defined(__APPLE__)
-# define UV_BARRIER_STRUCT_PADDING \
- sizeof(pthread_mutex_t) + \
- 2 * sizeof(sem_t) + \
- 2 * sizeof(unsigned int) - \
- sizeof(void *)
-#else
-# define UV_BARRIER_STRUCT_PADDING 0
-#endif
-
-typedef struct {
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- unsigned threshold;
- unsigned in;
- unsigned out;
-} _uv_barrier;
-
-typedef struct {
- _uv_barrier* b;
- char _pad[UV_BARRIER_STRUCT_PADDING];
-} pthread_barrier_t;
-
-int pthread_barrier_init(pthread_barrier_t* barrier,
- const void* barrier_attr,
- unsigned count);
-
-int pthread_barrier_wait(pthread_barrier_t* barrier);
-int pthread_barrier_destroy(pthread_barrier_t *barrier);
-
-#endif /* _UV_PTHREAD_BARRIER_ */
diff --git a/deps/uv/include/uv/unix.h b/deps/uv/include/uv/unix.h
index 74a0d643ce..7208557b56 100644
--- a/deps/uv/include/uv/unix.h
+++ b/deps/uv/include/uv/unix.h
@@ -66,10 +66,6 @@
# include "uv/posix.h"
#endif
-#ifndef PTHREAD_BARRIER_SERIAL_THREAD
-# include "uv/pthread-barrier.h"
-#endif
-
#ifndef NI_MAXHOST
# define NI_MAXHOST 1025
#endif
@@ -136,8 +132,28 @@ typedef pthread_rwlock_t uv_rwlock_t;
typedef UV_PLATFORM_SEM_T uv_sem_t;
typedef pthread_cond_t uv_cond_t;
typedef pthread_key_t uv_key_t;
-typedef pthread_barrier_t uv_barrier_t;
+/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */
+#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
+/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */
+struct _uv_barrier {
+ uv_mutex_t mutex;
+ uv_cond_t cond;
+ unsigned threshold;
+ unsigned in;
+ unsigned out;
+};
+
+typedef struct {
+ struct _uv_barrier* b;
+# if defined(PTHREAD_BARRIER_SERIAL_THREAD)
+ /* TODO(bnoordhuis) Remove padding in v2. */
+ char pad[sizeof(pthread_barrier_t) - sizeof(struct _uv_barrier*)];
+# endif
+} uv_barrier_t;
+#else
+typedef pthread_barrier_t uv_barrier_t;
+#endif
/* Platform-specific definitions for uv_spawn support. */
typedef gid_t uv_gid_t;
diff --git a/deps/uv/include/uv/version.h b/deps/uv/include/uv/version.h
index 9db3d130cd..cc064e2fd8 100644
--- a/deps/uv/include/uv/version.h
+++ b/deps/uv/include/uv/version.h
@@ -32,7 +32,7 @@
#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 23
-#define UV_VERSION_PATCH 1
+#define UV_VERSION_PATCH 2
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""
diff --git a/deps/uv/src/threadpool.c b/deps/uv/src/threadpool.c
index 4875f27beb..4258933c72 100644
--- a/deps/uv/src/threadpool.c
+++ b/deps/uv/src/threadpool.c
@@ -62,10 +62,10 @@ static void worker(void* arg) {
uv_sem_post((uv_sem_t*) arg);
arg = NULL;
+ uv_mutex_lock(&mutex);
for (;;) {
- uv_mutex_lock(&mutex);
+ /* `mutex` should always be locked at this point. */
- wait_for_work:
/* Keep waiting while either no work is present or only slow I/O
and we're at the threshold for that. */
while (QUEUE_EMPTY(&wq) ||
@@ -93,13 +93,13 @@ static void worker(void* arg) {
other work in the queue is done. */
if (slow_io_work_running >= slow_work_thread_threshold()) {
QUEUE_INSERT_TAIL(&wq, q);
- goto wait_for_work;
+ continue;
}
/* If we encountered a request to run slow I/O work but there is none
to run, that means it's cancelled => Start over. */
if (QUEUE_EMPTY(&slow_io_pending_wq))
- goto wait_for_work;
+ continue;
is_slow_work = 1;
slow_io_work_running++;
@@ -122,13 +122,19 @@ static void worker(void* arg) {
w->work(w);
uv_mutex_lock(&w->loop->wq_mutex);
- if (is_slow_work)
- slow_io_work_running--;
w->work = NULL; /* Signal uv_cancel() that the work req is done
executing. */
QUEUE_INSERT_TAIL(&w->loop->wq, &w->wq);
uv_async_send(&w->loop->wq_async);
uv_mutex_unlock(&w->loop->wq_mutex);
+
+ /* Lock `mutex` since that is expected at the start of the next
+ * iteration. */
+ uv_mutex_lock(&mutex);
+ if (is_slow_work) {
+ /* `slow_io_work_running` is protected by `mutex`. */
+ slow_io_work_running--;
+ }
}
}
diff --git a/deps/uv/src/unix/bsd-ifaddrs.c b/deps/uv/src/unix/bsd-ifaddrs.c
index 0d02154486..9825b1c4db 100644
--- a/deps/uv/src/unix/bsd-ifaddrs.c
+++ b/deps/uv/src/unix/bsd-ifaddrs.c
@@ -119,16 +119,13 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
continue;
address = *addresses;
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
for (i = 0; i < *count; i++) {
if (strcmp(address->name, ent->ifa_name) == 0) {
-#if defined(__CYGWIN__) || defined(__MSYS__)
- memset(address->phys_addr, 0, sizeof(address->phys_addr));
-#else
struct sockaddr_dl* sa_addr;
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
-#endif
}
address++;
}
diff --git a/deps/uv/src/unix/cygwin.c b/deps/uv/src/unix/cygwin.c
index 9fe4093ef4..9da20e203a 100644
--- a/deps/uv/src/unix/cygwin.c
+++ b/deps/uv/src/unix/cygwin.c
@@ -38,7 +38,7 @@ int uv_uptime(double* uptime) {
int uv_resident_set_memory(size_t* rss) {
/* FIXME: read /proc/meminfo? */
*rss = 0;
- return UV_ENOSYS;
+ return 0;
}
int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c
index c3f7951f11..3db5f89c95 100644
--- a/deps/uv/src/unix/fs.c
+++ b/deps/uv/src/unix/fs.c
@@ -262,17 +262,13 @@ static ssize_t uv__fs_read(uv_fs_t* req) {
#if defined(__linux__)
static int no_preadv;
#endif
+ unsigned int iovmax;
ssize_t result;
-#if defined(_AIX)
- struct stat buf;
- if(fstat(req->file, &buf))
- return -1;
- if(S_ISDIR(buf.st_mode)) {
- errno = EISDIR;
- return -1;
- }
-#endif /* defined(_AIX) */
+ iovmax = uv__getiovmax();
+ if (req->nbufs > iovmax)
+ req->nbufs = iovmax;
+
if (req->off < 0) {
if (req->nbufs == 1)
result = read(req->file, req->bufs[0].base, req->bufs[0].len);
@@ -291,25 +287,7 @@ static ssize_t uv__fs_read(uv_fs_t* req) {
if (no_preadv) retry:
# endif
{
- off_t nread;
- size_t index;
-
- nread = 0;
- index = 0;
- result = 1;
- do {
- if (req->bufs[index].len > 0) {
- result = pread(req->file,
- req->bufs[index].base,
- req->bufs[index].len,
- req->off + nread);
- if (result > 0)
- nread += result;
- }
- index++;
- } while (index < req->nbufs && result > 0);
- if (nread > 0)
- result = nread;
+ result = pread(req->file, req->bufs[0].base, req->bufs[0].len, req->off);
}
# if defined(__linux__)
else {
@@ -327,6 +305,13 @@ static ssize_t uv__fs_read(uv_fs_t* req) {
}
done:
+ /* Early cleanup of bufs allocation, since we're done with it. */
+ if (req->bufs != req->bufsml)
+ uv__free(req->bufs);
+
+ req->bufs = NULL;
+ req->nbufs = 0;
+
return result;
}
@@ -391,11 +376,13 @@ static ssize_t uv__fs_pathmax_size(const char* path) {
}
static ssize_t uv__fs_readlink(uv_fs_t* req) {
+ ssize_t maxlen;
ssize_t len;
char* buf;
+ char* newbuf;
- len = uv__fs_pathmax_size(req->path);
- buf = uv__malloc(len + 1);
+ maxlen = uv__fs_pathmax_size(req->path);
+ buf = uv__malloc(maxlen);
if (buf == NULL) {
errno = ENOMEM;
@@ -403,17 +390,28 @@ static ssize_t uv__fs_readlink(uv_fs_t* req) {
}
#if defined(__MVS__)
- len = os390_readlink(req->path, buf, len);
+ len = os390_readlink(req->path, buf, maxlen);
#else
- len = readlink(req->path, buf, len);
+ len = readlink(req->path, buf, maxlen);
#endif
-
if (len == -1) {
uv__free(buf);
return -1;
}
+ /* Uncommon case: resize to make room for the trailing nul byte. */
+ if (len == maxlen) {
+ newbuf = uv__realloc(buf, len + 1);
+
+ if (newbuf == NULL) {
+ uv__free(buf);
+ return -1;
+ }
+
+ buf = newbuf;
+ }
+
buf[len] = '\0';
req->ptr = buf;
@@ -735,25 +733,7 @@ static ssize_t uv__fs_write(uv_fs_t* req) {
if (no_pwritev) retry:
# endif
{
- off_t written;
- size_t index;
-
- written = 0;
- index = 0;
- r = 0;
- do {
- if (req->bufs[index].len > 0) {
- r = pwrite(req->file,
- req->bufs[index].base,
- req->bufs[index].len,
- req->off + written);
- if (r > 0)
- written += r;
- }
- index++;
- } while (index < req->nbufs && r >= 0);
- if (written > 0)
- r = written;
+ r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off);
}
# if defined(__linux__)
else {
@@ -1045,9 +1025,21 @@ static int uv__fs_fstat(int fd, uv_stat_t *buf) {
return ret;
}
+static size_t uv__fs_buf_offset(uv_buf_t* bufs, size_t size) {
+ size_t offset;
+ /* Figure out which bufs are done */
+ for (offset = 0; size > 0 && bufs[offset].len <= size; ++offset)
+ size -= bufs[offset].len;
+
+ /* Fix a partial read/write */
+ if (size > 0) {
+ bufs[offset].base += size;
+ bufs[offset].len -= size;
+ }
+ return offset;
+}
-typedef ssize_t (*uv__fs_buf_iter_processor)(uv_fs_t* req);
-static ssize_t uv__fs_buf_iter(uv_fs_t* req, uv__fs_buf_iter_processor process) {
+static ssize_t uv__fs_write_all(uv_fs_t* req) {
unsigned int iovmax;
unsigned int nbufs;
uv_buf_t* bufs;
@@ -1064,7 +1056,10 @@ static ssize_t uv__fs_buf_iter(uv_fs_t* req, uv__fs_buf_iter_processor process)
if (req->nbufs > iovmax)
req->nbufs = iovmax;
- result = process(req);
+ do
+ result = uv__fs_write(req);
+ while (result < 0 && errno == EINTR);
+
if (result <= 0) {
if (total == 0)
total = result;
@@ -1074,14 +1069,12 @@ static ssize_t uv__fs_buf_iter(uv_fs_t* req, uv__fs_buf_iter_processor process)
if (req->off >= 0)
req->off += result;
+ req->nbufs = uv__fs_buf_offset(req->bufs, result);
req->bufs += req->nbufs;
nbufs -= req->nbufs;
total += result;
}
- if (errno == EINTR && total == -1)
- return total;
-
if (bufs != req->bufsml)
uv__free(bufs);
@@ -1098,7 +1091,8 @@ static void uv__fs_work(struct uv__work* w) {
ssize_t r;
req = container_of(w, uv_fs_t, work_req);
- retry_on_eintr = !(req->fs_type == UV_FS_CLOSE);
+ retry_on_eintr = !(req->fs_type == UV_FS_CLOSE ||
+ req->fs_type == UV_FS_READ);
do {
errno = 0;
@@ -1127,7 +1121,7 @@ static void uv__fs_work(struct uv__work* w) {
X(MKDIR, mkdir(req->path, req->mode));
X(MKDTEMP, uv__fs_mkdtemp(req));
X(OPEN, uv__fs_open(req));
- X(READ, uv__fs_buf_iter(req, uv__fs_read));
+ X(READ, uv__fs_read(req));
X(SCANDIR, uv__fs_scandir(req));
X(READLINK, uv__fs_readlink(req));
X(REALPATH, uv__fs_realpath(req));
@@ -1138,7 +1132,7 @@ static void uv__fs_work(struct uv__work* w) {
X(SYMLINK, symlink(req->path, req->new_path));
X(UNLINK, unlink(req->path));
X(UTIME, uv__fs_utime(req));
- X(WRITE, uv__fs_buf_iter(req, uv__fs_write));
+ X(WRITE, uv__fs_write_all(req));
default: abort();
}
#undef X
diff --git a/deps/uv/src/unix/linux-core.c b/deps/uv/src/unix/linux-core.c
index 124a0a57f4..75362eb76d 100644
--- a/deps/uv/src/unix/linux-core.c
+++ b/deps/uv/src/unix/linux-core.c
@@ -890,6 +890,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
continue;
address = *addresses;
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
for (i = 0; i < (*count); i++) {
if (strcmp(address->name, ent->ifa_name) == 0) {
diff --git a/deps/uv/src/unix/os390.c b/deps/uv/src/unix/os390.c
index 5e93178f6f..65e9b70830 100644
--- a/deps/uv/src/unix/os390.c
+++ b/deps/uv/src/unix/os390.c
@@ -512,7 +512,7 @@ static int uv__interface_addresses_v6(uv_interface_address_t** addresses,
/* TODO: Retrieve netmask using SIOCGIFNETMASK ioctl */
address->is_internal = flg.__nif6e_flags & _NIF6E_FLAGS_LOOPBACK ? 1 : 0;
-
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
address++;
}
@@ -624,6 +624,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
}
address->is_internal = flg.ifr_flags & IFF_LOOPBACK ? 1 : 0;
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
address++;
}
diff --git a/deps/uv/src/unix/thread.c b/deps/uv/src/unix/thread.c
index 303bc6ec84..29004707a4 100644
--- a/deps/uv/src/unix/thread.c
+++ b/deps/uv/src/unix/thread.c
@@ -44,108 +44,119 @@
#undef NANOSEC
#define NANOSEC ((uint64_t) 1e9)
+#if defined(PTHREAD_BARRIER_SERIAL_THREAD)
+STATIC_ASSERT(sizeof(uv_barrier_t) == sizeof(pthread_barrier_t));
+#endif
-#if defined(UV__PTHREAD_BARRIER_FALLBACK)
-/* TODO: support barrier_attr */
-int pthread_barrier_init(pthread_barrier_t* barrier,
- const void* barrier_attr,
- unsigned count) {
+/* Note: guard clauses should match uv_barrier_t's in include/uv/uv-unix.h. */
+#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
+int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) {
+ struct _uv_barrier* b;
int rc;
- _uv_barrier* b;
if (barrier == NULL || count == 0)
- return EINVAL;
-
- if (barrier_attr != NULL)
- return ENOTSUP;
+ return UV_EINVAL;
b = uv__malloc(sizeof(*b));
if (b == NULL)
- return ENOMEM;
+ return UV_ENOMEM;
b->in = 0;
b->out = 0;
b->threshold = count;
- if ((rc = pthread_mutex_init(&b->mutex, NULL)) != 0)
+ rc = uv_mutex_init(&b->mutex);
+ if (rc != 0)
goto error2;
- if ((rc = pthread_cond_init(&b->cond, NULL)) != 0)
+
+ rc = uv_cond_init(&b->cond);
+ if (rc != 0)
goto error;
barrier->b = b;
return 0;
error:
- pthread_mutex_destroy(&b->mutex);
+ uv_mutex_destroy(&b->mutex);
error2:
uv__free(b);
return rc;
}
-int pthread_barrier_wait(pthread_barrier_t* barrier) {
- int rc;
- _uv_barrier* b;
+
+int uv_barrier_wait(uv_barrier_t* barrier) {
+ struct _uv_barrier* b;
+ int last;
if (barrier == NULL || barrier->b == NULL)
- return EINVAL;
+ return UV_EINVAL;
b = barrier->b;
- /* Lock the mutex*/
- if ((rc = pthread_mutex_lock(&b->mutex)) != 0)
- return rc;
+ uv_mutex_lock(&b->mutex);
- /* Increment the count. If this is the first thread to reach the threshold,
- wake up waiters, unlock the mutex, then return
- PTHREAD_BARRIER_SERIAL_THREAD. */
if (++b->in == b->threshold) {
b->in = 0;
- b->out = b->threshold - 1;
- rc = pthread_cond_signal(&b->cond);
- assert(rc == 0);
-
- pthread_mutex_unlock(&b->mutex);
- return PTHREAD_BARRIER_SERIAL_THREAD;
+ b->out = b->threshold;
+ uv_cond_signal(&b->cond);
+ } else {
+ do
+ uv_cond_wait(&b->cond, &b->mutex);
+ while (b->in != 0);
}
- /* Otherwise, wait for other threads until in is set to 0,
- then return 0 to indicate this is not the first thread. */
- do {
- if ((rc = pthread_cond_wait(&b->cond, &b->mutex)) != 0)
- break;
- } while (b->in != 0);
-
- /* mark thread exit */
- b->out--;
- pthread_cond_signal(&b->cond);
- pthread_mutex_unlock(&b->mutex);
- return rc;
+
+ last = (--b->out == 0);
+ if (!last)
+ uv_cond_signal(&b->cond); /* Not needed for last thread. */
+
+ uv_mutex_unlock(&b->mutex);
+ return last;
}
-int pthread_barrier_destroy(pthread_barrier_t* barrier) {
- int rc;
- _uv_barrier* b;
- if (barrier == NULL || barrier->b == NULL)
- return EINVAL;
+void uv_barrier_destroy(uv_barrier_t* barrier) {
+ struct _uv_barrier* b;
b = barrier->b;
+ uv_mutex_lock(&b->mutex);
- if ((rc = pthread_mutex_lock(&b->mutex)) != 0)
- return rc;
+ assert(b->in == 0);
+ assert(b->out == 0);
- if (b->in > 0 || b->out > 0)
- rc = EBUSY;
-
- pthread_mutex_unlock(&b->mutex);
+ if (b->in != 0 || b->out != 0)
+ abort();
- if (rc)
- return rc;
+ uv_mutex_unlock(&b->mutex);
+ uv_mutex_destroy(&b->mutex);
+ uv_cond_destroy(&b->cond);
- pthread_cond_destroy(&b->cond);
- pthread_mutex_destroy(&b->mutex);
uv__free(barrier->b);
barrier->b = NULL;
- return 0;
}
+
+#else
+
+int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) {
+ return UV__ERR(pthread_barrier_init(barrier, NULL, count));
+}
+
+
+int uv_barrier_wait(uv_barrier_t* barrier) {
+ int rc;
+
+ rc = pthread_barrier_wait(barrier);
+ if (rc != 0)
+ if (rc != PTHREAD_BARRIER_SERIAL_THREAD)
+ abort();
+
+ return rc == PTHREAD_BARRIER_SERIAL_THREAD;
+}
+
+
+void uv_barrier_destroy(uv_barrier_t* barrier) {
+ if (pthread_barrier_destroy(barrier))
+ abort();
+}
+
#endif
@@ -771,25 +782,6 @@ int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) {
}
-int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) {
- return UV__ERR(pthread_barrier_init(barrier, NULL, count));
-}
-
-
-void uv_barrier_destroy(uv_barrier_t* barrier) {
- if (pthread_barrier_destroy(barrier))
- abort();
-}
-
-
-int uv_barrier_wait(uv_barrier_t* barrier) {
- int r = pthread_barrier_wait(barrier);
- if (r && r != PTHREAD_BARRIER_SERIAL_THREAD)
- abort();
- return r == PTHREAD_BARRIER_SERIAL_THREAD;
-}
-
-
int uv_key_create(uv_key_t* key) {
return UV__ERR(pthread_key_create(key, NULL));
}
diff --git a/deps/uv/src/win/fs-event.c b/deps/uv/src/win/fs-event.c
index 226e6e7aee..25809ea4f2 100644
--- a/deps/uv/src/win/fs-event.c
+++ b/deps/uv/src/win/fs-event.c
@@ -83,7 +83,7 @@ static void uv_relative_path(const WCHAR* filename,
static int uv_split_path(const WCHAR* filename, WCHAR** dir,
WCHAR** file) {
size_t len, i;
-
+
if (filename == NULL) {
if (dir != NULL)
*dir = NULL;
diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c
index 0886d79982..812c1a6de5 100644
--- a/deps/uv/src/win/fs.c
+++ b/deps/uv/src/win/fs.c
@@ -1517,10 +1517,10 @@ static void fs__fchmod(uv_fs_t* req) {
SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(nt_status));
goto fchmod_cleanup;
}
-
+
/* Test if the Archive attribute is cleared */
if ((file_info.FileAttributes & FILE_ATTRIBUTE_ARCHIVE) == 0) {
- /* Set Archive flag, otherwise setting or clearing the read-only
+ /* Set Archive flag, otherwise setting or clearing the read-only
flag will not work */
file_info.FileAttributes |= FILE_ATTRIBUTE_ARCHIVE;
nt_status = pNtSetInformationFile(handle,
diff --git a/deps/uv/src/win/pipe.c b/deps/uv/src/win/pipe.c
index 382290e69f..9a3cbc8a1e 100644
--- a/deps/uv/src/win/pipe.c
+++ b/deps/uv/src/win/pipe.c
@@ -2347,7 +2347,7 @@ int uv_pipe_chmod(uv_pipe_t* handle, int mode) {
error = GetLastError();
goto clean_sid;
}
-
+
memset(&ea, 0, sizeof(EXPLICIT_ACCESS));
if (mode & UV_READABLE)
ea.grfAccessPermissions |= GENERIC_READ | FILE_WRITE_ATTRIBUTES;
diff --git a/deps/uv/src/win/req.c b/deps/uv/src/win/req.c
deleted file mode 100644
index 111cc5e289..0000000000
--- a/deps/uv/src/win/req.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include
-
-#include "uv.h"
-#include "internal.h"
diff --git a/deps/uv/src/win/thread.c b/deps/uv/src/win/thread.c
index 6e41dcd8a0..56ca41aab0 100644
--- a/deps/uv/src/win/thread.c
+++ b/deps/uv/src/win/thread.c
@@ -118,7 +118,7 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) {
ctx->arg = arg;
/* Create the thread in suspended state so we have a chance to pass
- * its own creation handle to it */
+ * its own creation handle to it */
thread = (HANDLE) _beginthreadex(NULL,
0,
uv__thread_start,
diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c
index 7045b11540..32ccf74ca8 100644
--- a/deps/uv/src/win/tty.c
+++ b/deps/uv/src/win/tty.c
@@ -1033,6 +1033,7 @@ int uv_tty_read_stop(uv_tty_t* handle) {
/* Cancel raw read. Write some bullshit event to force the console wait to
* return. */
memset(&record, 0, sizeof record);
+ record.EventType = FOCUS_EVENT;
if (!WriteConsoleInputW(handle->handle, &record, 1, &written)) {
return GetLastError();
}
@@ -2179,14 +2180,14 @@ void uv_process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle,
void uv_tty_close(uv_tty_t* handle) {
assert(handle->u.fd == -1 || handle->u.fd > 2);
+ if (handle->flags & UV_HANDLE_READING)
+ uv_tty_read_stop(handle);
+
if (handle->u.fd == -1)
CloseHandle(handle->handle);
else
close(handle->u.fd);
- if (handle->flags & UV_HANDLE_READING)
- uv_tty_read_stop(handle);
-
handle->u.fd = -1;
handle->handle = INVALID_HANDLE_VALUE;
handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c
index ce97270547..aa52d7cc5a 100644
--- a/deps/uv/test/runner-win.c
+++ b/deps/uv/test/runner-win.c
@@ -228,7 +228,7 @@ int process_copy_output(process_info_t* p, FILE* stream) {
while (fgets(buf, sizeof(buf), f) != NULL)
print_lines(buf, strlen(buf), stream);
-
+
if (ferror(f))
return -1;
diff --git a/deps/uv/test/test-barrier.c b/deps/uv/test/test-barrier.c
index dfd2dbdef1..89858db571 100644
--- a/deps/uv/test/test-barrier.c
+++ b/deps/uv/test/test-barrier.c
@@ -104,3 +104,45 @@ TEST_IMPL(barrier_3) {
return 0;
}
+
+static void serial_worker(void* data) {
+ uv_barrier_t* barrier;
+
+ barrier = data;
+ if (uv_barrier_wait(barrier) > 0)
+ uv_barrier_destroy(barrier);
+
+ uv_sleep(100); /* Wait a bit before terminating. */
+}
+
+/* Ensure that uv_barrier_wait returns positive only after all threads have
+ * exited the barrier. If this value is returned too early and the barrier is
+ * destroyed prematurely, then this test may see a crash. */
+TEST_IMPL(barrier_serial_thread) {
+ uv_thread_t threads[4];
+ uv_barrier_t barrier;
+ unsigned i;
+
+ ASSERT(0 == uv_barrier_init(&barrier, ARRAY_SIZE(threads) + 1));
+
+ for (i = 0; i < ARRAY_SIZE(threads); ++i)
+ ASSERT(0 == uv_thread_create(&threads[i], serial_worker, &barrier));
+
+ if (uv_barrier_wait(&barrier) > 0)
+ uv_barrier_destroy(&barrier);
+
+ for (i = 0; i < ARRAY_SIZE(threads); ++i)
+ ASSERT(0 == uv_thread_join(&threads[i]));
+
+ return 0;
+}
+
+/* Single thread uv_barrier_wait should return correct return value. */
+TEST_IMPL(barrier_serial_thread_single) {
+ uv_barrier_t barrier;
+
+ ASSERT(0 == uv_barrier_init(&barrier, 1));
+ ASSERT(0 < uv_barrier_wait(&barrier));
+ uv_barrier_destroy(&barrier);
+ return 0;
+}
diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c
index 9c1e8bec20..01f5a7b023 100644
--- a/deps/uv/test/test-fs.c
+++ b/deps/uv/test/test-fs.c
@@ -26,6 +26,7 @@
#include /* memset */
#include
#include
+#include /* INT_MAX, PATH_MAX, IOV_MAX */
/* FIXME we shouldn't need to branch in this file */
#if defined(__unix__) || defined(__POSIX__) || \
@@ -120,6 +121,31 @@ static char test_buf[] = "test-buffer\n";
static char test_buf2[] = "second-buffer\n";
static uv_buf_t iov;
+#ifdef _WIN32
+int uv_test_getiovmax(void) {
+ return INT32_MAX; /* Emulated by libuv, so no real limit. */
+}
+#else
+int uv_test_getiovmax(void) {
+#if defined(IOV_MAX)
+ return IOV_MAX;
+#elif defined(_SC_IOV_MAX)
+ static int iovmax = -1;
+ if (iovmax == -1) {
+ iovmax = sysconf(_SC_IOV_MAX);
+ /* On some embedded devices (arm-linux-uclibc based ip camera),
+ * sysconf(_SC_IOV_MAX) can not get the correct value. The return
+ * value is -1 and the errno is EINPROGRESS. Degrade the value to 1.
+ */
+ if (iovmax == -1) iovmax = 1;
+ }
+ return iovmax;
+#else
+ return 1024;
+#endif
+}
+#endif
+
#ifdef _WIN32
/*
* This tag and guid have no special meaning, and don't conflict with
@@ -2752,19 +2778,44 @@ TEST_IMPL(fs_write_multiple_bufs) {
memset(buf, 0, sizeof(buf));
memset(buf2, 0, sizeof(buf2));
+ /* Read the strings back to separate buffers. */
+ iovs[0] = uv_buf_init(buf, sizeof(test_buf));
+ iovs[1] = uv_buf_init(buf2, sizeof(test_buf2));
+ ASSERT(lseek(open_req1.result, 0, SEEK_CUR) == 0);
+ r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, 2, -1, NULL);
+ ASSERT(r >= 0);
+ ASSERT(read_req.result == sizeof(test_buf) + sizeof(test_buf2));
+ ASSERT(strcmp(buf, test_buf) == 0);
+ ASSERT(strcmp(buf2, test_buf2) == 0);
+ uv_fs_req_cleanup(&read_req);
+
+ iov = uv_buf_init(buf, sizeof(buf));
+ r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL);
+ ASSERT(r == 0);
+ ASSERT(read_req.result == 0);
+ uv_fs_req_cleanup(&read_req);
+
/* Read the strings back to separate buffers. */
iovs[0] = uv_buf_init(buf, sizeof(test_buf));
iovs[1] = uv_buf_init(buf2, sizeof(test_buf2));
r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, 2, 0, NULL);
ASSERT(r >= 0);
- ASSERT(read_req.result >= 0);
+ if (read_req.result == sizeof(test_buf)) {
+ /* Infer that preadv is not available. */
+ uv_fs_req_cleanup(&read_req);
+ r = uv_fs_read(NULL, &read_req, open_req1.result, &iovs[1], 1, read_req.result, NULL);
+ ASSERT(r >= 0);
+ ASSERT(read_req.result == sizeof(test_buf2));
+ } else {
+ ASSERT(read_req.result == sizeof(test_buf) + sizeof(test_buf2));
+ }
ASSERT(strcmp(buf, test_buf) == 0);
ASSERT(strcmp(buf2, test_buf2) == 0);
uv_fs_req_cleanup(&read_req);
iov = uv_buf_init(buf, sizeof(buf));
r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1,
- read_req.result, NULL);
+ sizeof(test_buf) + sizeof(test_buf2), NULL);
ASSERT(r == 0);
ASSERT(read_req.result == 0);
uv_fs_req_cleanup(&read_req);
@@ -2783,12 +2834,15 @@ TEST_IMPL(fs_write_multiple_bufs) {
TEST_IMPL(fs_write_alotof_bufs) {
- const size_t iovcount = 54321;
+ size_t iovcount;
+ size_t iovmax;
uv_buf_t* iovs;
char* buffer;
size_t index;
int r;
+ iovcount = 54321;
+
/* Setup. */
unlink("test_file");
@@ -2796,6 +2850,7 @@ TEST_IMPL(fs_write_alotof_bufs) {
iovs = malloc(sizeof(*iovs) * iovcount);
ASSERT(iovs != NULL);
+ iovmax = uv_test_getiovmax();
r = uv_fs_open(NULL,
&open_req1,
@@ -2829,7 +2884,10 @@ TEST_IMPL(fs_write_alotof_bufs) {
iovs[index] = uv_buf_init(buffer + index * sizeof(test_buf),
sizeof(test_buf));
- r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, iovcount, 0, NULL);
+ ASSERT(lseek(open_req1.result, 0, SEEK_SET) == 0);
+ r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, iovcount, -1, NULL);
+ if (iovcount > iovmax)
+ iovcount = iovmax;
ASSERT(r >= 0);
ASSERT((size_t)read_req.result == sizeof(test_buf) * iovcount);
@@ -2841,13 +2899,14 @@ TEST_IMPL(fs_write_alotof_bufs) {
uv_fs_req_cleanup(&read_req);
free(buffer);
+ ASSERT(lseek(open_req1.result, write_req.result, SEEK_SET) == write_req.result);
iov = uv_buf_init(buf, sizeof(buf));
r = uv_fs_read(NULL,
&read_req,
open_req1.result,
&iov,
1,
- read_req.result,
+ -1,
NULL);
ASSERT(r == 0);
ASSERT(read_req.result == 0);
@@ -2868,14 +2927,19 @@ TEST_IMPL(fs_write_alotof_bufs) {
TEST_IMPL(fs_write_alotof_bufs_with_offset) {
- const size_t iovcount = 54321;
+ size_t iovcount;
+ size_t iovmax;
uv_buf_t* iovs;
char* buffer;
size_t index;
int r;
int64_t offset;
- char* filler = "0123456789";
- int filler_len = strlen(filler);
+ char* filler;
+ int filler_len;
+
+ filler = "0123456789";
+ filler_len = strlen(filler);
+ iovcount = 54321;
/* Setup. */
unlink("test_file");
@@ -2884,6 +2948,7 @@ TEST_IMPL(fs_write_alotof_bufs_with_offset) {
iovs = malloc(sizeof(*iovs) * iovcount);
ASSERT(iovs != NULL);
+ iovmax = uv_test_getiovmax();
r = uv_fs_open(NULL,
&open_req1,
@@ -2927,6 +2992,10 @@ TEST_IMPL(fs_write_alotof_bufs_with_offset) {
r = uv_fs_read(NULL, &read_req, open_req1.result,
iovs, iovcount, offset, NULL);
ASSERT(r >= 0);
+ if (r == sizeof(test_buf))
+ iovcount = 1; /* Infer that preadv is not available. */
+ else if (iovcount > iovmax)
+ iovcount = iovmax;
ASSERT((size_t)read_req.result == sizeof(test_buf) * iovcount);
for (index = 0; index < iovcount; ++index)
@@ -2940,7 +3009,7 @@ TEST_IMPL(fs_write_alotof_bufs_with_offset) {
r = uv_fs_stat(NULL, &stat_req, "test_file", NULL);
ASSERT(r == 0);
ASSERT((int64_t)((uv_stat_t*)stat_req.ptr)->st_size ==
- offset + (int64_t)(iovcount * sizeof(test_buf)));
+ offset + (int64_t)write_req.result);
uv_fs_req_cleanup(&stat_req);
iov = uv_buf_init(buf, sizeof(buf));
@@ -2949,7 +3018,7 @@ TEST_IMPL(fs_write_alotof_bufs_with_offset) {
open_req1.result,
&iov,
1,
- read_req.result + offset,
+ offset + write_req.result,
NULL);
ASSERT(r == 0);
ASSERT(read_req.result == 0);
@@ -2969,6 +3038,175 @@ TEST_IMPL(fs_write_alotof_bufs_with_offset) {
}
+#ifdef _WIN32
+
+TEST_IMPL(fs_partial_read) {
+ RETURN_SKIP("Test not implemented on Windows.");
+}
+
+TEST_IMPL(fs_partial_write) {
+ RETURN_SKIP("Test not implemented on Windows.");
+}
+
+#else /* !_WIN32 */
+
+struct thread_ctx {
+ pthread_t pid;
+ int fd;
+ char* data;
+ int size;
+ int interval;
+ int doread;
+};
+
+static void thread_main(void* arg) {
+ const struct thread_ctx* ctx;
+ int size;
+ char* data;
+
+ ctx = (struct thread_ctx*)arg;
+ size = ctx->size;
+ data = ctx->data;
+
+ while (size > 0) {
+ ssize_t result;
+ int nbytes;
+ nbytes = size < ctx->interval ? size : ctx->interval;
+ if (ctx->doread) {
+ result = write(ctx->fd, data, nbytes);
+ /* Should not see EINTR (or other errors) */
+ ASSERT(result == nbytes);
+ } else {
+ result = read(ctx->fd, data, nbytes);
+ /* Should not see EINTR (or other errors),
+ * but might get a partial read if we are faster than the writer
+ */
+ ASSERT(result > 0 && result <= nbytes);
+ }
+
+ pthread_kill(ctx->pid, SIGUSR1);
+ size -= result;
+ data += result;
+ }
+}
+
+static void sig_func(uv_signal_t* handle, int signum) {
+ uv_signal_stop(handle);
+}
+
+static size_t uv_test_fs_buf_offset(uv_buf_t* bufs, size_t size) {
+ size_t offset;
+ /* Figure out which bufs are done */
+ for (offset = 0; size > 0 && bufs[offset].len <= size; ++offset)
+ size -= bufs[offset].len;
+
+ /* Fix a partial read/write */
+ if (size > 0) {
+ bufs[offset].base += size;
+ bufs[offset].len -= size;
+ }
+ return offset;
+}
+
+static void test_fs_partial(int doread) {
+ struct thread_ctx ctx;
+ uv_thread_t thread;
+ uv_signal_t signal;
+ int pipe_fds[2];
+ size_t iovcount;
+ uv_buf_t* iovs;
+ char* buffer;
+ size_t index;
+
+ iovcount = 54321;
+
+ iovs = malloc(sizeof(*iovs) * iovcount);
+ ASSERT(iovs != NULL);
+
+ ctx.pid = pthread_self();
+ ctx.doread = doread;
+ ctx.interval = 1000;
+ ctx.size = sizeof(test_buf) * iovcount;
+ ctx.data = malloc(ctx.size);
+ ASSERT(ctx.data != NULL);
+ buffer = malloc(ctx.size);
+ ASSERT(buffer != NULL);
+
+ for (index = 0; index < iovcount; ++index)
+ iovs[index] = uv_buf_init(buffer + index * sizeof(test_buf), sizeof(test_buf));
+
+ loop = uv_default_loop();
+
+ ASSERT(0 == uv_signal_init(loop, &signal));
+ ASSERT(0 == uv_signal_start(&signal, sig_func, SIGUSR1));
+
+ ASSERT(0 == pipe(pipe_fds));
+
+ ctx.fd = pipe_fds[doread];
+ ASSERT(0 == uv_thread_create(&thread, thread_main, &ctx));
+
+ if (doread) {
+ uv_buf_t* read_iovs;
+ int nread;
+ read_iovs = iovs;
+ nread = 0;
+ while (nread < ctx.size) {
+ int result;
+ result = uv_fs_read(loop, &read_req, pipe_fds[0], read_iovs, iovcount, -1, NULL);
+ if (result > 0) {
+ size_t read_iovcount;
+ read_iovcount = uv_test_fs_buf_offset(read_iovs, result);
+ read_iovs += read_iovcount;
+ iovcount -= read_iovcount;
+ nread += result;
+ } else {
+ ASSERT(result == UV_EINTR);
+ }
+ uv_fs_req_cleanup(&read_req);
+ }
+ } else {
+ int result;
+ result = uv_fs_write(loop, &write_req, pipe_fds[1], iovs, iovcount, -1, NULL);
+ ASSERT(write_req.result == result);
+ ASSERT(result == ctx.size);
+ uv_fs_req_cleanup(&write_req);
+ }
+
+ ASSERT(0 == memcmp(buffer, ctx.data, ctx.size));
+
+ ASSERT(0 == uv_thread_join(&thread));
+ ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
+
+ ASSERT(0 == close(pipe_fds[1]));
+ uv_close((uv_handle_t*) &signal, NULL);
+
+ { /* Make sure we read everything that we wrote. */
+ int result;
+ result = uv_fs_read(loop, &read_req, pipe_fds[0], iovs, 1, -1, NULL);
+ ASSERT(result == 0);
+ uv_fs_req_cleanup(&read_req);
+ }
+ ASSERT(0 == close(pipe_fds[0]));
+
+ free(iovs);
+ free(buffer);
+ free(ctx.data);
+
+ MAKE_VALGRIND_HAPPY();
+}
+
+TEST_IMPL(fs_partial_read) {
+ test_fs_partial(1);
+ return 0;
+}
+
+TEST_IMPL(fs_partial_write) {
+ test_fs_partial(0);
+ return 0;
+}
+
+#endif/* _WIN32 */
+
TEST_IMPL(fs_read_write_null_arguments) {
int r;
@@ -3313,7 +3551,7 @@ TEST_IMPL(fs_exclusive_sharing_mode) {
int call_icacls(const char* command, ...) {
char icacls_command[1024];
va_list args;
-
+
va_start(args, command);
vsnprintf(icacls_command, ARRAYSIZE(icacls_command), command, args);
va_end(args);
@@ -3335,7 +3573,7 @@ TEST_IMPL(fs_open_readonly_acl) {
attrib -r test_file_icacls
del test_file_icacls
*/
-
+
/* Setup - clear the ACL and remove the file */
loop = uv_default_loop();
r = uv_os_get_passwd(&pwd);
@@ -3345,7 +3583,7 @@ TEST_IMPL(fs_open_readonly_acl) {
uv_fs_chmod(loop, &req, "test_file_icacls", S_IWUSR, NULL);
unlink("test_file_icacls");
- /* Create the file */
+ /* Create the file */
r = uv_fs_open(loop,
&open_req1,
"test_file_icacls",
@@ -3370,7 +3608,7 @@ TEST_IMPL(fs_open_readonly_acl) {
if (r != 0) {
goto acl_cleanup;
}
-
+
/* Try opening the file */
r = uv_fs_open(NULL, &open_req1, "test_file_icacls", O_RDONLY, 0, NULL);
if (r < 0) {
diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h
index b501722d4d..1bd062da3d 100644
--- a/deps/uv/test/test-list.h
+++ b/deps/uv/test/test-list.h
@@ -37,6 +37,8 @@ TEST_DECLARE (default_loop_close)
TEST_DECLARE (barrier_1)
TEST_DECLARE (barrier_2)
TEST_DECLARE (barrier_3)
+TEST_DECLARE (barrier_serial_thread)
+TEST_DECLARE (barrier_serial_thread_single)
TEST_DECLARE (condvar_1)
TEST_DECLARE (condvar_2)
TEST_DECLARE (condvar_3)
@@ -50,6 +52,7 @@ TEST_DECLARE (tty)
TEST_DECLARE (tty_raw)
TEST_DECLARE (tty_empty_write)
TEST_DECLARE (tty_large_write)
+TEST_DECLARE (tty_raw_cancel)
#endif
TEST_DECLARE (tty_file)
TEST_DECLARE (tty_pty)
@@ -339,6 +342,8 @@ TEST_DECLARE (get_osfhandle_valid_handle)
TEST_DECLARE (open_osfhandle_valid_handle)
TEST_DECLARE (fs_write_alotof_bufs)
TEST_DECLARE (fs_write_alotof_bufs_with_offset)
+TEST_DECLARE (fs_partial_read)
+TEST_DECLARE (fs_partial_write)
TEST_DECLARE (fs_file_pos_after_op_with_offset)
TEST_DECLARE (fs_null_req)
#ifdef _WIN32
@@ -456,6 +461,8 @@ TASK_LIST_START
TEST_ENTRY (barrier_1)
TEST_ENTRY (barrier_2)
TEST_ENTRY (barrier_3)
+ TEST_ENTRY (barrier_serial_thread)
+ TEST_ENTRY (barrier_serial_thread_single)
TEST_ENTRY (condvar_1)
TEST_ENTRY (condvar_2)
TEST_ENTRY (condvar_3)
@@ -480,6 +487,7 @@ TASK_LIST_START
TEST_ENTRY (tty_raw)
TEST_ENTRY (tty_empty_write)
TEST_ENTRY (tty_large_write)
+ TEST_ENTRY (tty_raw_cancel)
#endif
TEST_ENTRY (tty_file)
TEST_ENTRY (tty_pty)
@@ -884,6 +892,8 @@ TASK_LIST_START
TEST_ENTRY (fs_write_multiple_bufs)
TEST_ENTRY (fs_write_alotof_bufs)
TEST_ENTRY (fs_write_alotof_bufs_with_offset)
+ TEST_ENTRY (fs_partial_read)
+ TEST_ENTRY (fs_partial_write)
TEST_ENTRY (fs_read_write_null_arguments)
TEST_ENTRY (fs_file_pos_after_op_with_offset)
TEST_ENTRY (fs_null_req)
diff --git a/deps/uv/test/test-process-priority.c b/deps/uv/test/test-process-priority.c
index ebee6b90af..b3d0a85bdd 100644
--- a/deps/uv/test/test-process-priority.c
+++ b/deps/uv/test/test-process-priority.c
@@ -54,8 +54,10 @@ TEST_IMPL(process_priority) {
#ifndef _WIN32
ASSERT(priority == i);
#else
+ /* On Windows, only elevated users can set UV_PRIORITY_HIGHEST. Other
+ users will silently be set to UV_PRIORITY_HIGH. */
if (i < UV_PRIORITY_HIGH)
- ASSERT(priority == UV_PRIORITY_HIGHEST);
+ ASSERT(priority == UV_PRIORITY_HIGHEST || priority == UV_PRIORITY_HIGH);
else if (i < UV_PRIORITY_ABOVE_NORMAL)
ASSERT(priority == UV_PRIORITY_HIGH);
else if (i < UV_PRIORITY_NORMAL)
diff --git a/deps/uv/test/test-tty.c b/deps/uv/test/test-tty.c
index 3bbdfad780..979a6ec38d 100644
--- a/deps/uv/test/test-tty.c
+++ b/deps/uv/test/test-tty.c
@@ -310,6 +310,41 @@ TEST_IMPL(tty_large_write) {
MAKE_VALGRIND_HAPPY();
return 0;
}
+
+TEST_IMPL(tty_raw_cancel) {
+ int r;
+ int ttyin_fd;
+ uv_tty_t tty_in;
+ uv_loop_t* loop;
+ HANDLE handle;
+
+ loop = uv_default_loop();
+ /* Make sure we have an FD that refers to a tty */
+ handle = CreateFileA("conin$",
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+ ASSERT(handle != INVALID_HANDLE_VALUE);
+ ttyin_fd = _open_osfhandle((intptr_t) handle, 0);
+ ASSERT(ttyin_fd >= 0);
+ ASSERT(UV_TTY == uv_guess_handle(ttyin_fd));
+
+ r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */
+ ASSERT(r == 0);
+ r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW);
+ ASSERT(r == 0);
+ r = uv_read_start((uv_stream_t*)&tty_in, tty_raw_alloc, tty_raw_read);
+ ASSERT(r == 0);
+
+ r = uv_read_stop((uv_stream_t*) &tty_in);
+ ASSERT(r == 0);
+
+ MAKE_VALGRIND_HAPPY();
+ return 0;
+}
#endif
diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp
index 37dcb3604f..5148a850ab 100644
--- a/deps/uv/uv.gyp
+++ b/deps/uv/uv.gyp
@@ -116,7 +116,6 @@
'src/win/poll.c',
'src/win/process.c',
'src/win/process-stdio.c',
- 'src/win/req.c',
'src/win/req-inl.h',
'src/win/signal.c',
'src/win/snprintf.c',
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index 06038eca3b..415d17dbbb 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 7
#define V8_MINOR_VERSION 0
#define V8_BUILD_NUMBER 276
-#define V8_PATCH_LEVEL 24
+#define V8_PATCH_LEVEL 25
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
diff --git a/deps/v8/src/compiler/js-operator.cc b/deps/v8/src/compiler/js-operator.cc
index 57f9950d55..797814314f 100644
--- a/deps/v8/src/compiler/js-operator.cc
+++ b/deps/v8/src/compiler/js-operator.cc
@@ -623,7 +623,7 @@ CompareOperationHint CompareOperationHintOf(const Operator* op) {
V(CreateKeyValueArray, Operator::kEliminatable, 2, 1) \
V(CreatePromise, Operator::kEliminatable, 0, 1) \
V(CreateTypedArray, Operator::kNoProperties, 5, 1) \
- V(CreateObject, Operator::kNoWrite, 1, 1) \
+ V(CreateObject, Operator::kNoProperties, 1, 1) \
V(ObjectIsArray, Operator::kNoProperties, 1, 1) \
V(HasProperty, Operator::kNoProperties, 2, 1) \
V(HasInPrototypeChain, Operator::kNoProperties, 2, 1) \
diff --git a/deps/v8/test/mjsunit/compiler/regress-888923.js b/deps/v8/test/mjsunit/compiler/regress-888923.js
new file mode 100644
index 0000000000..e352673b7d
--- /dev/null
+++ b/deps/v8/test/mjsunit/compiler/regress-888923.js
@@ -0,0 +1,31 @@
+// Copyright 2018 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+(function() {
+ function f(o) {
+ o.x;
+ Object.create(o);
+ return o.y.a;
+ }
+
+ f({ x : 0, y : { a : 1 } });
+ f({ x : 0, y : { a : 2 } });
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals(3, f({ x : 0, y : { a : 3 } }));
+})();
+
+(function() {
+ function f(o) {
+ let a = o.y;
+ Object.create(o);
+ return o.x + a;
+ }
+
+ f({ x : 42, y : 21 });
+ f({ x : 42, y : 21 });
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals(63, f({ x : 42, y : 21 }));
+})();
diff --git a/doc/api/cli.md b/doc/api/cli.md
index 8337a9aef5..a8e935be2a 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -23,7 +23,7 @@ _For more info about `node inspect`, please see the [debugger][] documentation._
## Options
Print source-able bash completion script for Node.js.
diff --git a/doc/api/crypto.md b/doc/api/crypto.md
index ecb0c8186c..88545f8636 100644
--- a/doc/api/crypto.md
+++ b/doc/api/crypto.md
@@ -1675,7 +1675,7 @@ signing algorithms. Optional `options` argument controls the
### crypto.generateKeyPair(type, options, callback)
* `type`: {string} Must be `'rsa'`, `'dsa'` or `'ec'`.
* `options`: {Object}
@@ -1736,7 +1736,7 @@ a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
### crypto.generateKeyPairSync(type, options)
* `type`: {string} Must be `'rsa'`, `'dsa'` or `'ec'`.
* `options`: {Object}
diff --git a/doc/api/errors.md b/doc/api/errors.md
index 7cdee52e79..3ba2742b94 100644
--- a/doc/api/errors.md
+++ b/doc/api/errors.md
@@ -1952,9 +1952,9 @@ The `repl` module was unable to parse data from the REPL history file.
### ERR_STDERR_CLOSE
+
+
+
+* {Object}
+
+The object that acts as the namespace for all W3C
+[WebAssembly][webassembly-org] related functionality. See the
+[Mozilla Developer Network][webassembly-mdn] for usage and compatibility.
+
[`__dirname`]: modules.html#modules_dirname
[`__filename`]: modules.html#modules_filename
[`clearImmediate`]: timers.html#timers_clearimmediate_immediate
@@ -236,3 +249,5 @@ The WHATWG `URLSearchParams` class. See the [`URLSearchParams`][] section.
[built-in objects]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
[module system documentation]: modules.html
[timers]: timers.html
+[webassembly-mdn]: https://developer.mozilla.org/en-US/docs/WebAssembly
+[webassembly-org]: https://webassembly.org
diff --git a/doc/api/http2.md b/doc/api/http2.md
index e1e82c9dce..f3314695cf 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -224,7 +224,7 @@ session.on('localSettings', (settings) => {
#### Event: 'ping'
* `payload` {Buffer} The `PING` frame 8-byte payload
@@ -684,7 +684,7 @@ are passed through as provided by the user or received from the peer.
#### serverhttp2session.origin(...origins)
* `origins` { string | URL | Object } One or more URL Strings passed as
@@ -764,7 +764,7 @@ client.on('altsvc', (alt, origin, streamId) => {
#### Event: 'origin'
* `origins` {string[]}
@@ -2000,7 +2000,7 @@ server.listen(80);
* `filename` {string} Filename to be used to construct the relative require
diff --git a/doc/api/n-api.md b/doc/api/n-api.md
index 5276ee2e54..c976c5e8f0 100644
--- a/doc/api/n-api.md
+++ b/doc/api/n-api.md
@@ -11,8 +11,8 @@ the underlying JavaScript runtime (ex V8) and is maintained as part of
Node.js itself. This API will be Application Binary Interface (ABI) stable
across versions of Node.js. It is intended to insulate Addons from
changes in the underlying JavaScript engine and allow modules
-compiled for one version to run on later versions of Node.js without
-recompilation.
+compiled for one major version to run on later major versions of Node.js without
+recompilation. The [ABI Stability][] guide provides a more in-depth explanation.
Addons are built/packaged with the same approach/tools
outlined in the section titled [C++ Addons](addons.html).
@@ -1757,7 +1757,7 @@ added: v10.7.0
```C
napi_status napi_create_bigint_uint64(napi_env env,
- uint64_t vaue,
+ uint64_t value,
napi_value* result);
```
@@ -4596,6 +4596,7 @@ idempotent.
This API may only be called from the main thread.
+[ABI Stability]: https://nodejs.org/en/docs/guides/abi-stability/
[ECMAScript Language Specification]: https://tc39.github.io/ecma262/
[Error Handling]: #n_api_error_handling
[Native Abstractions for Node.js]: https://github.com/nodejs/nan
diff --git a/doc/api/process.md b/doc/api/process.md
index 0eaeef8ba3..5139ad95d8 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -99,7 +99,7 @@ not be the same as what is originally sent.
### Event: 'multipleResolves'
* `type` {string} The error type. One of `'resolve'` or `'reject'`.
diff --git a/doc/api/stream.md b/doc/api/stream.md
index 4ec151a37c..fb2f2da28d 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -1205,9 +1205,8 @@ added: v0.9.4
* `stream` {Stream} An "old style" readable stream
* Returns: {this}
-Versions of Node.js prior to v0.10 had streams that did not implement the
-entire `stream` module API as it is currently defined. (See [Compatibility][]
-for more information.)
+Prior to Node.js 0.10, streams did not implement the entire `stream` module API
+as it is currently defined. (See [Compatibility][] for more information.)
When using an older Node.js library that emits [`'data'`][] events and has a
[`stream.pause()`][stream-pause] method that is advisory only, the
@@ -2325,10 +2324,10 @@ primarily for examples and testing, but there are some use cases where
-In versions of Node.js prior to v0.10, the `Readable` stream interface was
-simpler, but also less powerful and less useful.
+Prior to Node.js 0.10, the `Readable` stream interface was simpler, but also
+less powerful and less useful.
-* Rather than waiting for calls the [`stream.read()`][stream-read] method,
+* Rather than waiting for calls to the [`stream.read()`][stream-read] method,
[`'data'`][] events would begin emitting immediately. Applications that
would need to perform some amount of work to decide how to handle data
were required to store read data into buffers so the data would not be lost.
@@ -2336,7 +2335,7 @@ simpler, but also less powerful and less useful.
guaranteed. This meant that it was still necessary to be prepared to receive
[`'data'`][] events *even when the stream was in a paused state*.
-In Node.js v0.10, the [`Readable`][] class was added. For backwards
+In Node.js 0.10, the [`Readable`][] class was added. For backwards
compatibility with older Node.js programs, `Readable` streams switch into
"flowing mode" when a [`'data'`][] event handler is added, or when the
[`stream.resume()`][stream-resume] method is called. The effect is that, even
@@ -2366,9 +2365,8 @@ net.createServer((socket) => {
}).listen(1337);
```
-In versions of Node.js prior to v0.10, the incoming message data would be
-simply discarded. However, in Node.js v0.10 and beyond, the socket remains
-paused forever.
+Prior to Node.js 0.10, the incoming message data would be simply discarded.
+However, in Node.js 0.10 and beyond, the socket remains paused forever.
The workaround in this situation is to call the
[`stream.resume()`][stream-resume] method to begin the flow of data:
@@ -2386,7 +2384,7 @@ net.createServer((socket) => {
```
In addition to new `Readable` streams switching into flowing mode,
-pre-v0.10 style streams can be wrapped in a `Readable` class using the
+pre-0.10 style streams can be wrapped in a `Readable` class using the
[`readable.wrap()`][`stream.wrap()`] method.
### `readable.read(0)`
diff --git a/doc/api/util.md b/doc/api/util.md
index 6dfbec8ac3..c1fc606a51 100644
--- a/doc/api/util.md
+++ b/doc/api/util.md
@@ -202,8 +202,8 @@ Each placeholder token is replaced with the converted value from the
corresponding argument. Supported placeholders are:
* `%s` - `String`.
-* `%d` - `Number` (integer or floating point value).
-* `%i` - Integer.
+* `%d` - `Number` (integer or floating point value) or `BigInt`.
+* `%i` - Integer or `BigInt`.
* `%f` - Floating point value.
* `%j` - JSON. Replaced with the string `'[Circular]'` if the argument
contains circular references.
@@ -361,13 +361,14 @@ stream.write('With ES6');
```
## util.inspect(object[, options])
+## util.inspect(object[, showHidden[, depth[, colors]]])
diff --git a/doc/changelogs/CHANGELOG_V10.md b/doc/changelogs/CHANGELOG_V10.md
index 04b836a947..5b69c7c4e5 100644
--- a/doc/changelogs/CHANGELOG_V10.md
+++ b/doc/changelogs/CHANGELOG_V10.md
@@ -9,6 +9,7 @@
+10.12.0 10.11.0 10.10.0 10.9.0
@@ -39,6 +40,323 @@
* [io.js](CHANGELOG_IOJS.md)
* [Archive](CHANGELOG_ARCHIVE.md)
+
+## 2018-10-10, Version 10.12.0 (Current), @targos
+
+### Notable changes
+
+* **assert**
+ * The diff output is now a tiny bit improved by sorting object properties when
+ inspecting the values that are compared with each other. [#22788](https://github.com/nodejs/node/pull/22788)
+* **cli**
+ * The options parser now normalizes `_` to `-` in all multi-word command-line
+ flags, e.g. `--no_warnings` has the same effect as `--no-warnings`. [#23020](https://github.com/nodejs/node/pull/23020)
+ * Added bash completion for the `node` binary. To generate a bash completion
+ script, run `node --completion-bash`. The output can be saved to a file
+ which can be sourced to enable completion. [#20713](https://github.com/nodejs/node/pull/20713)
+* **crypto**
+ * Added support for PEM-level encryption. [#23151](https://github.com/nodejs/node/pull/23151)
+ * Added an API asymmetric key pair generation. The new methods
+ `crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be used to
+ generate public and private key pairs. The API supports RSA, DSA and EC and
+ a variety of key encodings (both PEM and DER). [#22660](https://github.com/nodejs/node/pull/22660)
+* **fs**
+ * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If this option
+ is set to true, non-existing parent folders will be automatically created. [#21875](https://github.com/nodejs/node/pull/21875)
+* **http2**
+ * Added a `'ping'` event to `Http2Session` that is emitted whenever a non-ack
+ `PING` is received. [#23009](https://github.com/nodejs/node/pull/23009)
+ * Added support for the `ORIGIN` frame. [#22956](https://github.com/nodejs/node/pull/22956)
+ * Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect protocol
+ support to allow use of WebSockets over HTTP/2. [#23284](https://github.com/nodejs/node/pull/23284)
+* **module**
+ * Added `module.createRequireFromPath(filename)`. This new method can be used
+ to create a custom require function that will resolve modules relative to
+ the filename path. [#19360](https://github.com/nodejs/node/pull/19360)
+* **process**
+ * Added a `'multipleResolves'` process event that is emitted whenever a
+ `Promise` is attempted to be resolved multiple times, e.g. if the `resolve`
+ and `reject` functions are both called in a `Promise` executor. [#22218](https://github.com/nodejs/node/pull/22218)
+* **url**
+ * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These methods
+ can be used to correctly convert between file: URLs and absolute paths. [#22506](https://github.com/nodejs/node/pull/22506)
+* **util**
+ * Added the `sorted` option to `util.inspect()`. If set to `true`, all
+ properties of an object and Set and Map entries will be sorted in the
+ returned string. If set to a function, it is used as a compare function. [#22788](https://github.com/nodejs/node/pull/22788)
+ * The `util.instpect.custom` symbol is now defined in the global symbol
+ registry as `Symbol.for('nodejs.util.inspect.custom')`. [#20857](https://github.com/nodejs/node/pull/20857)
+ * Added support for `BigInt` numbers in `util.format()`. [#22097](https://github.com/nodejs/node/pull/22097)
+* **V8 API**
+ * A number of V8 C++ APIs have been marked as deprecated since they have been
+ removed in the upstream repository. Replacement APIs are added where
+ necessary. [#23159](https://github.com/nodejs/node/pull/23159)
+* **Windows**
+ * The Windows msi installer now provides an option to automatically install
+ the tools required to build native modules. [#22645](https://github.com/nodejs/node/pull/22645)
+* **Workers**
+ * Debugging support for Workers using the DevTools protocol has been
+ implemented. [#21364](https://github.com/nodejs/node/pull/21364)
+ * The public `inspector` module is now enabled in Workers. [#22769](https://github.com/nodejs/node/pull/22769)
+* **Added new collaborators**:
+ * [digitalinfinity](https://github.com/digitalinfinity) - Hitesh Kanwathirtha
+
+### Commits
+
+* [[`12ff395e35`](https://github.com/nodejs/node/commit/12ff395e35)] - **assert**: remove internal errorCache property (Rich Trott) [#23304](https://github.com/nodejs/node/pull/23304)
+* [[`efdb32603c`](https://github.com/nodejs/node/commit/efdb32603c)] - **(SEMVER-MINOR)** **assert**: improve diff output (Ruben Bridgewater) [#22788](https://github.com/nodejs/node/pull/22788)
+* [[`9749d48729`](https://github.com/nodejs/node/commit/9749d48729)] - **benchmark**: increase lint compliance (Rich Trott) [#23305](https://github.com/nodejs/node/pull/23305)
+* [[`90bbab6f71`](https://github.com/nodejs/node/commit/90bbab6f71)] - **benchmark**: refactor util benchmarks (Ruben Bridgewater) [#22503](https://github.com/nodejs/node/pull/22503)
+* [[`2d7e4e0116`](https://github.com/nodejs/node/commit/2d7e4e0116)] - **benchmark,doc,lib,src,test,tools**: fix typos (Brandon Smith) [#23302](https://github.com/nodejs/node/pull/23302)
+* [[`e6484c2c11`](https://github.com/nodejs/node/commit/e6484c2c11)] - **build**: restore js2c direct dependency on config.gypi (Refael Ackermann) [#23355](https://github.com/nodejs/node/pull/23355)
+* [[`c4aa0331c1`](https://github.com/nodejs/node/commit/c4aa0331c1)] - **build**: make configure script verbose by default (Michaël Zasso) [#23408](https://github.com/nodejs/node/pull/23408)
+* [[`cf17759113`](https://github.com/nodejs/node/commit/cf17759113)] - **build**: toggle lint-cpp using verbose (V) variable (Daniel Bevenius) [#23217](https://github.com/nodejs/node/pull/23217)
+* [[`b0dc0ca9a9`](https://github.com/nodejs/node/commit/b0dc0ca9a9)] - **build**: make lint-addon-docs quiet (Daniel Bevenius) [#23217](https://github.com/nodejs/node/pull/23217)
+* [[`0f236c8d42`](https://github.com/nodejs/node/commit/0f236c8d42)] - **build**: add pgo specific variables to common.gypi (Denys Otrishko) [#23102](https://github.com/nodejs/node/pull/23102)
+* [[`de4d688d1f`](https://github.com/nodejs/node/commit/de4d688d1f)] - **build**: cleanup in .gitignore (Refael Ackermann) [#23180](https://github.com/nodejs/node/pull/23180)
+* [[`49b0ec4fe7`](https://github.com/nodejs/node/commit/49b0ec4fe7)] - **build**: add loader path to rpath for cctest (Sam Ruby) [#23168](https://github.com/nodejs/node/pull/23168)
+* [[`7d21cc2177`](https://github.com/nodejs/node/commit/7d21cc2177)] - **build**: reduce chance of unneeded rebuild (Refael Ackermann) [#23156](https://github.com/nodejs/node/pull/23156)
+* [[`aae0eceea0`](https://github.com/nodejs/node/commit/aae0eceea0)] - **build**: encapsulate node/inspector gyp scafolding (Refael Ackermann) [#23156](https://github.com/nodejs/node/pull/23156)
+* [[`180099a5ac`](https://github.com/nodejs/node/commit/180099a5ac)] - **build**: enabling pgo at configure (Octavian Soldea) [#21596](https://github.com/nodejs/node/pull/21596)
+* [[`f4cffffc96`](https://github.com/nodejs/node/commit/f4cffffc96)] - **build**: add --quiet to lint-cpp (Daniel Bevenius) [#23075](https://github.com/nodejs/node/pull/23075)
+* [[`d572f6001a`](https://github.com/nodejs/node/commit/d572f6001a)] - **build**: remove unnecessary Makefile output (Rich Trott) [#23129](https://github.com/nodejs/node/pull/23129)
+* [[`fb03faa835`](https://github.com/nodejs/node/commit/fb03faa835)] - **build**: move addons message in Makefile (Rich Trott) [#23114](https://github.com/nodejs/node/pull/23114)
+* [[`948dc71664`](https://github.com/nodejs/node/commit/948dc71664)] - **build**: make config verbose on CI (Refael Ackermann) [#22935](https://github.com/nodejs/node/pull/22935)
+* [[`b69ed9c80c`](https://github.com/nodejs/node/commit/b69ed9c80c)] - **build**: stop printing execution of lint-md command (Ruben Bridgewater) [#22904](https://github.com/nodejs/node/pull/22904)
+* [[`2b8f569388`](https://github.com/nodejs/node/commit/2b8f569388)] - **build,deps**: refactor and fix v8.gyp (Refael Ackermann) [#23182](https://github.com/nodejs/node/pull/23182)
+* [[`4db9e36b57`](https://github.com/nodejs/node/commit/4db9e36b57)] - **build,doc**: remove outdated `lint-md-build` (Michaël Zasso) [#22991](https://github.com/nodejs/node/pull/22991)
+* [[`c29e5ac5be`](https://github.com/nodejs/node/commit/c29e5ac5be)] - **(SEMVER-MINOR)** **cli**: normalize `\_` → `-` when parsing options (Anna Henningsen) [#23020](https://github.com/nodejs/node/pull/23020)
+* [[`54ca0e159f`](https://github.com/nodejs/node/commit/54ca0e159f)] - **cluster**: move handle tracking out of utils (cjihrig) [#23131](https://github.com/nodejs/node/pull/23131)
+* [[`cb0d8239b7`](https://github.com/nodejs/node/commit/cb0d8239b7)] - **cluster**: use Map to track handles in master (cjihrig) [#23125](https://github.com/nodejs/node/pull/23125)
+* [[`0f133eb5a3`](https://github.com/nodejs/node/commit/0f133eb5a3)] - **cluster**: use Map to track handles in cluster child (cjihrig) [#23125](https://github.com/nodejs/node/pull/23125)
+* [[`2dd157fbf3`](https://github.com/nodejs/node/commit/2dd157fbf3)] - **cluster**: use Map to track indexes (cjihrig) [#23125](https://github.com/nodejs/node/pull/23125)
+* [[`64f840a767`](https://github.com/nodejs/node/commit/64f840a767)] - **cluster**: use Map to track round robin workers (cjihrig) [#23125](https://github.com/nodejs/node/pull/23125)
+* [[`22f51a6a83`](https://github.com/nodejs/node/commit/22f51a6a83)] - **cluster**: use Map to track callbacks (cjihrig) [#23125](https://github.com/nodejs/node/pull/23125)
+* [[`26c36efa2f`](https://github.com/nodejs/node/commit/26c36efa2f)] - **crypto**: remove node::crypto::CheckResult (Tobias Nießen) [#23225](https://github.com/nodejs/node/pull/23225)
+* [[`5f450f3f92`](https://github.com/nodejs/node/commit/5f450f3f92)] - **crypto**: replace goto SSL\_CTX\_use\_certificate\_chain (Daniel Bevenius) [#23113](https://github.com/nodejs/node/pull/23113)
+* [[`db8d99dbc2`](https://github.com/nodejs/node/commit/db8d99dbc2)] - **crypto**: add virtual dtor to KeyPairGenerationConfig (Daniel Bevenius) [#23215](https://github.com/nodejs/node/pull/23215)
+* [[`f98d441461`](https://github.com/nodejs/node/commit/f98d441461)] - **crypto**: extract throwInvalidArgType function (Daniel Bevenius) [#22947](https://github.com/nodejs/node/pull/22947)
+* [[`1a21cf13cb`](https://github.com/nodejs/node/commit/1a21cf13cb)] - **crypto**: make PEM parsing RFC7468-compliant (Tobias Nießen) [#23164](https://github.com/nodejs/node/pull/23164)
+* [[`9c96573124`](https://github.com/nodejs/node/commit/9c96573124)] - **(SEMVER-MINOR)** **crypto**: add support for PEM-level encryption (Tobias Nießen) [#23151](https://github.com/nodejs/node/pull/23151)
+* [[`398c0e03e4`](https://github.com/nodejs/node/commit/398c0e03e4)] - **crypto**: replace gotos (Tobias Nießen) [#23132](https://github.com/nodejs/node/pull/23132)
+* [[`a51d839a31`](https://github.com/nodejs/node/commit/a51d839a31)] - **crypto**: remove unnecessary calls to TLS\_method() (Daniel Bevenius) [#23077](https://github.com/nodejs/node/pull/23077)
+* [[`074b7af7ef`](https://github.com/nodejs/node/commit/074b7af7ef)] - **crypto**: enable auto cert chaining for BoringSSL (Jeremy Apthorp) [#22110](https://github.com/nodejs/node/pull/22110)
+* [[`2888f809e3`](https://github.com/nodejs/node/commit/2888f809e3)] - **crypto**: deduplicate cipher initialization code (Tobias Nießen) [#23011](https://github.com/nodejs/node/pull/23011)
+* [[`0bc4529a07`](https://github.com/nodejs/node/commit/0bc4529a07)] - **crypto**: remove unnecessary usage of goto (Tobias Nießen) [#23018](https://github.com/nodejs/node/pull/23018)
+* [[`cc8219433c`](https://github.com/nodejs/node/commit/cc8219433c)] - **(SEMVER-MINOR)** **crypto**: allow promisifying generateKeyPair (Tobias Nießen) [#22660](https://github.com/nodejs/node/pull/22660)
+* [[`421909394c`](https://github.com/nodejs/node/commit/421909394c)] - **(SEMVER-MINOR)** **crypto**: add API for key pair generation (Tobias Nießen) [#22660](https://github.com/nodejs/node/pull/22660)
+* [[`76cb52ca11`](https://github.com/nodejs/node/commit/76cb52ca11)] - **deps**: upgrade to libuv 1.23.2 (cjihrig) [#23336](https://github.com/nodejs/node/pull/23336)
+* [[`95bdf37265`](https://github.com/nodejs/node/commit/95bdf37265)] - **(SEMVER-MINOR)** **deps**: update nghttp2 to 1.34.0 (James M Snell) [#23284](https://github.com/nodejs/node/pull/23284)
+* [[`46c7d0d21f`](https://github.com/nodejs/node/commit/46c7d0d21f)] - **(SEMVER-MINOR)** **deps**: increase V8 deprecation levels (Anna Henningsen) [#23159](https://github.com/nodejs/node/pull/23159)
+* [[`e3550f2366`](https://github.com/nodejs/node/commit/e3550f2366)] - **deps**: backport 958b761 from upstream V8 (Matheus Marchini) [#22914](https://github.com/nodejs/node/pull/22914)
+* [[`f08373f18d`](https://github.com/nodejs/node/commit/f08373f18d)] - **deps**: cherry-pick 64-bit hash seed commits from V8 (Yang Guo) [#23260](https://github.com/nodejs/node/pull/23260)
+* [[`e93c94c327`](https://github.com/nodejs/node/commit/e93c94c327)] - **deps**: add no-strict-aliasing to ICU cflags (Daniel Bevenius) [#23112](https://github.com/nodejs/node/pull/23112)
+* [[`5d70652d86`](https://github.com/nodejs/node/commit/5d70652d86)] - **deps**: fix Array.prototype.forEach on v8 6.8 (Mike Stanton) [#22899](https://github.com/nodejs/node/pull/22899)
+* [[`e668815a24`](https://github.com/nodejs/node/commit/e668815a24)] - **deps**: cherry-pick dbfcc48 from upstream V8 (Alexey Kozyatinskiy) [#22251](https://github.com/nodejs/node/pull/22251)
+* [[`e5efdba75c`](https://github.com/nodejs/node/commit/e5efdba75c)] - **deps**: upgrade to libuv 1.23.1 (cjihrig) [#22997](https://github.com/nodejs/node/pull/22997)
+* [[`39d7699a87`](https://github.com/nodejs/node/commit/39d7699a87)] - **deps**: cherry-pick d48bd16 from upstream V8 (Junliang Yan) [#22909](https://github.com/nodejs/node/pull/22909)
+* [[`62a2c81214`](https://github.com/nodejs/node/commit/62a2c81214)] - **doc**: simplify and clarify README language (Rich Trott) [#23322](https://github.com/nodejs/node/pull/23322)
+* [[`7c0d6ac0bd`](https://github.com/nodejs/node/commit/7c0d6ac0bd)] - **doc**: simplify governance info in README intro (Rich Trott) [#23320](https://github.com/nodejs/node/pull/23320)
+* [[`5ff43006d1`](https://github.com/nodejs/node/commit/5ff43006d1)] - **doc**: add link to ABI guide (Gabriel Schulhof)
+* [[`9dd47bcf99`](https://github.com/nodejs/node/commit/9dd47bcf99)] - **doc**: fix minor typo in streams.md (Rich Trott) [#23306](https://github.com/nodejs/node/pull/23306)
+* [[`a0e8e7fea6`](https://github.com/nodejs/node/commit/a0e8e7fea6)] - **doc**: standardize versions in stream module doc (Rich Trott) [#23306](https://github.com/nodejs/node/pull/23306)
+* [[`eee71d6d16`](https://github.com/nodejs/node/commit/eee71d6d16)] - **doc**: add util.inspect() legacy signature (siddhant) [#23216](https://github.com/nodejs/node/pull/23216)
+* [[`fbbb25b901`](https://github.com/nodejs/node/commit/fbbb25b901)] - **doc**: edit building-node text (Rich Trott) [#23335](https://github.com/nodejs/node/pull/23335)
+* [[`037063c6ee`](https://github.com/nodejs/node/commit/037063c6ee)] - **doc**: remove 72-hour mentions in pull-requests.md (Rich Trott) [#23309](https://github.com/nodejs/node/pull/23309)
+* [[`4c54f897f8`](https://github.com/nodejs/node/commit/4c54f897f8)] - **doc**: fix minor typo in n-api.md (Aleksey Chemakin) [#23310](https://github.com/nodejs/node/pull/23310)
+* [[`f1cb8ab4bf`](https://github.com/nodejs/node/commit/f1cb8ab4bf)] - **doc**: remove ABI guide (Gabriel Schulhof) [#23303](https://github.com/nodejs/node/pull/23303)
+* [[`39e3ef7739`](https://github.com/nodejs/node/commit/39e3ef7739)] - **doc**: Replace vague 'may not' with definitive 'will not' (Mike MacCana) [#23143](https://github.com/nodejs/node/pull/23143)
+* [[`11c674549b`](https://github.com/nodejs/node/commit/11c674549b)] - **doc**: update author-ready label terms (Vse Mozhet Byt) [#23249](https://github.com/nodejs/node/pull/23249)
+* [[`33e3eb44f7`](https://github.com/nodejs/node/commit/33e3eb44f7)] - **doc**: update onboarding task (Rich Trott) [#23300](https://github.com/nodejs/node/pull/23300)
+* [[`df4ade7dc7`](https://github.com/nodejs/node/commit/df4ade7dc7)] - **doc**: use backticks around file names in README.md (Rich Trott) [#23299](https://github.com/nodejs/node/pull/23299)
+* [[`80964d36b7`](https://github.com/nodejs/node/commit/80964d36b7)] - **doc**: improve API Documentation text in README (Rich Trott) [#23268](https://github.com/nodejs/node/pull/23268)
+* [[`ef0f7e613a`](https://github.com/nodejs/node/commit/ef0f7e613a)] - **doc**: shorten pull request wait time to 48 hours (Rich Trott) [#23082](https://github.com/nodejs/node/pull/23082)
+* [[`5b76313059`](https://github.com/nodejs/node/commit/5b76313059)] - **doc**: improve instructions for verifying binaries (Rich Trott) [#23248](https://github.com/nodejs/node/pull/23248)
+* [[`6943fa9fc7`](https://github.com/nodejs/node/commit/6943fa9fc7)] - **doc**: shorten intro of README.md (Rich Trott) [#23073](https://github.com/nodejs/node/pull/23073)
+* [[`e5bfab0fb6`](https://github.com/nodejs/node/commit/e5bfab0fb6)] - **doc**: add guide about abi stability (Gabriel Schulhof) [#23229](https://github.com/nodejs/node/pull/23229)
+* [[`e283206047`](https://github.com/nodejs/node/commit/e283206047)] - **doc**: improve `stream.Writable` ctor encoding option docs (Anna Henningsen) [#23246](https://github.com/nodejs/node/pull/23246)
+* [[`bd59d4efbf`](https://github.com/nodejs/node/commit/bd59d4efbf)] - **doc**: fix code snippets in tls.md (Ouyang Yadong) [#23239](https://github.com/nodejs/node/pull/23239)
+* [[`27c5e96ffe`](https://github.com/nodejs/node/commit/27c5e96ffe)] - **doc**: leave pull requests open for 72 hours (Rich Trott) [#22275](https://github.com/nodejs/node/pull/22275)
+* [[`5836b9fcc8`](https://github.com/nodejs/node/commit/5836b9fcc8)] - **doc**: specify cluster worker.kill() caveat (cjihrig) [#23165](https://github.com/nodejs/node/pull/23165)
+* [[`ed01b38295`](https://github.com/nodejs/node/commit/ed01b38295)] - **doc**: use stronger language about security of vm (Gus Caplan) [#23198](https://github.com/nodejs/node/pull/23198)
+* [[`eb8721977f`](https://github.com/nodejs/node/commit/eb8721977f)] - **doc**: improve Download section of README (Rich Trott) [#23212](https://github.com/nodejs/node/pull/23212)
+* [[`003d85d2d9`](https://github.com/nodejs/node/commit/003d85d2d9)] - **doc**: remove GA tracking (Ben Noordhuis) [#23083](https://github.com/nodejs/node/pull/23083)
+* [[`6912376562`](https://github.com/nodejs/node/commit/6912376562)] - **doc**: move gibfahn to TSC Emeritus (Gibson Fahnestock) [#23238](https://github.com/nodejs/node/pull/23238)
+* [[`1553e21007`](https://github.com/nodejs/node/commit/1553e21007)] - **doc**: clarify assigning issues to the TSC (Franziska Hinkelmann) [#22759](https://github.com/nodejs/node/pull/22759)
+* [[`71901d6b30`](https://github.com/nodejs/node/commit/71901d6b30)] - **doc**: improve Release Types text in README (Rich Trott) [#23190](https://github.com/nodejs/node/pull/23190)
+* [[`8191bee313`](https://github.com/nodejs/node/commit/8191bee313)] - **doc**: simplify support section of README (Rich Trott) [#23170](https://github.com/nodejs/node/pull/23170)
+* [[`548934d412`](https://github.com/nodejs/node/commit/548934d412)] - **doc**: fix incorrect anchoring (#vcbuild.bat -\> #vcbuildbat) (Justin Lee) [#23211](https://github.com/nodejs/node/pull/23211)
+* [[`ce006eb68d`](https://github.com/nodejs/node/commit/ce006eb68d)] - **doc**: fix minor typo (to early -\> too early) (Justin Lee) [#23211](https://github.com/nodejs/node/pull/23211)
+* [[`21490c2a87`](https://github.com/nodejs/node/commit/21490c2a87)] - **doc**: remove recommendation to use node-eps (Richard Lau) [#23148](https://github.com/nodejs/node/pull/23148)
+* [[`e71a72fbf2`](https://github.com/nodejs/node/commit/e71a72fbf2)] - **doc**: add contents table to CONTRIBUTING.md (ZYSzys) [#23140](https://github.com/nodejs/node/pull/23140)
+* [[`818db4036b`](https://github.com/nodejs/node/commit/818db4036b)] - **doc**: move perf tools and APIs to Tier 3 (Matheus Marchini) [#22915](https://github.com/nodejs/node/pull/22915)
+* [[`e791abe5ef`](https://github.com/nodejs/node/commit/e791abe5ef)] - **doc**: formalize `auto` usage in C++ style guide (Anna Henningsen) [#23028](https://github.com/nodejs/node/pull/23028)
+* [[`310109691b`](https://github.com/nodejs/node/commit/310109691b)] - **doc**: fix casing in stream.md (Sintendo) [#23166](https://github.com/nodejs/node/pull/23166)
+* [[`bb5c6892ee`](https://github.com/nodejs/node/commit/bb5c6892ee)] - **doc**: add table of contents in BUILDING.md (ZYSzys) [#23147](https://github.com/nodejs/node/pull/23147)
+* [[`cbcf5f88cd`](https://github.com/nodejs/node/commit/cbcf5f88cd)] - **doc**: deeper link to downloads site (Refael Ackermann) [#23084](https://github.com/nodejs/node/pull/23084)
+* [[`9109187948`](https://github.com/nodejs/node/commit/9109187948)] - **doc**: update guide for assert team (Rich Trott) [#23085](https://github.com/nodejs/node/pull/23085)
+* [[`2731d08c33`](https://github.com/nodejs/node/commit/2731d08c33)] - **doc**: add links for fs.createWriteStream() (Rich Trott) [#23104](https://github.com/nodejs/node/pull/23104)
+* [[`9fa3813845`](https://github.com/nodejs/node/commit/9fa3813845)] - **doc**: edit fast-tracking section (cjihrig) [#23059](https://github.com/nodejs/node/pull/23059)
+* [[`14327aea7b`](https://github.com/nodejs/node/commit/14327aea7b)] - **doc**: improve instruction to purple merge (Refael Ackermann) [#23007](https://github.com/nodejs/node/pull/23007)
+* [[`87565c763a`](https://github.com/nodejs/node/commit/87565c763a)] - **doc**: require two approvals to land changes (Rich Trott) [#22255](https://github.com/nodejs/node/pull/22255)
+* [[`e7be1edc49`](https://github.com/nodejs/node/commit/e7be1edc49)] - **doc**: fix optional parameters in n-api.md (Lars-Magnus Skog) [#22998](https://github.com/nodejs/node/pull/22998)
+* [[`24073cef6b`](https://github.com/nodejs/node/commit/24073cef6b)] - **doc**: add callback parameters of worker.terminate() (Denis Fäcke) [#23002](https://github.com/nodejs/node/pull/23002)
+* [[`6b2e2ff036`](https://github.com/nodejs/node/commit/6b2e2ff036)] - **doc**: improve metadata for http.request (Tobias Nießen) [#22949](https://github.com/nodejs/node/pull/22949)
+* [[`91b410259e`](https://github.com/nodejs/node/commit/91b410259e)] - **doc**: add missing metadata for recursive mkdir (Tobias Nießen) [#22949](https://github.com/nodejs/node/pull/22949)
+* [[`15c7c57a78`](https://github.com/nodejs/node/commit/15c7c57a78)] - **doc**: add missing metadata for dns.lookup (Tobias Nießen) [#22949](https://github.com/nodejs/node/pull/22949)
+* [[`05196893b9`](https://github.com/nodejs/node/commit/05196893b9)] - **doc**: fix heading levels in C++ style guide (Anna Henningsen) [#23061](https://github.com/nodejs/node/pull/23061)
+* [[`29a9e8498a`](https://github.com/nodejs/node/commit/29a9e8498a)] - **doc**: remove outdated notes on stdio in workers (Anna Henningsen) [#23054](https://github.com/nodejs/node/pull/23054)
+* [[`d3bc862d88`](https://github.com/nodejs/node/commit/d3bc862d88)] - **doc**: match program and console output in synopsis.md (Mohammed Essehemy) [#23006](https://github.com/nodejs/node/pull/23006)
+* [[`15b91b9eb8`](https://github.com/nodejs/node/commit/15b91b9eb8)] - **doc**: add links for repl.ReplServer (Rich Trott) [#23005](https://github.com/nodejs/node/pull/23005)
+* [[`b0e86ea8d0`](https://github.com/nodejs/node/commit/b0e86ea8d0)] - **doc**: update maintaining V8 guide (Michaël Zasso) [#22913](https://github.com/nodejs/node/pull/22913)
+* [[`00dd9738ee`](https://github.com/nodejs/node/commit/00dd9738ee)] - **doc**: specify fast-tracking (Ruben Bridgewater) [#22929](https://github.com/nodejs/node/pull/22929)
+* [[`ef5d90dfdc`](https://github.com/nodejs/node/commit/ef5d90dfdc)] - **doc**: add digitalinfinity to collaborators (Hitesh Kanwathirtha) [#22984](https://github.com/nodejs/node/pull/22984)
+* [[`b48dc0b667`](https://github.com/nodejs/node/commit/b48dc0b667)] - **doc,test**: fix inspect's sorted compare function (Michaël Zasso) [#22992](https://github.com/nodejs/node/pull/22992)
+* [[`d9d9d23191`](https://github.com/nodejs/node/commit/d9d9d23191)] - **errors**: fix ERR\_SOCKET\_BAD\_PORT message (Giovanny Andres Gongora Granada (Gioyik)) [#23015](https://github.com/nodejs/node/pull/23015)
+* [[`bb6530b31b`](https://github.com/nodejs/node/commit/bb6530b31b)] - **fs**: consistently return symlink type from readdir (Klaus Meinhardt) [#22808](https://github.com/nodejs/node/pull/22808)
+* [[`7e45daf494`](https://github.com/nodejs/node/commit/7e45daf494)] - **(SEMVER-MINOR)** **fs**: implement mkdir recursive (mkdirp) (Benjamin Coe) [#21875](https://github.com/nodejs/node/pull/21875)
+* [[`c29734c9d6`](https://github.com/nodejs/node/commit/c29734c9d6)] - **fs**: improve fs.watch ENOSPC error message (Anna Henningsen) [#21846](https://github.com/nodejs/node/pull/21846)
+* [[`7b327ea909`](https://github.com/nodejs/node/commit/7b327ea909)] - **(SEMVER-MINOR)** **http2**: add RFC 8441 extended connect protocol support (James M Snell) [#23284](https://github.com/nodejs/node/pull/23284)
+* [[`001881f33e`](https://github.com/nodejs/node/commit/001881f33e)] - **http2**: set nghttp2\_option\_set\_no\_closed\_streams (David Halls) [#23134](https://github.com/nodejs/node/pull/23134)
+* [[`8fe62f8d38`](https://github.com/nodejs/node/commit/8fe62f8d38)] - **http2**: don't send trailers on a closed connection (André Cruz) [#23146](https://github.com/nodejs/node/pull/23146)
+* [[`d1826fed41`](https://github.com/nodejs/node/commit/d1826fed41)] - **http2**: close fd in doSendFileFD() (cjihrig) [#23047](https://github.com/nodejs/node/pull/23047)
+* [[`8bf004b96d`](https://github.com/nodejs/node/commit/8bf004b96d)] - **(SEMVER-MINOR)** **http2**: add ping event (James M Snell) [#23009](https://github.com/nodejs/node/pull/23009)
+* [[`badc38f305`](https://github.com/nodejs/node/commit/badc38f305)] - **http2**: do not falsely emit 'aborted' on push (Anatoli Papirovski) [#22878](https://github.com/nodejs/node/pull/22878)
+* [[`24675a4306`](https://github.com/nodejs/node/commit/24675a4306)] - **(SEMVER-MINOR)** **http2**: add origin frame support (James M Snell) [#22956](https://github.com/nodejs/node/pull/22956)
+* [[`89fe9edd08`](https://github.com/nodejs/node/commit/89fe9edd08)] - **http2**: check if stream is not destroyed before sending trailers (Matteo Collina) [#22896](https://github.com/nodejs/node/pull/22896)
+* [[`aa48192f9d`](https://github.com/nodejs/node/commit/aa48192f9d)] - **inspector**: add virtual destructor to WorkerDelegate (Daniel Bevenius) [#23215](https://github.com/nodejs/node/pull/23215)
+* [[`16f7f52b24`](https://github.com/nodejs/node/commit/16f7f52b24)] - **inspector**: workers debugging (Eugene Ostroukhov) [#21364](https://github.com/nodejs/node/pull/21364)
+* [[`f66e9abcb3`](https://github.com/nodejs/node/commit/f66e9abcb3)] - **inspector**: implemented V8InspectorClient::resourceNameToUrl (Alexey Kozyatinskiy) [#22251](https://github.com/nodejs/node/pull/22251)
+* [[`1c3a2ebfcf`](https://github.com/nodejs/node/commit/1c3a2ebfcf)] - **inspector**: enable Inspector JS API in workers (Eugene Ostroukhov) [#22769](https://github.com/nodejs/node/pull/22769)
+* [[`c40e2dd6c9`](https://github.com/nodejs/node/commit/c40e2dd6c9)] - **lib**: reword help text for clarity (Gireesh Punathil) [#23016](https://github.com/nodejs/node/pull/23016)
+* [[`f38eff29e7`](https://github.com/nodejs/node/commit/f38eff29e7)] - **lib**: change abstract equal to strict equal (ZYSzys) [#22974](https://github.com/nodejs/node/pull/22974)
+* [[`0140a98e05`](https://github.com/nodejs/node/commit/0140a98e05)] - **lib**: make DOMException attributes configurable and enumerable (Joyee Cheung) [#22550](https://github.com/nodejs/node/pull/22550)
+* [[`5e7b1082d9`](https://github.com/nodejs/node/commit/5e7b1082d9)] - **lib**: set Symbol.toStringTag of DOMException (Joyee Cheung) [#22933](https://github.com/nodejs/node/pull/22933)
+* [[`a7f4d5e134`](https://github.com/nodejs/node/commit/a7f4d5e134)] - **lib**: refactor variable declarations (ZYSzys) [#22643](https://github.com/nodejs/node/pull/22643)
+* [[`fb68ef2e74`](https://github.com/nodejs/node/commit/fb68ef2e74)] - **lib**: added common.restoreStderr(); to end of file (Mark Abel) [#22487](https://github.com/nodejs/node/pull/22487)
+* [[`600c225439`](https://github.com/nodejs/node/commit/600c225439)] - **(SEMVER-MINOR)** **module**: add createRequireFunction method (Gus Caplan) [#19360](https://github.com/nodejs/node/pull/19360)
+* [[`a65bb42551`](https://github.com/nodejs/node/commit/a65bb42551)] - **net**: use connect() instead of connect.call() (Jackson Tian) [#23289](https://github.com/nodejs/node/pull/23289)
+* [[`5a306748e9`](https://github.com/nodejs/node/commit/5a306748e9)] - **process**: allow reading from stdout/stderr sockets (Anna Henningsen) [#23053](https://github.com/nodejs/node/pull/23053)
+* [[`66484b82c4`](https://github.com/nodejs/node/commit/66484b82c4)] - **(SEMVER-MINOR)** **process**: add `multipleResolves` event (Ruben Bridgewater) [#22218](https://github.com/nodejs/node/pull/22218)
+* [[`e16dd6d165`](https://github.com/nodejs/node/commit/e16dd6d165)] - **repl**: refactor ERR\_SCRIPT\_EXECUTION\_INTERRUPTED stack handling (Ruben Bridgewater) [#22436](https://github.com/nodejs/node/pull/22436)
+* [[`b1ffda6c17`](https://github.com/nodejs/node/commit/b1ffda6c17)] - **repl**: improve error output (Ruben Bridgewater) [#22436](https://github.com/nodejs/node/pull/22436)
+* [[`cd69e1b6c3`](https://github.com/nodejs/node/commit/cd69e1b6c3)] - **src**: fix ToObject() usage in node\_http\_parser.cc (cjihrig) [#23314](https://github.com/nodejs/node/pull/23314)
+* [[`5228ec4410`](https://github.com/nodejs/node/commit/5228ec4410)] - **src**: fix ToObject() usage in exceptions.cc (cjihrig) [#23314](https://github.com/nodejs/node/pull/23314)
+* [[`4d761d4224`](https://github.com/nodejs/node/commit/4d761d4224)] - **src**: reduce variable scope in stream\_base.cc (cjihrig) [#23297](https://github.com/nodejs/node/pull/23297)
+* [[`740741b279`](https://github.com/nodejs/node/commit/740741b279)] - **src**: reduce variable scope in node\_worker.cc (cjihrig) [#23297](https://github.com/nodejs/node/pull/23297)
+* [[`56c2f5702f`](https://github.com/nodejs/node/commit/56c2f5702f)] - **src**: reduce variable scope in node\_trace\_writer.cc (cjihrig) [#23297](https://github.com/nodejs/node/pull/23297)
+* [[`046fd987e4`](https://github.com/nodejs/node/commit/046fd987e4)] - **src**: reduce variable scope in node\_url.cc (cjihrig) [#23297](https://github.com/nodejs/node/pull/23297)
+* [[`36c430796b`](https://github.com/nodejs/node/commit/36c430796b)] - **src**: remove unneeded variables in node\_crypto.cc (cjihrig) [#23297](https://github.com/nodejs/node/pull/23297)
+* [[`902ba0ecb4`](https://github.com/nodejs/node/commit/902ba0ecb4)] - **src**: reduce variable scope in module\_wrap.cc (cjihrig) [#23297](https://github.com/nodejs/node/pull/23297)
+* [[`402867c0a9`](https://github.com/nodejs/node/commit/402867c0a9)] - **src**: reduce variable scope in cares\_wrap.cc (cjihrig) [#23297](https://github.com/nodejs/node/pull/23297)
+* [[`315bf257e5`](https://github.com/nodejs/node/commit/315bf257e5)] - **src**: fix ToObject() usage in node\_crypto.cc (cjihrig) [#23298](https://github.com/nodejs/node/pull/23298)
+* [[`950ccee386`](https://github.com/nodejs/node/commit/950ccee386)] - **src**: name EmbededderGraph edges and use class names for nodes (Joyee Cheung) [#23072](https://github.com/nodejs/node/pull/23072)
+* [[`390fc85ff0`](https://github.com/nodejs/node/commit/390fc85ff0)] - **src**: implement the new EmbedderGraph::AddEdge() (Joyee Cheung) [#22106](https://github.com/nodejs/node/pull/22106)
+* [[`5a8396796d`](https://github.com/nodejs/node/commit/5a8396796d)] - **src**: use JS inheritance for `AsyncWrap` (Anna Henningsen) [#23094](https://github.com/nodejs/node/pull/23094)
+* [[`894210ec12`](https://github.com/nodejs/node/commit/894210ec12)] - **src**: add virtual desctructor to Options class (Daniel Bevenius) [#23215](https://github.com/nodejs/node/pull/23215)
+* [[`8f5fb6f90c`](https://github.com/nodejs/node/commit/8f5fb6f90c)] - **src**: clean up zlib write code (Anna Henningsen) [#23183](https://github.com/nodejs/node/pull/23183)
+* [[`2da6f622dc`](https://github.com/nodejs/node/commit/2da6f622dc)] - **(SEMVER-MINOR)** **src**: deprecate `UVException()` without `Isolate\*` (Anna Henningsen) [#23175](https://github.com/nodejs/node/pull/23175)
+* [[`e9a0cffbd6`](https://github.com/nodejs/node/commit/e9a0cffbd6)] - **(SEMVER-MINOR)** **src**: deprecate V8 date conversion helpers (Anna Henningsen) [#23179](https://github.com/nodejs/node/pull/23179)
+* [[`a2c1ce24b5`](https://github.com/nodejs/node/commit/a2c1ce24b5)] - **src**: fix indentation for `AsyncResource` (Anna Henningsen) [#23177](https://github.com/nodejs/node/pull/23177)
+* [[`64689edf76`](https://github.com/nodejs/node/commit/64689edf76)] - **src**: remove unused using declarations (Daniel Bevenius) [#23120](https://github.com/nodejs/node/pull/23120)
+* [[`0202c6c808`](https://github.com/nodejs/node/commit/0202c6c808)] - **src**: remove unused locale.h (Daniel Bevenius) [#23120](https://github.com/nodejs/node/pull/23120)
+* [[`20a4f14c57`](https://github.com/nodejs/node/commit/20a4f14c57)] - **src**: make req\_wrap a unique\_ptr in AfterConnect (Daniel Bevenius) [#23115](https://github.com/nodejs/node/pull/23115)
+* [[`ce7fad5b79`](https://github.com/nodejs/node/commit/ce7fad5b79)] - **src**: use unique\_ptr for obj in SetWeak lambda (Daniel Bevenius) [#23117](https://github.com/nodejs/node/pull/23117)
+* [[`7d7dc16240`](https://github.com/nodejs/node/commit/7d7dc16240)] - **src**: unique\_ptrs in few lambdas (Gireesh Punathil) [#23124](https://github.com/nodejs/node/pull/23124)
+* [[`4bd3b6e332`](https://github.com/nodejs/node/commit/4bd3b6e332)] - **src**: refactor crypto code with RAII cleanup (Gireesh Punathil) [#23014](https://github.com/nodejs/node/pull/23014)
+* [[`f3d09b6e4f`](https://github.com/nodejs/node/commit/f3d09b6e4f)] - **src**: simplify `MessagePort` construction code a bit (Anna Henningsen) [#23036](https://github.com/nodejs/node/pull/23036)
+* [[`4d61c34b9e`](https://github.com/nodejs/node/commit/4d61c34b9e)] - **src**: fix a typo in the comment (Gireesh Punathil) [#23078](https://github.com/nodejs/node/pull/23078)
+* [[`fa833828b2`](https://github.com/nodejs/node/commit/fa833828b2)] - **src**: added URL::FromFilePath method (Alexey Kozyatinskiy) [#22251](https://github.com/nodejs/node/pull/22251)
+* [[`109aa63910`](https://github.com/nodejs/node/commit/109aa63910)] - **src**: cache and resue isolate and contex pointers (Gireesh Punathil) [#23024](https://github.com/nodejs/node/pull/23024)
+* [[`2f659a3d74`](https://github.com/nodejs/node/commit/2f659a3d74)] - **src**: use RAII cleanup in node\_i18n.cc (Anna Henningsen) [#23021](https://github.com/nodejs/node/pull/23021)
+* [[`90f1200be9`](https://github.com/nodejs/node/commit/90f1200be9)] - **src**: define zlib constants in node\_zlib.cc (Anna Henningsen) [#23019](https://github.com/nodejs/node/pull/23019)
+* [[`d72867ec0c`](https://github.com/nodejs/node/commit/d72867ec0c)] - **src**: make `ZCtx::Init()` non-static (Anna Henningsen) [#23019](https://github.com/nodejs/node/pull/23019)
+* [[`56b1a3cf6e`](https://github.com/nodejs/node/commit/56b1a3cf6e)] - **src**: refactor zlib dictionary to STL vector (Anna Henningsen) [#23019](https://github.com/nodejs/node/pull/23019)
+* [[`76453f1878`](https://github.com/nodejs/node/commit/76453f1878)] - **src**: replace deprecated uses of FunctionTemplate::GetFunction (Andreas Haas) [#22993](https://github.com/nodejs/node/pull/22993)
+* [[`cb3062aa42`](https://github.com/nodejs/node/commit/cb3062aa42)] - **src**: remove calls to SetWrapperClassId() (Joyee Cheung) [#22975](https://github.com/nodejs/node/pull/22975)
+* [[`ab032e4ff4`](https://github.com/nodejs/node/commit/ab032e4ff4)] - **src**: refactor win32 `DebugProcess()` to use RAII cleanup (Anna Henningsen) [#22981](https://github.com/nodejs/node/pull/22981)
+* [[`b6cd18517c`](https://github.com/nodejs/node/commit/b6cd18517c)] - **src**: add CheckOptions to Options classes (Daniel Bevenius) [#22943](https://github.com/nodejs/node/pull/22943)
+* [[`ace6e07f0e`](https://github.com/nodejs/node/commit/ace6e07f0e)] - **src**: initialize pid variable before goto (Jeremy Apthorp) [#22961](https://github.com/nodejs/node/pull/22961)
+* [[`25bf1f5e28`](https://github.com/nodejs/node/commit/25bf1f5e28)] - **stream**: improve buffer list inspection (Ruben Bridgewater) [#23109](https://github.com/nodejs/node/pull/23109)
+* [[`2b77b94c05`](https://github.com/nodejs/node/commit/2b77b94c05)] - **streams**: refactor ReadableStream asyncIterator creation and a few fixes (Gus Caplan) [#23042](https://github.com/nodejs/node/pull/23042)
+* [[`df54db667c`](https://github.com/nodejs/node/commit/df54db667c)] - **test**: remove internal errorCache property (Rich Trott) [#23304](https://github.com/nodejs/node/pull/23304)
+* [[`70abcf2d10`](https://github.com/nodejs/node/commit/70abcf2d10)] - **test**: remove eslint-disable from fixtures (Rich Trott) [#23345](https://github.com/nodejs/node/pull/23345)
+* [[`b2d3445644`](https://github.com/nodejs/node/commit/b2d3445644)] - **test**: read() on dir on AIX does not return EISDIR (Ben Noordhuis) [#23330](https://github.com/nodejs/node/pull/23330)
+* [[`b523f13fa2`](https://github.com/nodejs/node/commit/b523f13fa2)] - **test**: add module require tests for certain package.json errors (Tom White) [#23285](https://github.com/nodejs/node/pull/23285)
+* [[`45e0080cf1`](https://github.com/nodejs/node/commit/45e0080cf1)] - **test**: remove flaky designation for test (Rich Trott) [#22856](https://github.com/nodejs/node/pull/22856)
+* [[`085de6fe18`](https://github.com/nodejs/node/commit/085de6fe18)] - **test**: swap arguments in strictEqual() (Duarte David) [#23204](https://github.com/nodejs/node/pull/23204)
+* [[`a070842e97`](https://github.com/nodejs/node/commit/a070842e97)] - **test**: remove obsolete domain test (Julien Gilli)
+* [[`cb68188805`](https://github.com/nodejs/node/commit/cb68188805)] - **test**: add stdin writable regression test (Anna Henningsen) [#23053](https://github.com/nodejs/node/pull/23053)
+* [[`06b5ef3868`](https://github.com/nodejs/node/commit/06b5ef3868)] - **test**: terminate cluster worker in infinite loop (cjihrig) [#23165](https://github.com/nodejs/node/pull/23165)
+* [[`9352d9d596`](https://github.com/nodejs/node/commit/9352d9d596)] - **test**: harden test-gc-http-client-timeout (Denys Otrishko) [#23184](https://github.com/nodejs/node/pull/23184)
+* [[`748d9d22fa`](https://github.com/nodejs/node/commit/748d9d22fa)] - **test**: add process.stdin.end() TTY regression test (Matteo Collina) [#23051](https://github.com/nodejs/node/pull/23051)
+* [[`44db98a7b6`](https://github.com/nodejs/node/commit/44db98a7b6)] - **test**: add more descriptive err message to assert (Josh Broomfield) [#23118](https://github.com/nodejs/node/pull/23118)
+* [[`b2a1cf3793`](https://github.com/nodejs/node/commit/b2a1cf3793)] - **test**: mark some flakes (Refael Ackermann) [#23208](https://github.com/nodejs/node/pull/23208)
+* [[`9b30a635e0`](https://github.com/nodejs/node/commit/9b30a635e0)] - **test**: improve test-gc-http-client (Rich Trott) [#23145](https://github.com/nodejs/node/pull/23145)
+* [[`23525b0547`](https://github.com/nodejs/node/commit/23525b0547)] - **test**: replace localhost with os.hostname in fs-readfilesync (Denys Otrishko) [#23101](https://github.com/nodejs/node/pull/23101)
+* [[`bebd7b2cdc`](https://github.com/nodejs/node/commit/bebd7b2cdc)] - **test**: fix flaky test-gc-net-timeout (Rich Trott) [#23139](https://github.com/nodejs/node/pull/23139)
+* [[`efeb49d224`](https://github.com/nodejs/node/commit/efeb49d224)] - **test**: increase test coverage for fs.promises read (Jennifer Bland) [#22800](https://github.com/nodejs/node/pull/22800)
+* [[`39c2a3f1c1`](https://github.com/nodejs/node/commit/39c2a3f1c1)] - **test**: improve test-gc-http-client-connaborted (Rich Trott) [#23091](https://github.com/nodejs/node/pull/23091)
+* [[`48c1c428f9`](https://github.com/nodejs/node/commit/48c1c428f9)] - **test**: improve debugging information for http2 test (Rich Trott) [#23058](https://github.com/nodejs/node/pull/23058)
+* [[`f486186e25`](https://github.com/nodejs/node/commit/f486186e25)] - **test**: remove setImmediate from timeout test (Rich Trott) [#23058](https://github.com/nodejs/node/pull/23058)
+* [[`85c4ecb8a5`](https://github.com/nodejs/node/commit/85c4ecb8a5)] - **test**: test undefined in util (ZYSzys) [#22741](https://github.com/nodejs/node/pull/22741)
+* [[`3e4af49157`](https://github.com/nodejs/node/commit/3e4af49157)] - **test**: add dns.onlookupall() to increase coverage (Masashi Hirano) [#22985](https://github.com/nodejs/node/pull/22985)
+* [[`d68dfa9243`](https://github.com/nodejs/node/commit/d68dfa9243)] - **test**: console.table when `null` in data (ZYSzys) [#22974](https://github.com/nodejs/node/pull/22974)
+* [[`4cda83dae2`](https://github.com/nodejs/node/commit/4cda83dae2)] - **test**: improve test-gc-http-client-onerror (Rich Trott) [#23090](https://github.com/nodejs/node/pull/23090)
+* [[`52c6ee789b`](https://github.com/nodejs/node/commit/52c6ee789b)] - **test**: improve test-gc-http-client-timeout (Rich Trott) [#23088](https://github.com/nodejs/node/pull/23088)
+* [[`69d3c08be1`](https://github.com/nodejs/node/commit/69d3c08be1)] - **test**: improve reliability of test-gc-http-client (Rich Trott) [#23087](https://github.com/nodejs/node/pull/23087)
+* [[`a566f0f43e`](https://github.com/nodejs/node/commit/a566f0f43e)] - **test**: improve reliability of test-gc-net-timeout (Rich Trott) [#23086](https://github.com/nodejs/node/pull/23086)
+* [[`c54e42362c`](https://github.com/nodejs/node/commit/c54e42362c)] - **test**: remove unnecessary assertions (Anna Henningsen) [#23040](https://github.com/nodejs/node/pull/23040)
+* [[`adaf530cdb`](https://github.com/nodejs/node/commit/adaf530cdb)] - **test**: check parameter type of fs.mkdir() (Masashi Hirano) [#22616](https://github.com/nodejs/node/pull/22616)
+* [[`a3b3485b34`](https://github.com/nodejs/node/commit/a3b3485b34)] - **test**: add comment describing test-fs-mkdir (Jennifer Bland) [#22424](https://github.com/nodejs/node/pull/22424)
+* [[`5d4bec3e0f`](https://github.com/nodejs/node/commit/5d4bec3e0f)] - **test**: fix flaky sequential/test-fs-watch-system-limit (Anna Henningsen) [#23038](https://github.com/nodejs/node/pull/23038)
+* [[`9de6b26a0c`](https://github.com/nodejs/node/commit/9de6b26a0c)] - **test**: remove string literals for strictEquals/notStrictEquals (MaleDong) [#22891](https://github.com/nodejs/node/pull/22891)
+* [[`43e3cf93e8`](https://github.com/nodejs/node/commit/43e3cf93e8)] - **test**: do not export common.leakedGlobals() (Rich Trott) [#22965](https://github.com/nodejs/node/pull/22965)
+* [[`70ccec2d91`](https://github.com/nodejs/node/commit/70ccec2d91)] - **test**: increase coverage for worker\_threads (Rich Trott) [#22942](https://github.com/nodejs/node/pull/22942)
+* [[`83278b23a7`](https://github.com/nodejs/node/commit/83278b23a7)] - **test**: fix flaky key pair generation test (Tobias Nießen) [#22980](https://github.com/nodejs/node/pull/22980)
+* [[`d38ce82756`](https://github.com/nodejs/node/commit/d38ce82756)] - **test**: remove common.hasSmallICU (Rich Trott) [#22937](https://github.com/nodejs/node/pull/22937)
+* [[`dcce2d67ae`](https://github.com/nodejs/node/commit/dcce2d67ae)] - **test**: add tests to check error in dns.lookupService. (Masashi Hirano) [#22908](https://github.com/nodejs/node/pull/22908)
+* [[`079760f28b`](https://github.com/nodejs/node/commit/079760f28b)] - **test**: mark some tests as flaky (João Reis) [#22941](https://github.com/nodejs/node/pull/22941)
+* [[`4436a3d660`](https://github.com/nodejs/node/commit/4436a3d660)] - **timers**: use custom inspection for linked lists (Ruben Bridgewater) [#23108](https://github.com/nodejs/node/pull/23108)
+* [[`4b976df9e2`](https://github.com/nodejs/node/commit/4b976df9e2)] - **tls**: fix DEP0083 after upgrading to OpenSSL 1.1.0 (Tobias Nießen) [#22953](https://github.com/nodejs/node/pull/22953)
+* [[`acc4a761b7`](https://github.com/nodejs/node/commit/acc4a761b7)] - **tools**: make Travis commit linting more robust (Rich Trott) [#23397](https://github.com/nodejs/node/pull/23397)
+* [[`e2a6e051b3`](https://github.com/nodejs/node/commit/e2a6e051b3)] - **tools**: apply linting to first commit in PRs (Rich Trott) [#22452](https://github.com/nodejs/node/pull/22452)
+* [[`42e67a4e68`](https://github.com/nodejs/node/commit/42e67a4e68)] - **tools**: remove useless assignment from configure.py (Gus Caplan) [#23200](https://github.com/nodejs/node/pull/23200)
+* [[`1010ef5df7`](https://github.com/nodejs/node/commit/1010ef5df7)] - **tools**: fix ICU shrinker and docs (Steven R. Loomis) [#23266](https://github.com/nodejs/node/pull/23266)
+* [[`d7031df415`](https://github.com/nodejs/node/commit/d7031df415)] - **tools**: allow input for TTY tests (Anna Henningsen) [#23053](https://github.com/nodejs/node/pull/23053)
+* [[`1a92335543`](https://github.com/nodejs/node/commit/1a92335543)] - **tools**: unify .editorconfig rules for 2-space (Roman Reiss) [#23163](https://github.com/nodejs/node/pull/23163)
+* [[`ef00e5c967`](https://github.com/nodejs/node/commit/ef00e5c967)] - **tools**: fix cpplint --quiet option (Daniel Bevenius) [#23075](https://github.com/nodejs/node/pull/23075)
+* [[`1cbc2ee034`](https://github.com/nodejs/node/commit/1cbc2ee034)] - **tools**: update ESLint to 5.6.1 (cjihrig) [#23149](https://github.com/nodejs/node/pull/23149)
+* [[`f6fc7e7aa5`](https://github.com/nodejs/node/commit/f6fc7e7aa5)] - **tools**: .eslintrc.js messages "default" typo style (Lovingly) [#22868](https://github.com/nodejs/node/pull/22868)
+* [[`a22485d8f1`](https://github.com/nodejs/node/commit/a22485d8f1)] - **(SEMVER-MINOR)** **tools**: add bash completion for node (Daniel Bevenius) [#20713](https://github.com/nodejs/node/pull/20713)
+* [[`a6562685c3`](https://github.com/nodejs/node/commit/a6562685c3)] - ***Revert*** "**tools,gyp**: don't force build actions with multiple outputs" (Sakthipriyan Vairamani (thefourtheye)) [#23257](https://github.com/nodejs/node/pull/23257)
+* [[`73917387f4`](https://github.com/nodejs/node/commit/73917387f4)] - **tools,gyp**: cosmetic change to GYP `make` generator outputs (Refael Ackermann) [#23156](https://github.com/nodejs/node/pull/23156)
+* [[`d8cedf545e`](https://github.com/nodejs/node/commit/d8cedf545e)] - **tools,gyp**: don't force build actions with multiple outputs (Refael Ackermann) [#23156](https://github.com/nodejs/node/pull/23156)
+* [[`bf17708aa2`](https://github.com/nodejs/node/commit/bf17708aa2)] - **tty**: document `WriteStream.cursorTo()` and others (Umang Raghuvanshi) [#22893](https://github.com/nodejs/node/pull/22893)
+* [[`9c36827e94`](https://github.com/nodejs/node/commit/9c36827e94)] - **(SEMVER-MINOR)** **tty**: make `readStream.setRawMode()` return `this` (Alexander Mills) [#22950](https://github.com/nodejs/node/pull/22950)
+* [[`36028caf8c`](https://github.com/nodejs/node/commit/36028caf8c)] - **tty**: handle setRawMode errors (Nikolai Vavilov) [#22886](https://github.com/nodejs/node/pull/22886)
+* [[`d22ee2c698`](https://github.com/nodejs/node/commit/d22ee2c698)] - **url**: use foreach-style C++ loop (Tobias Nießen) [#23138](https://github.com/nodejs/node/pull/23138)
+* [[`f1b1b73c2b`](https://github.com/nodejs/node/commit/f1b1b73c2b)] - **(SEMVER-MINOR)** **url**: provide pathToFileURL and fileURLToPath (guybedford) [#22506](https://github.com/nodejs/node/pull/22506)
+* [[`384221e75c`](https://github.com/nodejs/node/commit/384221e75c)] - **(SEMVER-MINOR)** **util**: support BigInt in util.format (Masashi Hirano) [#22097](https://github.com/nodejs/node/pull/22097)
+* [[`77de1beaf0`](https://github.com/nodejs/node/commit/77de1beaf0)] - **util**: move inspect in separate file (Ruben Bridgewater) [#22845](https://github.com/nodejs/node/pull/22845)
+* [[`f2dfebb7b4`](https://github.com/nodejs/node/commit/f2dfebb7b4)] - **util**: update definition of DISALLOW\_COPY\_AND\_ASSIGN macro (Nitish Sakhawalkar) [#23092](https://github.com/nodejs/node/pull/23092)
+* [[`68eaa8789a`](https://github.com/nodejs/node/commit/68eaa8789a)] - **(SEMVER-MINOR)** **util**: add order option to `.inspect()` (Ruben Bridgewater) [#22788](https://github.com/nodejs/node/pull/22788)
+* [[`a2a1ebfecf`](https://github.com/nodejs/node/commit/a2a1ebfecf)] - **(SEMVER-MINOR)** **util**: use a shared symbol for util.inspect.custom (chocolateboy) [#20857](https://github.com/nodejs/node/pull/20857)
+* [[`077e7e0ce7`](https://github.com/nodejs/node/commit/077e7e0ce7)] - **util**: fix indentationLvl when exceeding max call stack size (Ruben Bridgewater) [#22787](https://github.com/nodejs/node/pull/22787)
+* [[`5a13e66088`](https://github.com/nodejs/node/commit/5a13e66088)] - **util**: improve inspect performance (Ruben Bridgewater) [#22503](https://github.com/nodejs/node/pull/22503)
+* [[`92e0f38a65`](https://github.com/nodejs/node/commit/92e0f38a65)] - **util**: remove outdated TODO (Ruben Bridgewater) [#22503](https://github.com/nodejs/node/pull/22503)
+* [[`3b895d1258`](https://github.com/nodejs/node/commit/3b895d1258)] - **win,msi**: display license notes before installing tools (João Reis) [#23044](https://github.com/nodejs/node/pull/23044)
+* [[`cf284c80a9`](https://github.com/nodejs/node/commit/cf284c80a9)] - **win,msi**: install Boxstarter from elevated shell (João Reis) [#22988](https://github.com/nodejs/node/pull/22988)
+* [[`2b7e18dec5`](https://github.com/nodejs/node/commit/2b7e18dec5)] - **win,msi**: highlight installation of 3rd-party tools (Tobias Nießen) [#23003](https://github.com/nodejs/node/pull/23003)
+* [[`ebf36cd180`](https://github.com/nodejs/node/commit/ebf36cd180)] - **(SEMVER-MINOR)** **win,msi**: install tools for native modules (João Reis) [#22645](https://github.com/nodejs/node/pull/22645)
+* [[`c34db7a9c2`](https://github.com/nodejs/node/commit/c34db7a9c2)] - **worker**: reduce `MessagePort` prototype to documented API (Anna Henningsen) [#23037](https://github.com/nodejs/node/pull/23037)
+* [[`2e30a6897d`](https://github.com/nodejs/node/commit/2e30a6897d)] - **worker**: hide MessagePort init function behind symbol (Anna Henningsen) [#23037](https://github.com/nodejs/node/pull/23037)
+* [[`b5889d0b84`](https://github.com/nodejs/node/commit/b5889d0b84)] - **worker**: only stop inspector if started (Anna Henningsen) [#22927](https://github.com/nodejs/node/pull/22927)
+* [[`7639390032`](https://github.com/nodejs/node/commit/7639390032)] - **worker,coverage**: support V8 coverage generation (Anna Henningsen) [#22928](https://github.com/nodejs/node/pull/22928)
+* [[`18cbde5ade`](https://github.com/nodejs/node/commit/18cbde5ade)] - **zlib**: simplify flushing mechanism (Anna Henningsen) [#23186](https://github.com/nodejs/node/pull/23186)
+* [[`e749a28c55`](https://github.com/nodejs/node/commit/e749a28c55)] - **zlib**: use common owner symbol to access JS wrapper (Anna Henningsen) [#23189](https://github.com/nodejs/node/pull/23189)
+* [[`a6b55c73b0`](https://github.com/nodejs/node/commit/a6b55c73b0)] - **zlib**: move, rename, document internal params() cb (Anna Henningsen) [#23187](https://github.com/nodejs/node/pull/23187)
+
## 2018-09-20, Version 10.11.0 (Current), @targos
diff --git a/lib/_http_agent.js b/lib/_http_agent.js
index 1a2920cf09..97c5ab604f 100644
--- a/lib/_http_agent.js
+++ b/lib/_http_agent.js
@@ -167,7 +167,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
var socket = this.freeSockets[name].shift();
// Guard against an uninitialized or user supplied Socket.
if (socket._handle && typeof socket._handle.asyncReset === 'function') {
- // Assign the handle a new asyncId and run any init() hooks.
+ // Assign the handle a new asyncId and run any destroy()/init() hooks.
socket._handle.asyncReset();
socket[async_id_symbol] = socket._handle.getAsyncId();
}
diff --git a/lib/_http_client.js b/lib/_http_client.js
index c83800a93b..d91b43516f 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -47,6 +47,7 @@ const {
ERR_UNESCAPED_CHARACTERS
} = require('internal/errors').codes;
const { validateTimerDuration } = require('internal/timers');
+const is_reused_symbol = require('internal/freelist').symbols.is_reused_symbol;
const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/;
@@ -631,7 +632,7 @@ function tickOnSocket(req, socket) {
var parser = parsers.alloc();
req.socket = socket;
req.connection = socket;
- parser.reinitialize(HTTPParser.RESPONSE);
+ parser.reinitialize(HTTPParser.RESPONSE, parser[is_reused_symbol]);
parser.socket = socket;
parser.outgoing = req;
req.parser = parser;
diff --git a/lib/_http_common.js b/lib/_http_common.js
index 1de0ee6025..b37814f783 100644
--- a/lib/_http_common.js
+++ b/lib/_http_common.js
@@ -23,7 +23,7 @@
const { methods, HTTPParser } = internalBinding('http_parser');
-const FreeList = require('internal/freelist');
+const { FreeList } = require('internal/freelist');
const { ondrain } = require('internal/http');
const incoming = require('_http_incoming');
const {
diff --git a/lib/_http_server.js b/lib/_http_server.js
index cc1a428cd6..3b2d7f5041 100644
--- a/lib/_http_server.js
+++ b/lib/_http_server.js
@@ -42,6 +42,7 @@ const {
defaultTriggerAsyncIdScope,
getOrSetAsyncId
} = require('internal/async_hooks');
+const is_reused_symbol = require('internal/freelist').symbols.is_reused_symbol;
const { IncomingMessage } = require('_http_incoming');
const {
ERR_HTTP_HEADERS_SENT,
@@ -338,7 +339,7 @@ function connectionListenerInternal(server, socket) {
socket.on('timeout', socketOnTimeout);
var parser = parsers.alloc();
- parser.reinitialize(HTTPParser.REQUEST);
+ parser.reinitialize(HTTPParser.REQUEST, parser[is_reused_symbol]);
parser.socket = socket;
socket.parser = parser;
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
index 2b9600f0fd..488d10a10b 100644
--- a/lib/_stream_readable.js
+++ b/lib/_stream_readable.js
@@ -42,7 +42,7 @@ const { emitExperimentalWarning } = require('internal/util');
// Lazy loaded to improve the startup performance.
let StringDecoder;
-let ReadableAsyncIterator;
+let createReadableStreamAsyncIterator;
util.inherits(Readable, Stream);
@@ -990,9 +990,11 @@ Readable.prototype.wrap = function(stream) {
Readable.prototype[Symbol.asyncIterator] = function() {
emitExperimentalWarning('Readable[Symbol.asyncIterator]');
- if (ReadableAsyncIterator === undefined)
- ReadableAsyncIterator = require('internal/streams/async_iterator');
- return new ReadableAsyncIterator(this);
+ if (createReadableStreamAsyncIterator === undefined) {
+ createReadableStreamAsyncIterator =
+ require('internal/streams/async_iterator');
+ }
+ return createReadableStreamAsyncIterator(this);
};
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
diff --git a/lib/assert.js b/lib/assert.js
index 0f3d770358..9990d0e888 100644
--- a/lib/assert.js
+++ b/lib/assert.js
@@ -27,12 +27,14 @@ const { codes: {
ERR_INVALID_ARG_VALUE,
ERR_INVALID_RETURN_VALUE
} } = require('internal/errors');
-const { AssertionError, errorCache } = require('internal/assert');
+const { AssertionError } = require('internal/assert');
const { openSync, closeSync, readSync } = require('fs');
const { inspect, types: { isPromise, isRegExp } } = require('util');
const { EOL } = require('internal/constants');
const { NativeModule } = require('internal/bootstrap/loaders');
+const errorCache = new Map();
+
let isDeepEqual;
let isDeepStrictEqual;
let parseExpressionAt;
diff --git a/lib/buffer.js b/lib/buffer.js
index f274c51739..c7ffa42a54 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -37,14 +37,7 @@ const {
kMaxLength,
kStringMaxLength
} = process.binding('buffer');
-// We cannot use internalBinding unconditionally here because of the way
-// that test/parallel/test-buffer-bindingobj-no-zerofill.js is written.
-let isAnyArrayBuffer;
-try {
- isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer;
-} catch (e) {
- isAnyArrayBuffer = require('util').types.isAnyArrayBuffer;
-}
+const { isAnyArrayBuffer } = internalBinding('types');
const {
customInspectSymbol,
isInsideNodeModules,
@@ -1078,7 +1071,7 @@ if (process.binding('config').hasIntl) {
const {
icuErrName,
transcode: _transcode
- } = process.binding('icu');
+ } = internalBinding('icu');
// Transcodes the Buffer from one encoding to another, returning a new
// Buffer instance.
diff --git a/lib/internal/assert.js b/lib/internal/assert.js
index e174cddb60..829f666319 100644
--- a/lib/internal/assert.js
+++ b/lib/internal/assert.js
@@ -396,6 +396,5 @@ class AssertionError extends Error {
}
module.exports = {
- AssertionError,
- errorCache: new Map()
+ AssertionError
};
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 70de4bfa41..770bb78f73 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -128,7 +128,7 @@
const browserGlobals = !process._noBrowserGlobals;
if (browserGlobals) {
- // we are setting this here to foward it to the inspector later
+ // we are setting this here to forward it to the inspector later
perThreadSetup.originalConsole = global.console;
setupGlobalTimeouts();
setupGlobalConsole();
@@ -393,6 +393,7 @@
new SafeSet([
'cares_wrap',
'fs_event_wrap',
+ 'icu',
'udp_wrap',
'uv',
'pipe_wrap',
@@ -653,7 +654,7 @@
function setupProcessICUVersions() {
const icu = process.binding('config').hasIntl ?
- process.binding('icu') : undefined;
+ internalBinding('icu') : undefined;
if (!icu) return; // no Intl/ICU: nothing to add here.
// With no argument, getVersion() returns a comma separated list
// of possible types.
diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js
index 161ae72a19..b2448144b0 100644
--- a/lib/internal/encoding.js
+++ b/lib/internal/encoding.js
@@ -356,7 +356,7 @@ function makeTextDecoderICU() {
decode: _decode,
getConverter,
hasConverter
- } = process.binding('icu');
+ } = internalBinding('icu');
class TextDecoder {
constructor(encoding = 'utf-8', options = {}) {
diff --git a/lib/internal/freelist.js b/lib/internal/freelist.js
index 7e9cef9528..04d684e833 100644
--- a/lib/internal/freelist.js
+++ b/lib/internal/freelist.js
@@ -1,5 +1,7 @@
'use strict';
+const is_reused_symbol = Symbol('isReused');
+
class FreeList {
constructor(name, max, ctor) {
this.name = name;
@@ -9,9 +11,15 @@ class FreeList {
}
alloc() {
- return this.list.length ?
- this.list.pop() :
- this.ctor.apply(this, arguments);
+ let item;
+ if (this.list.length > 0) {
+ item = this.list.pop();
+ item[is_reused_symbol] = true;
+ } else {
+ item = this.ctor.apply(this, arguments);
+ item[is_reused_symbol] = false;
+ }
+ return item;
}
free(obj) {
@@ -23,4 +31,9 @@ class FreeList {
}
}
-module.exports = FreeList;
+module.exports = {
+ FreeList,
+ symbols: {
+ is_reused_symbol
+ }
+};
diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js
index b08008857e..4e9ab05af5 100644
--- a/lib/internal/http2/core.js
+++ b/lib/internal/http2/core.js
@@ -761,7 +761,7 @@ const proxySocketHandler = {
// indicate if the ping was successful or not. The duration indicates the
// number of milliseconds elapsed since the ping was sent and the ack
// received. The payload is a Buffer containing the 8 bytes of payload
-// data received on the PING acknowlegement.
+// data received on the PING acknowledgement.
function pingCallback(cb) {
return function pingCallback(ack, duration, payload) {
if (ack) {
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index ec5e9d491f..70ae4c4ef1 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -218,16 +218,6 @@ function tryExtensions(p, exts, isMain) {
return false;
}
-function readExtensions() {
- const exts = Object.keys(Module._extensions);
- for (var i = 0, j = 0; i < exts.length; ++i) {
- if (path.extname(exts[i]) === '')
- exts[j++] = exts[i];
- }
- exts.length = j;
- return exts;
-}
-
var warned = false;
Module._findPath = function(request, paths, isMain) {
if (path.isAbsolute(request)) {
@@ -284,7 +274,7 @@ Module._findPath = function(request, paths, isMain) {
if (!filename) {
// try it with each of the extensions
if (exts === undefined)
- exts = readExtensions();
+ exts = Object.keys(Module._extensions);
filename = tryExtensions(basePath, exts, isMain);
}
}
@@ -292,7 +282,7 @@ Module._findPath = function(request, paths, isMain) {
if (!filename && rc === 1) { // Directory.
// try it with each of the extensions at "index"
if (exts === undefined)
- exts = readExtensions();
+ exts = Object.keys(Module._extensions);
filename = tryPackage(basePath, exts, isMain);
if (!filename) {
filename = tryExtensions(path.resolve(basePath, 'index'), exts, isMain);
diff --git a/lib/internal/readline.js b/lib/internal/readline.js
index 45125db0c2..0f7d969d20 100644
--- a/lib/internal/readline.js
+++ b/lib/internal/readline.js
@@ -31,7 +31,7 @@ CSI.kClearLine = CSI`2K`;
CSI.kClearScreenDown = CSI`0J`;
if (process.binding('config').hasIntl) {
- const icu = process.binding('icu');
+ const icu = internalBinding('icu');
getStringWidth = function getStringWidth(str, options) {
options = options || {};
if (!Number.isInteger(str))
diff --git a/lib/internal/repl/recoverable.js b/lib/internal/repl/recoverable.js
index 5d270f5146..023de2f7ab 100644
--- a/lib/internal/repl/recoverable.js
+++ b/lib/internal/repl/recoverable.js
@@ -5,7 +5,7 @@ const { tokTypes: tt } = acorn;
// If the error is that we've unexpectedly ended the input,
// then let the user try to recover by adding more input.
-// Note: `e` (the original exception) is not used by the current implemention,
+// Note: `e` (the original exception) is not used by the current implementation,
// but may be needed in the future.
function isRecoverableError(e, code) {
let recoverable = false;
diff --git a/lib/internal/streams/async_iterator.js b/lib/internal/streams/async_iterator.js
index 0e34573d87..91c473ee9d 100644
--- a/lib/internal/streams/async_iterator.js
+++ b/lib/internal/streams/async_iterator.js
@@ -8,12 +8,9 @@ const kLastPromise = Symbol('lastPromise');
const kHandlePromise = Symbol('handlePromise');
const kStream = Symbol('stream');
-const AsyncIteratorRecord = class AsyncIteratorRecord {
- constructor(value, done) {
- this.done = done;
- this.value = value;
- }
-};
+function createIterResult(value, done) {
+ return { value, done };
+}
function readAndResolve(iter) {
const resolve = iter[kLastResolve];
@@ -26,7 +23,7 @@ function readAndResolve(iter) {
iter[kLastPromise] = null;
iter[kLastResolve] = null;
iter[kLastReject] = null;
- resolve(new AsyncIteratorRecord(data, false));
+ resolve(createIterResult(data, false));
}
}
}
@@ -43,7 +40,7 @@ function onEnd(iter) {
iter[kLastPromise] = null;
iter[kLastResolve] = null;
iter[kLastReject] = null;
- resolve(new AsyncIteratorRecord(null, true));
+ resolve(createIterResult(null, true));
}
iter[kEnded] = true;
}
@@ -69,39 +66,13 @@ function wrapForNext(lastPromise, iter) {
};
}
-const ReadableAsyncIterator = class ReadableAsyncIterator {
- constructor(stream) {
- this[kStream] = stream;
- this[kLastResolve] = null;
- this[kLastReject] = null;
- this[kError] = null;
- this[kEnded] = false;
- this[kLastPromise] = null;
-
- stream.on('readable', onReadable.bind(null, this));
- stream.on('end', onEnd.bind(null, this));
- stream.on('error', onError.bind(null, this));
-
- // the function passed to new Promise
- // is cached so we avoid allocating a new
- // closure at every run
- this[kHandlePromise] = (resolve, reject) => {
- const data = this[kStream].read();
- if (data) {
- this[kLastPromise] = null;
- this[kLastResolve] = null;
- this[kLastReject] = null;
- resolve(new AsyncIteratorRecord(data, false));
- } else {
- this[kLastResolve] = resolve;
- this[kLastReject] = reject;
- }
- };
- }
+const AsyncIteratorPrototype = Object.getPrototypeOf(
+ Object.getPrototypeOf(async function* () {}).prototype);
+const ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf({
get stream() {
return this[kStream];
- }
+ },
next() {
// if we have detected an error in the meanwhile
@@ -112,7 +83,7 @@ const ReadableAsyncIterator = class ReadableAsyncIterator {
}
if (this[kEnded]) {
- return Promise.resolve(new AsyncIteratorRecord(null, true));
+ return Promise.resolve(createIterResult(null, true));
}
// if we have multiple next() calls
@@ -129,7 +100,7 @@ const ReadableAsyncIterator = class ReadableAsyncIterator {
// without triggering the next() queue
const data = this[kStream].read();
if (data !== null) {
- return Promise.resolve(new AsyncIteratorRecord(data, false));
+ return Promise.resolve(createIterResult(data, false));
}
promise = new Promise(this[kHandlePromise]);
@@ -138,7 +109,7 @@ const ReadableAsyncIterator = class ReadableAsyncIterator {
this[kLastPromise] = promise;
return promise;
- }
+ },
return() {
// destroy(err, cb) is a private API
@@ -150,10 +121,45 @@ const ReadableAsyncIterator = class ReadableAsyncIterator {
reject(err);
return;
}
- resolve(new AsyncIteratorRecord(null, true));
+ resolve(createIterResult(null, true));
});
});
- }
+ },
+}, AsyncIteratorPrototype);
+
+const createReadableStreamAsyncIterator = (stream) => {
+ const iterator = Object.create(ReadableStreamAsyncIteratorPrototype, {
+ [kStream]: { value: stream, writable: true },
+ [kLastResolve]: { value: null, writable: true },
+ [kLastReject]: { value: null, writable: true },
+ [kError]: { value: null, writable: true },
+ [kEnded]: { value: false, writable: true },
+ [kLastPromise]: { value: null, writable: true },
+ // the function passed to new Promise
+ // is cached so we avoid allocating a new
+ // closure at every run
+ [kHandlePromise]: {
+ value: (resolve, reject) => {
+ const data = iterator[kStream].read();
+ if (data) {
+ iterator[kLastPromise] = null;
+ iterator[kLastResolve] = null;
+ iterator[kLastReject] = null;
+ resolve(createIterResult(data, false));
+ } else {
+ iterator[kLastResolve] = resolve;
+ iterator[kLastReject] = reject;
+ }
+ },
+ writable: true,
+ },
+ });
+
+ stream.on('readable', onReadable.bind(null, iterator));
+ stream.on('end', onEnd.bind(null, iterator));
+ stream.on('error', onError.bind(null, iterator));
+
+ return iterator;
};
-module.exports = ReadableAsyncIterator;
+module.exports = createReadableStreamAsyncIterator;
diff --git a/lib/net.js b/lib/net.js
index 8fdd7bd86a..f7d55ca646 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -152,7 +152,7 @@ function connect(...args) {
socket.setTimeout(options.timeout);
}
- return Socket.prototype.connect.call(socket, normalized);
+ return socket.connect(normalized);
}
diff --git a/lib/url.js b/lib/url.js
index ba2033b4e5..db7369fed0 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -22,7 +22,7 @@
'use strict';
const { toASCII } = process.binding('config').hasIntl ?
- process.binding('icu') : require('punycode');
+ internalBinding('icu') : require('punycode');
const { hexTable } = require('internal/querystring');
diff --git a/lib/util.js b/lib/util.js
index 27affda109..2e42beb58b 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -102,7 +102,13 @@ function formatWithOptions(inspectOptions, f) {
tempStr = tryStringify(arguments[a++]);
break;
case 100: // 'd'
- tempStr = `${Number(arguments[a++])}`;
+ const tempNum = arguments[a++];
+ // eslint-disable-next-line valid-typeof
+ if (typeof tempNum === 'bigint') {
+ tempStr = `${tempNum}n`;
+ } else {
+ tempStr = `${Number(tempNum)}`;
+ }
break;
case 79: // 'O'
tempStr = inspect(arguments[a++], inspectOptions);
@@ -117,7 +123,13 @@ function formatWithOptions(inspectOptions, f) {
break;
}
case 105: // 'i'
- tempStr = `${parseInt(arguments[a++])}`;
+ const tempInteger = arguments[a++];
+ // eslint-disable-next-line valid-typeof
+ if (typeof tempInteger === 'bigint') {
+ tempStr = `${tempInteger}n`;
+ } else {
+ tempStr = `${parseInt(tempInteger)}`;
+ }
break;
case 102: // 'f'
tempStr = `${parseFloat(arguments[a++])}`;
diff --git a/lib/zlib.js b/lib/zlib.js
index 68d06fa93f..5d5ef3e083 100644
--- a/lib/zlib.js
+++ b/lib/zlib.js
@@ -311,10 +311,9 @@ function Zlib(opts, mode) {
this._level = level;
this._strategy = strategy;
this._chunkSize = chunkSize;
- this._flushFlag = flush;
- this._scheduledFlushFlag = Z_NO_FLUSH;
- this._origFlushFlag = flush;
+ this._defaultFlushFlag = flush;
this._finishFlushFlag = finishFlush;
+ this._nextFlush = -1;
this._info = opts && opts.info;
this.once('end', this.close);
}
@@ -398,6 +397,7 @@ function maxFlush(a, b) {
return flushiness[a] > flushiness[b] ? a : b;
}
+const flushBuffer = Buffer.alloc(0);
Zlib.prototype.flush = function flush(kind, callback) {
var ws = this._writableState;
@@ -412,21 +412,13 @@ Zlib.prototype.flush = function flush(kind, callback) {
} else if (ws.ending) {
if (callback)
this.once('end', callback);
- } else if (ws.needDrain) {
- const alreadyHadFlushScheduled = this._scheduledFlushFlag !== Z_NO_FLUSH;
- this._scheduledFlushFlag = maxFlush(kind, this._scheduledFlushFlag);
-
- // If a callback was passed, always register a new `drain` + flush handler,
- // mostly because that's simpler and flush callbacks piling up is a rare
- // thing anyway.
- if (!alreadyHadFlushScheduled || callback) {
- const drainHandler = () => this.flush(this._scheduledFlushFlag, callback);
- this.once('drain', drainHandler);
- }
+ } else if (this._nextFlush !== -1) {
+ // This means that there is a flush currently in the write queue.
+ // We currently coalesce this flush into the pending one.
+ this._nextFlush = maxFlush(this._nextFlush, kind);
} else {
- this._flushFlag = kind;
- this.write(Buffer.alloc(0), '', callback);
- this._scheduledFlushFlag = Z_NO_FLUSH;
+ this._nextFlush = kind;
+ this.write(flushBuffer, '', callback);
}
};
@@ -436,20 +428,18 @@ Zlib.prototype.close = function close(callback) {
};
Zlib.prototype._transform = function _transform(chunk, encoding, cb) {
- // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag
- // (or whatever flag was provided using opts.finishFlush).
- // If it's explicitly flushing at some other time, then we use
- // Z_FULL_FLUSH. Otherwise, use the original opts.flush flag.
- var flushFlag;
+ var flushFlag = this._defaultFlushFlag;
+ // We use a 'fake' zero-length chunk to carry information about flushes from
+ // the public API to the actual stream implementation.
+ if (chunk === flushBuffer) {
+ flushFlag = this._nextFlush;
+ this._nextFlush = -1;
+ }
+
+ // For the last chunk, also apply `_finishFlushFlag`.
var ws = this._writableState;
if ((ws.ending || ws.ended) && ws.length === chunk.byteLength) {
- flushFlag = this._finishFlushFlag;
- } else {
- flushFlag = this._flushFlag;
- // once we've flushed the last of the queue, stop flushing and
- // go back to the normal behavior.
- if (chunk.byteLength >= ws.length)
- this._flushFlag = this._origFlushFlag;
+ flushFlag = maxFlush(flushFlag, this._finishFlushFlag);
}
processChunk(this, chunk, flushFlag, cb);
};
diff --git a/node.gyp b/node.gyp
index e33628816c..a3b0cd1838 100644
--- a/node.gyp
+++ b/node.gyp
@@ -629,6 +629,7 @@
'process_outputs_as_sources': 1,
'inputs': [
'<@(library_files)',
+ 'config.gypi',
'tools/check_macros.py'
],
'outputs': [
@@ -648,7 +649,7 @@
'action': [
'python', 'tools/js2c.py',
'<@(_outputs)',
- '<@(_inputs)', 'config.gypi',
+ '<@(_inputs)',
],
},
],
diff --git a/src/aliased_buffer.h b/src/aliased_buffer.h
index 931b275364..2642b2b2a7 100644
--- a/src/aliased_buffer.h
+++ b/src/aliased_buffer.h
@@ -14,7 +14,7 @@ namespace node {
* going through JS, and the data is then available to user's via the exposed
* JS object.
*
- * While this technique is computationaly efficient, it is effectively a
+ * While this technique is computationally efficient, it is effectively a
* write to JS program state w/out going through the standard
* (monitored) API. Thus any VM capabilities to detect the modification are
* circumvented.
diff --git a/src/async_wrap.cc b/src/async_wrap.cc
index 2b163a5fa2..596fcc8356 100644
--- a/src/async_wrap.cc
+++ b/src/async_wrap.cc
@@ -563,6 +563,7 @@ AsyncWrap::AsyncWrap(Environment* env,
CHECK_NE(provider, PROVIDER_NONE);
CHECK_GE(object->InternalFieldCount(), 1);
+ async_id_ = -1;
// Use AsyncReset() call to execute the init() callbacks.
AsyncReset(execution_async_id, silent);
}
@@ -606,6 +607,14 @@ void AsyncWrap::EmitDestroy(Environment* env, double async_id) {
// and reused over their lifetime. This way a new uid can be assigned when
// the resource is pulled out of the pool and put back into use.
void AsyncWrap::AsyncReset(double execution_async_id, bool silent) {
+ if (async_id_ != -1) {
+ // This instance was in use before, we have already emitted an init with
+ // its previous async_id and need to emit a matching destroy for that
+ // before generating a new async_id.
+ EmitDestroy(env(), async_id_);
+ }
+
+ // Now we can assign a new async_id_ to this instance.
async_id_ =
execution_async_id == -1 ? env()->new_async_id() : execution_async_id;
trigger_async_id_ = env()->get_default_trigger_async_id();
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc
index 3fb00859d3..1a83a1cf7a 100644
--- a/src/cares_wrap.cc
+++ b/src/cares_wrap.cc
@@ -429,7 +429,6 @@ void cares_wrap_hostent_cpy(struct hostent* dest, struct hostent* src) {
/* copy `h_aliases` */
size_t alias_count;
- size_t cur_alias_length;
for (alias_count = 0;
src->h_aliases[alias_count] != nullptr;
alias_count++) {
@@ -437,9 +436,9 @@ void cares_wrap_hostent_cpy(struct hostent* dest, struct hostent* src) {
dest->h_aliases = node::Malloc(alias_count + 1);
for (size_t i = 0; i < alias_count; i++) {
- cur_alias_length = strlen(src->h_aliases[i]);
- dest->h_aliases[i] = node::Malloc(cur_alias_length + 1);
- memcpy(dest->h_aliases[i], src->h_aliases[i], cur_alias_length + 1);
+ const size_t cur_alias_size = strlen(src->h_aliases[i]) + 1;
+ dest->h_aliases[i] = node::Malloc(cur_alias_size);
+ memcpy(dest->h_aliases[i], src->h_aliases[i], cur_alias_size);
}
dest->h_aliases[alias_count] = nullptr;
@@ -1065,7 +1064,6 @@ int ParseSoaReply(Environment* env,
/* Can't use ares_parse_soa_reply() here which can only parse single record */
unsigned int ancount = cares_get_16bit(buf + 6);
unsigned char* ptr = buf + NS_HFIXEDSZ;
- int rr_type, rr_len;
char* name;
char* rr_name;
long temp_len; // NOLINT(runtime/int)
@@ -1094,8 +1092,8 @@ int ParseSoaReply(Environment* env,
break;
}
- rr_type = cares_get_16bit(ptr);
- rr_len = cares_get_16bit(ptr + 8);
+ const int rr_type = cares_get_16bit(ptr);
+ const int rr_len = cares_get_16bit(ptr + 8);
ptr += NS_RRFIXEDSZ;
/* only need SOA */
diff --git a/src/env.cc b/src/env.cc
index 9efeaadff1..14a8b23a84 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -576,10 +576,10 @@ void Environment::RunTimers(uv_timer_t* handle) {
ret = cb->Call(env->context(), process, 1, &arg);
} while (ret.IsEmpty() && env->can_call_into_js());
- // NOTE(apapirovski): If it ever becomes possibble that `call_into_js` above
+ // NOTE(apapirovski): If it ever becomes possible that `call_into_js` above
// is reset back to `true` after being previously set to `false` then this
// code becomes invalid and needs to be rewritten. Otherwise catastrophic
- // timers corruption will occurr and all timers behaviour will become
+ // timers corruption will occur and all timers behaviour will become
// entirely unpredictable.
if (ret.IsEmpty())
return;
diff --git a/src/exceptions.cc b/src/exceptions.cc
index c9e308240f..98c87603dd 100644
--- a/src/exceptions.cc
+++ b/src/exceptions.cc
@@ -128,7 +128,9 @@ Local UVException(Isolate* isolate,
String::Concat(isolate, js_msg, FIXED_ONE_BYTE_STRING(isolate, "'"));
}
- Local