Skip tests if localhost does not resolve to ::1.
Fixes: https://github.com/nodejs/node/issues/7288
PR-URL: https://github.com/nodejs/node/pull/7605
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Conflicts:
test/parallel/test-https-connect-address-family.js
test/parallel/test-tls-connect-address-family.js
Many extensions are unknown to the `ClientHelloParser::ParseExtension`,
do not cast user-supplied `uint16_t` to `enum`.
PR-URL: https://github.com/nodejs/node/pull/7494
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
`offset` is user supplied variable and may be bigger than
`ts_obj_length`. There is no need to subtract them and pass along, so
just throw when the subtraction result would overflow.
PR-URL: https://github.com/nodejs/node/pull/7494
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Coverity marked a change in 630096b as a constant expression.
However, on platforms where sizeof(int64_t) > sizeof(size_t),
this should not be the case. This commit flags the comparison
as OK to coverity.
PR-URL: https://github.com/nodejs/node/pull/7587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
ParseArrayIndex() would wrap around large (>=2^32) index values on
platforms where sizeof(int64_t) > sizeof(size_t). Ensure that the
return value fits in a size_t.
PR-URL: https://github.com/nodejs/node/pull/7497
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
It's not used anywhere else so move it out of src/node_internals.h.
PR-URL: https://github.com/nodejs/node/pull/7497
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Conflicts:
src/node_internals.h
Make BINARY an alias for LATIN1 rather than a distinct enum value.
PR-URL: https://github.com/nodejs/node/pull/7284
Refs: https://github.com/nodejs/node/pull/7262
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
A missing 'break' statement unintentionally allowed "linary"
and "luffer" as alternatives for "binary" and "buffer".
Regression introduced in commit 54cc7212 ("buffer: introduce latin1
encoding term".)
PR-URL: https://github.com/nodejs/node/pull/7262
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@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>
Original commit message:
[regexp] Fix case-insensitive matching for one-byte subjects.
The bug occurs because we do not canonicalize character class ranges
before adding case equivalents. While adding case equivalents, we abort
early for one-byte subject strings, assuming that the ranges are sorted.
Which they are not.
R=marja@chromium.org
BUG=v8:5199
Review-Url: https://codereview.chromium.org/2159683002
Cr-Commit-Position: refs/heads/master@{#37833}
Fixes: https://github.com/nodejs/node/issues/7708
PR-URL: https://github.com/nodejs/node/pull/7834
Ref: https://github.com/nodejs/node/pull/7833
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
There has been some question about whether the #node.js irc channel
falls under the TSC oversight or not.
See: https://github.com/nodejs/node/issues/7746
This clarifies that the #node.js irc channel is a community provided
resource that is not currently directly under the oversight of the
TSC/CTC.
PR-URL: https://github.com/nodejs/node/pull/7810
Reviewed-By: Bryan Hughes <bryan@nebri.us>
Reviewed-By: Julien Gilli <jgilli@nodejs.org>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
`NODE_REPL_HISTORY` was introduced in v3.0.0
(see e.g. 6faf17cb45).
PR-URL: https://github.com/nodejs/node/pull/7775
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
The `test/common` module has the capability to identify if any variable
is leaked to the global scope and fail the test. So that has to be
imported at the beginning.
PR-URL: https://github.com/nodejs/node/pull/7786
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Excessive buffering of perf map files in V8 could cause profiles
to be missing symbols at times.
Original commit message:
switch perf and ll_prof loggers to line buffering
BUG=v8:5015
R=jarin@chromium.org,yangguo@chromium.org
Review-Url: https://codereview.chromium.org/2041243002
Cr-Commit-Position: refs/heads/master@{#36788}
PR-URL: https://github.com/nodejs/node/pull/7814
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/node/pull/7638
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message:
port 2aa070b (r34863)
original commit message:
Repair this to match what the runtime correctly does,
by first checking if the function is a constructor
before we access the prototype.
BUG=
Review URL: https://codereview.chromium.org/1809333002
Cr-Commit-Position: refs/heads/master@{#34880}
Fixes: https://github.com/nodejs/node/issues/7592 for X87
PR-URL: https://github.com/nodejs/node/pull/7638
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message:
PPC: InstanceOfStub incorrectly interprets the hole as a prototype.
Port 2aa070b
Original commit message:
Repair this to match what the runtime correctly does,
by first checking if the function is a constructor
before we access the prototype.
R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com,
michael_dawson@ca.ibm.com
BUG=
Review URL: https://codereview.chromium.org/1811013002
Cr-Commit-Position: refs/heads/master@{#34869}
Fixes: https://github.com/nodejs/node/issues/7592 for PPC
PR-URL: https://github.com/nodejs/node/pull/7638
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message:
InstanceOfStub incorrectly interprets the hole as a prototype.
Repair this to match what the runtime correctly does, by first
checking if the function is a constructor before we access the
prototype.
R=verwaest@chromium.org
BUG=
Committed: https://crrev.com/2aa070be4fd2960df98905b254f12ed801ef26cd
Cr-Commit-Position: refs/heads/master@{#34863}
This fixes the behavior of instanceof when the second parameter is not a
constructor.
Fixes: https://github.com/nodejs/node/issues/7592
PR-URL: https://github.com/nodejs/node/pull/7638
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
test-fs-read-buffer-tostring-fail and test-fs-readfile-tostring-fail
have been timing out on Raspberry Pi 3 devices on the continuous
integration server. These devices have 1 Gb of RAM and the tests are
memory intensive. Previous checks for memory intensive tests used a 512
Mb cut-off, but that was probably instituted when we only had Pi 1
devices.
Consequently, this change increases the threshold for memory-intensive
tests to 1 Gb and adds that threshold to test-fs-readfile-tostring-fail.
PR-URL: https://github.com/nodejs/node/pull/7772
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
If something bad happens in spawnSync, stderr might be null. Therefore,
we have to check it before using it, so we won't mask the actual
exception.
PR-URL: https://github.com/nodejs/node/pull/6877
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Robert Jefe Lindstädt <robert.lindstaedt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Many of the tests use variables to track when callback functions
are invoked or events are emitted. These variables are then
asserted on process exit. This commit replaces this pattern in
straightforward cases with common.mustCall(). This makes the
tests easier to reason about, leads to a net reduction in lines
of code, and uncovered a few bugs in tests. This commit also
replaces some callbacks that should never be called with
common.fail().
PR-URL: https://github.com/nodejs/node/pull/7753
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Conflicts:
test/parallel/test-file-read-noexist.js
The test case fails in AIX due to the mixed-use of unspecified
and loopback addresses. This is not a problem in most platforms
but fails in AIX. (In Windows too, but does not manifest as the
test is omitted in Windows for a different reason).
There exists no documented evidence which supports the mixed use
of unspecified and loopback addresses.
While AIX strictly follows the IPV6 specification with respect to
unspecified address ('::') and loopback address ('::1'), the test
case latches on to the behavior exhibited by other platforms,
and hence it fails in AIX.
The proposed fix is to make it work in all platforms including
AIX by using the loopback address for the client to connect,
as that is the address at which the server listens.
Fixes: https://github.com/nodejs/node/issues/7563
PR-URL: https://github.com/nodejs/node/pull/7702
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Comparing the buffers `ABC` and `ABCD` returns `-1` not `1`.
PR-URL: https://github.com/nodejs/node/pull/7777
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
API function callbacks run inside an implicit HandleScope. We don't
need to explicitly create one and in fact introduce some unnecessary
overhead when we do.
PR-URL: https://github.com/nodejs/node/pull/7711
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Create a handle scope before performing a check that creates a handle,
otherwise the handle is leaked into the handle scope of the caller.
PR-URL: https://github.com/nodejs/node/pull/7711
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Create a handle scope before performing a check that creates a handle,
otherwise the handle is leaked into the handle scope of the caller.
PR-URL: https://github.com/nodejs/node/pull/7711
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Fix handle leaks in Buffer::New() and Buffer::Copy() by creating the
handle scope before looking up the env with Environment::GetCurrent().
Environment::GetCurrent() calls v8::Isolate::GetCurrentContext(), which
creates a handle in the current scope, i.e., the scope created by the
caller of Buffer::New() or Buffer::Copy().
PR-URL: https://github.com/nodejs/node/pull/7711
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Inspect boxed symbol objects in the same way other boxed primitives
are inspected.
Fixes: https://github.com/nodejs/node/issues/7639
PR-URL: https://github.com/nodejs/node/pull/7641
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>