Under Windows 'ipc' communication requires the other process to format
its messages with 'IPC framing protocol'. Otherwise, an assert is
triggered in libuv. This commit changes child-process-read benchmark
to use stdout to communicate with parent process. It also adds
child-process-read-ipc.js to benchmark IPC communication using
child node process.
PR-URL: https://github.com/nodejs/node/pull/6971
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
cluster.setupMaster() can be called more than once. Core even has
tests for this functionality. This commit removes an incorrect
statement to the contrary from the documentation.
Fixes: https://github.com/nodejs/node/issues/7156
PR-URL: https://github.com/nodejs/node/pull/7179
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Avoid sending messages if the IPC channel is already disconnected. It
avoids undesired errors when calling `process.disconnect` when there are
still pending IPC messages.
PR-URL: https://github.com/nodejs/node/pull/7132
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fix running the tests when node was compiled without crypto
support. Some of these are cleanup after 52bae222a3, where
common was used before it was required.
PR-URL: https://github.com/nodejs/node/pull/7056
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Remove obsolete `setTimeout()` introduced in 3148f1400. The fix for the
problem is in b266074347. (For the record, I mostly don't know what I'm
talking about here but am summarizing from an IRC #node-dev conversation
with @indutny on 04-Jun-2016.)
PR-URL: https://github.com/nodejs/node/pull/7154
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
A message stuck around in the native API warning users to not use 'raw'
encoding. Followed by an abort(). This is no longer necessary since all
other signs of 'raw' encoding have been removed.
PR-URL: https://github.com/nodejs/node/pull/7111
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
When node began using the OneByte API (f150d56) it also switched to
officially supporting ISO-8859-1. Though at the time no new encoding
string was introduced.
Introduce the new encoding string 'latin1' to be more explicit. The
previous 'binary' and documented as an alias to 'latin1'. While many
tests have switched to use 'latin1', there are still plenty that do both
'binary' and 'latin1' checks side-by-side to ensure there is no
regression.
PR-URL: https://github.com/nodejs/node/pull/7111
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Most Windows systems do not have an external `echo` program installed,
so any attempts to spawn `echo` as a child process will fail with
`ENOENT`. This commit forces the use of the built-in `echo` provided
by `cmd.exe`.
PR-URL: https://github.com/nodejs/node/pull/7049
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/7155
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Fix issues with disabled test-debug-brk-no-arg and re-enable the test.
PR-URL: https://github.com/nodejs/node/pull/7143
Reviewed-By: Fedor Indutny <fedor@indutny.com>
In prose, always surround `null`-as-a-value in backticks.
PR-URL: https://github.com/nodejs/node/pull/6986
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Updating tests to use `common.fixturesDir` whenever possible/reasonable.
Left out things like tests for `path` and `require.resolve`.
PR-URL: https://github.com/nodejs/node/pull/6997
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The repl documentation has always been rather lacking. This is
a first step towards making significant improvements.
PR-URL: https://github.com/nodejs/node/pull/7002
Reviewed-By: Anna Henningsen <anna@addaleax.net>
When `free`ing the socket to be reused in keep-alive Agent wait for
both `prefinish` and `end` events. Otherwise the next request may be
written before the previous one has finished sending the body, leading
to a parser errors.
PR-URL: https://github.com/nodejs/node/pull/7149
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Got the information from git history, I added the version when Interface
was exported as class (v0.1.104), it was an internal class on previous
versions.
Refs: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/6996
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
`stdout` was written as `inline code` most of the time,
except for the `console.time` and `console.timeEnd`
functions which made it a bit more tedious to read about.
Now it's always using inline code.
PR-URL: https://github.com/nodejs/node/pull/7062
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/7161
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
The test script (tools/test.py) logs duration as "duration_ms: x.y".
This is confusing (as the duration is measured in seconds).
New example output: duration: 0.212s
PR-URL: https://github.com/nodejs/node/pull/7133
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This is maybe more verbose than needed, since the same information is
repeated several times. An alternative, maybe a single short sentence at
the beginning is better. E.g.
Fixes: https://github.com/nodejs/node/issues/7110
PR-URL: https://github.com/nodejs/node/pull/7113
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Majoring restructuring and update for streams doc.
This is the first step of multiple to updating and
correcting the streams documentation.
PR-URL: https://github.com/nodejs/node/pull/6947
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Improves performance of allocating unsafe buffers, creating buffers from
an existing ArrayBuffer and creating .slice(...) from existing Buffer by
avoiding deoptimizing change of prototype after Uint8Array allocation
in favor of ES6 native subclassing.
This is done through an internal ES6 class that extends Uint8Array and
is used for allocations, but the regular Buffer function is exposed, so
calling Buffer(...) with or without `new` continues to work as usual
and prototype chains are also preserved.
Performance wins for .slice are +120% (2.2x), and, consequently, for
unsafe allocations up to +95% (1.9x) for small buffers, and for safe
allocations (zero-filled) up to +30% (1.3x).
PR-URL: https://github.com/nodejs/node/pull/6893
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Remove a couple of internal methods that are neither exported in
the public headers nor used internally anywhere.
PR-URL: https://github.com/nodejs/node/pull/7117
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Add a `REPLACEME` tag that should be used when introducing
docs for new features, so that they can be updated when releases
are made.
Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/6864
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Deprecate worker.suicide in favor of worker.exitedAfterDisconnect.
PR-URL: https://github.com/nodejs/node/pull/3747
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Illegal tokens are only recoverable in string literals, RegExp literals,
and block comments. If not in one of these constructs, immediately
return an error rather than giving the user false hope by giving them a
chance to try to recover.
PR-URL: https://github.com/nodejs/node/pull/7104
Fixes: https://github.com/nodejs/node/issues/3611
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Use `sizeof()` of the zero fill flag as the byte length of the
`zeroFill` array buffer rather than `1`.
This fixes running debug builds, which have boundary checks for
typed array creations from native code enabled.
PR-URL: https://github.com/nodejs/node/pull/7142
Fixes: https://github.com/nodejs/node/issues/7140
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
All the callback functions in `fs` module are supposed to be executed
with no context (`this` value should not be a valid object). But
`mkdtemp`'s callback will have the `FSReqWrap` object as the context.
Sample code to reproduce the problem
'use strict';
const fs = require('fs');
fs.mkdtemp('/tmp/abcd', null, function() {
console.log(this);
});
This would print
FSReqWrap { oncomplete: [Function] }
But that should have printed `null` and this patch fixes that.
PR-URL: https://github.com/nodejs/node/pull/7068
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
The command line flag `--debug-brk` was ignored when the `-e` flag was
also present. This change allows the flags to both be honored when they
are used in a single command line.
PR-URL: https://github.com/nodejs/node/pull/7089
Fixes: https://github.com/nodejs/node/issues/3589
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Update the licenses for both Marked and ESLint.
Created using `tools/license-builder.sh`
PR-URL: https://github.com/nodejs/node/pull/7121
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Remove a disabled test in favor of one that expects an error.
This validates (somewhat) that the underlying code is calling the
correct system call for setting UID and GID. Unlike the formerly
disabled test, it does not try to validate that the system UID/GID
setting works.
PR-URL: https://github.com/nodejs/node/pull/7084
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
The project does not use libeio anymore. Remove disabled libeio-specific
test.
PR-URL: https://github.com/nodejs/node/pull/7083
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Got the information from git history and I ignored previous version of
dns attached to `node.dns` (pre v0.1.16).
There is a case where `dns.resolveNaptr` were intented to be in v0.7.12 and
it was reverted and addec back on `v0.9.12`, I left the latest version
when module was introduced. Same for `dns.resolvePtr` who was referenced
before but it was only added on `v6.0.0`
Refs: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7021
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Pick the latest v8_inspector [1] with:
* V8 5.1 compatibility
* Modify parse builder templates to make coverity happy
* The whitespace differences in the jinja2 sub-dependency do exist
upstream. I am not sure how I missed them in the original import
(ed2eac).
[1] https://github.com/pavelfeldman/v8_inspector/commit/3b56732
PR-URL: https://github.com/nodejs/node/pull/7118
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Node.js has earned the Linux Foundation Core Infrastructure Initiative (CII) best practices badge.
This change lets people see that, including a link for more information.
The badge lets users and potential users of Node.js know that Node.js follows best practices.
It may also help spur other projects to follow Node.js's lead.
My thanks to Rod Vagg, who did the work to see that Node.js earned the badge.
PR-URL: https://github.com/nodejs/node/pull/6819
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
* buffer: Ignore negative lengths in calls to Buffer() and
Buffer.allocUnsafe(). This fixes a possible security concern
(reported by Feross Aboukhadijeh) where user input is passed
unchecked to the Buffer constructor or allocUnsafe() as it can
expose parts of the memory slab used by other Buffers in the
application. Note that negative lengths are not supported by the
Buffer API and user input to the constructor should always be
sanitised and type-checked.
(Anna Henningsen) https://github.com/nodejs/node/pull/7030
* npm: Upgrade npm to 3.9.3
(Kat Marchán) https://github.com/nodejs/node/pull/7030
* tty: Default to blocking mode for stdio on OS X. A bug fix
in libuv 1.9.0, introduced in Node.js v6.0.0, exposed problems with
Node's use of non-blocking stdio, particularly on OS X which has a
small output buffer. This change should fix CLI applications that
have been having problems with output since Node.js v6.0.0 on OS X.
The core team is continuing to address stdio concerns that exist
across supported platforms and progress can be tracked at
https://github.com/nodejs/node/pull/6980.
(Jeremiah Senkpiel) https://github.com/nodejs/node/pull/6895
* V8: Upgrade to V8 5.0.71.52. This includes a fix that addresses
problems experienced by users of node-inspector since Node.js
v6.0.0, see https://github.com/nodejs/node/issues/6980 for details.
(Michaël Zasso) https://github.com/nodejs/node/pull/6928