platform/upstream/nodejs.git
8 years agomodule: remove unnecessary JSON.stringify
Andres Suarez [Thu, 29 Oct 2015 00:12:35 +0000 (17:12 -0700)]
module: remove unnecessary JSON.stringify

`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.

PR-URL: https://github.com/nodejs/node/pull/3578
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodoc: made code spans more visible in the API docs
phijohns [Wed, 28 Oct 2015 19:59:02 +0000 (20:59 +0100)]
doc: made code spans more visible in the API docs

This makes the code spans in the API docs more visible and
therefore readable by adding some background color.

PR-URL: https://github.com/nodejs/node/pull/3573
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agoAdd missing va_end before return
Ömer Fadıl Usta [Wed, 28 Oct 2015 12:49:51 +0000 (15:49 +0300)]
Add missing va_end before return

PR-URL: https://github.com/nodejs/node/pull/3565
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: added what buf.copy returns
Manuel B [Wed, 28 Oct 2015 00:39:23 +0000 (01:39 +0100)]
doc: added what buf.copy returns

as of https://github.com/nodejs/node/blob/v5.x/src/node_buffer.cc#L555

buf.copy returns the number of bytes copied.

PR-URL: https://github.com/nodejs/node/pull/3555
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: add test-zlib-flush-drain
Myles Borins [Wed, 11 Nov 2015 22:49:35 +0000 (14:49 -0800)]
test: add test-zlib-flush-drain

This test assures that if flush is called while the zlib object needs
to be drained that it will defer the callback until after the drain.

PR-URL: https://github.com/nodejs/node/pull/3534
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agozlib: only apply drain listener if given callback
Craig Cavalier [Mon, 26 Oct 2015 21:40:56 +0000 (14:40 -0700)]
zlib: only apply drain listener if given callback

When stream.flush() is called without a callback, an empty listener is
being added. Since flush may be called multiple times to push SSE's
down to the client, multiple noop listeners are being added. This in
turn causes the memory leak detected message.

PR-URL: https://github.com/nodejs/node/pull/3534
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agozlib: pass kind to recursive calls to flush
Myles Borins [Mon, 26 Oct 2015 21:39:05 +0000 (14:39 -0700)]
zlib: pass kind to recursive calls to flush

Bug spotted by @bnoordhuis while doing code review on #3534

Refs: https://github.com/nodejs/node/pull/3534#discussion_r43047477
PR-URL: https://github.com/nodejs/node/pull/3534
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc:fix function param order in assert doc
David Woods [Mon, 26 Oct 2015 17:51:30 +0000 (13:51 -0400)]
doc:fix function param order in assert doc

PR-URL: https://github.com/nodejs/node/pull/3533
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agodoc: add note about timeout delay > TIMEOUT_MAX
Guilherme Souza [Sun, 25 Oct 2015 01:56:49 +0000 (23:56 -0200)]
doc: add note about timeout delay > TIMEOUT_MAX

When setTimeout() and setInterval() are called with `delay` greater than
TIMEOUT_MAX (2147483647), the supplied value is ignored and 1 is used
instead. Add a note about this in the timers docs.

PR-URL: https://github.com/nodejs/node/pull/3512
Reviewed-By: Trevor Norris <trev.norris@gmai.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
8 years agosrc: Revert "nix stdin _readableState.reading"
Roman Reiss [Mon, 26 Oct 2015 12:30:54 +0000 (13:30 +0100)]
src: Revert "nix stdin _readableState.reading"

This reverts 8cee8f5 which was causing stdin to behave strangely on
Windows 8 and 10. The suspected explanation for the issue is that there
might be a race condition occuring when stdin._readableState.reading is
set indirectly through `push('')`.

PR-URL: https://github.com/nodejs/node/pull/3490
Fixes: https://github.com/nodejs/node/issues/2996
Fixes: https://github.com/nodejs/node/issues/2504
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
8 years agodoc: add caveats of algs and key size in crypto
Shigeki Ohtsu [Mon, 27 Jul 2015 07:10:57 +0000 (16:10 +0900)]
doc: add caveats of algs and key size in crypto

Add description of user responsibility in the choice of cypto
algorithms and its key length. Some of recommendations for the safer
use are also described.

PR-URL: https://github.com/nodejs/node/pull/3479
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agorepl: To exit, press ^C again or type .exit.
Hemanth.HM [Sat, 7 Nov 2015 08:18:40 +0000 (13:48 +0530)]
repl: To exit, press ^C again or type .exit.

When the user hits `^C` in the REPL show more info about `.exit`.

The idea was to give more info to the user when they hit ^C.
Current version just displays `(^C again to quit)` and most
of the users are not aware of the `.exit` command that would
Exit the repl.

PR-URL: https://github.com/nodejs/node/pull/3368
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: add method links in events.markdown
Alejandro Oviedo [Fri, 6 Nov 2015 14:00:16 +0000 (11:00 -0300)]
doc: add method links in events.markdown

Added referenced method links.

PR-URL: https://github.com/nodejs/node/pull/3187
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agodoc: stdout/stderr can block when directed to file
Ben Noordhuis [Sat, 3 Oct 2015 22:15:08 +0000 (00:15 +0200)]
doc: stdout/stderr can block when directed to file

Update the documentation for `process.stdout` and `process.stdout` to
clarify that writes can block when stdio is redirected to a file.  In
all other cases, it's non-blocking.

PR-URL: https://github.com/nodejs/node/pull/3170
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodocs: fs - change links to buffer encoding to Buffer class anchor
fansworld-claudio [Tue, 13 Oct 2015 19:15:06 +0000 (16:15 -0300)]
docs: fs - change links to buffer encoding to Buffer class anchor

PR-URL: https://github.com/nodejs/node/pull/2796
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agobuild: fix configuring with prebuilt libraries
Markus Tzoe [Wed, 30 Sep 2015 18:27:17 +0000 (02:27 +0800)]
build: fix configuring with prebuilt libraries

Fix configure_library() to produce correct LDFLAGS when configuring with
prebuilt 3rd-party libraries (libuv, openssl, etc) using `pkg-config' or
`--shared-{LIBRARY}-includes=xxx --shared-{LIBRARY}-libpath=xxx'.

PR-URL: https://github.com/nodejs/node/pull/3135
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agotest: enhance fs-watch-recursive test
Sakthipriyan Vairamani [Fri, 28 Aug 2015 14:38:39 +0000 (20:08 +0530)]
test: enhance fs-watch-recursive test

This patch

  - issues a TAP plugin parsable message on non darwin/windows boxes
  - uses `const` wherever applicable
  - moves the test to parallel

PR-URL: https://github.com/nodejs/node/pull/2599
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodeps: upgrade npm to 2.14.9
Forrest L Norvell [Fri, 6 Nov 2015 02:28:06 +0000 (18:28 -0800)]
deps: upgrade npm to 2.14.9

Dependency upgrades.

PR-URL: https://github.com/nodejs/node/pull/3686
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agoWorking on v4.2.4
Rod Vagg [Fri, 4 Dec 2015 03:33:33 +0000 (14:33 +1100)]
Working on v4.2.4

8 years ago2015-12-04, Version 4.2.3 "Argon" (LTS) Release upstream/4.2.3 v4.2.3
Rod Vagg [Thu, 3 Dec 2015 11:57:34 +0000 (22:57 +1100)]
2015-12-04, Version 4.2.3 "Argon" (LTS) Release

Security Update

Notable items:

* http: Fix a bug where an HTTP socket may no longer have a socket
  but a pipelined request triggers a pause or resume, a potential
  denial-of-service vector. (Fedor Indutny)
* openssl: Upgrade to 1.0.2e, containing fixes for:
  - CVE-2015-3193 "BN_mod_exp may produce incorrect results on x86_64",
    an attack is considered feasible against a Node.js TLS server using
    DHE key exchange. Details are available at
    <http://openssl.org/news/secadv/20151203.txt>.
  - CVE-2015-3194 "Certificate verify crash with missing PSS parameter",
    a potential denial-of-service vector for Node.js TLS servers; TLS
    clients are also impacted. Details are available at
    <http://openssl.org/news/secadv/20151203.txt>.
  (Shigeki Ohtsu) #4134
* v8: Backport fixes for a bug in `JSON.stringify()` that can result
  in out-of-bounds reads for arrays. (Ben Noordhuis)

PR-URL: https://github.com/nodejs/node-private/pull/12

8 years agodeps: upgrade openssl sources to 1.0.2e
Shigeki Ohtsu [Thu, 3 Dec 2015 15:41:27 +0000 (00:41 +0900)]
deps: upgrade openssl sources to 1.0.2e

This just replaces all sources of openssl-1.0.2e.tar.gz into
deps/openssl/openssl

deps: copy all openssl header files to include dir

All symlink files in `deps/openssl/openssl/include/openssl/`
are removed and replaced with real header files to avoid
issues on Windows. Two files of opensslconf.h in crypto and
include dir are replaced to refer config/opensslconf.h.

deps: fix openssl assembly error on ia32 win32

`x86masm.pl` was mistakenly using .486 instruction set, why `cpuid` (and
perhaps others) are requiring .686 .

deps: fix asm build error of openssl in x86_win32

See
https://mta.openssl.org/pipermail/openssl-dev/2015-February/000651.html

node needs to stop using masm and move to nasm or yasm on Win32.

openssl: fix keypress requirement in apps on win32

Reapply b910613792dac946b295855963869933a9089044 .

deps: add -no_rand_screen to openssl s_client

In openssl s_client on Windows, RAND_screen() is invoked to initialize
random state but it takes several seconds in each connection.
This added -no_rand_screen to openssl s_client on Windows to skip
RAND_screen() and gets a better performance in the unit test of
test-tls-server-verify.
Do not enable this except to use in the unit test.

deps: update openssl config files

Regenrate config files for supported platforms with Makefile.

deps: update openssl asm and asm_obsolete files

Regenerate asm files with Makefile and CC=gcc and ASM=gcc where
gcc-4.8.4. Also asm files in asm_obsolete dir to support old compiler
and assmebler are regenerated without CC and ASM envs.

PR-URL: https://github.com/nodejs/node/pull/4134
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agodeps: backport a7e50a5 from upstream v8
Ben Noordhuis [Wed, 18 Nov 2015 17:12:52 +0000 (18:12 +0100)]
deps: backport a7e50a5 from upstream v8

PR-URL: https://github.com/nodejs/node-private/pull/8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agodeps: backport 6df9a1d from upstream v8
Ben Noordhuis [Sat, 14 Nov 2015 15:18:14 +0000 (16:18 +0100)]
deps: backport 6df9a1d from upstream v8

PR-URL: https://github.com/nodejs/node-private/pull/8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agohttp: fix pipeline regression
Fedor Indutny [Thu, 29 Oct 2015 18:17:37 +0000 (14:17 -0400)]
http: fix pipeline regression

Always check that socket still has the parser. It may be destroyed
interim, and we may end up with an uncaught exception.

Fix: https://github.com/nodejs/node/issues/3508
PR-URL: https://github.com/nodejs/node-private/pull/5
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agoWorking on v4.2.3
James M Snell [Tue, 3 Nov 2015 20:05:51 +0000 (12:05 -0800)]
Working on v4.2.3

8 years ago2015-11-03, Version 4.2.2 "Argon" (LTS) Release v4.2.2
James M Snell [Thu, 29 Oct 2015 15:58:41 +0000 (08:58 -0700)]
2015-11-03, Version 4.2.2 "Argon" (LTS) Release

8 years agodoc: fix typos in changelog
reggi [Fri, 9 Oct 2015 13:15:38 +0000 (09:15 -0400)]
doc: fix typos in changelog

PR-URL: https://github.com/nodejs/node/pull/3291
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agotest: split independent tests into separate files
Rich Trott [Tue, 27 Oct 2015 16:40:41 +0000 (09:40 -0700)]
test: split independent tests into separate files

Move ENOENT related tests out of general fs.watch() test file and into
its own file. This may help diagnose
https://github.com/nodejs/node/issues/3541.

PR-URL: https://github.com/nodejs/node/pull/3548
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
8 years agotest: add node::MakeCallback() test coverage
Ben Noordhuis [Wed, 21 Oct 2015 23:30:19 +0000 (01:30 +0200)]
test: add node::MakeCallback() test coverage

PR-URL: https://github.com/nodejs/node/pull/3478
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agodoc: more use-cases for promise events
Domenic Denicola [Thu, 26 Feb 2015 23:17:15 +0000 (18:17 -0500)]
doc: more use-cases for promise events

This adds an example of a semi-common promise pattern that could
result in false-positive 'unhandledRejection' events, to help motivate
why there is a dual 'rejectionHandled' event. I anticipate it being
helpful to users who encounter 'unhandledRejection' events that do not
stem from obvious typos such as the JSON.pasre example.

Also cleans up the promise rejection tracking sample. By using a Map
instead of array we can get O(1) deletion and actually record the errors.
And, fixed indentation and backtick usage there to align with the rest of
the document.

Reviewed-By: Stephan Belanger <admin@stephenbelanger.com>
Reviewed-By: Petka Antonov <petka.antonov@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3438

8 years agobuild: rectify --link-module help text
P.S.V.R [Thu, 15 Oct 2015 08:38:46 +0000 (16:38 +0800)]
build: rectify --link-module help text

PR-URL: https://github.com/nodejs/node/pull/3379
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodoc: remove old note, 'cluster' is marked stable
Balázs Galambosi [Sat, 10 Oct 2015 18:23:05 +0000 (20:23 +0200)]
doc: remove old note, 'cluster' is marked stable

Fixes: https://github.com/nodejs/node/issues/3313
PR-URL: https://github.com/nodejs/node/pull/3314
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
8 years agodoc: createServer's key option can be an array
Sakthipriyan Vairamani [Wed, 30 Sep 2015 02:33:43 +0000 (08:03 +0530)]
doc: createServer's key option can be an array

The `tls` module's `createServer` and `createSecureContext` accept
`key` option and it can be an array of keys as well. This patch
explains the format of the entries in that array.

Corresponding code:
https://github.com/nodejs/node/blob/v4.1.1/lib/_tls_common.js#L73-L90

PR-URL: https://github.com/nodejs/node/pull/3123
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
8 years agodoc: binary encoding is not deprecated
Trevor Norris [Mon, 19 Oct 2015 20:06:51 +0000 (14:06 -0600)]
doc: binary encoding is not deprecated

When v8 implemented proper one-byte string support Node's internal
"binary" encoding implementation was removed in favor of it. The result
was that "binary" encoding effectively became "latin-1" encoding.
Because of this and because one-byte strings are natively supported by
v8 the buffer encoding is not deprecated and will not be removed.

Ref: 83261e7 "deps: update v8 to 3.17.13"
PR-URL: https://github.com/nodejs/node/pull/3441
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
8 years agov8: pull fix for builtin code size on PPC
Michael Dawson [Wed, 21 Oct 2015 20:40:27 +0000 (16:40 -0400)]
v8: pull fix for builtin code size on PPC

Pull in the change that has been committed to v8 master in
https://codereview.chromium.org/1415463002/.  We are currently
cherry-picking into 4.6 and 4.7 but until next next v8 update
into Node Master I'd like to float it as it will make PPC LE
go green in the CI

Fixes: https://github.com/nodejs/node/issues/3390
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
PR-URL: https://github.com/nodejs/node/pull/3474

8 years agotest: use port number from env in tls socket test
Stefan Budeanu [Wed, 28 Oct 2015 02:52:15 +0000 (22:52 -0400)]
test: use port number from env in tls socket test

Tests normally use common.PORT to allow the user to select which port
number to listen on. Hardcoding the port number will cause parallel
instances of the test to fail.

PR-URL: https://github.com/nodejs/node/pull/3557
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
8 years agotest: fix heap-profiler link error LNK1194 on win
Junliang Yan [Wed, 28 Oct 2015 19:57:13 +0000 (15:57 -0400)]
test: fix heap-profiler link error LNK1194 on win

Fix the following error message in windows using VS 2013:

    LINK : fatal error LNK1194: cannot delay-load 'node.exe'
    due to import of data symbol '"__declspec(dllimport)
    const v8::OutputStream::`vftable'"
    (__imp_??_7OutputStream@v8@@6B@)'; link without
    /DELAYLOAD:node.exe

PR-URL: https://github.com/nodejs/node/pull/3572
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agosrc: wrap source before doing syntax check
Evan Lucas [Thu, 29 Oct 2015 16:22:00 +0000 (11:22 -0500)]
src: wrap source before doing syntax check

This is to ensure that it is evaluated the same way it would be if it
were to be run by node or required.

Before, the following would pass if run by node, but fail if run via
the syntax check flag:

    if (true) {
      return;
    }

Now, this will pass the syntax check

PR-URL: https://github.com/nodejs/node/pull/3587
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agotest: fix missing unistd.h on windows
Junliang Yan [Mon, 26 Oct 2015 12:39:13 +0000 (08:39 -0400)]
test: fix missing unistd.h on windows

PR-URL: https://github.com/nodejs/node/pull/3532
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agotest: add regression test for --debug-brk -e 0
Ben Noordhuis [Thu, 29 Oct 2015 12:39:56 +0000 (13:39 +0100)]
test: add regression test for --debug-brk -e 0

Check that `node --debug-brk -e 0` immediately quits.

PR-URL: https://github.com/nodejs/node/pull/3585
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: mention the behaviour if URL is invalid
Sakthipriyan Vairamani [Sun, 20 Sep 2015 06:59:24 +0000 (12:29 +0530)]
doc: mention the behaviour if URL is invalid

If the URL passed to `http.request` is not properly parsable by `url.parse`, we
fall back to use `localhost` and port 80. This creates confusing error messages
like in this question http://stackoverflow.com/q/32675907/1903116.

PR-URL: https://github.com/nodejs/node/pull/2966
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodeps: backport 010897c from V8 upstream
Ali Ijaz Sheikh [Mon, 26 Oct 2015 00:19:58 +0000 (17:19 -0700)]
deps: backport 010897c from V8 upstream

This is a reland of https://github.com/nodejs/node/pull/3165. The patch abates
the truncation of script filenames in the perf-event output produced by V8.

V8 commits:
Original: https://github.com/v8/v8/commit/03ef3cd004c2fd31ae7e48772f106df67b8c2feb
Reland: https://github.com/v8/v8/commit/010897c16adb46d3fe403eab525502a63e174b0c

Original commit message:
  improve perf_basic_prof filename reporting

  The buffer used for appending filenames to the string printed to the
  perf_basic_prof log was unnecessarily too small. Bump it up to be at least
  kUtf8BufferSize.

  Truncation of filenames makes it really hard to work with profiles gathered on
  Node.js. Because of the way Node.js works, you can have node module dependencies
  in deeply nested directories. The last thing you want when investigating a
  performance problem is to have script names be truncated.

  This patch is a stop-gap. Ideally, I want no truncation of the filename at all
  and use a dynamically growing buffer. That would be a larger change, and I
  wanted to have a quick fix available that can be back-ported to Node.js LTS
  release.

  R=yangguo@chromium.org,yurys@chromium.org
  BUG=

  Review URL: https://codereview.chromium.org/1388543002

PR-URL: https://github.com/nodejs/node/pull/3520
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
8 years agosrc: fix race condition in debug signal on exit
Ben Noordhuis [Mon, 26 Oct 2015 13:11:03 +0000 (14:11 +0100)]
src: fix race condition in debug signal on exit

Before this commit, sending a SIGUSR1 at program exit could trigger a
hard to reproduce race condition where `v8::Debug::DebugBreak(isolate)`
got called when the isolate was in the process of being torn down.

A similar race condition is in theory possible when sending signals
to two threads simultaneously but I haven't been able to reproduce
that myself (and I tried, oh how I tried.)

This commit fixes the race condition by turning `node_isolate` into
a `std::atomic` and using it as an ad hoc synchronization primitive
in places where that is necessary.

A bare minimum std::atomic polyfill is added for OS X because Apple
wouldn't be Apple if things just worked out of the box.

PR-URL: https://github.com/nodejs/node/pull/3528
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agorepl: handle comments properly
Sakthipriyan Vairamani [Sat, 24 Oct 2015 07:46:08 +0000 (13:16 +0530)]
repl: handle comments properly

As it is, the comments are not handled properly in REPL. So, if the
comments have `'` or `"`, then they are treated as incomplete string
literals and the error is thrown in REPL.

This patch refactors the existing logic and groups everything in a
class.

Fixes: https://github.com/nodejs/node/issues/3421
PR-URL: https://github.com/nodejs/node/pull/3515
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agotimers: reuse timer in `setTimeout().unref()`
Fedor Indutny [Fri, 16 Oct 2015 19:34:15 +0000 (15:34 -0400)]
timers: reuse timer in `setTimeout().unref()`

Instead of creating new timer - reuse the timer from the freelist. This
won't make the freelist timer active for the duration of `uv_close()`,
and will let the event-loop exit properly.

Fix: #1264
PR-URL: https://github.com/nodejs/node/pull/3407
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agotest: port domains regression test from v0.10
Jonas Dohse [Wed, 14 Oct 2015 01:38:45 +0000 (18:38 -0700)]
test: port domains regression test from v0.10

f2a45caf2e1b73fea01fa9a941bc61096a999664 contained a test for a
regression that had been introduced by the original change that
77a10ed05f1e413818d29f07cbb268108b1f08fa ported. While
77a10ed05f1e413818d29f07cbb268108b1f08fa did not contain that
regression, the test that f2a45caf2e1b73fea01fa9a941bc61096a999664
contained should still be in the code base to prevent any regression
from happening in the future.

Original message for the commit that contained the test:

  domains: fix stack clearing after error handled

  caeb67735baa8e069902e23f21d01033907c4f33 introduced a regression where
  the domains stack would not be cleared after an error had been handled
  by the top-level domain.

  This change clears the domains stack regardless of the position of the
  active domain in the stack.

  PR: #9364
  PR-URL: https://github.com/joyent/node/pull/9364
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR: #3356
PR-URL: https://github.com/nodejs/node/pull/3356
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
8 years agotest: remove util from common
Rich Trott [Mon, 12 Oct 2015 05:14:01 +0000 (22:14 -0700)]
test: remove util from common

util is loaded just for one use of util.format(). Replace it with a
string template. While we're at it, delete nearby lengthy comment
justifying use of fs.readFileSync().

PR-URL: https://github.com/nodejs/node/pull/3324
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed By: Evan Lucas <evanlucas@me.com>

8 years agotest: remove util properties from common
Rich Trott [Fri, 9 Oct 2015 22:26:55 +0000 (15:26 -0700)]
test: remove util properties from common

common does not need util properties anymore. Remove them.

PR-URL: https://github.com/nodejs/node/pull/3304
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agosrc: fix exception message encoding on Windows
Brian White [Tue, 13 Oct 2015 21:18:15 +0000 (17:18 -0400)]
src: fix exception message encoding on Windows

The printf family of functions do not properly display UTF8
strings well on Windows. Use the appropriate wide character
API instead if stderr is a tty.

PR-URL: https://github.com/nodejs/node/pull/3288
Fixes: https://github.com/nodejs/node/issues/3284
Reviewed-By: Bert Belder <bertbelder@gmail.com>
8 years agotest: split up buffer tests for reliability
Rich Trott [Mon, 12 Oct 2015 03:53:31 +0000 (20:53 -0700)]
test: split up buffer tests for reliability

The Pi 1's in CI don't always fail on the buffer.toString() tests. But
they time out sometimes, so let's split the tests up so they don't.

PR-URL: https://github.com/nodejs/node/pull/3323
Reviewed By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed By: Trevor Norris <trev.norris@gmail.com>

8 years agotest: parallelize long-running test
Rich Trott [Thu, 8 Oct 2015 20:56:34 +0000 (13:56 -0700)]
test: parallelize long-running test

Fixes a persistently troublesome failing test by splitting it
out into multiple parallel tests.

Reviewed By: Evan Lucas <evanlucas@me.com>
Reviewed By: Trevor Norris <trev.norris@gmail.com>
Reviewed By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3287

8 years agotest: change call to deprecated util.isError()
Rich Trott [Sat, 26 Sep 2015 23:29:41 +0000 (16:29 -0700)]
test: change call to deprecated util.isError()

common.Error() is just util.isError() which is deprecated. Use
assert.throws() instead.

PR-URL: https://github.com/nodejs/node/pull/3084
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
8 years agodeps: backport 8d6a228 from the v8's upstream
Fedor Indutny [Tue, 27 Oct 2015 16:54:42 +0000 (12:54 -0400)]
deps: backport 8d6a228 from the v8's upstream

Original commit message:

    [heap] fix crash during the scavenge of ArrayBuffer
    Scavenger should not attempt to visit ArrayBuffer's storage, it is a
    user-supplied pointer that may have any alignment. Visiting it, may
    result in a crash.

    BUG=
    R=jochen

    Review URL: https://codereview.chromium.org/1406133003

    Cr-Commit-Position: refs/heads/master@{#31611}

PR-URL: https://github.com/nodejs/node/pull/3549
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agolib: fix cluster handle leak
Rich Trott [Sat, 24 Oct 2015 18:51:10 +0000 (11:51 -0700)]
lib: fix cluster handle leak

It is possible to cause a resource leak in SharedHandle. This commit
fixes the leak.

Fixes: https://github.com/nodejs/node/issues/2510
PR-URL: https://github.com/nodejs/node/pull/3510
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agotest: improve tests for util.inherits
Michaël Zasso [Sat, 24 Oct 2015 08:42:29 +0000 (10:42 +0200)]
test: improve tests for util.inherits

inherits is used in lib and tests but its functionality itself is not
tested yet.

PR-URL: https://github.com/nodejs/node/pull/3507
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agotest: print helpful err msg on test-dns-ipv6.js
Junliang Yan [Fri, 23 Oct 2015 16:48:36 +0000 (12:48 -0400)]
test: print helpful err msg on test-dns-ipv6.js

The test sometimes fail on an assertion but no useful error message
was generated for debugging. Modify the test to generate useful
debugging message.

PR-URL: https://github.com/nodejs/node/pull/3501
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
8 years agobuffer: fix value check for writeUInt{B,L}E
Trevor Norris [Fri, 23 Oct 2015 18:34:11 +0000 (12:34 -0600)]
buffer: fix value check for writeUInt{B,L}E

Fixes: https://github.com/nodejs/node/issues/3497
PR-URL: https://github.com/nodejs/node/pull/3500
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agotest: fix domain with abort-on-uncaught on PPC
Julien Gilli [Wed, 14 Oct 2015 00:07:35 +0000 (17:07 -0700)]
test: fix domain with abort-on-uncaught on PPC

Add SIGTRAP and the corresponding exit code to the list of signals/exit
codes that are expected when running tests that throw an uncaught error
and have --abort-on-uncaught-exception enabled.

Also refactor a bit related comments so that they better reflect what's
actually happening.

Fixes #3239.

PR: #3354
PR-URL: https://github.com/nodejs/node/pull/3354
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
8 years agofs: reduced duplicate code in fs.write()
ronkorving [Fri, 18 Sep 2015 08:36:57 +0000 (17:36 +0900)]
fs: reduced duplicate code in fs.write()

PR-URL: https://github.com/nodejs/node/pull/2947
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agorepl: limit persistent history correctly on load
Jeremiah Senkpiel [Wed, 7 Oct 2015 06:01:28 +0000 (23:01 -0700)]
repl: limit persistent history correctly on load

Previously the wrong end of the history was limited on load.

PR-URL: https://github.com/nodejs/node/pull/2356
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed By: Evan Lucas <evanlucas@me.com>

8 years agotest: cleanup, improve repl-persistent-history
Jeremiah Senkpiel [Wed, 7 Oct 2015 06:00:31 +0000 (23:00 -0700)]
test: cleanup, improve repl-persistent-history

- Now cleans up the history file unless told otherwise.
- Now also logs which test case failed.
- Waits for flush after repl close if necessary.

Fixes: https://github.com/nodejs/node/issues/2319
PR-URL: https://github.com/nodejs/node/pull/2356
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed By: Evan Lucas <evanlucas@me.com>

8 years agotest: add Symbol test for assert.deepEqual()
Rich Trott [Mon, 12 Oct 2015 16:50:56 +0000 (09:50 -0700)]
test: add Symbol test for assert.deepEqual()

The existing test never ran because typeof Symbol === 'function' and not
'symbol'. We have Symbols now so remove the check and just run the test.

PR-URL: https://github.com/nodejs/node/pull/3327
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agobuffer: don't CHECK on zero-sized realloc
Ben Noordhuis [Fri, 23 Oct 2015 17:10:49 +0000 (19:10 +0200)]
buffer: don't CHECK on zero-sized realloc

malloc(0) and realloc(ptr, 0) have implementation-defined behavior in
that the standard allows them to either return a unique pointer or a
nullptr for zero-sized allocation requests.  Normalize by always using
a nullptr.

Fixes: https://github.com/nodejs/node/issues/3496
PR-URL: https://github.com/nodejs/node/pull/3499
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agotest: disable test-tick-processor - aix and be ppc
Michael Dawson [Thu, 22 Oct 2015 20:15:33 +0000 (16:15 -0400)]
test: disable test-tick-processor - aix and be ppc

This test is already partially disabled for several platforms with
the comment that the required info is not provided at the C++ level.
I'm adding AIX as and PPC BE linux as they currently fall into
the same category.  We are working to see if we can change that
in v8 but it will be non-trivial if is possible at all so I don't
want to leave the CI with failing tests until that point.

PR-URL: https://github.com/nodejs/node/pull/3491
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
8 years agotest: harden test-child-process-fork-regr-gh-2847
Michael Dawson [Tue, 20 Oct 2015 22:35:34 +0000 (18:35 -0400)]
test: harden test-child-process-fork-regr-gh-2847

test-child-process-fork-regr-gh-2847 could fail depending
on timing and how messages were packed into tcp packets.
If all of the requests fit into one packet then the test
worked otherwise, otherwise errors could occur.  This PR
modifies the test to be tolerant while still validating that
some of the connection can be made succesfully

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3459

8 years agotest: fix test-net-keepalive for AIX
Imran Iqbal [Tue, 20 Oct 2015 20:58:16 +0000 (16:58 -0400)]
test: fix test-net-keepalive for AIX

Fixed an intermittent issue on AIX where the 100ms timeout was reached
before the 'connection' event was fired. This resulted in a failure as
serverConnection would be undefined and the assert.equal would throw an
error. Changed the flow of the test so that the timeout is only set
after a connection has been made.

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: https://github.com/nodejs/node/pull/3458

8 years agotest: wrap assert.fail when passed to callback
Myles Borins [Tue, 20 Oct 2015 18:40:54 +0000 (11:40 -0700)]
test: wrap assert.fail when passed to callback

Currently there are many instances where assert.fail is directly passed
to a callback for error handling. Unfortunately this will swallow the
error as it is the third argument of assert.fail that sets the message
not the first.

This commit adds a new function to test/common.js that simply wraps
assert.fail and calls it with the provided message.

Tip of the hat to @trott for pointing me in the direction of this.

PR-URL: https://github.com/nodejs/node/pull/3453
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
8 years agotest: skip test-dns-ipv6.js if ipv6 is unavailable
Junliang Yan [Mon, 19 Oct 2015 19:30:11 +0000 (15:30 -0400)]
test: skip test-dns-ipv6.js if ipv6 is unavailable

Test should be skipped if ipv6 is unavailable on the running system.

Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3444

8 years agodocs: add missing shell option to execSync
fansworld-claudio [Mon, 19 Oct 2015 19:10:18 +0000 (16:10 -0300)]
docs: add missing shell option to execSync

Adds the "shell" option from child_process.exec to
child_process.execSync on the api docs.

Fixes: #3387
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3440

8 years agotest: repl-persistent-history is no longer flaky
Jeremiah Senkpiel [Mon, 19 Oct 2015 15:57:55 +0000 (11:57 -0400)]
test: repl-persistent-history is no longer flaky

The race conditions were fixed in
286ef1daca1c1f3e3363ee162fb97fb823632352

PR-URL: https://github.com/nodejs/node/pull/3437
Reviewed By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
8 years agotest: fix flaky test-child-process-emfile
Rich Trott [Sun, 18 Oct 2015 21:42:44 +0000 (14:42 -0700)]
test: fix flaky test-child-process-emfile

Require the test setup to obtain an EMFILE error and not ENFILE as
ENFILE means there is a race condition with other processes that may
close files before `spawn()` is called by the test.

Fixes: https://github.com/nodejs/node/issues/2666
PR-URL: https://github.com/nodejs/node/pull/3430
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: remove flaky status from eval_messages test
Rich Trott [Sun, 18 Oct 2015 01:52:15 +0000 (18:52 -0700)]
test: remove flaky status from eval_messages test

This test has not failed on armv7-wheezy in over 6 weeks. Let's remove its
"flaky" status.

Fixes: https://github.com/nodejs/node/issues/2672
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3420

8 years agotest: fix flaky test for symlinks
Rich Trott [Sat, 17 Oct 2015 04:07:21 +0000 (21:07 -0700)]
test: fix flaky test for symlinks

If the symlink portion of the test was being skipped due to a
combination of OS support and user privileges, then an assertion would
always fail. This fixes that problem, improves assertion error reporting
and splits the test to make it clear that it is a test for links and
symlinks.

Fixes: https://github.com/nodejs/node/issues/3311
PR-URL: https://github.com/nodejs/node/pull/3418
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
8 years agotest: apply correct assert.fail() arguments
Rich Trott [Thu, 15 Oct 2015 04:22:55 +0000 (21:22 -0700)]
test: apply correct assert.fail() arguments

The assert.fail function signature has the message as the third argument
but, understandably, it is often assumed that it is the first argument
(or at least the first argument if no other arguments are passed).

This corrects the assert.fail() invocations in the Node.js tests.

Before:
assert.fail('message');
// result: AssertionError: 'message' undefined undefined

After:
assert.fail(null, null, 'message');
// result: AssertionError: message

PR-URL: https://github.com/nodejs/node/pull/3378
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodoc: fix indent in tls resumption example
Roman Reiss [Wed, 14 Oct 2015 19:45:12 +0000 (21:45 +0200)]
doc: fix indent in tls resumption example

Markdown requires 4-space indent to correctly format code blocks. This
fixes the example so it's correctly presented as code.

PR-URL: https://github.com/nodejs/node/pull/3372
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agotest: replace util with backtick strings
Myles Borins [Tue, 13 Oct 2015 04:26:50 +0000 (21:26 -0700)]
test: replace util with backtick strings

Now that we have backticks we no longer need to use util.format
to template strings!

This commit was inspired by #3324, and it replaces instances of
util.format with backtick strings in a number of tests

Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3359

8 years agodoc: fix typo in changelog
Timothy Gu [Tue, 13 Oct 2015 23:20:21 +0000 (16:20 -0700)]
doc: fix typo in changelog

PR-URL: https://github.com/nodejs/node/pull/3353
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
8 years agolib: avoid REPL exit on completion error
Rich Trott [Wed, 14 Oct 2015 04:39:16 +0000 (21:39 -0700)]
lib: avoid REPL exit on completion error

If a tab completion is attempted on an undefined reference inside of a
function, the REPL was exiting without reporting an error or anything
else. This change results in the REPL reporting the ReferenceError and
continuing.

Fixes: https://github.com/nodejs/node/issues/3346
PR-URL: https://github.com/nodejs/node/pull/3358
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: add test-child-process-emfile fail message
Rich Trott [Tue, 13 Oct 2015 03:48:41 +0000 (20:48 -0700)]
test: add test-child-process-emfile fail message

When the test fails (as it does frequently on FreeBSD unfortunately)
provide a non-cryptic error message that also provides a line number.

PR-URL: https://github.com/nodejs/node/pull/3335
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agodoc: show keylen in pbkdf2 as a byte length
calebboyd [Mon, 19 Oct 2015 17:38:55 +0000 (12:38 -0500)]
doc: show keylen in pbkdf2 as a byte length

Ensure that keylen for pbkdf2 is documented as a length of bytes and not
bits.

PR-URL: https://github.com/nodejs/node/pull/3334
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodoc: add information about Assert behavior and maintenance
Rich Trott [Mon, 12 Oct 2015 20:58:00 +0000 (13:58 -0700)]
doc: add information about Assert behavior and maintenance

Assert is now locked. Userland alternatives should be used. Assert is
for testing Node.js itself.

Document potentially surprising use of enumerable properties only in
deep equality assertions.

Ref: https://github.com/nodejs/node/pull/3124
Ref: https://github.com/nodejs/node/issues/3122

PR-URL: https://github.com/nodejs/node/pull/3330
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
8 years agohttp: fix stalled pipeline bug
Fedor Indutny [Tue, 13 Oct 2015 06:16:39 +0000 (02:16 -0400)]
http: fix stalled pipeline bug

This is a two-part fix:

- Fix pending data notification in `OutgoingMessage` to notify server
  about flushed data too
- Fix pause/resume behavior for the consumed socket. `resume` event is
  emitted on a next tick, and `socket._paused` can already be `true` at
  this time. Pause the socket again to avoid PAUSED error on parser.

Fix: https://github.com/nodejs/node/issues/3332
PR-URL: https://github.com/nodejs/node/pull/3342
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agostream: avoid unnecessary concat of a single buffer.
Calvin Metcalf [Fri, 9 Oct 2015 18:50:11 +0000 (14:50 -0400)]
stream: avoid unnecessary concat of a single buffer.

Avoids doing a buffer.concat on the internal buffer
when that array has only a single thing in it.

Reviewed-By: Chris Dickinson <chris@neversaw.us>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3300

8 years agodoc: clarify API buffer.concat
Martii [Thu, 8 Oct 2015 03:14:16 +0000 (21:14 -0600)]
doc: clarify API buffer.concat

* Add a simple example for buffer.concat
* Change grammar slightly.

Fixes: #3219
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3255

8 years agodoc: clarify the use of `option.detached`
Kyle Smith [Wed, 7 Oct 2015 23:03:21 +0000 (16:03 -0700)]
doc: clarify the use of `option.detached`

This paragraph conveys that detached child processes do not stay
running in the background in general. Instead clarify that this
refers to the parent process exiting before the detached child
process is complete.

Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3250

8 years agostream: fix signature of _write() in a comment
Fábio Santos [Wed, 7 Oct 2015 22:27:06 +0000 (23:27 +0100)]
stream: fix signature of _write() in a comment

This comment was a bit misleading, since it was missing the `encoding`
argument.

PR-URL: https://github.com/nodejs/node/pull/3248
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
8 years agotls: TLSSocket options default isServer false
Yuval Brik [Sat, 29 Aug 2015 21:27:14 +0000 (00:27 +0300)]
tls: TLSSocket options default isServer false

Upon creating a TLSSocket object, set the default isServer option to false
Updated tls docs and added test-tls-socket-default-options

PR-URL: https://github.com/nodejs/node/pull/2614
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agodoc: label v4.2.1 as LTS in changelog heading
Phillip Johnsen [Wed, 14 Oct 2015 09:17:25 +0000 (11:17 +0200)]
doc: label v4.2.1 as LTS in changelog heading

PR-URL: #3360
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agoWorking on v4.2.2
James M Snell [Tue, 13 Oct 2015 17:36:10 +0000 (10:36 -0700)]
Working on v4.2.2

8 years ago2015-10-13, Version 4.2.1 'Argon' (LTS) Release upstream/4.2.1 v4.2.1
James M Snell [Tue, 13 Oct 2015 04:21:54 +0000 (21:21 -0700)]
2015-10-13, Version 4.2.1 'Argon' (LTS) Release

* Includes fixes for two regressions
  - Assertion error in WeakCallback  - see [#3329](https://github.com/nodejs/node/pull/3329)
  - Undefined timeout regression - see [#3331](https://github.com/nodejs/node/pull/3331)

* Document an additional known issue with pipelined requests
  - See: https://github.com/nodejs/node/issues/3332 and https://github.com/nodejs/node/pull/3342

8 years agodoc: label v4.2.0 as LTS in changelog heading
Rod Vagg [Tue, 13 Oct 2015 06:55:40 +0000 (17:55 +1100)]
doc: label v4.2.0 as LTS in changelog heading

Update the label for v4.2.0 to (LTS) from (Stable)

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3343

8 years agolib: fix undefined timeout regression
Ryan Graham [Mon, 12 Oct 2015 23:03:59 +0000 (16:03 -0700)]
lib: fix undefined timeout regression

63644dd1cd6e introduced a regression caused by everyone's favourite
JavaScript feature: undefined < 0 === undefined >= 0.

Add a case to the existing tests to cover this scenario and then add
the check for undefined that makes the test pass.

PR-URL: https://github.com/nodejs/node/pull/3331
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed By: Evan Lucas <evanlucas@me.com>

8 years agobuffer: fix assertion error in WeakCallback
Fedor Indutny [Mon, 12 Oct 2015 20:08:13 +0000 (16:08 -0400)]
buffer: fix assertion error in WeakCallback

`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`,
therefore `SPREAD_ARG` will abort with:

    Assertion failed: ((object)->IsUint8Array())

Make changes necessary to migrate it to `ArrayBuffer`.

See: https://github.com/nodejs/node/pull/3080#issuecomment-147502167

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3329

8 years agoWorking on v4.2.1
James M Snell [Mon, 12 Oct 2015 18:11:26 +0000 (11:11 -0700)]
Working on v4.2.1

8 years ago2015-10-12, Version 4.2.0 'Argon' (LTS) Release v4.2.0
James M Snell [Thu, 8 Oct 2015 05:15:51 +0000 (22:15 -0700)]
2015-10-12, Version 4.2.0 'Argon' (LTS) Release

The first Node.js LTS release! See https://github.com/nodejs/LTS/
for details of the LTS process.

* **icu**: Updated to version 56 with significant performance improvements
  (Steven R. Loomis) https://github.com/nodejs/node/pull/3281
* **node**:
  - Added new `-c` (or `--check`) command line argument for checking script
    syntax without executing the code (Dave Eddy) https://github.com/nodejs/node/pull/2411
  - Added `process.versions.icu` to hold the current ICU library version
    (Evan Lucas) https://github.com/nodejs/node/pull/3102
  - Added `process.release.lts` to hold the current LTS codename when the
    binary is from an active LTS release line (Rod Vagg) https://github.com/nodejs/node/pull/3212
* **npm**: Upgraded to npm 2.14.7 from 2.14.4, see release notes:
  https://github.com/npm/npm/releases/tag/v2.14.7 for full details (Kat Marchán) https://github.com/nodejs/node/pull/3299

PR-URL: https://github.com/nodejs/node/pull/3258

8 years agotls: use parent handle's close callback
Fedor Indutny [Mon, 21 Sep 2015 23:22:26 +0000 (19:22 -0400)]
tls: use parent handle's close callback

When closing the child TLSWrap handle - wait for the proper parent's
handle close callback invocation. `uv_close_cb` may be invoked much
later than the next libuv tick, depending on the platform.

The only platform that currently seem to defer `uv_close_cb` is Windows
XP. This behavior was not observed on other Windows systems, and is not
possible on Unixes.

Fix: https://github.com/nodejs/node/issues/2979
PR-URL: https://github.com/nodejs/node/pull/2991
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agonet: don't throw on bytesWritten access
Trevor Norris [Fri, 9 Oct 2015 22:51:42 +0000 (16:51 -0600)]
net: don't throw on bytesWritten access

If bytesWritten is accessed before the object has been properly
constructed then return undefined.

Fixes: https://github.com/nodejs/node/issues/3298
PR-URL: https://github.com/nodejs/node/pull/3305
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agosrc: add process.release.lts property
Rod Vagg [Tue, 6 Oct 2015 12:31:14 +0000 (23:31 +1100)]
src: add process.release.lts property

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3212

8 years agodoc: update the assert module summary
David Boivin [Thu, 10 Sep 2015 15:14:47 +0000 (10:14 -0500)]
doc: update the assert module summary

The current wording "This module is used for writing unit tests for your
applications, you can access it with require('assert')." implies that
this module should only be used in development while unit testing.

The article "Error Handling in Node.js" by Joyent
(https://www.joyent.com/developers/node/design/errors) uses the assert
module in an efficient way to validate required function arguments.

PR-URL: https://github.com/nodejs/node/pull/2799
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agodoc: replace node-gyp link with nodejs/node-gyp
Roman Klauke [Sun, 11 Oct 2015 12:53:06 +0000 (14:53 +0200)]
doc: replace node-gyp link with nodejs/node-gyp

The node-gyp is now in the nodejs/node-gyp. This commit replaces the
repository owner link with the new nodejs/node-gyp link.

PR-URL: https://github.com/nodejs/node/pull/3320
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>