0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

4287 Commits

Author SHA1 Message Date
Rich Trott
7652ae9829 test: favor strict equality check
Change use of `!=` in assertion to `assert.notStrictEqual()` check.

PR-URL: https://github.com/nodejs/node/pull/8130
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-18 15:40:32 -07:00
Rich Trott
5eb0ca7d1a test: fix assertion in test-watch-file.js
Because it is comparing two Date objects, an assertion in
test/pummel/test-watch-file.js would never fire even if the two objects
represented the same time. Use `assert.notDeepStrictEqual()` so that the
assertion fires if different Date objects represent the same time.

PR-URL: https://github.com/nodejs/node/pull/8129
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-18 15:15:56 -07:00
Ilkka Myller
1d0385f62d url: url.format() encodes all # in search
This commit fixes an error where only the first occurrence of `#` in
`search` parameter is URL encoded, and subsequent occurrences are not.

Also added a test for the case.

Fixes: https://github.com/nodejs/node/issues/8064
PR-URL: https://github.com/nodejs/node/pull/8072
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-18 11:21:19 -07:00
Santiago Gimeno
5f617c5f9e test: fix flaky fs-watch tests
`test-fs-watch-recursive` and `test-fs-watch` were both watching the
same folder: `tmp/testsubdir` so running them sequentially on `OS X`
could make `test-fs-watch` to fail due to events generated in the other
test. Make them watch a random directory to fix the issue.

Fixes: https://github.com/nodejs/node/issues/8045
PR-URL: https://github.com/nodejs/node/pull/8115
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-18 09:54:43 -07:00
Calvin Metcalf
774146dc58 stream: avoid caching prepend check
This removes the cached check for EE.prototype.prependListener
because we can't have nice things. More specifically some
libraries will bundle their own event emitter implementation.

PR-URL: https://github.com/nodejs/node/pull/8018
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2016-08-17 18:47:41 -07:00
Anna Henningsen
4c9b0bdf2f test: add an zlib binding addon test
Add a test addon that makes use of the zlib implementation bundled
with node, checking that a compression/decompression round-trip works.

This is largely based on the already-existing OpenSSL addon.

Fixes: https://github.com/nodejs/node/issues/7535
PR-URL: https://github.com/nodejs/node/pull/8039
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-17 18:44:00 -07:00
Sakthipriyan Vairamani
60dcd7323f tls: copy the Buffer object before using
`convertNPNProtocols` and `convertALPNProtocols' uses the `protocols`
buffer object as it is, and if it is modified outside of core, it
might have an impact. This patch makes a copy of the buffer object,
before using it.

PR-URL: https://github.com/nodejs/node/pull/8055
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2016-08-17 18:40:52 -07:00
Bryan English
249bb8da2f util: fix deprecated class prototype
Ensure the wrapped class prototype is exactly the unwrapped class
prototype, rather than an object whose prototype is the unwrapped
class prototype.

This ensures that instances of the unwrapped class are instances
of the wrapped class. This is useful when both a wrapped class and
a factory for the unwrapped class are both exposed.

Ref: https://github.com/nodejs/node/pull/8103
PR-URL: https://github.com/nodejs/node/pull/8105
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-17 18:27:22 -07:00
Prince J Wesley
4b883a3fb4
readline: keypress trigger for escape character
Fixes: https://github.com/nodejs/node/issues/7379
PR-URL: https://github.com/nodejs/node/pull/7382
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-08-17 23:44:39 +05:30
Rich Trott
8badb67761 test: use strict equality in regression test
Replace `==` with `===` and `assert.strictEqual()` in
test-regress-GH-877.js.

PR-URL: https://github.com/nodejs/node/pull/8098
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-08-16 20:51:39 -07:00
Rich Trott
88650aaa70 test: remove extraneous space
Change `require ('zlib');` to `require('zlib');` in conformance with
style in the rest of the code base. This is in preparation for enabling
linting for that issue.

PR-URL: https://github.com/nodejs/node/pull/8097
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-08-16 15:15:15 -07:00
Rich Trott
647826017e test: add test for assert.notStrictEqual()
There is currently no test for `assert.notStrictEqual()` throwing an
`AssertionError` when passed identical values. This change adds such a
test.

PR-URL: https://github.com/nodejs/node/pull/8091
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-08-16 09:29:53 -07:00
Rich Trott
3f6e1dae7e test: add uncaught exception test for debugger
PR-URL: https://github.com/nodejs/node/pull/8087
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
2016-08-15 22:13:00 -07:00
JungMinu
fce4b981ea repl,util: insert carriage returns in output
`\n` is not enough for Linux with some custom stream
add carriage returns to ensure that the output is displayed correctly
using `\r\n` should not be a problem, even on non-Windows platforms.

Fixes: https://github.com/nodejs/node/issues/7954
PR-URL: https://github.com/nodejs/node/pull/8028
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-08-13 23:03:30 +09:00
Rich Trott
3dfcb2e266 test: add test for debug usage message
PR-URL: https://github.com/nodejs/node/pull/8061
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-12 17:15:40 -07:00
Bartosz Sosnowski
08996fde3c fs: restore JS implementation of realpath
This reverts parts of b488b19eaf
restoring javascript implementation of realpath and realpathSync.

Fixes: https://github.com/nodejs/node/issues/7175
Fixes: https://github.com/nodejs/node/issues/6861
Fixes: https://github.com/nodejs/node/issues/7294
Fixes: https://github.com/nodejs/node/issues/7192
Fixes: https://github.com/nodejs/node/issues/7044
Fixes: https://github.com/nodejs/node/issues/6624
Fixes: https://github.com/nodejs/node/issues/6978
PR-URL: https://github.com/nodejs/node/pull/7899
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-08-12 13:07:55 +02:00
Michael Dawson
a0b3bc56c6 test: mark test failing on AIX as flaky
We now have adequate AIX hardware to add AIX to
the regular regression runs.

However, there are a couple of failing tests even
though AIX was green at one point.  This PR
marks those tests as flaky so that we can add AIX
so that we can spot any new regressions without making
the builds RED

The tests are being worked under the following PRs

- being worked under https://github.com/nodejs/node/pull/7564
test-async-wrap-post-did-throw
test-async-wrap-throw-from-callback
test-crypto-random

- being worked under https://github.com/nodejs/node/issues/7973
test-stdio-closed

- covered by https://github.com/nodejs/node/issues/3796
test-debug-signal-cluster

PR-URL: https://github.com/nodejs/node/pull/8065
Reviewed-By: joaocgreis - João Reis <reis@janeasystems.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-08-11 14:20:13 -04:00
Anna Henningsen
6d3241d19c
test,util: fix flaky test-util-sigint-watchdog
Fix parallel/test-util-sigint-watchdog by polling until the
signal has definitely been received instead of just using a timeout.

Fixes: https://github.com/nodejs/node/issues/7919
PR-URL: https://github.com/nodejs/node/pull/7933
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-11 18:42:41 +02:00
Rich Trott
4c62892a4b test: console constructor missing new keyword
The `console.Console()` constructor function handles a missing `new`
keyword. This code is not exercised in the current tests. Add a test for
this.

PR-URL: https://github.com/nodejs/node/pull/8003
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: JacksonTian - Jackson Tian <shvyo1987@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-09 23:42:21 -07:00
Eugene Ostroukhov
49e473a45f test: fix failing inspector cctest
Test was updated to wait till the inspector processes socket closure.

Fixes: https://github.com/nodejs/node/pull/8006
PR-URL: https://github.com/nodejs/node/pull/8019
Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-08-09 17:28:12 -07:00
Owen Smith
b7a8a691b4 events: unwrap #once listeners in #listeners
Fixes: https://github.com/nodejs/node/issues/6873
PR-URL: https://github.com/nodejs/node/pull/6881
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-09 14:13:09 -07:00
Jan Schär
1b99093df7 timers: remove unused repeat param in timer_wrap
The `repeat` param in `start(timeout, repeat)` was 0 in all callsites.

PR-URL: https://github.com/nodejs/node/pull/7994
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-09 12:26:10 -07:00
Roman Reiss
1a6a69a8e0
util: add inspect.defaultOptions
Adds util.inspect.defaultOptions which allows customization of the
default util.inspect options, which is useful for functions like
console.log or util.format which implicitly call into util.inspect.

PR-URL: https://github.com/nodejs/node/pull/8013
Fixes: https://github.com/nodejs/node/issues/7566
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-08-09 20:57:24 +02:00
Feross Aboukhadijeh
a8438a0438 test,assert: add deepEqual/deepStrictEqual tests for typed arrays
Let's test typed arrays which have a .byteOffset and .byteLength (i.e.
typed arrays that are slices of parent typed arrays).

PR-URL: https://github.com/nodejs/node/pull/8002
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-09 11:43:32 -07:00
hefangshi
55852e1421 module: fix node_modules search path in edge case
The `p < nmLen` condition will fail when a module's name is end with
`node_modules` like `foo_node_modules`. The old logic will miss the
`foo_node_modules/node_modules` in node_modules paths.

TL;TR, a module named like `foo_node_modules` can't require any module
 in the node_modules folder.

Fixes: https://github.com/nodejs/node/issues/6679
PR-URL: https://github.com/nodejs/node/pull/6670
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-08-09 05:46:40 -05:00
Linus Unnebäck
4a87abb8e8 fs: add bytesRead to ReadStream
Add a property named bytesRead that exposes how many bytes that have
currently been read from the file. This brings consistency with
WriteStream that has bytesWritten and net.Socket which have both
bytesRead and bytesWritten.

Fixes: https://github.com/nodejs/node/issues/#7938
PR-URL: https://github.com/nodejs/node/pull/7942
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-08-08 10:11:17 -07:00
cjihrig
2d4a521d58 repl: don't override all internal repl defaults
The createInternalRepl() module accepts an options object as an
argument. However, if one is provided, it overrides all of the
default options. This commit applies the options object to the
defaults, only changing the values that are explicitly set.

PR-URL: https://github.com/nodejs/node/pull/7826
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-08 11:03:18 -04:00
cjihrig
f18b1c91b8 test: allow globals to be whitelisted
This commit adds a function to test/common.js that allows
additional global variables to be whitelisted in a test.

PR-URL: https://github.com/nodejs/node/pull/7826
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-08 11:03:18 -04:00
Pat Pannuto
99f45b2476
child_process: control argv0 for spawned processes
In some cases it useful to control the value of `argv[0]`, c.f.
 - https://github.com/andrewffff/child_process_with_argv0
 - https://github.com/andrep/argv0

This patch adds explicit support for setting the value of `argv[0]`
when spawning a process.

PR-URL: https://github.com/nodejs/node/pull/7696
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-08 16:35:43 +02:00
Anna Henningsen
8f90dcc1b8
buffer: throw on negative .allocUnsafe() argument
Add a check for `size < 0` to `assertSize()`, as passing a negative
value almost certainly indicates a programming error.

This also lines up the behaviour of `.allocUnsafe()` with the ones
of `.alloc()` and `.allocUnsafeSlow()` (which previously threw errors
from the Uint8Array constructor).

Notably, this also affects `Buffer()` calls with negative arguments.

PR-URL: https://github.com/nodejs/node/pull/7079
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
2016-08-08 15:04:21 +02:00
Anna Henningsen
be73480eec
test: fix flaky test-vm-sigint-existing-handler
Set the `SIGUSR2` handler before spawning the child process to make sure
the signal is always handled.

Ref: https://github.com/nodejs/node/pull/7854
Fixes: https://github.com/nodejs/node/issues/7981
PR-URL: https://github.com/nodejs/node/pull/7982
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-08 14:48:01 +02:00
Prince J Wesley
b779eb423d
repl: Add editor mode support
```js
> node
> .editor
// Entering editor mode (^D to finish, ^C to cancel)
function test() {
  console.log('tested!');
}

test();

// ^D
tested!
undefined
>
```

PR-URL: https://github.com/nodejs/node/pull/7275
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-08-06 19:41:35 +05:30
Gibson Fahnestock
9a0d26fa43 test: remove internal headers from addons
PR-URL: https://github.com/nodejs/node/pull/7947
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-05 12:49:39 -07:00
Franziska Hinkelmann
ff7a841f4d src: make EnvDelete behave like the delete operator
According to TC39 specification, the delete
operator returns false or throws
in strict mode, if the property is
non-configurable. It returns true in all other cases.

Process.env can never have non-configurable
properties, thus EnvDelete must always return true. This
is independent of strict mode.

Fixes: https://github.com/nodejs/node/issues/7960
PR-URL: https://github.com/nodejs/node/pull/7975
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-08-05 12:34:11 -07:00
yorkie
99296eedbe http: specify _implicitHeader in OutgoingMessage
PR-URL: https://github.com/nodejs/node/pull/7949
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-05 23:26:46 +08:00
Myles Borins
21b0a27af8
Revert "fs: make callback mandatory to all async functions"
This reverts commit 9359de9dd2.

Original Commit Message:

    The "fs" module has two functions called `maybeCallback` and
    `makeCallback`, as of now.

    The `maybeCallback` creates a default function to report errors, if the
    parameter passed is not a function object. Basically, if the callback
    is omitted in some cases, this function is used to create a default
    callback function.

    The `makeCallback`, OTOH, creates a default function only if the
    parameter passed is `undefined`, and if it is not a function object it
    will throw an `Error`.

    This patch removes the `maybeCallback` function and makes the callback
    function argument mandatory for all the async functions.

    PR-URL: https://github.com/nodejs/node/pull/7168
    Reviewed-By: Trevor Norris <trev.norris@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/7846
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-05 00:13:29 +02:00
Anna Henningsen
1a9e247c79
readline: show completions only after 2nd TAB
Show `TAB` completion suggestions only after the user has pressed `TAB`
twice in a row, so that the full list of suggestions doesn’t present
a distraction. The first time a `TAB` key is pressed, only partial
longest-common-prefix completion is performed.

This moves the `readline` autocompletion a lot closer to what e.g.
`bash` does.

Fixes: https://github.com/nodejs/node/issues/7665
PR-URL: https://github.com/nodejs/node/pull/7754
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-04 23:32:38 +02:00
Prince J Wesley
488d28d391 repl: deprecate unused function convertToContext
PR-URL: https://github.com/nodejs/node/pull/7829
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-04 12:59:50 -07:00
Franziska Hinkelmann
588ee2296a src: do not copy on failing setProperty()
In vm, the setter interceptor should not copy a value onto the
sandbox, if setting it on the global object will fail. It will fail if
we are in strict mode and set a value without declaring it.

Fixes: https://github.com/nodejs/node/issues/5344
PR-URL: https://github.com/nodejs/node/pull/7908
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-04 12:42:55 -07:00
Myles Borins
c5a18e748d Revert "fs: validate args of truncate functions in js"
This reverts commit c86c1eeab5.

original commit message:

    This patch

     1. moves the basic validation of arguments to `truncate` family
        of functions to the JavaScript layer from the C++ layer.

     2. makes sure that the File Descriptors are validated strictly.

    PR-URL: #2498
    Reviewed-By: Trevor Norris <trev.norris@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/7950
Reviewed-By: Julien Gilli <jgilli@nodejs.org>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-04 09:37:17 -07:00
vladimir
320f433dcd util: support classes in util.deprecate()
Classes cannot be instantiated without new, but util.deprecate()
uses Function.prototype.apply(). This commit uses new.target to
detect constructor calls, allowing classes to be deprecated.

PR-URL: https://github.com/nodejs/node/pull/7690
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-04 11:44:40 -04:00
Rich Trott
b4258bba11 test: improve chained property readability
A new version of ESLint flags chained properties on multiple lines that
were not flagged by the previous version of ESLint. In preparation for
turning that feature on, adjust alignment to that expected by the
linter.

This change happened to be predominantly around assertions using
`assert()` and `assert.equal()`. These were changed to
`assert.strictEqual()` where possible.

PR-URL: https://github.com/nodejs/node/pull/7920
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-02 09:52:50 -07:00
Santiago Gimeno
93ac2ea36e
test: fix test-vm-sigint flakiness
Set the `SIGUSR2` handler before spawning the child process to make sure
the signal is always handled.

Fixes: https://github.com/nodejs/node/issues/7767
PR-URL: https://github.com/nodejs/node/pull/7854
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-02 15:40:04 +02:00
Anna Henningsen
1b24b37299
util: fix formatting of objects with SIMD enabled
When SIMD is enabled, `util.format` couldn’t display objects
(with at least 1 key) because the formatter function got
overridden.

PR-URL: https://github.com/nodejs/node/pull/7864
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2016-08-02 15:00:59 +02:00
cjihrig
75c6d9dd95 cluster: support stdio option for workers
This commit allows setupMaster() to configure the stdio channels
for worker processes.

Refs: https://github.com/nodejs/node-v0.x-archive/issues/5727
Refs: https://github.com/nodejs/node/pull/7811
PR-URL: https://github.com/nodejs/node/pull/7838
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-01 15:08:42 -04:00
Prince J Wesley
c52a9730b8 test: don't hard code deprecation count
PR-URL: https://github.com/nodejs/node/pull/7927
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-01 10:42:29 -07:00
Ben Noordhuis
c8c1f96abe src: avoid manual memory management in inspector
Make the inspector code easier to reason about by restructuring it
to avoid manual memory allocation and copying as much as possible.

An amusing side effect is that it reduces the total amount of memory
used in the test suite.

Before:

    $ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31-
    1,017 allocs, 1,017 frees, 21,695,456 allocated

After:

    $ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31-
    869 allocs, 869 frees, 14,484,641 bytes allocated

PR-URL: https://github.com/nodejs/node/pull/7906
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-01 16:17:24 +02:00
Ben Noordhuis
0190db44ac test: fix memory leaks in inspector tests
The inspector tests weren't closing open libuv handles properly,
making valgrind complain.  Strengthen the uv_loop_close() check
while here.

With this commit applied:

    $ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31-
    1,017 allocs, 1,017 frees, 21,695,456 bytes allocated

PR-URL: https://github.com/nodejs/node/pull/7906
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-01 16:16:48 +02:00
Vse Mozhet Byt
0de55d864d
test: decrease inconsistency in the common.js
1. `process.env['PROCESSOR_ARCHITEW6432']` ->
   `process.env.PROCESSOR_ARCHITEW6432`.

2. `path.dirname(__filename)` -> `__dirname`.

3. `path.resolve(__dirname)` -> `__dirname`.

PR-URL: https://github.com/nodejs/node/pull/7758
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-08-01 14:17:20 +02:00
Rich Trott
bc464a8a3b test: fix flaky test-tls-wrap-timeout
Competing timers were causing a race condition and thus the test was
flaky. Instead, we check an object property on process exit.

Fixes: https://github.com/nodejs/node/issues/7650
PR-URL: https://github.com/nodejs/node/pull/7857
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
2016-07-31 13:31:40 -07:00