Removes race condition when test relied on both sides of the socket
to be closed on the same UV event loop iteration.
Fixes: nodejs/node#8498
PR-URL: https://github.com/nodejs/node/pull/8505
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Refs: nodejs/code-and-learn#56(comment)
Replace the equal assetion with strictEqual.
Replace the notEqual assertion with strictNotEqual.
PR-URL: https://github.com/nodejs/node/pull/8584
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Changed var -> const and assert.equal -> assert.strictEqual
PR-URL: https://github.com/nodejs/node/pull/8590
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
change var to const
use arrow function in callback
use strict equal
PR-URL: https://github.com/nodejs/node/pull/8594
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* Replace equal with strictEqual
* Update functions to arrow functions
PR-URL: https://github.com/nodejs/node/pull/8596
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* change var to let
* replace equal with strictEqual
PR-URL: https://github.com/nodejs/node/pull/8625
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
openssl command does not allow to both "-ssl3" and "-no_tls1".
A protocol connecting to the server is only specified.
PR-URL: https://github.com/nodejs/node/pull/8714
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Change `Malloc()/Calloc()` so that size zero does not return a null
pointer, consistent with prior behavior.
Fixes: https://github.com/nodejs/node/issues/8571
PR-URL: https://github.com/nodejs/node/pull/8572
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@keybase.io>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Moved from var to const.
Moved from .equal to .strictEqual.
Added more checks about the type of the returned values.
PR-URL: https://github.com/nodejs/node/pull/8606
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
If calling `https.request()` with `options.headers.host` defined
and `options.servername` undefined, `https.Agent.createSocket` mutates
connection `options` after `https.Agent.addRequest` has created empty
socket pool array with mismatching connection name. This results in two
socket pool arrays being created and only the last one gets eventually
deleted by `removeSocket` - causing a memory leak.
This commit fixes the leak by making sure that `addRequest` does the
same modifications to `options` object as the `createSocket`.
`createSocket` is intentionally left unmodified to prevent userland
regressions.
Test case included.
PR-URL: https://github.com/nodejs/node/pull/8647
Fixes: https://github.com/nodejs/node/issues/6687
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jackson Tian <shvyo1987@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit adds better handling of exceptional array formats
passed to dns.setServers(). Prior to this commit, the input
array was validated using map(), which preserves holes, allowing
them to be passed to c-ares, crashing Node. This commit replaces
map() with forEach(), which skips holes.
Fixes: https://github.com/nodejs/node/issues/8538
PR-URL: https://github.com/nodejs/node/pull/8567
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Refactored the code to latest standards, where all var is
changed to const, functions are changed to arrow functions
and assert.equal chaned to assert.strictEqual
PR-URL: https://github.com/nodejs/node/pull/8582
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This commit prevents thrown JavaScript exceptions from crashing
the process in node_contextify's CopyProperties() function.
Fixes: https://github.com/nodejs/node/issues/8537
PR-URL: https://github.com/nodejs/node/pull/8649
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
change var to const/let where appropriate
use strictEqual instead of equal
call toString on buffers in strictEqual asserts
use common.mustCall on callbacks containing asserts
PR-URL: https://github.com/nodejs/node/pull/8648
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Changed vars to const / let, functions to arrow functions and a
mustCall where appropriate.
PR-URL: https://github.com/nodejs/node/pull/8581
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Uses const where possible, removes inaccurate comments, prefers
strictEqual where possible, ensures functions with assertions are called
and enures the inflater has correct encoding set.
PR-URL: https://github.com/nodejs/node/pull/8512
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Moves inflateSetDictionary right after inflateInit2 when mode is
INFLATERAW, since without the wrapper in appears zlib won't return
Z_NEED_DICT as it would otherwise, and will thus attempt inflating
without the dictionary, leading to an error.
Fixes: https://github.com/nodejs/node/issues/8507
PR-URL: https://github.com/nodejs/node/pull/8512
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Replace equal with strictEqual, use const instead of var and
improve test with use of assert.notStrictEqual
PR-URL: https://github.com/nodejs/node/pull/8600
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Changed vars to consts and lets, assert.equals to
assert.strictEquals and added common.mustCall around callbacks.
Switched to arrow functions.
PR-URL: https://github.com/nodejs/node/pull/8616
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
PR-URL: https://github.com/nodejs/node/pull/8578
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Changed var to const
PR-URL: https://github.com/nodejs/node/pull/8599
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
PR-URL: https://github.com/nodejs/node/pull/8628
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/8640
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
An upcoming custom lint rule will provide slightly more strict
enforcement of argument alignment for multiline function calls. Adjust
existing code to conform.
PR-URL: https://github.com/nodejs/node/pull/8642
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Ctor has to be added as memset to 0 is no longer an option, since
the structure now has std::vector member.
Attempt at fixing nodejs/node#8155 (so far I was not able to repro it)
PR-URL: https://github.com/nodejs/node/pull/8536
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
When the result of a path.relative() is an absolute UNC path, it should
include the leading backslashes.
Fixes: https://github.com/nodejs/node/issues/8444
PR-URL: https://github.com/nodejs/node/pull/8523
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Replaced var with const
PR-URL: https://github.com/nodejs/node/pull/8598
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Changes in test-zlib-from-string is because var->const
pushed us over the max char limit per line.
PR-URL: https://github.com/nodejs/node/pull/8627
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Changed var --> const and let.
Changed assert.equal !== --> assert.notStrictEqual
Correctly aligned argument
PR-URL: https://github.com/nodejs/node/pull/8580
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Improved variables to be all const.
Enforced assert.strictEqual across all tests.
Modified haveIntl tests to check for int.
Fixed alignment.
PR-URL: https://github.com/nodejs/node/pull/8641
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Changed var --> const and let
Changed assert.equal --> assert.strictEqual
PR-URL: https://github.com/nodejs/node/pull/8602
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Add tests for untested branches and statements.
Change assert.equal to assert.strictEqual for consistency.
PR-URL: https://github.com/nodejs/node/pull/8633
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Replace equal with strictEqual, use const instead of var
Replace throw error with assert.ifError
PR-URL: https://github.com/nodejs/node/pull/8577
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Replaced var keyword with const and let in the tests for child process
stdin and stdio.
PR-URL: https://github.com/nodejs/node/pull/8617
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This test executes a simple debug session over the inspector protocol.
PR-URL: https://github.com/nodejs/node/pull/8429
Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
Add tests for untested branches and statements.
Also convert some lines to const.
PR-URL: https://github.com/nodejs/node/pull/8552
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
On line 40: replace '==' with '==='
On line 52: replace 'assert.equal' with 'assert.strictEqual'
Added some comments.
Changed 'var' to 'const' where possible.
Replaced console.log(res.statusCode); with and assertion.
Rather than logging the https request status on every loop it will now
assert the https status is correct on every loop.
Changed the error listener to throw the error rather than log it.
PR-URL: https://github.com/nodejs/node/pull/8517
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
- Added dots to printed commands.
- Use spaces instead of tabs so there's no misalignment on terminals
with a tab size other than 4.
- Improved the help text for .editor and .help.
- Automatically indent command help based on the longest command.
PR-URL: https://github.com/nodejs/node/pull/8519
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Wait for a sought-for symbol to appear instead of just hard-killing
subprocesses at 2s timeout.
Fix: #4427
PR-URL: https://github.com/nodejs/node/pull/8542
Reviewed-By: Rich Trott <rtrott@gmail.com>
`Client.prototype._addHandle()` in the `_debugger` module has conditions
around invalid properties that are not currently tested. This change
adds some minimal unit tests.
PR-URL: https://github.com/nodejs/node/pull/8518
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Increase time allowed for startup from 1 second to 5 seconds to avoid
occasional flakiness. While at it, refactor a few minor things such as
var->const and using common.mustCall().
Fixes: https://github.com/nodejs/node/issues/8483
PR-URL: https://github.com/nodejs/node/pull/8484
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>