diff --git a/BUILDING.md b/BUILDING.md
index c6e8656a72c40e..a4aa0808237c54 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -87,7 +87,14 @@ To test if Node.js was built correctly:
$ node -e "console.log('Hello from Node.js ' + process.version)"
```
-### Android / Android based devices, aka. Firefox OS
+### Android / Android-based devices (e.g., Firefox OS)
+
+Although these instructions for building on Android are provided, please note
+that Android is not an officially supported platform at this time. Patches to
+improve the Android build are accepted. However, there is no testing on Android
+in the current continuous integration environment. The participation of people
+dedicated and determined to improve Android building, testing, and support is
+encouraged.
Be sure you have downloaded and extracted [Android NDK]
(https://developer.android.com/tools/sdk/ndk/index.html)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 27062a6b62c6d8..702b232a138005 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,71 @@
# Node.js ChangeLog
+## 2016-04-12, Version 4.4.3 'Argon' (LTS), @thealphanerd
+
+### Notable Changes
+
+* **deps**:
+ - Fix `--gdbjit` for embedders. Backported from v8 upstream. (Ben Noordhuis) [#5577](https://github.com/nodejs/node/pull/5577)
+* **etw**:
+ - Correctly display descriptors for ETW events 9 and 23 on the windows platform. (João Reis) [#5742](https://github.com/nodejs/node/pull/5742)
+* **querystring**:
+ - Restore throw when attempting to stringify bad surrogate pair. (Brian White) [#5858](https://github.com/nodejs/node/pull/5858)
+
+### Commits
+
+* [[`f949c273cd`](https://github.com/nodejs/node/commit/f949c273cd)] - **assert**: Check typed array view type in deepEqual (Anna Henningsen) [#5910](https://github.com/nodejs/node/pull/5910)
+* [[`132acea0d4`](https://github.com/nodejs/node/commit/132acea0d4)] - **build**: introduce ci targets for lint/benchmark (Johan Bergström) [#5921](https://github.com/nodejs/node/pull/5921)
+* [[`9a8f922dee`](https://github.com/nodejs/node/commit/9a8f922dee)] - **build**: add missing `openssl_fips%` to common.gypi (Fedor Indutny) [#5919](https://github.com/nodejs/node/pull/5919)
+* [[`d275cdf202`](https://github.com/nodejs/node/commit/d275cdf202)] - **child_process**: refactor self=this in socket_list (Benjamin Gruenbaum) [#5860](https://github.com/nodejs/node/pull/5860)
+* [[`aadf356aa2`](https://github.com/nodejs/node/commit/aadf356aa2)] - **deps**: backport 8d00c2c from v8 upstream (Ben Noordhuis) [#5577](https://github.com/nodejs/node/pull/5577)
+* [[`200f763c43`](https://github.com/nodejs/node/commit/200f763c43)] - **deps**: completely upgrade npm in LTS to 2.15.1 (Forrest L Norvell) [#5989](https://github.com/nodejs/node/pull/5989)
+* [[`86e3903626`](https://github.com/nodejs/node/commit/86e3903626)] - **dns**: Use object without protoype for map (Benjamin Gruenbaum) [#5843](https://github.com/nodejs/node/pull/5843)
+* [[`9a33f43f73`](https://github.com/nodejs/node/commit/9a33f43f73)] - **doc**: update openssl LICENSE using license-builder.sh (Steven R. Loomis) [#6065](https://github.com/nodejs/node/pull/6065)
+* [[`9679e2dc70`](https://github.com/nodejs/node/commit/9679e2dc70)] - **doc**: clarify that __dirname is module local (James M Snell) [#6018](https://github.com/nodejs/node/pull/6018)
+* [[`86d2af58d6`](https://github.com/nodejs/node/commit/86d2af58d6)] - **doc**: simple doc typo fix (Brendon Pierson) [#6041](https://github.com/nodejs/node/pull/6041)
+* [[`f16802f3ca`](https://github.com/nodejs/node/commit/f16802f3ca)] - **doc**: note about Android support (Rich Trott) [#6040](https://github.com/nodejs/node/pull/6040)
+* [[`8c2befe176`](https://github.com/nodejs/node/commit/8c2befe176)] - **doc**: note assert.throws() pitfall (Rich Trott) [#6029](https://github.com/nodejs/node/pull/6029)
+* [[`0870ac65f2`](https://github.com/nodejs/node/commit/0870ac65f2)] - **doc**: use HTTPS for links where possible (Rich Trott) [#6019](https://github.com/nodejs/node/pull/6019)
+* [[`56755de96e`](https://github.com/nodejs/node/commit/56755de96e)] - **doc**: clarify stdout/stderr arguments to callback (James M Snell) [#6015](https://github.com/nodejs/node/pull/6015)
+* [[`bb603b89a2`](https://github.com/nodejs/node/commit/bb603b89a2)] - **doc**: add 'Command Line Options' to 'View on single page' (firedfox) [#6011](https://github.com/nodejs/node/pull/6011)
+* [[`c91f3d897a`](https://github.com/nodejs/node/commit/c91f3d897a)] - **doc**: add copy about how to curl SHA256.txt (Myles Borins) [#6120](https://github.com/nodejs/node/pull/6120)
+* [[`f9cf232284`](https://github.com/nodejs/node/commit/f9cf232284)] - **doc**: add example using algorithms not directly exposed (Brad Hill) [#6108](https://github.com/nodejs/node/pull/6108)
+* [[`f60ce1078d`](https://github.com/nodejs/node/commit/f60ce1078d)] - **doc**: document unspecified behavior for buf.write* methods (James M Snell) [#5925](https://github.com/nodejs/node/pull/5925)
+* [[`02401a6cbd`](https://github.com/nodejs/node/commit/02401a6cbd)] - **doc**: fix scrolling on iOS devices (Luigi Pinca) [#5878](https://github.com/nodejs/node/pull/5878)
+* [[`aed22d0855`](https://github.com/nodejs/node/commit/aed22d0855)] - **doc**: path.format provide more examples (John Eversole) [#5838](https://github.com/nodejs/node/pull/5838)
+* [[`6e2bfbe1fd`](https://github.com/nodejs/node/commit/6e2bfbe1fd)] - **doc**: fix doc for Buffer.readInt32LE() (ghaiklor) [#5890](https://github.com/nodejs/node/pull/5890)
+* [[`940d204401`](https://github.com/nodejs/node/commit/940d204401)] - **doc**: consolidate timers docs in timers.markdown (Bryan English) [#5837](https://github.com/nodejs/node/pull/5837)
+* [[`505faf6360`](https://github.com/nodejs/node/commit/505faf6360)] - **doc**: refine child_process detach behaviour (Robert Jefe Lindstaedt) [#5330](https://github.com/nodejs/node/pull/5330)
+* [[`feedca7879`](https://github.com/nodejs/node/commit/feedca7879)] - **doc**: add topic - event loop, timers, `nextTick()` (Jeff Harris) [#4936](https://github.com/nodejs/node/pull/4936)
+* [[`6d3822c12b`](https://github.com/nodejs/node/commit/6d3822c12b)] - **etw**: fix descriptors of events 9 and 23 (João Reis) [#5742](https://github.com/nodejs/node/pull/5742)
+* [[`56dda6f336`](https://github.com/nodejs/node/commit/56dda6f336)] - **fs**: Remove unused branches (Benjamin Gruenbaum) [#5289](https://github.com/nodejs/node/pull/5289)
+* [[`dfe9e157c1`](https://github.com/nodejs/node/commit/dfe9e157c1)] - **governance**: remove target size for CTC (Rich Trott) [#5879](https://github.com/nodejs/node/pull/5879)
+* [[`c4103b154f`](https://github.com/nodejs/node/commit/c4103b154f)] - **lib**: refactor code with startsWith/endsWith (Jackson Tian) [#5753](https://github.com/nodejs/node/pull/5753)
+* [[`16216a81de`](https://github.com/nodejs/node/commit/16216a81de)] - **meta**: add "joining a wg" section to WORKING_GROUPS.md (Matteo Collina) [#5488](https://github.com/nodejs/node/pull/5488)
+* [[`65fc4e36ce`](https://github.com/nodejs/node/commit/65fc4e36ce)] - **querystring**: don't stringify bad surrogate pair (Brian White) [#5858](https://github.com/nodejs/node/pull/5858)
+* [[`4f683ab912`](https://github.com/nodejs/node/commit/4f683ab912)] - **src,tools**: use template literals (Rich Trott) [#5778](https://github.com/nodejs/node/pull/5778)
+* [[`ac40a4510d`](https://github.com/nodejs/node/commit/ac40a4510d)] - **test**: explicitly set global in test-repl (Rich Trott) [#6026](https://github.com/nodejs/node/pull/6026)
+* [[`a7b3a7533a`](https://github.com/nodejs/node/commit/a7b3a7533a)] - **test**: be explicit about polluting of `global` (Rich Trott) [#6017](https://github.com/nodejs/node/pull/6017)
+* [[`73e3b7b9a8`](https://github.com/nodejs/node/commit/73e3b7b9a8)] - **test**: make use of globals explicit (Rich Trott) [#6014](https://github.com/nodejs/node/pull/6014)
+* [[`e7877e61b6`](https://github.com/nodejs/node/commit/e7877e61b6)] - **test**: fix flaky test-net-socket-timeout-unref (Rich Trott) [#6003](https://github.com/nodejs/node/pull/6003)
+* [[`a39051f5b3`](https://github.com/nodejs/node/commit/a39051f5b3)] - **test**: make arch available in status files (Santiago Gimeno) [#5997](https://github.com/nodejs/node/pull/5997)
+* [[`ccf90b651a`](https://github.com/nodejs/node/commit/ccf90b651a)] - **test**: fix test-dns.js flakiness (Rich Trott) [#5996](https://github.com/nodejs/node/pull/5996)
+* [[`1994ac0912`](https://github.com/nodejs/node/commit/1994ac0912)] - **test**: add test for piping large input from stdin (Anna Henningsen) [#5949](https://github.com/nodejs/node/pull/5949)
+* [[`cc1aab9f6a`](https://github.com/nodejs/node/commit/cc1aab9f6a)] - **test**: mitigate flaky test-https-agent (Rich Trott) [#5939](https://github.com/nodejs/node/pull/5939)
+* [[`10fe79b809`](https://github.com/nodejs/node/commit/10fe79b809)] - **test**: fix offending max-len linter error (Sakthipriyan Vairamani) [#5980](https://github.com/nodejs/node/pull/5980)
+* [[`63d82960fd`](https://github.com/nodejs/node/commit/63d82960fd)] - **test**: stdin is not always a net.Socket (Jeremiah Senkpiel) [#5935](https://github.com/nodejs/node/pull/5935)
+* [[`fe0233b923`](https://github.com/nodejs/node/commit/fe0233b923)] - **test**: add known_issues test for GH-2148 (Rich Trott) [#5920](https://github.com/nodejs/node/pull/5920)
+* [[`d59be4d248`](https://github.com/nodejs/node/commit/d59be4d248)] - **test**: ensure _handle property existence (Rich Trott) [#5916](https://github.com/nodejs/node/pull/5916)
+* [[`9702153107`](https://github.com/nodejs/node/commit/9702153107)] - **test**: fix flaky test-repl (Brian White) [#5914](https://github.com/nodejs/node/pull/5914)
+* [[`a0a2e69097`](https://github.com/nodejs/node/commit/a0a2e69097)] - **test**: move dns test to test/internet (Ben Noordhuis) [#5905](https://github.com/nodejs/node/pull/5905)
+* [[`8462d8f465`](https://github.com/nodejs/node/commit/8462d8f465)] - **test**: fix flaky test-net-socket-timeout (Brian White) [#5902](https://github.com/nodejs/node/pull/5902)
+* [[`e0b283af73`](https://github.com/nodejs/node/commit/e0b283af73)] - **test**: fix flaky test-http-set-timeout (Rich Trott) [#5856](https://github.com/nodejs/node/pull/5856)
+* [[`5853fec36f`](https://github.com/nodejs/node/commit/5853fec36f)] - **test**: fix test-debugger-client.js (Rich Trott) [#5851](https://github.com/nodejs/node/pull/5851)
+* [[`ea83c382f9`](https://github.com/nodejs/node/commit/ea83c382f9)] - **test**: ensure win32.isAbsolute() is consistent (Brian White) [#6043](https://github.com/nodejs/node/pull/6043)
+* [[`c33a23fd1e`](https://github.com/nodejs/node/commit/c33a23fd1e)] - **tools**: fix json doc generation (firedfox) [#5943](https://github.com/nodejs/node/pull/5943)
+* [[`6f0bd64122`](https://github.com/nodejs/node/commit/6f0bd64122)] - **tools,doc**: fix incomplete json produced by doctool (firedfox) [#5966](https://github.com/nodejs/node/pull/5966)
+* [[`f7eb48302c`](https://github.com/nodejs/node/commit/f7eb48302c)] - **win,build**: build and test add-ons on test-ci (Bogdan Lobor) [#5886](https://github.com/nodejs/node/pull/5886)
+
## 2016-03-31, Version 4.4.2 'Argon' (LTS), @thealphanerd
### Notable Changes
diff --git a/GOVERNANCE.md b/GOVERNANCE.md
index 0ec424d45a1bf7..2337353cb7b4f7 100644
--- a/GOVERNANCE.md
+++ b/GOVERNANCE.md
@@ -63,10 +63,9 @@ A guide for Collaborators is maintained in
## CTC Membership
-CTC seats are not time-limited. There is no fixed size of the CTC.
-However, the expected target is between 6 and 12, to ensure adequate
-coverage of important areas of expertise, balanced with the ability to
-make decisions efficiently.
+CTC seats are not time-limited. There is no fixed size of the CTC. The CTC
+should be of such a size as to ensure adequate coverage of important areas of
+expertise balanced with the ability to make decisions efficiently.
There is no specific set of requirements or qualifications for CTC
membership beyond these rules.
diff --git a/LICENSE b/LICENSE
index b39df1e0a8d9cb..e6cd58888640bf 100644
--- a/LICENSE
+++ b/LICENSE
@@ -506,7 +506,7 @@ The externally maintained libraries used by Node.js are:
- OpenSSL, located at deps/openssl, is licensed as follows:
"""
- Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
+ Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff --git a/Makefile b/Makefile
index ff0098b70d7b2c..7e311cc0ee450e 100644
--- a/Makefile
+++ b/Makefile
@@ -508,6 +508,8 @@ bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events
bench: bench-net bench-http bench-fs bench-tls
+bench-ci: bench
+
bench-http-simple:
benchmark/http_simple_bench.sh
@@ -547,9 +549,11 @@ cpplint:
lint: jslint cpplint
+lint-ci: lint
+
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \
check uninstall install install-includes install-bin all staticlib \
dynamiclib test test-all test-addons build-addons website-upload pkg \
blog blogclean tar binary release-only bench-http-simple bench-idle \
bench-all bench bench-misc bench-array bench-buffer bench-net \
- bench-http bench-fs bench-tls cctest run-ci
+ bench-http bench-fs bench-tls cctest run-ci lint-ci bench-ci
diff --git a/README.md b/README.md
index 5e805ca55d2a95..20c24dee60beba 100644
--- a/README.md
+++ b/README.md
@@ -70,7 +70,15 @@ documentation of the latest stable version.
Stable, LTS and Nightly download directories all contain a *SHASUM256.txt*
file that lists the SHA checksums for each file available for
-download. To check that a downloaded file matches the checksum, run
+download.
+
+The *SHASUM256.txt* can be downloaded using curl.
+
+```
+$ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt
+```
+
+To check that a downloaded file matches the checksum, run
it through `sha256sum` with a command such as:
```
@@ -114,8 +122,8 @@ Node.js from source.
* [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
* [CONTRIBUTING.md](./CONTRIBUTING.md)
* [GOVERNANCE.md](./GOVERNANCE.md)
-* IRC (general questions): [#node.js on Freenode.net](http://webchat.freenode.net?channels=node.js&uio=d4)
-* IRC (node core development): [#node-dev on Freenode.net](http://webchat.freenode.net?channels=node-dev&uio=d4)
+* IRC (general questions): [#node.js on Freenode.net](https://webchat.freenode.net?channels=node.js&uio=d4)
+* IRC (node core development): [#node-dev on Freenode.net](https://webchat.freenode.net?channels=node-dev&uio=d4)
* [nodejs/node on Gitter](https://gitter.im/nodejs/node)
## Security
diff --git a/WORKING_GROUPS.md b/WORKING_GROUPS.md
index 1a413fc72a0319..94e221ebdb43c5 100644
--- a/WORKING_GROUPS.md
+++ b/WORKING_GROUPS.md
@@ -300,6 +300,11 @@ It's responsibilities are:
* Working with the Build Working Group to improve continuous integration.
* Improving tooling for testing.
+## Joining a WG
+
+To find out how to join a working group, consult the GOVERNANCE.md in
+the working group's repository, or simply open an issue there.
+
## Starting a WG
A Working Group is established by first defining a charter that can be
diff --git a/common.gypi b/common.gypi
index 5b8b2c09d6b4a9..7d7715e84e5fcc 100644
--- a/common.gypi
+++ b/common.gypi
@@ -14,6 +14,8 @@
'node_tag%': '',
'uv_library%': 'static_library',
+ 'openssl_fips%': '',
+
# Default to -O0 for debug builds.
'v8_optimized_debug%': 0,
diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS
index e4fd0f37c9db50..ee80493535b80d 100644
--- a/deps/npm/AUTHORS
+++ b/deps/npm/AUTHORS
@@ -352,3 +352,6 @@ Scott Plumlee 2.15.0 2.15.1 This is the API documentation for npm.
To find documentation of the command line
@@ -109,5 +109,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html
index c79fe10422d594..c33a1f44ec1527 100644
--- a/deps/npm/html/doc/api/npm-bin.html
+++ b/deps/npm/html/doc/api/npm-bin.html
@@ -28,5 +28,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html
index 09e2bc09450faf..ffc62e2bdc4e2f 100644
--- a/deps/npm/html/doc/api/npm-bugs.html
+++ b/deps/npm/html/doc/api/npm-bugs.html
@@ -33,5 +33,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html
index 0fd8c4d68212b7..84033385522249 100644
--- a/deps/npm/html/doc/api/npm-cache.html
+++ b/deps/npm/html/doc/api/npm-cache.html
@@ -42,5 +42,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html
index 3b5eccdd427ef1..7167d3a88000ef 100644
--- a/deps/npm/html/doc/api/npm-commands.html
+++ b/deps/npm/html/doc/api/npm-commands.html
@@ -36,5 +36,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html
index 34caf47bac8b8b..f67a0603fd207c 100644
--- a/deps/npm/html/doc/api/npm-config.html
+++ b/deps/npm/html/doc/api/npm-config.html
@@ -57,5 +57,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html
index 134e3a0940a141..103ea108eab8e2 100644
--- a/deps/npm/html/doc/api/npm-deprecate.html
+++ b/deps/npm/html/doc/api/npm-deprecate.html
@@ -47,5 +47,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html
index 606abc68590250..5ab9405f8cc790 100644
--- a/deps/npm/html/doc/api/npm-docs.html
+++ b/deps/npm/html/doc/api/npm-docs.html
@@ -33,5 +33,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html
index 0d06ec8b5c3dec..735a2cd835a625 100644
--- a/deps/npm/html/doc/api/npm-edit.html
+++ b/deps/npm/html/doc/api/npm-edit.html
@@ -36,5 +36,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html
index c2b00dee7f317b..499b5df36f5164 100644
--- a/deps/npm/html/doc/api/npm-explore.html
+++ b/deps/npm/html/doc/api/npm-explore.html
@@ -31,5 +31,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html
index 5aaa0d749d934f..f32fb2d8a81f60 100644
--- a/deps/npm/html/doc/api/npm-help-search.html
+++ b/deps/npm/html/doc/api/npm-help-search.html
@@ -44,5 +44,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html
index 16656cfa83ac33..884de28f43686f 100644
--- a/deps/npm/html/doc/api/npm-init.html
+++ b/deps/npm/html/doc/api/npm-init.html
@@ -39,5 +39,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html
index ff44ed9b80b69c..76a20f142333d0 100644
--- a/deps/npm/html/doc/api/npm-install.html
+++ b/deps/npm/html/doc/api/npm-install.html
@@ -32,5 +32,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html
index 4370dfa82016a4..b09d4cb5372222 100644
--- a/deps/npm/html/doc/api/npm-link.html
+++ b/deps/npm/html/doc/api/npm-link.html
@@ -42,5 +42,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html
index 4ff8e4dd1fa708..ee000c4202b2e1 100644
--- a/deps/npm/html/doc/api/npm-load.html
+++ b/deps/npm/html/doc/api/npm-load.html
@@ -37,5 +37,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html
index 395cd8c0d7cda1..236513b0346853 100644
--- a/deps/npm/html/doc/api/npm-ls.html
+++ b/deps/npm/html/doc/api/npm-ls.html
@@ -63,5 +63,5 @@ global
-
+
diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html
index f88bf6ded1acbd..7edd6772e8a1bf 100644
--- a/deps/npm/html/doc/api/npm-outdated.html
+++ b/deps/npm/html/doc/api/npm-outdated.html
@@ -28,5 +28,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html
index 9352adce3c0eae..f73871365f078d 100644
--- a/deps/npm/html/doc/api/npm-owner.html
+++ b/deps/npm/html/doc/api/npm-owner.html
@@ -47,5 +47,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html
index f85a094d53dde5..7982455cd1772f 100644
--- a/deps/npm/html/doc/api/npm-pack.html
+++ b/deps/npm/html/doc/api/npm-pack.html
@@ -33,5 +33,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-ping.html b/deps/npm/html/doc/api/npm-ping.html
index 9a0461ee11d735..93e7cc30a32253 100644
--- a/deps/npm/html/doc/api/npm-ping.html
+++ b/deps/npm/html/doc/api/npm-ping.html
@@ -29,4 +29,4 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html
index 7003be312db0b7..c148f077a84eb9 100644
--- a/deps/npm/html/doc/api/npm-prefix.html
+++ b/deps/npm/html/doc/api/npm-prefix.html
@@ -29,5 +29,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html
index d49bfc87b99386..60c412c117341e 100644
--- a/deps/npm/html/doc/api/npm-prune.html
+++ b/deps/npm/html/doc/api/npm-prune.html
@@ -30,5 +30,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html
index c19aadd53fc9ee..19a09ade22f6ce 100644
--- a/deps/npm/html/doc/api/npm-publish.html
+++ b/deps/npm/html/doc/api/npm-publish.html
@@ -46,5 +46,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html
index da78b38906037d..d654fbf6665efd 100644
--- a/deps/npm/html/doc/api/npm-rebuild.html
+++ b/deps/npm/html/doc/api/npm-rebuild.html
@@ -30,5 +30,5 @@ CONFIGURATION
-
+
diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html
index 7469d73e07364f..8d03f5e0dfac9a 100644
--- a/deps/npm/html/doc/api/npm-repo.html
+++ b/deps/npm/html/doc/api/npm-repo.html
@@ -33,5 +33,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html
index bd4d54b13ddb64..4f044747a93254 100644
--- a/deps/npm/html/doc/api/npm-restart.html
+++ b/deps/npm/html/doc/api/npm-restart.html
@@ -52,5 +52,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html
index 830b5c723698b2..7dff730705dbd0 100644
--- a/deps/npm/html/doc/api/npm-root.html
+++ b/deps/npm/html/doc/api/npm-root.html
@@ -29,5 +29,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html
index 568a49f5686c73..51ee612aab1bf0 100644
--- a/deps/npm/html/doc/api/npm-run-script.html
+++ b/deps/npm/html/doc/api/npm-run-script.html
@@ -41,5 +41,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html
index e6f4d166e92d7e..de3da188e56c55 100644
--- a/deps/npm/html/doc/api/npm-search.html
+++ b/deps/npm/html/doc/api/npm-search.html
@@ -53,5 +53,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html
index 453cc82fc27ae4..4ad5960990403f 100644
--- a/deps/npm/html/doc/api/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/api/npm-shrinkwrap.html
@@ -33,5 +33,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html
index 5477a143121612..ab13d80a5827c9 100644
--- a/deps/npm/html/doc/api/npm-start.html
+++ b/deps/npm/html/doc/api/npm-start.html
@@ -28,5 +28,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html
index 3bf0851434a666..5b164d512693ba 100644
--- a/deps/npm/html/doc/api/npm-stop.html
+++ b/deps/npm/html/doc/api/npm-stop.html
@@ -28,5 +28,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html
index a97fee612b18fc..29cd613a36b0ce 100644
--- a/deps/npm/html/doc/api/npm-tag.html
+++ b/deps/npm/html/doc/api/npm-tag.html
@@ -36,5 +36,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html
index 9a32f5fb3c8441..1a0dea744e17c5 100644
--- a/deps/npm/html/doc/api/npm-test.html
+++ b/deps/npm/html/doc/api/npm-test.html
@@ -30,5 +30,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html
index ab13f65071acf3..20de67f1a9efde 100644
--- a/deps/npm/html/doc/api/npm-uninstall.html
+++ b/deps/npm/html/doc/api/npm-uninstall.html
@@ -30,5 +30,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html
index 517ef69d7a958d..a32eb39c9d831b 100644
--- a/deps/npm/html/doc/api/npm-unpublish.html
+++ b/deps/npm/html/doc/api/npm-unpublish.html
@@ -33,5 +33,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html
index 9bdda1f22beb6d..7dc3ed5002ec98 100644
--- a/deps/npm/html/doc/api/npm-update.html
+++ b/deps/npm/html/doc/api/npm-update.html
@@ -33,5 +33,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html
index 43ecf02668d774..fd91a628b04782 100644
--- a/deps/npm/html/doc/api/npm-version.html
+++ b/deps/npm/html/doc/api/npm-version.html
@@ -32,5 +32,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html
index cf9a61b59a7b97..4eb5a5b1d661b5 100644
--- a/deps/npm/html/doc/api/npm-view.html
+++ b/deps/npm/html/doc/api/npm-view.html
@@ -81,5 +81,5 @@ RETURN VALUE
-
+
diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html
index 095e750349e8ed..3b0b408e464e7b 100644
--- a/deps/npm/html/doc/api/npm-whoami.html
+++ b/deps/npm/html/doc/api/npm-whoami.html
@@ -29,5 +29,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html
index 51a0eb3b641278..1a7aa99887ef31 100644
--- a/deps/npm/html/doc/api/npm.html
+++ b/deps/npm/html/doc/api/npm.html
@@ -23,7 +23,7 @@ SYNOPSIS
npm.commands.install(["package"], cb)
})
VERSION
-DESCRIPTION
ABBREVS
-
+
diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html
index 03e8250cbedb9e..2a2787d0d17558 100644
--- a/deps/npm/html/doc/cli/npm-access.html
+++ b/deps/npm/html/doc/cli/npm-access.html
@@ -84,5 +84,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html
index 54ae6e4118f3d2..49c2c914b97798 100644
--- a/deps/npm/html/doc/cli/npm-adduser.html
+++ b/deps/npm/html/doc/cli/npm-adduser.html
@@ -72,5 +72,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html
index a9def2a9015475..678427fb8be3f7 100644
--- a/deps/npm/html/doc/cli/npm-bin.html
+++ b/deps/npm/html/doc/cli/npm-bin.html
@@ -35,5 +35,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html
index ae6c1f4d7280ce..8d569d4d8cb622 100644
--- a/deps/npm/html/doc/cli/npm-bugs.html
+++ b/deps/npm/html/doc/cli/npm-bugs.html
@@ -56,5 +56,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html
index f768c932063d65..ae7302bca1d033 100644
--- a/deps/npm/html/doc/cli/npm-build.html
+++ b/deps/npm/html/doc/cli/npm-build.html
@@ -40,5 +40,5 @@ DESCRIPTION
-
+
diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html
index 8c700377190488..51a66b1b8594dd 100644
--- a/deps/npm/html/doc/cli/npm-bundle.html
+++ b/deps/npm/html/doc/cli/npm-bundle.html
@@ -31,5 +31,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html
index 613261b1201c04..1be71da7c48310 100644
--- a/deps/npm/html/doc/cli/npm-cache.html
+++ b/deps/npm/html/doc/cli/npm-cache.html
@@ -81,5 +81,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html
index e3896b87156037..a0063d3162dd35 100644
--- a/deps/npm/html/doc/cli/npm-completion.html
+++ b/deps/npm/html/doc/cli/npm-completion.html
@@ -42,5 +42,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html
index 8535edcaf0ee97..621dc3352dd303 100644
--- a/deps/npm/html/doc/cli/npm-config.html
+++ b/deps/npm/html/doc/cli/npm-config.html
@@ -68,5 +68,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html
index 0cc2b1408444c6..c889929d71efca 100644
--- a/deps/npm/html/doc/cli/npm-dedupe.html
+++ b/deps/npm/html/doc/cli/npm-dedupe.html
@@ -65,5 +65,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html
index c96a0db369ee9c..0e59a1e8b44552 100644
--- a/deps/npm/html/doc/cli/npm-deprecate.html
+++ b/deps/npm/html/doc/cli/npm-deprecate.html
@@ -38,5 +38,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html
index 43e3924efa564b..1d447d94fbfc52 100644
--- a/deps/npm/html/doc/cli/npm-dist-tag.html
+++ b/deps/npm/html/doc/cli/npm-dist-tag.html
@@ -87,5 +87,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html
index f64494ef7d14ce..a403c2e96cc859 100644
--- a/deps/npm/html/doc/cli/npm-docs.html
+++ b/deps/npm/html/doc/cli/npm-docs.html
@@ -56,5 +56,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html
index 4c513c1928938c..c288226ef57dcc 100644
--- a/deps/npm/html/doc/cli/npm-edit.html
+++ b/deps/npm/html/doc/cli/npm-edit.html
@@ -49,5 +49,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html
index dc29b16d08c3a1..e2f5311f32471a 100644
--- a/deps/npm/html/doc/cli/npm-explore.html
+++ b/deps/npm/html/doc/cli/npm-explore.html
@@ -49,5 +49,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html
index 0cc0b0d489b91c..695401de97af7d 100644
--- a/deps/npm/html/doc/cli/npm-help-search.html
+++ b/deps/npm/html/doc/cli/npm-help-search.html
@@ -46,5 +46,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html
index 52d2c6ac7efd63..a01081b377de32 100644
--- a/deps/npm/html/doc/cli/npm-help.html
+++ b/deps/npm/html/doc/cli/npm-help.html
@@ -52,5 +52,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html
index 07734cd05f0f5b..f5edeaead849a0 100644
--- a/deps/npm/html/doc/cli/npm-init.html
+++ b/deps/npm/html/doc/cli/npm-init.html
@@ -48,5 +48,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html
index 9f3a0429cbae82..c7c4f966e4183b 100644
--- a/deps/npm/html/doc/cli/npm-install.html
+++ b/deps/npm/html/doc/cli/npm-install.html
@@ -279,5 +279,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html
index 87c8ae81c5e1a7..ecd63792b5b38e 100644
--- a/deps/npm/html/doc/cli/npm-link.html
+++ b/deps/npm/html/doc/cli/npm-link.html
@@ -73,5 +73,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html
index c82727f5c4595c..48455c65cfffce 100644
--- a/deps/npm/html/doc/cli/npm-logout.html
+++ b/deps/npm/html/doc/cli/npm-logout.html
@@ -51,5 +51,5 @@ scope
-
+
diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html
index 5af7135a678efa..92ca3bdaf3b996 100644
--- a/deps/npm/html/doc/cli/npm-ls.html
+++ b/deps/npm/html/doc/cli/npm-ls.html
@@ -22,7 +22,7 @@ SYNOPSIS
limit the results to only the paths to the packages named. Note that
nested packages will also show the paths to the specified packages.
For example, running npm ls promzard
in npm's source tree will show:
npm@2.15.0 /path/to/npm
+npm@2.15.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
It will print out extraneous, missing, and invalid packages.
@@ -97,5 +97,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html
index 5bb081e90cb29c..fc7a69ee8a1ccb 100644
--- a/deps/npm/html/doc/cli/npm-outdated.html
+++ b/deps/npm/html/doc/cli/npm-outdated.html
@@ -116,5 +116,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html
index 85ab5703df6abb..4bb52cd88ce740 100644
--- a/deps/npm/html/doc/cli/npm-owner.html
+++ b/deps/npm/html/doc/cli/npm-owner.html
@@ -51,5 +51,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html
index c247a4d4b95741..4ac77d52e375ed 100644
--- a/deps/npm/html/doc/cli/npm-pack.html
+++ b/deps/npm/html/doc/cli/npm-pack.html
@@ -41,5 +41,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html
index 20524fd5dd703b..3580cd80d395fb 100644
--- a/deps/npm/html/doc/cli/npm-ping.html
+++ b/deps/npm/html/doc/cli/npm-ping.html
@@ -32,4 +32,4 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html
index 2f217bcfab403f..e7bc29dc7ef778 100644
--- a/deps/npm/html/doc/cli/npm-prefix.html
+++ b/deps/npm/html/doc/cli/npm-prefix.html
@@ -38,5 +38,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html
index e1fb7cd73ee8a5..05015eea568bae 100644
--- a/deps/npm/html/doc/cli/npm-prune.html
+++ b/deps/npm/html/doc/cli/npm-prune.html
@@ -41,5 +41,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html
index 8ca91d7aaccbb0..6c5bf9c12ae1de 100644
--- a/deps/npm/html/doc/cli/npm-publish.html
+++ b/deps/npm/html/doc/cli/npm-publish.html
@@ -69,5 +69,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html
index 46e3975d7fbb4d..b62b49e0559a8a 100644
--- a/deps/npm/html/doc/cli/npm-rebuild.html
+++ b/deps/npm/html/doc/cli/npm-rebuild.html
@@ -38,5 +38,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html
index bfdcbff1f707a7..9340dad66102be 100644
--- a/deps/npm/html/doc/cli/npm-repo.html
+++ b/deps/npm/html/doc/cli/npm-repo.html
@@ -42,5 +42,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html
index 5d38582f641c7c..dd6a06c3cb8321 100644
--- a/deps/npm/html/doc/cli/npm-restart.html
+++ b/deps/npm/html/doc/cli/npm-restart.html
@@ -53,5 +53,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html
index 2a36d6104987ce..5b35c41e1d7cea 100644
--- a/deps/npm/html/doc/cli/npm-rm.html
+++ b/deps/npm/html/doc/cli/npm-rm.html
@@ -39,5 +39,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html
index b4c3969b597714..93348f2a5a36c8 100644
--- a/deps/npm/html/doc/cli/npm-root.html
+++ b/deps/npm/html/doc/cli/npm-root.html
@@ -35,5 +35,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html
index 7b97792a2126bc..17fc6850807ec3 100644
--- a/deps/npm/html/doc/cli/npm-run-script.html
+++ b/deps/npm/html/doc/cli/npm-run-script.html
@@ -57,5 +57,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html
index 6f4cbe3cfb5c79..69bf82850ab5f3 100644
--- a/deps/npm/html/doc/cli/npm-search.html
+++ b/deps/npm/html/doc/cli/npm-search.html
@@ -57,5 +57,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html
index bb36cfd775f438..21fc30f50b0b55 100644
--- a/deps/npm/html/doc/cli/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html
@@ -168,5 +168,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html
index 4375e29e4fa637..3a42832f34fb63 100644
--- a/deps/npm/html/doc/cli/npm-star.html
+++ b/deps/npm/html/doc/cli/npm-star.html
@@ -36,5 +36,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html
index f679ba62b95c7b..425781b62bb855 100644
--- a/deps/npm/html/doc/cli/npm-stars.html
+++ b/deps/npm/html/doc/cli/npm-stars.html
@@ -37,5 +37,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html
index 300500eba4796e..c755a7c9e549d4 100644
--- a/deps/npm/html/doc/cli/npm-start.html
+++ b/deps/npm/html/doc/cli/npm-start.html
@@ -39,5 +39,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html
index 353fb43592ce71..31ad051932039e 100644
--- a/deps/npm/html/doc/cli/npm-stop.html
+++ b/deps/npm/html/doc/cli/npm-stop.html
@@ -34,5 +34,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html
index 3d00cda5121575..ff83b5b0e43cfe 100644
--- a/deps/npm/html/doc/cli/npm-tag.html
+++ b/deps/npm/html/doc/cli/npm-tag.html
@@ -62,5 +62,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html
index d2bd12d6c8f5c5..8d5ef158de8ed9 100644
--- a/deps/npm/html/doc/cli/npm-team.html
+++ b/deps/npm/html/doc/cli/npm-team.html
@@ -67,4 +67,4 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html
index e961d231b2512f..cd041681897705 100644
--- a/deps/npm/html/doc/cli/npm-test.html
+++ b/deps/npm/html/doc/cli/npm-test.html
@@ -38,5 +38,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html
index 871e514398605f..2fd5d482136805 100644
--- a/deps/npm/html/doc/cli/npm-uninstall.html
+++ b/deps/npm/html/doc/cli/npm-uninstall.html
@@ -57,5 +57,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html
index 65fc3f13e835ed..1e87cb6e18ccaf 100644
--- a/deps/npm/html/doc/cli/npm-unpublish.html
+++ b/deps/npm/html/doc/cli/npm-unpublish.html
@@ -47,5 +47,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html
index a131392a352b4d..3ac7872bba9dc2 100644
--- a/deps/npm/html/doc/cli/npm-update.html
+++ b/deps/npm/html/doc/cli/npm-update.html
@@ -117,5 +117,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html
index 2cb44bb4ab2b31..4ce97d9c2822a3 100644
--- a/deps/npm/html/doc/cli/npm-version.html
+++ b/deps/npm/html/doc/cli/npm-version.html
@@ -95,5 +95,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html
index 7d15486d88772b..487850d57c1724 100644
--- a/deps/npm/html/doc/cli/npm-view.html
+++ b/deps/npm/html/doc/cli/npm-view.html
@@ -85,5 +85,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html
index e133032a40dcaf..4e48077a313ecd 100644
--- a/deps/npm/html/doc/cli/npm-whoami.html
+++ b/deps/npm/html/doc/cli/npm-whoami.html
@@ -33,5 +33,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html
index 64071e9abf5bc4..a0d8c51f0d571d 100644
--- a/deps/npm/html/doc/cli/npm.html
+++ b/deps/npm/html/doc/cli/npm.html
@@ -13,7 +13,7 @@ npm
javascript package manager
SYNOPSIS
npm <command> [args]
VERSION
-2.15.0
+2.15.1
DESCRIPTION
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@@ -126,7 +126,7 @@
AUTHOR
Isaac Z. Schlueter ::
isaacs ::
@izs ::
-i@izs.me
+i@izs.me
SEE ALSO
- npm-help(1)
@@ -152,5 +152,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html
index 8421d2147ad14e..0eba1a286fe5ca 100644
--- a/deps/npm/html/doc/files/npm-folders.html
+++ b/deps/npm/html/doc/files/npm-folders.html
@@ -183,5 +183,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html
index 8421d2147ad14e..0eba1a286fe5ca 100644
--- a/deps/npm/html/doc/files/npm-global.html
+++ b/deps/npm/html/doc/files/npm-global.html
@@ -183,5 +183,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html
index aa6d69fc28204e..a77fcc2527507e 100644
--- a/deps/npm/html/doc/files/npm-json.html
+++ b/deps/npm/html/doc/files/npm-json.html
@@ -581,5 +581,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html
index a76191cae9a40d..1566bf4424598c 100644
--- a/deps/npm/html/doc/files/npmrc.html
+++ b/deps/npm/html/doc/files/npmrc.html
@@ -83,5 +83,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html
index aa6d69fc28204e..a77fcc2527507e 100644
--- a/deps/npm/html/doc/files/package.json.html
+++ b/deps/npm/html/doc/files/package.json.html
@@ -581,5 +581,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html
index 4d3f849ad1fab4..2560055953f35e 100644
--- a/deps/npm/html/doc/index.html
+++ b/deps/npm/html/doc/index.html
@@ -242,5 +242,5 @@ semver(7)
-
+
diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html
index 4e934a2d1006f7..d73afaf4fd422e 100644
--- a/deps/npm/html/doc/misc/npm-coding-style.html
+++ b/deps/npm/html/doc/misc/npm-coding-style.html
@@ -147,5 +147,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html
index e5703ab77773d0..8d2d29cdc4fbb7 100644
--- a/deps/npm/html/doc/misc/npm-config.html
+++ b/deps/npm/html/doc/misc/npm-config.html
@@ -806,5 +806,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html
index b5095f6e4762a6..e907ef31c8d6f2 100644
--- a/deps/npm/html/doc/misc/npm-developers.html
+++ b/deps/npm/html/doc/misc/npm-developers.html
@@ -195,5 +195,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html
index 31f8e439234546..fc4c82cef83513 100644
--- a/deps/npm/html/doc/misc/npm-disputes.html
+++ b/deps/npm/html/doc/misc/npm-disputes.html
@@ -13,7 +13,7 @@ npm-disputes
Handling Module
SYNOPSIS
- Get the author email with
npm owner ls <pkgname>
-- Email the author, CC support@npmjs.com
+- Email the author, CC support@npmjs.com
- After a few weeks, if there's no resolution, we'll sort it out.
Don't squat on package names. Publish code or move out of the way.
@@ -51,12 +51,12 @@ DESCRIPTION
owner (Bob).
- Joe emails Bob, explaining the situation as respectfully as
possible, and what he would like to do with the module name. He
-adds the npm support staff support@npmjs.com to the CC list of
+adds the npm support staff support@npmjs.com to the CC list of
the email. Mention in the email that Bob can run
npm owner add
joe foo
to add Joe as an owner of the foo
package.
- After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can't come to any sort of resolution, email support
-support@npmjs.com and we'll sort it out. ("Reasonable" is
+support@npmjs.com and we'll sort it out. ("Reasonable" is
usually at least 4 weeks, but extra time is allowed around common
holidays.)
@@ -112,5 +112,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html
index 841d2f882414b1..5e45cff19cd1b2 100644
--- a/deps/npm/html/doc/misc/npm-index.html
+++ b/deps/npm/html/doc/misc/npm-index.html
@@ -242,5 +242,5 @@ semver(7)
-
+
diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html
index 63bf8dd20e0773..2a307aeced708e 100644
--- a/deps/npm/html/doc/misc/npm-orgs.html
+++ b/deps/npm/html/doc/misc/npm-orgs.html
@@ -86,4 +86,4 @@ Team Admins create teams
-
+
diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html
index bc90aa9e60d710..dfde0b230d430e 100644
--- a/deps/npm/html/doc/misc/npm-registry.html
+++ b/deps/npm/html/doc/misc/npm-registry.html
@@ -70,5 +70,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html
index 8e787b24915adf..aa019507d4e087 100644
--- a/deps/npm/html/doc/misc/npm-scope.html
+++ b/deps/npm/html/doc/misc/npm-scope.html
@@ -92,5 +92,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html
index e11f7bcfa6cc77..b6b78288faeb0a 100644
--- a/deps/npm/html/doc/misc/npm-scripts.html
+++ b/deps/npm/html/doc/misc/npm-scripts.html
@@ -207,5 +207,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html
index ebdd3610fbbd9c..c33d11472111fd 100644
--- a/deps/npm/html/doc/misc/removing-npm.html
+++ b/deps/npm/html/doc/misc/removing-npm.html
@@ -57,5 +57,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html
index ad6dd783786753..24fde756ae8769 100644
--- a/deps/npm/html/doc/misc/semver.html
+++ b/deps/npm/html/doc/misc/semver.html
@@ -302,5 +302,5 @@ Ranges
-
+
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index ca07364796dc41..92f4bbbd601f9e 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
-npm@2.15.0 /path/to/npm
+npm@2.15.1 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index 887dbe2f43220e..f3884eece6196f 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -10,7 +10,7 @@ npm [args]
.RE
.SH VERSION
.P
-2.15.0
+2.15.1
.SH DESCRIPTION
.P
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3
index 9142d46a32d9ca..ccfaf966a4c1b4 100644
--- a/deps/npm/man/man3/npm.3
+++ b/deps/npm/man/man3/npm.3
@@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) {
.RE
.SH VERSION
.P
-2.15.0
+2.15.1
.SH DESCRIPTION
.P
This is the API documentation for npm\.
diff --git a/deps/npm/package.json b/deps/npm/package.json
index be2988afefc2eb..fee618db55895e 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "2.15.0",
+ "version": "2.15.1",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc
index a57171f8a3b1d3..ec0f805876fd9c 100644
--- a/deps/v8/src/api.cc
+++ b/deps/v8/src/api.cc
@@ -29,6 +29,7 @@
#include "src/debug.h"
#include "src/deoptimizer.h"
#include "src/execution.h"
+#include "src/gdb-jit.h"
#include "src/global-handles.h"
#include "src/heap/spaces.h"
#include "src/heap-profiler.h"
@@ -7118,10 +7119,16 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) {
if (params.entry_hook) {
isolate->set_function_entry_hook(params.entry_hook);
}
- if (params.code_event_handler) {
+ auto code_event_handler = params.code_event_handler;
+#ifdef ENABLE_GDB_JIT_INTERFACE
+ if (code_event_handler == nullptr && i::FLAG_gdbjit) {
+ code_event_handler = i::GDBJITInterface::EventHandler;
+ }
+#endif // ENABLE_GDB_JIT_INTERFACE
+ if (code_event_handler) {
isolate->InitializeLoggingAndCounters();
isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault,
- params.code_event_handler);
+ code_event_handler);
}
if (params.counter_lookup_callback) {
v8_isolate->SetCounterFunction(params.counter_lookup_callback);
diff --git a/deps/v8/src/d8.cc b/deps/v8/src/d8.cc
index 45bf33167fd014..12edeb4fa07e2c 100644
--- a/deps/v8/src/d8.cc
+++ b/deps/v8/src/d8.cc
@@ -25,10 +25,6 @@
#include "include/v8-testing.h"
#endif // V8_SHARED
-#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE)
-#include "src/gdb-jit.h"
-#endif
-
#ifdef ENABLE_VTUNE_JIT_INTERFACE
#include "src/third_party/vtune/v8-vtune.h"
#endif
@@ -2331,11 +2327,6 @@ int Shell::Main(int argc, char* argv[]) {
Shell::array_buffer_allocator = &shell_array_buffer_allocator;
}
create_params.array_buffer_allocator = Shell::array_buffer_allocator;
-#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE)
- if (i::FLAG_gdbjit) {
- create_params.code_event_handler = i::GDBJITInterface::EventHandler;
- }
-#endif
#ifdef ENABLE_VTUNE_JIT_INTERFACE
create_params.code_event_handler = vTune::GetVtuneCodeEventHandler();
#endif
diff --git a/doc/api/all.markdown b/doc/api/all.markdown
index 8bac0103c88da7..93c7a300a162e9 100644
--- a/doc/api/all.markdown
+++ b/doc/api/all.markdown
@@ -5,6 +5,7 @@
@include buffer
@include child_process
@include cluster
+@include cli
@include console
@include crypto
@include debugger
diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown
index 6bbbf6bd629e22..35dbc3d2192209 100644
--- a/doc/api/assert.markdown
+++ b/doc/api/assert.markdown
@@ -361,8 +361,13 @@ If the values are not strictly equal, an `AssertionError` is thrown with a
## assert.throws(block[, error][, message])
-Expects the function `block` to throw an error. If specified, `error` can be a
-constructor, [`RegExp`][], or validation function.
+Expects the function `block` to throw an error.
+
+If specified, `error` can be a constructor, [`RegExp`][], or validation
+function.
+
+If specified, `message` will be the message provided by the `AssertionError` if
+the block fails to throw.
Validate instanceof using constructor:
@@ -402,6 +407,18 @@ assert.throws(
);
```
+Note that `error` can not be a string. If a string is provided as the second
+argument, then `error` is assumed to be omitted and the string will be used for
+`message` instead. This can lead to easy-to-miss mistakes:
+
+```js
+// THIS IS A MISTAKE! DO NOT DO THIS!
+assert.throws(myFunction, 'missing foo', 'did not throw with expected message');
+
+// Do this instead.
+assert.throws(myFunction, /missing foo/, 'did not throw with expected message');
+```
+
[Locked]: documentation.html#documentation_stability_index
[`assert.deepEqual()`]: #assert_assert_deepequal_actual_expected_message
[`assert.deepStrictEqual()`]: #assert_assert_deepstrictequal_actual_expected_message
diff --git a/doc/api/buffer.markdown b/doc/api/buffer.markdown
index 6d39ffdba84cf8..4e6cdd546d88a9 100644
--- a/doc/api/buffer.markdown
+++ b/doc/api/buffer.markdown
@@ -739,8 +739,10 @@ const buf = new Buffer([1,-2,3,4]);
buf.readInt32BE();
// returns 33424132
-buf.readInt32LE(1);
+buf.readInt32LE();
// returns 67370497
+buf.readInt32LE(1);
+ // throws RangeError: Index out of range
```
### buf.readIntBE(offset, byteLength[, noAssert])
@@ -1031,7 +1033,8 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little
-endian). The `value` argument must be a valid 64-bit double.
+endian). The `value` argument *should* be a valid 64-bit double. Behavior is
+not defined when `value` is anything other than a 64-bit double.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
@@ -1063,7 +1066,7 @@ console.log(buf);
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little
-endian). Behavior is unspecified if `value` is anything other than a 32-bit
+endian). Behavior is not defined when `value` is anything other than a 32-bit
float.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
@@ -1093,8 +1096,9 @@ console.log(buf);
* `noAssert` {Boolean} Default: false
* Return: {Number} The offset plus the number of written bytes
-Writes `value` to the Buffer at the specified `offset`. The `value` must be a
-valid signed 8-bit integer.
+Writes `value` to the Buffer at the specified `offset`. The `value` should be a
+valid signed 8-bit integer. Behavior is not defined when `value` is anything
+other than a signed 8-bit integer.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
@@ -1121,7 +1125,8 @@ console.log(buf);
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little
-endian). The `value` must be a valid signed 16-bit integer.
+endian). The `value` should be a valid signed 16-bit integer. Behavior is
+not defined when `value` is anything other than a signed 16-bit integer.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
@@ -1148,7 +1153,8 @@ console.log(buf);
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little
-endian). The `value` must be a valid signed 32-bit integer.
+endian). The `value` should be a valid signed 32-bit integer. Behavior is
+not defined when `value` is anything other than a signed 32-bit integer.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
@@ -1194,6 +1200,8 @@ that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
should not be used unless you are certain of correctness.
+Behavior is not defined when `value` is anything other than an integer.
+
### buf.writeUInt8(value, offset[, noAssert])
* `value` {Number} Bytes to be written to Buffer
@@ -1201,8 +1209,9 @@ should not be used unless you are certain of correctness.
* `noAssert` {Boolean} Default: false
* Return: {Number} The offset plus the number of written bytes
-Writes `value` to the Buffer at the specified `offset`. The `value` must be a
-valid unsigned 8-bit integer.
+Writes `value` to the Buffer at the specified `offset`. The `value` should be a
+valid unsigned 8-bit integer. Behavior is not defined when `value` is anything
+other than an unsigned 8-bit integer.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
@@ -1232,7 +1241,8 @@ console.log(buf);
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little
-endian). The `value` must be a valid unsigned 16-bit integer.
+endian). The `value` should be a valid unsigned 16-bit integer. Behavior is
+not defined when `value` is anything other than an unsigned 16-bit integer.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
@@ -1266,7 +1276,8 @@ console.log(buf);
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little
-endian). The `value` must be a valid unsigned 32-bit integer.
+endian). The `value` should be a valid unsigned 32-bit integer. Behavior is
+not defined when `value` is anything other than an unsigned 32-bit integer.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
@@ -1312,6 +1323,8 @@ that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
should not be used unless you are certain of correctness.
+Behavior is not defined when `value` is anything other than an unsigned integer.
+
## buffer.INSPECT_MAX_BYTES
* {Number} Default: 50
diff --git a/doc/api/child_process.markdown b/doc/api/child_process.markdown
index 2e7d137f12a65f..7f03ed38284426 100644
--- a/doc/api/child_process.markdown
+++ b/doc/api/child_process.markdown
@@ -130,8 +130,8 @@ exec('my.bat', (err, stdout, stderr) => {
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
* `callback` {Function} called with the output when process terminates
* `error` {Error}
- * `stdout` {Buffer}
- * `stderr` {Buffer}
+ * `stdout` {String|Buffer}
+ * `stderr` {String|Buffer}
* Return: {ChildProcess}
Spawns a shell then executes the `command` within that shell, buffering any
@@ -156,6 +156,13 @@ the exit code of the child process while `error.signal` will be set to the
signal that terminated the process. Any exit code other than `0` is considered
to be an error.
+The `stdout` and `stderr` arguments passed to the callback will contain the
+stdout and stderr output of the child process. By default, Node.js will decode
+the output as UTF-8 and pass strings to the callback. The `encoding` option
+can be used to specify the character encoding used to decode the stdout and
+stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to
+the callback instead.
+
The `options` argument may be passed as the second argument to customize how
the process is spawned. The default options are:
@@ -197,8 +204,8 @@ replace the existing process and uses a shell to execute the command.*
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
* `callback` {Function} called with the output when process terminates
* `error` {Error}
- * `stdout` {Buffer}
- * `stderr` {Buffer}
+ * `stdout` {String|Buffer}
+ * `stderr` {String|Buffer}
* Return: {ChildProcess}
The `child_process.execFile()` function is similar to [`child_process.exec()`][]
@@ -219,6 +226,13 @@ const child = execFile('node', ['--version'], (error, stdout, stderr) => {
});
```
+The `stdout` and `stderr` arguments passed to the callback will contain the
+stdout and stderr output of the child process. By default, Node.js will decode
+the output as UTF-8 and pass strings to the callback. The `encoding` option
+can be used to specify the character encoding used to decode the stdout and
+stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to
+the callback instead.
+
### child_process.fork(modulePath[, args][, options])
* `modulePath` {String} The module to run in the child
@@ -386,8 +400,27 @@ Doing so will cause the parent's event loop to not include the child in its
reference count, allowing the parent to exit independently of the child, unless
there is an established IPC channel between the child and parent.
-Example of detaching a long-running process and redirecting its output to a
-file:
+When using the `detached` option to start a long-running process, the process
+will not stay running in the background after the parent exits unless it is
+provided with a `stdio` configuration that is not connected to the parent.
+If the parent's `stdio` is inherited, the child will remain attached to the
+controlling terminal.
+
+Example of a long-running process, by detaching and also ignoring its parent
+`stdio` file descriptors, in order to ignore the parent's termination:
+
+```js
+const spawn = require('child_process').spawn;
+
+const child = spawn(process.argv[0], ['child_program.js'], {
+ detached: true,
+ stdio: ['ignore']
+});
+
+child.unref();
+```
+
+Alternatively one can redirect the child process' output into files:
```js
const fs = require('fs');
@@ -403,12 +436,6 @@ const child = spawn('prg', [], {
child.unref();
```
-When using the `detached` option to start a long-running process, the process
-will not stay running in the background after the parent exits unless it is
-provided with a `stdio` configuration that is not connected to the parent.
-If the parent's `stdio` is inherited, the child will remain attached to the
-controlling terminal.
-
#### options.stdio
The `options.stdio` option is used to configure the pipes that are established
diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown
index d176a482274c18..29fd956a7793d2 100644
--- a/doc/api/crypto.markdown
+++ b/doc/api/crypto.markdown
@@ -286,7 +286,7 @@ cipher text should be discarded due to failed authentication.
### decipher.setAutoPadding(auto_padding=true)
When data has been encrypted without standard block padding, calling
-`decipher.setAuthPadding(false)` will disable automatic padding to prevent
+`decipher.setAutoPadding(false)` will disable automatic padding to prevent
[`decipher.final()`][] from checking for and removing padding.
Turning auto padding off will only work if the input data's length is a
@@ -719,6 +719,28 @@ console.log(sign.sign(private_key, 'hex'));
// Prints the calculated signature
```
+A [`sign`][] instance can also be created by just passing in the digest
+algorithm name, in which case OpenSSL will infer the full signature algorithm
+from the type of the PEM-formatted private key, including algorithms that
+do not have directly exposed name constants, e.g. 'ecdsa-with-SHA256'.
+
+Example: signing using ECDSA with SHA256
+
+```js
+const crypto = require('crypto');
+const sign = crypto.createSign('sha256');
+
+sign.update('some data to sign');
+
+const private_key = '-----BEGIN EC PRIVATE KEY-----\n' +
+ 'MHcCAQEEIF+jnWY1D5kbVYDNvxxo/Y+ku2uJPDwS0r/VuPZQrjjVoAoGCCqGSM49\n' +
+ 'AwEHoUQDQgAEurOxfSxmqIRYzJVagdZfMMSjRNNhB8i3mXyIMq704m2m52FdfKZ2\n' +
+ 'pQhByd5eyj3lgZ7m7jbchtdgyOF8Io/1ng==\n' +
+ '-----END EC PRIVATE KEY-----\n';
+
+console.log(sign.sign(private_key).toString('hex'));
+```
+
### sign.sign(private_key[, output_format])
Calculates the signature on all the data passed through using either
diff --git a/doc/api/globals.markdown b/doc/api/globals.markdown
index 9ee5e48983730a..1bee7d0cf988c2 100644
--- a/doc/api/globals.markdown
+++ b/doc/api/globals.markdown
@@ -30,6 +30,16 @@ console.log(__dirname);
`__dirname` isn't actually a global but rather local to each module.
+For instance, given two modules: `a` and `b`, where `b` is a dependency of
+`a` and there is a directory structure of:
+
+* `/Users/mjr/app/a.js`
+* `/Users/mjr/app/node_modules/b/b.js`
+
+References to `__dirname` within `b.js` will return
+`/Users/mjr/app/node_modules/b` while references to `__dirname` within `a.js`
+will return `/Users/mj/app`.
+
## \_\_filename
@@ -50,19 +60,23 @@ console.log(__filename);
`__filename` isn't actually a global but rather local to each module.
-## clearInterval(t)
+## clearImmediate(immediateObject)
+
+
+
+[`clearImmediate`] is described in the [timers][] section.
-Stop a timer that was previously created with [`setInterval()`][]. The callback
-will not execute.
+## clearInterval(intervalObject)
-The timer functions are global variables. See the [timers][] section.
+[`clearInterval`] is described in the [timers][] section.
-## clearTimeout(t)
+## clearTimeout(timeoutObject)
-Stop a timer that was previously created with [`setTimeout()`][]. The callback will
-not execute.
+
+
+[`clearTimeout`] is described in the [timers][] section.
## console
@@ -162,34 +176,33 @@ left untouched.
Use the internal `require()` machinery to look up the location of a module,
but rather than loading the module, just return the resolved filename.
-## setInterval(cb, ms)
+## setImmediate(callback[, arg][, ...])
+
+
-Run callback `cb` repeatedly every `ms` milliseconds. Note that the actual
-interval may vary, depending on external factors like OS timer granularity and
-system load. It's never less than `ms` but it may be longer.
+[`setImmediate`] is described in the [timers][] section.
-The interval must be in the range of 1-2,147,483,647 inclusive. If the value is
-outside that range, it's changed to 1 millisecond. Broadly speaking, a timer
-cannot span more than 24.8 days.
+## setInterval(callback, delay[, arg][, ...])
-Returns an opaque value that represents the timer.
+
-## setTimeout(cb, ms)
+[`setInterval`] is described in the [timers][] section.
-Run callback `cb` after *at least* `ms` milliseconds. The actual delay depends
-on external factors like OS timer granularity and system load.
+## setTimeout(callback, delay[, arg][, ...])
-The timeout must be in the range of 1-2,147,483,647 inclusive. If the value is
-outside that range, it's changed to 1 millisecond. Broadly speaking, a timer
-cannot span more than 24.8 days.
+
-Returns an opaque value that represents the timer.
+[`setTimeout`] is described in the [timers][] section.
[`console`]: console.html
[`process` object]: process.html#process_process
-[`setInterval()`]: #globals_setinterval_cb_ms
-[`setTimeout()`]: #globals_settimeout_cb_ms
[buffer section]: buffer.html
[module system documentation]: modules.html
[Modules]: modules.html#modules_modules
[timers]: timers.html
+[`clearImmediate`]: timers.html#timers_clearimmediate_immediateobject
+[`clearInterval`]: timers.html#timers_clearinterval_intervalobject
+[`clearTimeout`]: timers.html#timers_cleartimeout_timeoutobject
+[`setImmediate`]: timers.html#timers_setimmediate_callback_arg
+[`setInterval`]: timers.html#timers_setinterval_callback_delay_arg
+[`setTimeout`]: timers.html#timers_settimeout_callback_delay_arg
diff --git a/doc/api/path.markdown b/doc/api/path.markdown
index e691d041458cc7..8ebb5fd08a5034 100644
--- a/doc/api/path.markdown
+++ b/doc/api/path.markdown
@@ -92,7 +92,7 @@ and the `base` property.
If the `dir` property is not supplied, the `root` property will be used as the
`dir` property. However, it will be assumed that the `root` property already
ends with the platform-dependent path separator. In this case, the returned
-string will be the concatenation fo the `root` property and the `base` property.
+string will be the concatenation of the `root` property and the `base` property.
If both the `dir` and the `root` properties are not supplied, then the returned
string will be the contents of the `base` property.
@@ -102,28 +102,41 @@ and the `ext` property will be used as the `base` property.
Examples:
-An example on Posix systems:
+Some Posix system examples:
```js
+// If `dir` and `base` are provided, `dir` + platform separator + `base`
+// will be returned.
path.format({
- root : "/",
- dir : "/home/user/dir",
- base : "file.txt",
- ext : ".txt",
- name : "file"
+ dir: '/home/user/dir',
+ base: 'file.txt'
});
// returns '/home/user/dir/file.txt'
-// `root` will be used if `dir` is not specified and `name` + `ext` will be used
-// if `base` is not specified
+// `root` will be used if `dir` is not specified.
+// `name` + `ext` will be used if `base` is not specified.
+// If only `root` is provided or `dir` is equal to `root` then the
+// platform separator will not be included.
path.format({
- root : "/",
- ext : ".txt",
- name : "file"
-})
+ root: '/',
+ base: 'file.txt'
+});
// returns '/file.txt'
-```
+path.format({
+ dir: '/',
+ root: '/',
+ name: 'file',
+ ext: '.txt'
+});
+// returns '/file.txt'
+
+// `base` will be returned if `dir` or `root` are not provided.
+path.format({
+ base: 'file.txt'
+});
+// returns 'file.txt'
+```
An example on Windows:
```js
diff --git a/doc/api/timers.markdown b/doc/api/timers.markdown
index 7859e7fecd6273..3990ab6c1d391d 100644
--- a/doc/api/timers.markdown
+++ b/doc/api/timers.markdown
@@ -27,7 +27,7 @@ Returns the timer.
## setImmediate(callback[, arg][, ...])
-To schedule the "immediate" execution of `callback` after I/O events'
+Schedules "immediate" execution of `callback` after I/O events'
callbacks and before timers set by [`setTimeout`][] and [`setInterval`][] are
triggered. Returns an `immediateObject` for possible use with
[`clearImmediate`][]. Additional optional arguments may be passed to the
@@ -40,7 +40,7 @@ until the next event loop iteration.
## setInterval(callback, delay[, arg][, ...])
-To schedule the repeated execution of `callback` every `delay` milliseconds.
+Schedules repeated execution of `callback` every `delay` milliseconds.
Returns a `intervalObject` for possible use with [`clearInterval`][]. Additional
optional arguments may be passed to the callback.
@@ -50,7 +50,7 @@ milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the
## setTimeout(callback, delay[, arg][, ...])
-To schedule execution of a one-time `callback` after `delay` milliseconds.
+Schedules execution of a one-time `callback` after `delay` milliseconds.
Returns a `timeoutObject` for possible use with [`clearTimeout`][]. Additional
optional arguments may be passed to the callback.
diff --git a/doc/api_assets/style.css b/doc/api_assets/style.css
index 47f3392395932f..b093b2c3fe11fd 100644
--- a/doc/api_assets/style.css
+++ b/doc/api_assets/style.css
@@ -5,7 +5,6 @@ html {
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
height: 100%;
- overflow: hidden;
}
body {
@@ -15,9 +14,8 @@ body {
padding: 0;
color: #333;
background: #fff;
- overflow: hidden;
+ overflow: auto;
height: 100%;
- display: block;
}
pre, tt, code, .pre, span.type, a.type {
@@ -27,7 +25,6 @@ pre, tt, code, .pre, span.type, a.type {
#content {
font-size: 1.8em;
overflow: hidden;
- display: block;
position: relative;
height: 100%;
}
@@ -426,7 +423,7 @@ a code {
}
span > .mark, span > .mark:visited {
- font-size: 18px;
+ font-size: 1em;
color: #707070;
position: absolute;
top: 0px;
@@ -458,16 +455,15 @@ th > *:last-child, td > *:last-child {
@media only screen and (max-width: 1024px) {
#content {
- font-size: 2.1em;
+ font-size: 2.5em;
+ overflow: visible;
}
#column1.interior {
margin-left: 0;
padding-left: .5em;
padding-right: .5em;
width: auto;
- }
- pre {
- margin-right: 0;
+ overflow-y: visible;
}
#column2 {
display: none;
@@ -476,18 +472,6 @@ th > *:last-child, td > *:last-child {
@media only screen and (max-width: 1024px) and (orientation: portrait) {
#content {
- font-size: 2.4em;
- }
- #column1.interior {
- margin-left: 0;
- padding-left: .5em;
- padding-right: .5em;
- width: auto;
- }
- pre {
- margin-right: 0;
- }
- #column2 {
- display: none;
+ font-size: 3.5em;
}
}
diff --git a/doc/topics/the-event-loop-timers-and-nexttick.md b/doc/topics/the-event-loop-timers-and-nexttick.md
new file mode 100644
index 00000000000000..2676b94da37ef4
--- /dev/null
+++ b/doc/topics/the-event-loop-timers-and-nexttick.md
@@ -0,0 +1,467 @@
+# The Node.js Event Loop, Timers, and `process.nextTick()`
+
+## What is the Event Loop?
+
+The event loop is what allows Node.js to perform non-blocking I/O
+operations — despite the fact that JavaScript is single-threaded — by
+offloading operations to the system kernel whenever possible.
+
+Since most modern kernels are multi-threaded, they can handle multiple
+operations executing in the background. When one of these operations
+completes, the kernel tells Node.js so that the appropriate callback
+may added to the `poll` queue to eventually be executed. We'll explain
+this in further detail later in this topic.
+
+## Event Loop Explained
+
+When Node.js starts, it initializes the event loop, processes the
+provided input script (or drops into the REPL, which is not covered in
+this document) which may make async API calls, schedule timers, or call
+`process.nextTick()`, then begins processing the event loop.
+
+The following diagram shows a simplified overview of the event loop's
+order of operations.
+
+ ┌───────────────────────┐
+ ┌─>│ timers │
+ │ └──────────┬────────────┘
+ │ ┌──────────┴────────────┐
+ │ │ I/O callbacks │
+ │ └──────────┬────────────┘
+ │ ┌──────────┴────────────┐
+ │ │ idle, prepare │
+ │ └──────────┬────────────┘ ┌───────────────┐
+ │ ┌──────────┴────────────┐ │ incoming: │
+ │ │ poll │<─────┤ connections, │
+ │ └──────────┬────────────┘ │ data, etc. │
+ │ ┌──────────┴────────────┐ └───────────────┘
+ │ │ check │
+ │ └──────────┬────────────┘
+ │ ┌──────────┴────────────┐
+ └──┤ close callbacks │
+ └───────────────────────┘
+
+*note: each box will be referred to as a "phase" of the event loop.*
+
+Each phase has a FIFO queue of callbacks to execute. While each phase is
+special in its own way, generally, when the event loop enters a given
+phase, it will perform any operations specific to that phase, then
+execute callbacks in that phase's queue until the queue has been
+exhausted or the maximum number of callbacks have executed. When the
+queue has been exhausted or the callback limit is reached, the event
+loop will move to the next phase, and so on.
+
+Since any of these operations may schedule _more_ operations and new
+events processed in the `poll` phase are queued by the kernel, poll
+events can be queued while polling events are being processed. As a
+result, long running callbacks can allow the poll phase to run much
+longer than a timer's threshold. See the [`timers`](#timers) and
+[`poll`](#poll) sections for more details.
+
+_**NOTE:** There is a slight discrepancy between the Windows and the
+Unix/Linux implementation, but that's not important for this
+demonstration. The most important parts are here. There are actually
+seven or eight steps, but the ones we care about — ones that Node.js
+actually uses are those above._
+
+
+## Phases Overview:
+
+* `timers`: this phase executes callbacks scheduled by `setTimeout()`
+ and `setInterval()`.
+* `I/O callbacks`: most types of callback except timers, setImmedate, close
+* `idle, prepare`: only used internally
+* `poll`: retrieve new I/O events; node will block here when appropriate
+* `check`: setImmediate callbacks are invoked here
+* `close callbacks`: e.g socket.on('close', ...)
+
+Between each run of the event loop, Node.js checks if it is waiting for
+any asynchronous I/O or timer and it shuts down cleanly if there are not
+any.
+
+## Phases in Detail
+
+### timers
+
+A timer specifies the **threshold** _after which_ a provided callback
+_may be executed_ rather than the **exact** time a person _wants it to
+be executed_. Timers callbacks will run as early as they can be
+scheduled after the specified amount of time has passed; however,
+Operating System scheduling or the running of other callbacks may delay
+them.
+
+_**Note**: Technically, the [`poll` phase](#poll) controls when timers
+are executed._
+
+For example, say you schedule a timeout to execute after a 100 ms
+threshold, then your script starts asynchronously reading a file which
+takes 95 ms:
+
+```js
+
+var fs = require('fs');
+
+function someAsyncOperation (callback) {
+
+ // let's assume this takes 95ms to complete
+ fs.readFile('/path/to/file', callback);
+
+}
+
+var timeoutScheduled = Date.now();
+
+setTimeout(function () {
+
+ var delay = Date.now() - timeoutScheduled;
+
+ console.log(delay + "ms have passed since I was scheduled");
+}, 100);
+
+
+// do someAsyncOperation which takes 95 ms to complete
+someAsyncOperation(function () {
+
+ var startCallback = Date.now();
+
+ // do something that will take 10ms...
+ while (Date.now() - startCallback < 10) {
+ ; // do nothing
+ }
+
+});
+```
+
+When the event loop enters the `poll` phase, it has an empty queue
+(`fs.readFile()` has not completed) so it will wait for the number of ms
+remaining until the soonest timer's threshold is reached. While it is
+waiting 95 ms pass, `fs.readFile()` finishes reading the file and its
+callback which takes 10 ms to complete is added to the `poll` queue and
+executed. When the callback finishes, there are no more callbacks in the
+queue, so the event loop will see that the threshold of the soonest
+timer has been reached then wrap back to the `timers` phase to execute
+the timer's callback. In this example, you will see that the total delay
+between the timer being scheduled and its callback being executed will
+be 105ms.
+
+Note: To prevent the `poll` phase from starving the event loop, libuv
+also has a hard maximum (system dependent) before it stops `poll`ing for
+more events.
+
+### I/O callbacks:
+
+This phase executes callbacks for some system operations such as types
+of TCP errors. For example if a TCP socket receives `ECONNREFUSED` when
+attempting to connect, some \*nix systems want to wait to report the
+error. This will be queued to execute in the `I/O callbacks` phase.
+
+### poll:
+
+The poll phase has two main functions:
+
+1. Executing scripts for timers who's threshold has elapsed, then
+2. Processing events in the `poll` queue.
+
+
+When the event loop enters the `poll` phase _and there are no timers
+scheduled_, one of two things will happen:
+
+* _If the `poll` queue **is not empty**_, the event loop will iterate
+through its queue of callbacks executing them synchronously until
+either the queue has been exhausted, or the system-dependent hard limit
+is reached.
+
+* _If the `poll` queue is **empty**, one of two more things will
+happen:
+ * If scripts have been scheduled by `setImmediate()`, the event loop
+ will end the `poll` phase and continue to the `check` phase to
+ execute those scheduled scripts.
+
+ * If scripts **have not** been scheduled by `setImmediate()`, the
+ event loop will wait for callbacks to be added to the queue, then
+ execute it immediately.
+
+Once the `poll` queue is empty the event loop will check for timers
+_whose time thresholds have been reached_. If one or more timers are
+ready, the event loop will wrap back to the timers phase to execute
+those timers' callbacks.
+
+### `check`:
+
+This phase allows a person to execute callbacks immediately after the
+`poll` phase has completed. If the `poll` phase becomes idle and
+scripts have been queued with `setImmediate()`, the event loop may
+continue to the `check` phase rather than waiting.
+
+`setImmediate()` is actually a special timer that runs in a separate
+phase of the event loop. It uses a libuv API that schedules callbacks to
+execute after the `poll` phase has completed.
+
+Generally, as the code is executed, the event loop will eventually hit
+the `poll` phase where it will wait for an incoming connection, request,
+etc. However, after a callback has been scheduled with `setImmediate()`,
+then the `poll` phase becomes idle, it will end and continue to the
+`check` phase rather than waiting for `poll` events.
+
+### `close callbacks`:
+
+If a socket or handle is closed abruptly (e.g. `socket.destroy()`), the
+`'close'` event will be emitted in this phase. Otherwise it will be
+emitted via `process.nextTick()`.
+
+## `setImmediate()` vs `setTimeout()`
+
+`setImmediate` and `setTimeout()` are similar, but behave in different
+ways depending on when they are called.
+
+* `setImmediate()` is designed to execute a script once the current
+`poll` phase completes.
+* `setTimeout()` schedules a script to be run
+after a minimum threshold in ms has elapsed.
+
+The order in which they are execute varies depending on the context in
+which they are called. If both are called in the main module then you
+are bound to how fast your process go, which is impacted by other
+programs running on your machine.
+
+For example, if we run the following script which is not within a I/O
+cycle (i.e. the main module), the order in which the two functions are
+executed is non-deterministic as it is based upon how fast your process
+goes (which is impacted by other programs running on your machine):
+
+
+```js
+// timeout_vs_immediate.js
+setTimeout(function timeout () {
+ console.log('timeout');
+},0);
+
+setImmediate(function immediate () {
+ console.log('immediate');
+});
+```
+
+ $ node timeout_vs_immediate.js
+ timeout
+ immediate
+
+ $ node timeout_vs_immediate.js
+ immediate
+ timeout
+
+
+However, if you move the two calls within an I/O cycle, the immediate
+callback is always executed first:
+
+```js
+// timeout_vs_immediate.js
+var fs = require('fs')
+
+fs.readFile(__filename, () => {
+ setTimeout(() => {
+ console.log('timeout')
+ }, 0)
+ setImmediate(() => {
+ console.log('immediate')
+ })
+})
+```
+
+ $ node timeout_vs_immediate.js
+ immediate
+ timeout
+
+ $ node timeout_vs_immediate.js
+ immediate
+ timeout
+
+The main advantage to using `setImmediate()` over `setTimeout()` is
+`setImmediate()` will always be executed before any timers if scheduled
+within an I/O cycle, independently of how many timers are present.
+
+## `process.nextTick()`:
+
+### Understanding `process.nextTick()`
+
+You may have noticed that `process.nextTick()` was not displayed in the
+diagram, even though its a part of the asynchronous API. This is because
+`process.nextTick()` is not technically part of the event loop. Instead,
+the nextTickQueue will be processed after the current operation
+completes, regardless of the current `phase` of the event loop.
+
+Looking back at our diagram, any time you call `process.nextTick()` in a
+given phase, all callbacks passed to `process.nextTick()` will be
+resolved before the event loop continues. This can create some bad
+situations because **it allows you to "starve" your I/O by making
+recursive `process.nextTick()` calls.** which prevents the event loop
+from reaching the `poll` phase.
+
+### Why would that be allowed?
+
+Why would something like this be included in Node.js? Part of it is a
+design philosophy where an API should always be asynchronous even where
+it doesn't have to be. Take this code snippet for example:
+
+```js
+function apiCall (arg, callback) {
+ if (typeof arg !== 'string')
+ return process.nextTick(callback,
+ new TypeError('argument should be string'));
+}
+```
+
+The snippet does an argument check and if it's not correct, it will pass
+the error to the callback. The API updated fairly recently to allow
+passing arguments to `process.nextTick()` allowing it to take any
+arguments passed after the callback to be propagated as the arguments to
+the callback so you don't have to nest functions.
+
+What we're doing is passing an error back to the user but only *after*
+we have allowed the rest of the user's code to execute. By using
+`process.nextTick()` we guarantee that `apiCall()` always runs its
+callback *after* the rest of the user's code and *before* the event loop
+is allowed to proceed. To acheive this, the JS call stack is allowed to
+unwind then immediately execute the provided callback which allows a
+person to make recursive calls to nextTick without reaching a
+`RangeError: Maximum call stack size exceeded from v8`.
+
+This philosophy can lead to some potentially problematic situations.
+Take this snippet for example:
+
+```js
+// this has an asynchronous signature, but calls callback synchronously
+function someAsyncApiCall (callback) { callback(); };
+
+// the callback is called before `someAsyncApiCall` completes.
+someAsyncApiCall(() => {
+
+ // since someAsyncApiCall has completed, bar hasn't been assigned any value
+ console.log('bar', bar); // undefined
+
+});
+
+var bar = 1;
+```
+
+The user defines `someAsyncApiCall()` to have an asynchronous signature,
+actually operates synchronously. When it is called, the callback
+provided to `someAsyncApiCall ()` is called in the same phase of the
+event loop because `someAsyncApiCall()` doesn't actually do anything
+asynchronously. As a result, the callback tries to reference `bar` but
+it may not have that variable in scope yet because the script has not
+been able to run to completion.
+
+By placing it in a `process.nextTick()`, the script still has the
+ability to run to completion, allowing all the variables, functions,
+etc., to be initialized prior to the callback being called. It also has
+the advantage of not allowing the event loop to continue. It may be
+useful that the user be alerted to an error before the event loop is
+allowed to continue.
+
+A real world example in node would be:
+
+```js
+const server = net.createServer(() => {}).listen(8080);
+
+server.on('listening', () => {});
+```
+
+When only a port is passed the port is bound immediately. So the
+`'listening'` callback could be called immediately. Problem is that the
+`.on('listening')` will not have been set by that time.
+
+To get around this the `'listening'` event is queued in a `nextTick()`
+to allow the script to run to completion. Which allows the user to set
+any event handlers they want.
+
+## `process.nextTick()` vs `setImmediate()`
+
+We have two calls that are similar as far as users are concerned, but
+their names are confusing.
+
+* `process.nextTick()` fires immediately on the same phase
+* `setImmediate()` fires on the following iteration or 'tick' of the
+event loop
+
+In essence, the names should be swapped. `process.nextTick()` fires more
+immediately than `setImmediate()` but this is an artifact of the past
+which is unlikely to change. Making this switch would break a large
+percentage of the packages on npm. Every day more new modules are being
+added, which mean every day we wait, more potential breakages occur.
+While they are confusing, the names themselves won't change.
+
+*We recommend developers use `setImmediate()` in all cases because its
+easier to reason about (and it leads to code that's compatible with a
+wider variety of environments, like browser JS.)*
+
+## Why use `process.nextTick()`?
+
+There are two main reasons:
+
+1. Allow users to handle errors, cleanup any then unneeded resources, or
+perhaps try the request again before the event loop continues.
+
+2. At times it's necessary to allow a callback to run after the call
+stack has unwound but before the event loop continues.
+
+One example is to match the user's expectations. Simple example:
+
+```js
+var server = net.createServer();
+server.on('connection', function(conn) { });
+
+server.listen(8080);
+server.on('listening', function() { });
+```
+
+Say that listen() is run at the beginning of the event loop, but the
+listening callback is placed in a `setImmediate()`. Now, unless a
+hostname is passed binding to the port will happen immediately. Now for
+the event loop to proceed it must hit the `poll` phase, which means
+there is a non-zero chance that a connection could have been received
+allowing the connection event to be fired before the listening event.
+
+Another example is running a function constructor that was to, say,
+inherit from `EventEmitter` and it wanted to call an event within the
+constructor:
+
+```js
+const EventEmitter = require('events');
+const util = require('util');
+
+function MyEmitter() {
+ EventEmitter.call(this);
+ this.emit('event');
+}
+util.inherits(MyEmitter, EventEmitter);
+
+const myEmitter = new MyEmitter();
+myEmitter.on('event', function() {
+ console.log('an event occurred!');
+});
+```
+
+You can't emit an event from the constructor immediately
+because the script will not have processed to the point where the user
+assigns a callback to that event. So, within the constructor itself,
+you can use `process.nextTick()` to set a callback to emit the event
+after the constructor has finished, which provides the expected results:
+
+```js
+const EventEmitter = require('events');
+const util = require('util');
+
+function MyEmitter() {
+ EventEmitter.call(this);
+
+ // use nextTick to emit the event once a handler is assigned
+ process.nextTick(function () {
+ this.emit('event');
+ }.bind(this));
+}
+util.inherits(MyEmitter, EventEmitter);
+
+const myEmitter = new MyEmitter();
+myEmitter.on('event', function() {
+ console.log('an event occurred!');
+});
+```
diff --git a/lib/_debug_agent.js b/lib/_debug_agent.js
index 152a7c65a63575..cb4684f0eddfac 100644
--- a/lib/_debug_agent.js
+++ b/lib/_debug_agent.js
@@ -119,10 +119,10 @@ Client.prototype._transform = function _transform(data, enc, cb) {
while (true) {
if (this.state === 'headers') {
// Not enough data
- if (!/\r\n/.test(this.buffer))
+ if (!this.buffer.includes('\r\n'))
break;
- if (/^\r\n/.test(this.buffer)) {
+ if (this.buffer.startsWith('\r\n')) {
this.buffer = this.buffer.slice(2);
this.state = 'body';
continue;
diff --git a/lib/_debugger.js b/lib/_debugger.js
index 3681ce58802a62..2bb9b7834cd654 100644
--- a/lib/_debugger.js
+++ b/lib/_debugger.js
@@ -1342,7 +1342,7 @@ Interface.prototype.setBreakpoint = function(script, line,
}
let req;
- if (/\(\)$/.test(script)) {
+ if (script.endsWith('()')) {
// setBreakpoint('functionname()');
req = {
type: 'function',
diff --git a/lib/assert.js b/lib/assert.js
index b33dbfa6cd1d4c..d9e107688ad4b2 100644
--- a/lib/assert.js
+++ b/lib/assert.js
@@ -29,6 +29,7 @@ const compare = process.binding('buffer').compare;
const util = require('util');
const Buffer = require('buffer').Buffer;
const pSlice = Array.prototype.slice;
+const pToString = (obj) => Object.prototype.toString.call(obj);
// 1. The assert module provides functions that throw
// AssertionError's when particular conditions are not met. The
@@ -170,10 +171,18 @@ function _deepEqual(actual, expected, strict) {
(expected === null || typeof expected !== 'object')) {
return strict ? actual === expected : actual == expected;
- // If both values are instances of typed arrays, wrap them in
- // a Buffer each to increase performance
- } else if (ArrayBuffer.isView(actual) && ArrayBuffer.isView(expected)) {
- return compare(new Buffer(actual), new Buffer(expected)) === 0;
+ // If both values are instances of typed arrays, wrap their underlying
+ // ArrayBuffers in a Buffer each to increase performance
+ // This optimization requires the arrays to have the same type as checked by
+ // Object.prototype.toString (aka pToString). Never perform binary
+ // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
+ // bit patterns are not identical.
+ } else if (ArrayBuffer.isView(actual) && ArrayBuffer.isView(expected) &&
+ pToString(actual) === pToString(expected) &&
+ !(actual instanceof Float32Array ||
+ actual instanceof Float64Array)) {
+ return compare(new Buffer(actual.buffer),
+ new Buffer(expected.buffer)) === 0;
// 7.5 For all other Object pairs, including Array objects, equivalence is
// determined by having the same number of owned properties (as verified
diff --git a/lib/cluster.js b/lib/cluster.js
index 4f7ca58170468f..e4bbd5f3ff7838 100644
--- a/lib/cluster.js
+++ b/lib/cluster.js
@@ -237,9 +237,8 @@ function masterInit() {
// Without --logfile=v8-%p.log, everything ends up in a single, unusable
// file. (Unusable because what V8 logs are memory addresses and each
// process has its own memory mappings.)
- if (settings.execArgv.some(function(s) { return /^--prof/.test(s); }) &&
- !settings.execArgv.some(function(s) { return /^--logfile=/.test(s); }))
- {
+ if (settings.execArgv.some((s) => s.startsWith('--prof')) &&
+ !settings.execArgv.some((s) => s.startsWith('--logfile='))) {
settings.execArgv = settings.execArgv.concat(['--logfile=v8-%p.log']);
}
cluster.settings = settings;
diff --git a/lib/dns.js b/lib/dns.js
index 5a87b8c865f616..d577023b50c440 100644
--- a/lib/dns.js
+++ b/lib/dns.js
@@ -241,7 +241,7 @@ function resolver(bindingName) {
}
-var resolveMap = {};
+var resolveMap = Object.create(null);
exports.resolve4 = resolveMap.A = resolver('queryA');
exports.resolve6 = resolveMap.AAAA = resolver('queryAaaa');
exports.resolveCname = resolveMap.CNAME = resolver('queryCname');
diff --git a/lib/fs.js b/lib/fs.js
index 3deb3090fd9731..64978efb9d0b2c 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -1098,7 +1098,7 @@ function writeAll(fd, buffer, offset, length, position, callback_) {
fs.write(fd, buffer, offset, length, position, function(writeErr, written) {
if (writeErr) {
fs.close(fd, function() {
- if (callback) callback(writeErr);
+ callback(writeErr);
});
} else {
if (written === length) {
@@ -1131,7 +1131,7 @@ fs.writeFile = function(path, data, options, callback_) {
var flag = options.flag || 'w';
fs.open(path, flag, options.mode, function(openErr, fd) {
if (openErr) {
- if (callback) callback(openErr);
+ callback(openErr);
} else {
var buffer = (data instanceof Buffer) ? data : new Buffer('' + data,
options.encoding || 'utf8');
diff --git a/lib/internal/socket_list.js b/lib/internal/socket_list.js
index 950d632a26360d..0f4be6df239dd6 100644
--- a/lib/internal/socket_list.js
+++ b/lib/internal/socket_list.js
@@ -58,13 +58,11 @@ SocketListSend.prototype.getConnections = function getConnections(callback) {
function SocketListReceive(slave, key) {
EventEmitter.call(this);
- var self = this;
-
this.connections = 0;
this.key = key;
this.slave = slave;
- function onempty() {
+ function onempty(self) {
if (!self.slave.connected) return;
self.slave.send({
@@ -73,21 +71,21 @@ function SocketListReceive(slave, key) {
});
}
- this.slave.on('internalMessage', function(msg) {
- if (msg.key !== self.key) return;
+ this.slave.on('internalMessage', (msg) => {
+ if (msg.key !== this.key) return;
if (msg.cmd === 'NODE_SOCKET_NOTIFY_CLOSE') {
// Already empty
- if (self.connections === 0) return onempty();
+ if (this.connections === 0) return onempty(this);
// Wait for sockets to get closed
- self.once('empty', onempty);
+ this.once('empty', onempty);
} else if (msg.cmd === 'NODE_SOCKET_GET_COUNT') {
- if (!self.slave.connected) return;
- self.slave.send({
+ if (!this.slave.connected) return;
+ this.slave.send({
cmd: 'NODE_SOCKET_COUNT',
- key: self.key,
- count: self.connections
+ key: this.key,
+ count: this.connections
});
}
});
@@ -95,14 +93,12 @@ function SocketListReceive(slave, key) {
util.inherits(SocketListReceive, EventEmitter);
SocketListReceive.prototype.add = function(obj) {
- var self = this;
-
this.connections++;
// Notify previous owner of socket about its state change
- obj.socket.once('close', function() {
- self.connections--;
+ obj.socket.once('close', () => {
+ this.connections--;
- if (self.connections === 0) self.emit('empty');
+ if (this.connections === 0) this.emit('empty', this);
});
};
diff --git a/lib/os.js b/lib/os.js
index ddf7cee9d48791..42ece99a7d266c 100644
--- a/lib/os.js
+++ b/lib/os.js
@@ -24,23 +24,23 @@ exports.platform = function() {
return process.platform;
};
-const trailingSlashRe = isWindows ? /[^:]\\$/
- : /.\/$/;
-
exports.tmpdir = function() {
var path;
if (isWindows) {
path = process.env.TEMP ||
process.env.TMP ||
(process.env.SystemRoot || process.env.windir) + '\\temp';
+ if (path.length > 1 && path.endsWith('\\') && !path.endsWith(':\\'))
+ path = path.slice(0, -1);
} else {
path = process.env.TMPDIR ||
process.env.TMP ||
process.env.TEMP ||
'/tmp';
+ if (path.length > 1 && path.endsWith('/'))
+ path = path.slice(0, -1);
}
- if (trailingSlashRe.test(path))
- path = path.slice(0, -1);
+
return path;
};
diff --git a/lib/querystring.js b/lib/querystring.js
index b034635668faa8..62404b75c7a717 100644
--- a/lib/querystring.js
+++ b/lib/querystring.js
@@ -138,7 +138,12 @@ QueryString.escape = function(str) {
}
// Surrogate pair
++i;
- c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF));
+ var c2;
+ if (i < str.length)
+ c2 = str.charCodeAt(i) & 0x3FF;
+ else
+ throw new URIError('URI malformed');
+ c = 0x10000 + (((c & 0x3FF) << 10) | c2);
out += hexTable[0xF0 | (c >> 18)] +
hexTable[0x80 | ((c >> 12) & 0x3F)] +
hexTable[0x80 | ((c >> 6) & 0x3F)] +
diff --git a/lib/readline.js b/lib/readline.js
index 8ee10850e54f89..74656896314531 100644
--- a/lib/readline.js
+++ b/lib/readline.js
@@ -330,7 +330,7 @@ Interface.prototype._normalWrite = function(b) {
this._line_buffer = null;
}
if (newPartContainsEnding) {
- this._sawReturn = /\r$/.test(string);
+ this._sawReturn = string.endsWith('\r');
// got one or more newlines; process into "line" events
var lines = string.split(lineEnding);
diff --git a/lib/repl.js b/lib/repl.js
index 0dc8a574523c6d..bff367929ff0a3 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -437,7 +437,7 @@ function REPLServer(prompt,
debug('finish', e, ret);
self.memory(cmd);
- if (e && !self.bufferedCommand && cmd.trim().match(/^npm /)) {
+ if (e && !self.bufferedCommand && cmd.trim().startsWith('npm ')) {
self.outputStream.write('npm should be run outside of the ' +
'node repl, in your normal shell.\n' +
'(Press Control-D to exit.)\n');
diff --git a/lib/tls.js b/lib/tls.js
index aad17c9ef2d6a3..c87929f96ae576 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -60,7 +60,7 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) {
// Create regexp to much hostnames
function regexpify(host, wildcards) {
// Add trailing dot (make hostnames uniform)
- if (!/\.$/.test(host)) host += '.';
+ if (!host || !host.endsWith('.')) host += '.';
// The same applies to hostname with more than one wildcard,
// if hostname has wildcard when wildcards are not allowed,
@@ -129,7 +129,7 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) {
}
} else if (cert.subject) {
// Transform hostname to canonical form
- if (!/\.$/.test(host)) host += '.';
+ if (!host || !host.endsWith('.')) host += '.';
// Otherwise check all DNS/URI records from certificate
// (with allowed wildcards)
diff --git a/src/.eslintrc b/src/.eslintrc
new file mode 100644
index 00000000000000..9ec5142499fcec
--- /dev/null
+++ b/src/.eslintrc
@@ -0,0 +1,3 @@
+# ECMAScript-6
+# http://eslint.org/docs/rules/#ecmascript-6
+prefer-template: 2
\ No newline at end of file
diff --git a/src/node.js b/src/node.js
index 8914e855880a2f..7301d9d114ed98 100644
--- a/src/node.js
+++ b/src/node.js
@@ -564,19 +564,19 @@
module.paths = Module._nodeModulePaths(cwd);
var script = process._eval;
var body = script;
- script = 'global.__filename = ' + JSON.stringify(name) + ';\n' +
+ script = `global.__filename = ${JSON.stringify(name)};\n` +
'global.exports = exports;\n' +
'global.module = module;\n' +
'global.__dirname = __dirname;\n' +
'global.require = require;\n' +
'return require("vm").runInThisContext(' +
- JSON.stringify(body) + ', { filename: ' +
- JSON.stringify(name) + ' });\n';
+ `${JSON.stringify(body)}, { filename: ` +
+ `${JSON.stringify(name)} });\n`;
// Defer evaluation for a tick. This is a workaround for deferred
// events not firing when evaluating scripts from the command line,
// see https://github.com/nodejs/node/issues/1600.
process.nextTick(function() {
- var result = module._compile(script, name + '-wrapper');
+ var result = module._compile(script, `${name}-wrapper`);
if (process._print_eval) console.log(result);
});
}
@@ -768,7 +768,7 @@
sig.slice(0, 3) === 'SIG') {
err = process._kill(pid, startup.lazyConstants()[sig]);
} else {
- throw new Error('Unknown signal: ' + sig);
+ throw new Error(`Unknown signal: ${sig}`);
}
}
@@ -873,7 +873,7 @@
}
function NativeModule(id) {
- this.filename = id + '.js';
+ this.filename = `${id}.js`;
this.id = id;
this.exports = {};
this.loaded = false;
@@ -893,10 +893,10 @@
}
if (!NativeModule.exists(id)) {
- throw new Error('No such native module ' + id);
+ throw new Error(`No such native module ${id}`);
}
- process.moduleLoadList.push('NativeModule ' + id);
+ process.moduleLoadList.push(`NativeModule ${id}`);
var nativeModule = new NativeModule(id);
diff --git a/src/node_version.h b/src/node_version.h
index 5707ca00f7d683..b906aaec6c8f2b 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -8,7 +8,7 @@
#define NODE_VERSION_IS_LTS 1
#define NODE_VERSION_LTS_CODENAME "Argon"
-#define NODE_VERSION_IS_RELEASE 0
+#define NODE_VERSION_IS_RELEASE 1
#ifndef NODE_STRINGIFY
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
diff --git a/src/node_win32_etw_provider-inl.h b/src/node_win32_etw_provider-inl.h
index de53203cb3c15f..3fef20cc1488c1 100644
--- a/src/node_win32_etw_provider-inl.h
+++ b/src/node_win32_etw_provider-inl.h
@@ -94,6 +94,13 @@ extern int events_enabled;
dataDescriptors); \
CHECK_EQ(status, ERROR_SUCCESS);
+#define ETW_WRITE_EMPTY_EVENT(eventDescriptor) \
+ DWORD status = event_write(node_provider, \
+ &eventDescriptor, \
+ 0, \
+ NULL); \
+ CHECK_EQ(status, ERROR_SUCCESS);
+
void NODE_HTTP_SERVER_REQUEST(node_dtrace_http_server_request_t* req,
node_dtrace_connection_t* conn, const char *remote, int port,
@@ -189,10 +196,7 @@ void NODE_V8SYMBOL_MOVE(const void* addr1, const void* addr2) {
void NODE_V8SYMBOL_RESET() {
if (events_enabled > 0) {
- int val = 0;
- EVENT_DATA_DESCRIPTOR descriptors[1];
- ETW_WRITE_INT32_DATA(descriptors, &val);
- ETW_WRITE_EVENT(NODE_V8SYMBOL_RESET_EVENT, descriptors);
+ ETW_WRITE_EMPTY_EVENT(NODE_V8SYMBOL_RESET_EVENT);
}
}
@@ -244,7 +248,7 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol,
line,
col,
symbuf,
- symbol_len * sizeof(symbuf[0]));
+ (symbol_len + 1) * sizeof(symbuf[0]));
ETW_WRITE_EVENT(MethodLoad, descriptors);
}
}
diff --git a/test/debugger/test-debugger-client.js b/test/debugger/test-debugger-client.js
index 972c94707ee56b..fe65405c8583ce 100644
--- a/test/debugger/test-debugger-client.js
+++ b/test/debugger/test-debugger-client.js
@@ -73,7 +73,7 @@ var d = 'Content-Length: 466\r\n\r\n' +
'"context":{"ref":0},"text":"dns.js (lines: 241)"}},"refs":' +
'[{"handle":0' +
',"type":"context","text":"#"}],"running":true}' +
- 'Content-Length: 119\r\n\r\n' +
+ '\r\n\r\nContent-Length: 119\r\n\r\n' +
'{"seq":11,"type":"event","event":"scriptCollected","success":true,' +
'"body":{"script":{"id":26}},"refs":[],"running":true}';
p.execute(d);
diff --git a/test/parallel/test-dns-cares-domains.js b/test/internet/test-dns-cares-domains.js
similarity index 100%
rename from test/parallel/test-dns-cares-domains.js
rename to test/internet/test-dns-cares-domains.js
diff --git a/test/known_issues/test-stdin-is-always-net.socket.js b/test/known_issues/test-stdin-is-always-net.socket.js
new file mode 100644
index 00000000000000..78c1a7d2eac20e
--- /dev/null
+++ b/test/known_issues/test-stdin-is-always-net.socket.js
@@ -0,0 +1,19 @@
+'use strict';
+// Refs: https://github.com/nodejs/node/pull/5916
+
+const common = require('../common');
+const assert = require('assert');
+const spawn = require('child_process').spawn;
+const net = require('net');
+
+if (process.argv[2] === 'child') {
+ assert(process.stdin instanceof net.Socket);
+ return;
+}
+
+const proc = spawn(process.execPath, [__filename, 'child'], {stdio: 'ignore'});
+// To double-check this test, set stdio to 'pipe' and uncomment the line below.
+// proc.stderr.pipe(process.stderr);
+proc.on('exit', common.mustCall(function(exitCode) {
+ process.exitCode = exitCode;
+}));
diff --git a/test/known_issues/test-stdout-buffer-flush-on-exit.js b/test/known_issues/test-stdout-buffer-flush-on-exit.js
new file mode 100644
index 00000000000000..f4ea0b5e01b2e1
--- /dev/null
+++ b/test/known_issues/test-stdout-buffer-flush-on-exit.js
@@ -0,0 +1,20 @@
+'use strict';
+// Refs: https://github.com/nodejs/node/issues/2148
+
+require('../common');
+const assert = require('assert');
+const execSync = require('child_process').execSync;
+
+const longLine = 'foo bar baz quux quuz aaa bbb ccc'.repeat(65536);
+
+if (process.argv[2] === 'child') {
+ process.on('exit', () => {
+ console.log(longLine);
+ });
+ process.exit();
+}
+
+const cmd = `${process.execPath} ${__filename} child`;
+const stdout = execSync(cmd).toString().trim();
+
+assert.strictEqual(stdout, longLine);
diff --git a/test/parallel/test-assert-typedarray-deepequal.js b/test/parallel/test-assert-typedarray-deepequal.js
index 68edefdc175317..be4462de5dff77 100644
--- a/test/parallel/test-assert-typedarray-deepequal.js
+++ b/test/parallel/test-assert-typedarray-deepequal.js
@@ -20,13 +20,25 @@ const equalArrayPairs = [
[new Int16Array(1e5), new Int16Array(1e5)],
[new Int32Array(1e5), new Int32Array(1e5)],
[new Float32Array(1e5), new Float32Array(1e5)],
- [new Float64Array(1e5), new Float64Array(1e5)]
+ [new Float64Array(1e5), new Float64Array(1e5)],
+ [new Int16Array(256), new Uint16Array(256)],
+ [new Int16Array([256]), new Uint16Array([256])],
+ [new Float32Array([+0.0]), new Float32Array([-0.0])],
+ [new Float64Array([+0.0]), new Float32Array([-0.0])],
+ [new Float64Array([+0.0]), new Float64Array([-0.0])]
];
const notEqualArrayPairs = [
[new Uint8Array(2), new Uint8Array(3)],
[new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6])],
- [new Uint8ClampedArray([300, 2, 3]), new Uint8Array([300, 2, 3])]
+ [new Uint8ClampedArray([300, 2, 3]), new Uint8Array([300, 2, 3])],
+ [new Uint16Array([2]), new Uint16Array([3])],
+ [new Uint16Array([0]), new Uint16Array([256])],
+ [new Int16Array([0]), new Uint16Array([256])],
+ [new Int16Array([-256]), new Uint16Array([0xff00])], // same bits
+ [new Int32Array([-256]), new Uint32Array([0xffffff00])], // ditto
+ [new Float32Array([0.1]), new Float32Array([0.0])],
+ [new Float64Array([0.1]), new Float64Array([0.0])]
];
equalArrayPairs.forEach((arrayPair) => {
diff --git a/test/parallel/test-c-ares.js b/test/parallel/test-c-ares.js
index b7802881f8e47c..9a061bab1acb01 100644
--- a/test/parallel/test-c-ares.js
+++ b/test/parallel/test-c-ares.js
@@ -27,6 +27,11 @@ assert.throws(function() {
dns.resolve('www.google.com', 'HI');
}, /Unknown type/);
+// Try calling resolve with an unsupported type that's an object key
+assert.throws(function() {
+ dns.resolve('www.google.com', 'toString');
+}, /Unknown type/);
+
// Windows doesn't usually have an entry for localhost 127.0.0.1 in
// C:\Windows\System32\drivers\etc\hosts
// so we disable this test on Windows.
diff --git a/test/parallel/test-dns.js b/test/parallel/test-dns.js
index 04264907d308d4..9a2577ec90de78 100644
--- a/test/parallel/test-dns.js
+++ b/test/parallel/test-dns.js
@@ -1,8 +1,8 @@
'use strict';
require('../common');
-var assert = require('assert');
+const assert = require('assert');
-var dns = require('dns');
+const dns = require('dns');
var existing = dns.getServers();
assert(existing.length);
@@ -121,27 +121,27 @@ assert.doesNotThrow(function() {
});
assert.doesNotThrow(function() {
- dns.lookup('www.google.com', {
+ dns.lookup('', {
family: 4,
hints: 0
}, noop);
});
assert.doesNotThrow(function() {
- dns.lookup('www.google.com', {
+ dns.lookup('', {
family: 6,
hints: dns.ADDRCONFIG
}, noop);
});
assert.doesNotThrow(function() {
- dns.lookup('www.google.com', {
+ dns.lookup('', {
hints: dns.V4MAPPED
}, noop);
});
assert.doesNotThrow(function() {
- dns.lookup('www.google.com', {
+ dns.lookup('', {
hints: dns.ADDRCONFIG | dns.V4MAPPED
}, noop);
});
diff --git a/test/parallel/test-domain-crypto.js b/test/parallel/test-domain-crypto.js
index e76e8d08791c87..4dd979dafeab73 100644
--- a/test/parallel/test-domain-crypto.js
+++ b/test/parallel/test-domain-crypto.js
@@ -6,8 +6,9 @@ try {
return;
}
-// the missing var keyword is intentional
-domain = require('domain');
+// Pollution of global is intentional as part of test.
+// See https://github.com/nodejs/node/commit/d1eff9ab
+global.domain = require('domain');
// should not throw a 'TypeError: undefined is not a function' exception
crypto.randomBytes(8);
diff --git a/test/parallel/test-http-set-timeout.js b/test/parallel/test-http-set-timeout.js
index 9bda60b2226443..ca238de43144e2 100644
--- a/test/parallel/test-http-set-timeout.js
+++ b/test/parallel/test-http-set-timeout.js
@@ -20,7 +20,7 @@ server.listen(common.PORT, function() {
var errorTimer = setTimeout(function() {
throw new Error('Timeout was not successful');
- }, 2000);
+ }, common.platformTimeout(2000));
var x = http.get({port: common.PORT, path: '/'});
x.on('error', function() {
diff --git a/test/parallel/test-https-agent.js b/test/parallel/test-https-agent.js
index a3bb28975a3155..9dea313e42ed8e 100644
--- a/test/parallel/test-https-agent.js
+++ b/test/parallel/test-https-agent.js
@@ -23,8 +23,8 @@ var server = https.Server(options, function(req, res) {
var responses = 0;
-var N = 10;
-var M = 10;
+var N = 4;
+var M = 4;
server.listen(common.PORT, function() {
for (var i = 0; i < N; i++) {
diff --git a/test/parallel/test-net-socket-timeout-unref.js b/test/parallel/test-net-socket-timeout-unref.js
index b7ed0ec344a996..bbc2dffcc15336 100644
--- a/test/parallel/test-net-socket-timeout-unref.js
+++ b/test/parallel/test-net-socket-timeout-unref.js
@@ -1,39 +1,35 @@
'use strict';
-var common = require('../common');
-var assert = require('assert');
-var net = require('net');
-var server = net.createServer(function(c) {
+// Test that unref'ed sockets with timeouts do not prevent exit.
+
+const common = require('../common');
+const net = require('net');
+
+const server = net.createServer(function(c) {
c.write('hello');
c.unref();
});
server.listen(common.PORT);
server.unref();
-var timedout = false;
var connections = 0;
-var sockets = [];
-var delays = [8, 5, 3, 6, 2, 4];
+const sockets = [];
+const delays = [8, 5, 3, 6, 2, 4];
delays.forEach(function(T) {
- var socket = net.createConnection(common.PORT, 'localhost');
- socket.on('connect', function() {
+ const socket = net.createConnection(common.PORT, 'localhost');
+ socket.on('connect', common.mustCall(function() {
if (++connections === delays.length) {
sockets.forEach(function(s) {
- s[0].setTimeout(s[1] * 1000, function() {
- timedout = true;
- s[0].destroy();
+ s.socket.setTimeout(s.timeout, function() {
+ s.socket.destroy();
+ throw new Error('socket timed out unexpectedly');
});
- s[0].unref();
+ s.socket.unref();
});
}
- });
-
- sockets.push([socket, T]);
-});
+ }));
-process.on('exit', function() {
- assert.strictEqual(timedout, false,
- 'Socket timeout should not hold loop open');
+ sockets.push({socket: socket, timeout: T * 1000});
});
diff --git a/test/parallel/test-net-socket-timeout.js b/test/parallel/test-net-socket-timeout.js
index f15b20c023194f..7cae61d71bc4a5 100644
--- a/test/parallel/test-net-socket-timeout.js
+++ b/test/parallel/test-net-socket-timeout.js
@@ -41,7 +41,7 @@ server.listen(common.PORT, function() {
});
var timer = setTimeout(function() {
process.exit(1);
- }, 200);
+ }, common.platformTimeout(200));
});
process.on('exit', function() {
diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js
index e8c282053550cf..1432cb63a10ae4 100644
--- a/test/parallel/test-path.js
+++ b/test/parallel/test-path.js
@@ -344,8 +344,18 @@ resolveTests.forEach(function(test) {
assert.equal(failures.length, 0, failures.join(''));
// path.isAbsolute tests
+assert.equal(path.win32.isAbsolute('/'), true);
+assert.equal(path.win32.isAbsolute('//'), true);
+assert.equal(path.win32.isAbsolute('//server'), true);
assert.equal(path.win32.isAbsolute('//server/file'), true);
assert.equal(path.win32.isAbsolute('\\\\server\\file'), true);
+assert.equal(path.win32.isAbsolute('\\\\server'), true);
+assert.equal(path.win32.isAbsolute('\\\\'), true);
+assert.equal(path.win32.isAbsolute('c'), false);
+assert.equal(path.win32.isAbsolute('c:'), false);
+assert.equal(path.win32.isAbsolute('c:\\'), true);
+assert.equal(path.win32.isAbsolute('c:/'), true);
+assert.equal(path.win32.isAbsolute('c://'), true);
assert.equal(path.win32.isAbsolute('C:/Users/'), true);
assert.equal(path.win32.isAbsolute('C:\\Users\\'), true);
assert.equal(path.win32.isAbsolute('C:cwd/another'), false);
diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js
index b4388852499ed1..2db59be1750da2 100644
--- a/test/parallel/test-querystring.js
+++ b/test/parallel/test-querystring.js
@@ -139,6 +139,11 @@ qsWeirdObjects.forEach(function(testCase) {
assert.equal(testCase[1], qs.stringify(testCase[0]));
});
+// invalid surrogate pair throws URIError
+assert.throws(function() {
+ qs.stringify({ foo: '\udc00' });
+}, URIError);
+
// coerce numbers to string
assert.strictEqual('foo=0', qs.stringify({ foo: 0 }));
assert.strictEqual('foo=0', qs.stringify({ foo: -0 }));
diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js
index 3d2cab6334bd25..33530cf1058b0f 100644
--- a/test/parallel/test-repl.js
+++ b/test/parallel/test-repl.js
@@ -15,7 +15,7 @@ const prompt_npm = 'npm should be run outside of the ' +
'node repl, in your normal shell.\n' +
'(Press Control-D to exit.)\n';
const expect_npm = prompt_npm + prompt_unix;
-var server_tcp, server_unix, client_tcp, client_unix, timer, replServer;
+var server_tcp, server_unix, client_tcp, client_unix, replServer;
// absolute path to test/fixtures/a.js
@@ -24,7 +24,7 @@ var moduleFilename = require('path').join(common.fixturesDir, 'a');
console.error('repl test');
// function for REPL to run
-invoke_me = function(arg) {
+global.invoke_me = function(arg) {
return 'invoked ' + arg;
};
@@ -45,7 +45,6 @@ function send_expect(list) {
function clean_up() {
client_tcp.end();
client_unix.end();
- clearTimeout(timer);
}
function strict_mode_error_test() {
@@ -449,7 +448,3 @@ function unix_test() {
}
unix_test();
-
-timer = setTimeout(function() {
- assert.fail(null, null, 'Timeout');
-}, 5000);
diff --git a/test/parallel/test-stdin-pipe-large.js b/test/parallel/test-stdin-pipe-large.js
new file mode 100644
index 00000000000000..428bbb0430283c
--- /dev/null
+++ b/test/parallel/test-stdin-pipe-large.js
@@ -0,0 +1,23 @@
+'use strict';
+// See https://github.com/nodejs/node/issues/5927
+
+const common = require('../common');
+const assert = require('assert');
+const spawn = require('child_process').spawn;
+
+if (process.argv[2] === 'child') {
+ process.stdin.pipe(process.stdout);
+ return;
+}
+
+const child = spawn(process.execPath, [__filename, 'child'], { stdio: 'pipe' });
+
+const expectedBytes = 1024 * 1024;
+let readBytes = 0;
+
+child.stdin.end(Buffer(expectedBytes));
+
+child.stdout.on('data', (chunk) => readBytes += chunk.length);
+child.stdout.on('end', common.mustCall(() => {
+ assert.strictEqual(readBytes, expectedBytes);
+}));
diff --git a/test/parallel/test-stdout-close-unref.js b/test/parallel/test-stdout-close-unref.js
index 37ab4987eebcaa..67c6141c963088 100644
--- a/test/parallel/test-stdout-close-unref.js
+++ b/test/parallel/test-stdout-close-unref.js
@@ -1,16 +1,30 @@
'use strict';
-require('../common');
-var assert = require('assert');
+const common = require('../common');
+const assert = require('assert');
+const spawn = require('child_process').spawn;
-var errs = 0;
+if (process.argv[2] === 'child') {
+ var errs = 0;
-process.stdin.resume();
-process.stdin._handle.close();
-process.stdin._handle.unref(); // Should not segfault.
-process.stdin.on('error', function(err) {
- errs++;
-});
+ process.stdin.resume();
+ process.stdin._handle.close();
+ process.stdin._handle.unref(); // Should not segfault.
+ process.stdin.on('error', function(err) {
+ errs++;
+ });
-process.on('exit', function() {
- assert.strictEqual(errs, 1);
-});
+ process.on('exit', function() {
+ assert.strictEqual(errs, 1);
+ });
+ return;
+}
+
+// Use spawn so that we can be sure that stdin has a _handle property.
+// Refs: https://github.com/nodejs/node/pull/5916
+const proc = spawn(process.execPath, [__filename, 'child'], { stdio: 'pipe' });
+
+proc.stderr.pipe(process.stderr);
+proc.on('exit', common.mustCall(function(exitCode) {
+ if (exitCode !== 0)
+ process.exitCode = exitCode;
+}));
diff --git a/test/parallel/test-vm-static-this.js b/test/parallel/test-vm-static-this.js
index a5f5ad9415a828..143e4e12216d5e 100644
--- a/test/parallel/test-vm-static-this.js
+++ b/test/parallel/test-vm-static-this.js
@@ -14,25 +14,25 @@ assert.throws(function() {
vm.runInThisContext('throw new Error(\'test\');');
}, /test/);
-hello = 5;
+global.hello = 5;
vm.runInThisContext('hello = 2');
-assert.equal(2, hello);
+assert.equal(2, global.hello);
console.error('pass values');
-code = 'foo = 1;' +
+var code = 'foo = 1;' +
'bar = 2;' +
'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');';
-foo = 2;
-obj = { foo: 0, baz: 3 };
+global.foo = 2;
+global.obj = { foo: 0, baz: 3 };
/* eslint-disable no-unused-vars */
var baz = vm.runInThisContext(code);
/* eslint-enable no-unused-vars */
-assert.equal(0, obj.foo);
-assert.equal(2, bar);
-assert.equal(1, foo);
+assert.equal(0, global.obj.foo);
+assert.equal(2, global.bar);
+assert.equal(1, global.foo);
console.error('call a function');
-f = function() { foo = 100; };
+global.f = function() { global.foo = 100; };
vm.runInThisContext('f()');
-assert.equal(100, foo);
+assert.equal(100, global.foo);
diff --git a/tools/doc/json.js b/tools/doc/json.js
index 299c8ed9fd84ad..b2165c15d23c90 100644
--- a/tools/doc/json.js
+++ b/tools/doc/json.js
@@ -183,7 +183,7 @@ function processList(section) {
list.forEach(function(tok) {
var type = tok.type;
if (type === 'space') return;
- if (type === 'list_item_start') {
+ if (type === 'list_item_start' || type === 'loose_item_start') {
var n = {};
if (!current) {
values.push(n);
@@ -260,6 +260,14 @@ function processList(section) {
// event: each item is an argument.
section.params = values;
break;
+
+ default:
+ if (section.list.length > 0) {
+ section.desc = section.desc || [];
+ for (var i = 0; i < section.list.length; i++) {
+ section.desc.push(section.list[i]);
+ }
+ }
}
// section.listParsed = values;
diff --git a/tools/test.py b/tools/test.py
index d5caff92e1232c..9189ff36aa7b5d 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -1514,10 +1514,15 @@ def Main():
if not exists(vm):
print "Can't find shell executable: '%s'" % vm
continue
+ archEngineContext = Execute([vm, "-p", "process.arch"], context)
+ vmArch = archEngineContext.stdout.rstrip()
+ if archEngineContext.exit_code is not 0 or vmArch == "undefined":
+ print "Can't determine the arch of: '%s'" % vm
+ continue
env = {
'mode': mode,
'system': utils.GuessOS(),
- 'arch': arch,
+ 'arch': vmArch,
}
test_list = root.ListTests([], path, context, arch, mode)
unclassified_tests += test_list
diff --git a/vcbuild.bat b/vcbuild.bat
index cd3f758a3933a1..4910ce3db88b29 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -35,6 +35,7 @@ set download_arg=
set release_urls_arg=
set build_release=
set configure_flags=
+set build_addons=
:next-arg
if "%1"=="" goto args-done
@@ -53,8 +54,9 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
if /i "%1"=="noetw" set noetw=1&goto arg-ok
if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
-if /i "%1"=="test" set test_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok
-if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap message sequential parallel&goto arg-ok
+if /i "%1"=="test" set test_args=%test_args% addons sequential parallel message -J&set jslint=1&set build_addons=1&goto arg-ok
+if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons message sequential parallel&set build_addons=1&goto arg-ok
+if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok
if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok
if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok
if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&goto arg-ok
@@ -89,6 +91,9 @@ if defined build_release (
set i18n_arg=small-icu
)
+:: assign path to node_exe
+set "node_exe=%config%\node.exe"
+
if "%config%"=="Debug" set configure_flags=%configure_flags% --debug
if defined nosnapshot set configure_flags=%configure_flags% --without-snapshot
if defined noetw set configure_flags=%configure_flags% --without-etw& set noetw_msi_arg=/p:NoETW=1
@@ -237,15 +242,36 @@ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/no
:build-node-weak
@rem Build node-weak if required
-if "%buildnodeweak%"=="" goto run-tests
+if "%buildnodeweak%"=="" goto build-addons
"%config%\node" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild --directory="%~dp0test\gc\node_modules\weak" --nodedir="%~dp0."
if errorlevel 1 goto build-node-weak-failed
-goto run-tests
+goto build-addons
:build-node-weak-failed
echo Failed to build node-weak.
goto exit
+:build-addons
+if not defined build_addons goto run-tests
+if not exist "%node_exe%" (
+ echo Failed to find node.exe
+ goto run-tests
+)
+echo Building add-ons
+:: clear
+for /d %%F in (test\addons\??_*) do (
+ rd /s /q %%F
+)
+:: generate
+"%node_exe%" tools\doc\addon-verify.js
+:: building addons
+for /d %%F in (test\addons\*) do (
+ "%node_exe%" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild ^
+ --directory="%%F" ^
+ --nodedir="%cd%"
+)
+goto run-tests
+
:run-tests
if "%test_args%"=="" goto jslint
if "%config%"=="Debug" set test_args=--mode=debug %test_args%