Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6.11.0 proposal #13059

Merged
merged 127 commits into from
Jun 6, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
736a736
tools: update ESLint to 3.19.0
Trott Apr 2, 2017
87534d6
tools: replace custom ESLint timers rule
Trott Apr 2, 2017
d63befa
tools: Add no useless regex char class rule
princejwesley Nov 13, 2016
ad29e29
doc: gcc version is at least 4.8.5 in BUILDING.md
detailyang Mar 14, 2017
15226f5
test: add hasCrypto check to tls-socket-close
danbev Mar 8, 2017
cd1a7ea
test: add regex to text-crypto-random
NFoxley Dec 1, 2016
32fa37f
benchmark: cleanup child_process IPC benchmark
ypresto Dec 31, 2016
c13429a
child_process: optimize IPC for large data
ypresto Dec 31, 2016
331681a
src: return early if nextTickQueue is empty
trevnorris Dec 15, 2016
202f007
process: maintain constructor descriptor
bengl Oct 26, 2016
f1ea367
src: use std::list for at_exit_functions
danbev Apr 6, 2017
7678da4
crypto: handle exceptions in hmac/hash.digest
tniessen Apr 2, 2017
9fc695c
doc: fixup the collaborators list
aqrln Apr 29, 2017
c1e4b2f
test: move test to sequential for reliability
Trott Apr 27, 2017
43d3c00
doc: fix formatting of TOC
refack Apr 28, 2017
64f9adc
test: cleanup test-util-inherits.js
RobotMermaid Apr 22, 2017
32d7981
build: use do_not_edit variable where possible
krydos Apr 23, 2017
ac825fc
test: use common.js to check platform
krydos Apr 24, 2017
cb63808
test: improve test-process-kill-pid
QueueHefner Apr 22, 2017
f2230cc
eslint: remove dead and unused symlink
sam-github Jan 12, 2017
bea0a6e
test: add common.mustNotCall()
cjihrig Feb 3, 2017
c304414
test: improve test-tcp-wrap-listen
QueueHefner Apr 22, 2017
89e76e8
test: improved type checking with regex
Apr 22, 2017
a714449
test: cleanup test-fs-watch.js
RobotMermaid Apr 22, 2017
3ae8d00
doc: add single arg scenario for util.format
tarunbatra Apr 12, 2017
afac316
test: improve punycode coverage to check surrogate pair
orisano Apr 12, 2017
dac66d5
doc: limit lines to 80 cols in internal README
evanlucas Apr 12, 2017
0a79b2d
crypto: make LazyTransform compabile with Streams1
mcollina Apr 13, 2017
d2afd7c
doc: add AnnaMag to collaborators
AnnaMag Apr 14, 2017
3c1bd05
doc: response.write ignores body in some cases
krydos Apr 10, 2017
7c335f6
build: run cpplint even if jslint failed
krydos Apr 7, 2017
9e89edf
test: add hasCrypto check to test-debug-usage
danbev Apr 12, 2017
945dcde
doc: fix formatting in onboarding-extras
Trott Apr 11, 2017
929ca30
doc: add info about serializable types
shubheksha Apr 10, 2017
a6e0673
doc: path functions ignore trailing slashes
tniessen Apr 3, 2017
7d47b02
test: remove common.PORT from test-cluster-basic
Trott Apr 12, 2017
4a18e51
doc: add jkrems to collaborators
Apr 15, 2017
c6f3ebd
doc: fix typo in streams.md
jpbamberg1993 Apr 15, 2017
81b5350
doc: add DavidCai1993 to collaborators
DavidCai1111 Apr 15, 2017
1c1269d
doc: update link for landing PRs
Trott Apr 14, 2017
656c30e
doc: add guide for backporting prs
evanlucas Feb 1, 2017
40f292c
doc: add missing ) in CONTRIBUTING.md
matkoniecz Apr 16, 2017
b7ca748
meta: move the Code of Conduct to TSC repository
jasnell Mar 31, 2017
c408a3b
src: support "--" after "-e" as end-of-options
jBarz Dec 30, 2016
f2e97f8
src: make copies of startup environment variables
bnoordhuis Jan 28, 2017
aec7ae2
src: add SafeGetenv() to internal API
sam-github Jan 27, 2017
f8da60f
crypto: support OPENSSL_CONF again
sam-github Jan 25, 2017
875674b
crypto: return `this` in setAuthTag/setAAD
fanatid Nov 1, 2016
2b3381a
Revert "v8: drop v8::FunctionCallbackInfo<T>::NewTarget()"
bnoordhuis Mar 2, 2017
bbfd2e3
crypto: do not use pointers to std::vector
AdamMajer Dec 21, 2016
fd9bb56
crypto: Use system CAs instead of using bundled ones
AdamMajer Dec 21, 2016
e72749b
crypto: ability to select cert store at runtime
AdamMajer Dec 21, 2016
0bc14b6
dns: implement {ttl: true} for dns.resolve4()
bnoordhuis Oct 26, 2016
da70161
dns: implement {ttl: true} for dns.resolve6()
bnoordhuis Oct 26, 2016
ae587f3
cluster: return worker reference from disconnect()
stv8 Dec 1, 2016
df9d8ee
tls: allow obvious key/passphrase combinations
sam-github Dec 15, 2016
861fa65
test: make tls-socket-default-options tests run
sam-github Jan 16, 2017
7cad561
tls: new tls.TLSSocket() supports sec ctx options
sam-github Jan 17, 2017
637d9e3
process: add NODE_NO_WARNINGS environment variable
cjihrig Jan 16, 2017
0c318a6
build: support for mips64el
nanxiongchao Jan 25, 2017
62a8f47
async_wrap: close the destroy_ids_idle_handle_
reshnm Dec 21, 2016
8bd6ab7
readline: add option to stop duplicates in history
DannyNemer Sep 21, 2015
e9f33e3
readline: rename `deDupeHistory` option
DannyNemer Mar 20, 2017
db4aef4
doc: change Mac OS X to macOS
Mar 28, 2017
32a6d87
doc: correct markdown file line lengths
Mar 29, 2017
e3352bb
doc: update Mac OS X references in releases.md
Mar 29, 2017
a0973c3
build: don't create directory for NDK toolchain
diastremskii Mar 21, 2017
3585ffa
deps: upgrade libuv to 1.10.0
cjihrig Oct 25, 2016
c59370a
deps: upgrade libuv to 1.10.1
cjihrig Nov 16, 2016
827411c
Revert "repl: disable Ctrl+C support on win32 for now"
addaleax Sep 18, 2016
738d830
deps: upgrade libuv to 1.10.2
cjihrig Jan 9, 2017
0caca45
test: add crypto check to crypto-lazy-transform
danbev Apr 15, 2017
26fcc7a
doc: s/origin/upstream/ collaborator guide
addaleax Apr 15, 2017
bc64cf2
build: make linter targets silent
thefourtheye Apr 15, 2017
1bd07ac
net: refactor onSlaveClose in Server.close
claudiorodriguez Apr 11, 2017
d54d0c4
test: add --use-bundled-ca to tls-cnnic-whitelist
danbev Apr 13, 2017
bc40169
doc: correct git fix whitespace command
matkoniecz Apr 16, 2017
384fa17
test: use dynamic port in 3 test-cluster-worker tests
Apr 17, 2017
5fa4170
doc: fix encoding string in buffer example
MapleGu Apr 18, 2017
3244ae3
test: remove common.PORT from test-cluster*.js
tarunbatra Apr 16, 2017
04ec97e
test: use dynamic port in test-cluster-bind-twice
Trott Apr 15, 2017
3556c17
doc: avoid colloquialism
Trott Apr 15, 2017
9881da1
doc: run tests before landing changes
Trott Apr 15, 2017
4786ad7
test: buffer should always be stringified
lucamaraschi Apr 12, 2017
a4b092c
test: complete coverage of lib/child_process.js
cjihrig Apr 12, 2017
e1098a4
doc: unify spaces in a querystring.md code example
vsemozhetbyt Apr 17, 2017
a755ef0
test: increase coverage for buffer.js
Trott Apr 17, 2017
ce3b544
test: dynamic port in cluster worker send
Apr 17, 2017
b1d26d8
test: remove uses of common.PORT in test-tls-client tests
z0al Apr 17, 2017
768431c
test: dynamic port in cluster worker disconnect
Apr 17, 2017
50bfb28
test: console.log removed from test-net-localport
fhalde Apr 18, 2017
3d52672
doc: add lucamaraschi to collaborators
lucamaraschi Apr 20, 2017
278e8cc
doc: update link to Code of Conduct
aautem Apr 20, 2017
830949c
test: use JSON.stringify to trigger stack overflow
hashseed Mar 8, 2017
dd0b170
build: fix case in lib names
refack Apr 19, 2017
32425be
test: use duplex streams in duplex stream test
cjihrig Apr 19, 2017
928382d
doc: add suggestion to use --3way
mhdawson Apr 19, 2017
b296bd5
src: remove TODO about uv errno removal
danbev Apr 20, 2017
b53d172
test: move test-debugger-repeat-last to sequential
kumarrishav Apr 17, 2017
2b6e588
doc: make commit guidelines easier to reference
bf4 Mar 7, 2017
daf6535
test: dynamic port in cluster worker dgram
Apr 18, 2017
18c56df
doc: fix typo in doc/api/process.md
morrme Apr 23, 2017
fd126b5
tools: add `root: true` in main .eslintrc.yaml
vsemozhetbyt Apr 21, 2017
51794dd
test: dynamic port in parallel cluster tests
Apr 22, 2017
32f905a
test: improve test-process-chdir
vperezma Apr 22, 2017
8044b83
test: refactored context type err message to regex
Apr 22, 2017
0bd0d52
test: replace assertion error check with regex
TheLady Apr 22, 2017
00b6646
url: improve descriptiveness of identifier
Trott Apr 22, 2017
53d5aac
test: dynamic port in cluster ipc throw
Apr 21, 2017
12287f1
test: dynamic port in cluster eaddrinuse
Apr 20, 2017
33821e4
test: use block scoped variable names
neeharv Apr 20, 2017
6e6e63a
lib: fix typo in comments in module.js
WORMSS Apr 20, 2017
f20ebf2
meta: update authors list
aashil Feb 25, 2017
ce795ec
src: remove invalid comment
cjihrig Apr 25, 2017
5ce1089
doc: fix an unclear wording in readline.md
vsemozhetbyt Apr 23, 2017
3cce181
test: add mustCall in test-timers-clearImmediate
ChatbotSchool Apr 22, 2017
b920c5d
tools: enable no-useless-return eslint rule
cjihrig Apr 21, 2017
995423e
benchmark: terminate child process on Windows
Trott Apr 25, 2017
a0f9d59
v8: fix stack overflow in recursive method
bnoordhuis Apr 17, 2017
a679e06
tools: use no-useless-concat ESLint rule
vsemozhetbyt Apr 23, 2017
699e274
doc: add link on logo to README
silverwind Apr 10, 2017
e714243
deps: upgrade libuv to 1.11.0
cjihrig Feb 1, 2017
ae1f6fd
fs: re-enable watch facility in AIX
gireeshpunathil Dec 2, 2016
a1de1ab
test: remove flaky designation for test on AIX
Trott Apr 21, 2017
b09f738
test: cleanup test-fs-watch.js
RobotMermaid Apr 22, 2017
d38364b
deps/v8: add missing #include "unicode/normlzr.h"
ArchangeGabriel May 15, 2017
40859e2
2017-06-06, Version 6.11.0 'Boron' (LTS)
MylesBorins May 16, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: upgrade libuv to 1.10.2
Refs: #9439
Fixes: #9464
Fixes: #9690
PR-URL: #10717
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
  • Loading branch information
cjihrig authored and MylesBorins committed May 18, 2017
commit 738d830f09eb8a9e9f4b9876173f2ca8a4dece50
1 change: 1 addition & 0 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,4 @@ Brad King <brad.king@kitware.com>
Philippe Laferriere <laferriere.phil@gmail.com>
Will Speak <lithiumflame@gmail.com>
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
Eric Sciple <ersciple@microsoft.com>
28 changes: 28 additions & 0 deletions deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
2017.01.10, Version 1.10.2 (Stable), cb9f579a454b8db592030ffa274ae58df78dbe20

Changes since version 1.10.1:

* Now working on version 1.10.2 (cjihrig)

* darwin: fix fsync and fdatasync (Joran Dirk Greef)

* Revert "Revert "win,tty: add support for ANSI codes in win10 v1511""
(Santiago Gimeno)

* win,tty: fix MultiByteToWideChar output buffer (Santiago Gimeno)

* win: remove dead code related to BACKUP_SEMANTICS (Sam Roberts)

* win: fix comment in quote_cmd_arg (Eric Sciple)

* darwin: use clock_gettime in macOS 10.12 (Saúl Ibarra Corretgé)

* win, tty: fix crash on restarting with pending data (Nicholas Vavilov)

* fs: fix uv__to_stat on BSD platforms (Santiago Gimeno)

* win: map ERROR_ELEVATION_REQUIRED to UV_EACCES (Richard Lau)

* win: fix free() on bad input in uv_getaddrinfo() (Ben Noordhuis)


2016.11.17, Version 1.10.1 (Stable), 2e49e332bdede6db7cf17fa784a902e8386d5d86

Changes since version 1.10.0:
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: v1.10.1.build{build}
version: v1.10.2.build{build}

install:
- cinst -y nsis
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.10.1], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.10.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])
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/include/uv-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH 1
#define UV_VERSION_PATCH 2
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""

Expand Down
10 changes: 10 additions & 0 deletions deps/uv/src/unix/darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@
#include <mach-o/dyld.h> /* _NSGetExecutablePath */
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <time.h>
#include <unistd.h> /* sysconf */

#undef NANOSEC
#define NANOSEC ((uint64_t) 1e9)


int uv__platform_loop_init(uv_loop_t* loop) {
loop->cf_state = NULL;
Expand All @@ -53,6 +57,11 @@ void uv__platform_loop_delete(uv_loop_t* loop) {


uint64_t uv__hrtime(uv_clocktype_t type) {
#ifdef MAC_OS_X_VERSION_10_12
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
#else
static mach_timebase_info_data_t info;

if ((ACCESS_ONCE(uint32_t, info.numer) == 0 ||
Expand All @@ -61,6 +70,7 @@ uint64_t uv__hrtime(uv_clocktype_t type) {
abort();

return mach_absolute_time() * info.numer / info.denom;
#endif
}


Expand Down
29 changes: 23 additions & 6 deletions deps/uv/src/unix/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,23 @@
static ssize_t uv__fs_fdatasync(uv_fs_t* req) {
#if defined(__linux__) || defined(__sun) || defined(__NetBSD__)
return fdatasync(req->file);
#elif defined(__APPLE__) && defined(SYS_fdatasync)
return syscall(SYS_fdatasync, req->file);
#elif defined(__APPLE__)
/* Apple's fdatasync and fsync explicitly do NOT flush the drive write cache
* to the drive platters. This is in contrast to Linux's fdatasync and fsync
* which do, according to recent man pages. F_FULLFSYNC is Apple's equivalent
* for flushing buffered data to permanent storage.
*/
return fcntl(req->file, F_FULLFSYNC);
#else
return fsync(req->file);
#endif
}


static ssize_t uv__fs_fsync(uv_fs_t* req) {
#if defined(__APPLE__)
/* See the comment in uv__fs_fdatasync. */
return fcntl(req->file, F_FULLFSYNC);
#else
return fsync(req->file);
#endif
Expand Down Expand Up @@ -798,6 +813,10 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
dst->st_flags = 0;
dst->st_gen = 0;
#elif !defined(_AIX) && ( \
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
defined(_GNU_SOURCE) || \
defined(_BSD_SOURCE) || \
defined(_SVID_SOURCE) || \
Expand All @@ -809,9 +828,7 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
dst->st_mtim.tv_nsec = src->st_mtim.tv_nsec;
dst->st_ctim.tv_sec = src->st_ctim.tv_sec;
dst->st_ctim.tv_nsec = src->st_ctim.tv_nsec;
# if defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
# if defined(__FreeBSD__) || \
defined(__NetBSD__)
dst->st_birthtim.tv_sec = src->st_birthtim.tv_sec;
dst->st_birthtim.tv_nsec = src->st_birthtim.tv_nsec;
Expand Down Expand Up @@ -945,7 +962,7 @@ static void uv__fs_work(struct uv__work* w) {
X(FCHOWN, fchown(req->file, req->uid, req->gid));
X(FDATASYNC, uv__fs_fdatasync(req));
X(FSTAT, uv__fs_fstat(req->file, &req->statbuf));
X(FSYNC, fsync(req->file));
X(FSYNC, uv__fs_fsync(req));
X(FTRUNCATE, ftruncate(req->file, req->off));
X(FUTIME, uv__fs_futime(req));
X(LSTAT, uv__fs_lstat(req->path, &req->statbuf));
Expand Down
1 change: 1 addition & 0 deletions deps/uv/src/win/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ int uv_translate_sys_error(int sys_errno) {
switch (sys_errno) {
case ERROR_NOACCESS: return UV_EACCES;
case WSAEACCES: return UV_EACCES;
case ERROR_ELEVATION_REQUIRED: return UV_EACCES;
case ERROR_ADDRESS_ALREADY_ASSOCIATED: return UV_EADDRINUSE;
case WSAEADDRINUSE: return UV_EADDRINUSE;
case WSAEADDRNOTAVAIL: return UV_EADDRNOTAVAIL;
Expand Down
2 changes: 0 additions & 2 deletions deps/uv/src/win/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ void fs__open(uv_fs_t* req) {
switch (flags & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
case _O_RDONLY:
access = FILE_GENERIC_READ;
attributes |= FILE_FLAG_BACKUP_SEMANTICS;
break;
case _O_WRONLY:
access = FILE_GENERIC_WRITE;
Expand All @@ -418,7 +417,6 @@ void fs__open(uv_fs_t* req) {
if (flags & _O_APPEND) {
access &= ~FILE_WRITE_DATA;
access |= FILE_APPEND_DATA;
attributes &= ~FILE_FLAG_BACKUP_SEMANTICS;
}

/*
Expand Down
3 changes: 1 addition & 2 deletions deps/uv/src/win/getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ int uv_getaddrinfo(uv_loop_t* loop,
int err;

if (req == NULL || (node == NULL && service == NULL)) {
err = WSAEINVAL;
goto error;
return UV_EINVAL;
}

uv_req_init(loop, (uv_req_t*)req);
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/win/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ WCHAR* quote_cmd_arg(const WCHAR *source, WCHAR *target) {
* input : hello\\"world
* output: "hello\\\\\"world"
* input : hello world\
* output: "hello world\"
* output: "hello world\\"
*/

*(target++) = L'"';
Expand Down
107 changes: 97 additions & 10 deletions deps/uv/src/win/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@
#define ANSI_BACKSLASH_SEEN 0x80

#define MAX_INPUT_BUFFER_LENGTH 8192
#define MAX_CONSOLE_CHAR 8192

#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif

static void uv_tty_capture_initial_style(CONSOLE_SCREEN_BUFFER_INFO* info);
static void uv_tty_update_virtual_window(CONSOLE_SCREEN_BUFFER_INFO* info);
Expand Down Expand Up @@ -125,6 +129,14 @@ static char uv_tty_default_fg_bright = 0;
static char uv_tty_default_bg_bright = 0;
static char uv_tty_default_inverse = 0;

typedef enum {
UV_SUPPORTED,
UV_UNCHECKED,
UV_UNSUPPORTED
} uv_vtermstate_t;
/* Determine whether or not ANSI support is enabled. */
static uv_vtermstate_t uv__vterm_state = UV_UNCHECKED;
static void uv__determine_vterm_state(HANDLE handle);

void uv_console_init() {
if (uv_sem_init(&uv_tty_output_lock, 1))
Expand Down Expand Up @@ -168,6 +180,9 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) {
/* shared between all uv_tty_t handles. */
uv_sem_wait(&uv_tty_output_lock);

if (uv__vterm_state == UV_UNCHECKED)
uv__determine_vterm_state(handle);

/* Store the global tty output handle. This handle is used by TTY read */
/* streams to update the virtual window when a CONSOLE_BUFFER_SIZE_EVENT */
/* is received. */
Expand Down Expand Up @@ -989,6 +1004,9 @@ int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb,
if (handle->tty.rd.last_key_len > 0) {
SET_REQ_SUCCESS(&handle->read_req);
uv_insert_pending_req(handle->loop, (uv_req_t*) &handle->read_req);
/* Make sure no attempt is made to insert it again until it's handled. */
handle->flags |= UV_HANDLE_READ_PENDING;
handle->reqs_pending++;
return 0;
}

Expand Down Expand Up @@ -1602,17 +1620,29 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
DWORD* error) {
/* We can only write 8k characters at a time. Windows can't handle */
/* much more characters in a single console write anyway. */
WCHAR utf16_buf[8192];
WCHAR utf16_buf[MAX_CONSOLE_CHAR];
WCHAR* utf16_buffer;
DWORD utf16_buf_used = 0;
unsigned int i;

#define FLUSH_TEXT() \
do { \
if (utf16_buf_used > 0) { \
uv_tty_emit_text(handle, utf16_buf, utf16_buf_used, error); \
utf16_buf_used = 0; \
} \
} while (0)
unsigned int i, len, max_len, pos;
int allocate = 0;

#define FLUSH_TEXT() \
do { \
pos = 0; \
do { \
len = utf16_buf_used - pos; \
if (len > MAX_CONSOLE_CHAR) \
len = MAX_CONSOLE_CHAR; \
uv_tty_emit_text(handle, &utf16_buffer[pos], len, error); \
pos += len; \
} while (pos < utf16_buf_used); \
if (allocate) { \
uv__free(utf16_buffer); \
allocate = 0; \
utf16_buffer = utf16_buf; \
} \
utf16_buf_used = 0; \
} while (0)

#define ENSURE_BUFFER_SPACE(wchars_needed) \
if (wchars_needed > ARRAY_SIZE(utf16_buf) - utf16_buf_used) { \
Expand All @@ -1630,12 +1660,48 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
/* state. */
*error = ERROR_SUCCESS;

utf16_buffer = utf16_buf;

uv_sem_wait(&uv_tty_output_lock);

for (i = 0; i < nbufs; i++) {
uv_buf_t buf = bufs[i];
unsigned int j;

if (uv__vterm_state == UV_SUPPORTED && buf.len > 0) {
utf16_buf_used = MultiByteToWideChar(CP_UTF8,
0,
buf.base,
buf.len,
NULL,
0);

if (utf16_buf_used == 0) {
*error = GetLastError();
break;
}

max_len = (utf16_buf_used + 1) * sizeof(WCHAR);
allocate = max_len > MAX_CONSOLE_CHAR;
if (allocate)
utf16_buffer = uv__malloc(max_len);
if (!MultiByteToWideChar(CP_UTF8,
0,
buf.base,
buf.len,
utf16_buffer,
utf16_buf_used)) {
if (allocate)
uv__free(utf16_buffer);
*error = GetLastError();
break;
}

FLUSH_TEXT();

continue;
}

for (j = 0; j < buf.len; j++) {
unsigned char c = buf.base[j];

Expand Down Expand Up @@ -2193,3 +2259,24 @@ int uv_tty_reset_mode(void) {
/* Not necessary to do anything. */
return 0;
}

/* Determine whether or not this version of windows supports
* proper ANSI color codes. Should be supported as of windows
* 10 version 1511, build number 10.0.10586.
*/
static void uv__determine_vterm_state(HANDLE handle) {
DWORD dwMode = 0;

if (!GetConsoleMode(handle, &dwMode)) {
uv__vterm_state = UV_UNSUPPORTED;
return;
}

dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
if (!SetConsoleMode(handle, dwMode)) {
uv__vterm_state = UV_UNSUPPORTED;
return;
}

uv__vterm_state = UV_SUPPORTED;
}
1 change: 1 addition & 0 deletions deps/uv/test/test-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ TEST_IMPL(error_message) {
TEST_IMPL(sys_error) {
#if defined(_WIN32)
ASSERT(uv_translate_sys_error(ERROR_NOACCESS) == UV_EACCES);
ASSERT(uv_translate_sys_error(ERROR_ELEVATION_REQUIRED) == UV_EACCES);
ASSERT(uv_translate_sys_error(WSAEADDRINUSE) == UV_EADDRINUSE);
ASSERT(uv_translate_sys_error(ERROR_BAD_PIPE) == UV_EPIPE);
#else
Expand Down
20 changes: 11 additions & 9 deletions deps/uv/test/test-fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,22 +1141,24 @@ TEST_IMPL(fs_fstat) {
ASSERT(s->st_mtim.tv_nsec == t.st_mtimensec);
ASSERT(s->st_ctim.tv_sec == t.st_ctime);
ASSERT(s->st_ctim.tv_nsec == t.st_ctimensec);
#elif defined(__sun) || \
defined(_GNU_SOURCE) || \
defined(_BSD_SOURCE) || \
defined(_SVID_SOURCE) || \
defined(_XOPEN_SOURCE) || \
#elif defined(__sun) || \
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
defined(_GNU_SOURCE) || \
defined(_BSD_SOURCE) || \
defined(_SVID_SOURCE) || \
defined(_XOPEN_SOURCE) || \
defined(_DEFAULT_SOURCE)
ASSERT(s->st_atim.tv_sec == t.st_atim.tv_sec);
ASSERT(s->st_atim.tv_nsec == t.st_atim.tv_nsec);
ASSERT(s->st_mtim.tv_sec == t.st_mtim.tv_sec);
ASSERT(s->st_mtim.tv_nsec == t.st_mtim.tv_nsec);
ASSERT(s->st_ctim.tv_sec == t.st_ctim.tv_sec);
ASSERT(s->st_ctim.tv_nsec == t.st_ctim.tv_nsec);
# if defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__)
# if defined(__FreeBSD__) || \
defined(__NetBSD__)
ASSERT(s->st_birthtim.tv_sec == t.st_birthtim.tv_sec);
ASSERT(s->st_birthtim.tv_nsec == t.st_birthtim.tv_nsec);
ASSERT(s->st_flags == t.st_flags);
Expand Down
Loading