Sam Roberts
a4f67f9243
src: --abort-on-uncaught-exception in NODE_OPTIONS
...
Allow --abort-on-uncaught-exception in NODE_OPTIONS, its useful to
enable for post-mortem debugging.
PR-URL: https://github.com/nodejs/node/pull/13932
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-19 15:02:12 -04:00
Rich Trott
5abe8c0693
test: restore no-op function in test
...
Remove common.mustCall() in test that might connect to a server already
running on the local host.
PR-URL: https://github.com/nodejs/node/pull/14065
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-07-19 15:02:07 -04:00
Rich Trott
e583e3b0b6
test: skip test-fs-readdir-ucs2 if no support
...
If the filesystem does not support UCS2, do not run the test.
PR-URL: https://github.com/nodejs/node/pull/14029
Fixes: https://github.com/nodejs/node/issues/14028
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2017-07-19 15:02:07 -04:00
Vse Mozhet Byt
bc99efc973
test: simplify test skipping
...
* Make common.skip() exit.
Also add common.printSkipMessage() for partial skips.
* Don't make needless things before skip
PR-URL: https://github.com/nodejs/node/pull/14021
Fixes: https://github.com/nodejs/node/issues/14016
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-07-19 15:02:06 -04:00
Vse Mozhet Byt
898fe6135b
test: fix require nits in some test-tls-* tests
...
* Do not require if test is skipped.
* Do not re-require without need.
* Sort requiring by module names.
PR-URL: https://github.com/nodejs/node/pull/14008
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-07-19 15:02:06 -04:00
Rich Trott
1058556752
test: refactor test-http-hostname-typechecking
...
* Use common.mustCall() to confirm callback is invoked.
* Change spacing of require statements to conform to test-writing guide.
PR-URL: https://github.com/nodejs/node/pull/13993
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-07-19 15:02:05 -04:00
Alexey Orlenko
16a2f6865e
test: refactor test-http(s)-set-timeout-server
...
* Make changes to `test-https-set-timeout-server` to resolve
inconsistencies with its http counterpart:
- Apply the changes analogous to those in GH-13802 to the https test.
- Add a missing `common.mustCall()` wrapper.
- Make small stylistic changes (e.g., remove unnecessary line breaks
in comments) to make it visually consistent with the http test.
* Use arrow functions.
PR-URL: https://github.com/nodejs/node/pull/13935
Fixes: https://github.com/nodejs/node/issues/13588
Refs: https://github.com/nodejs/node/pull/13802
Refs: https://github.com/nodejs/node/pull/13625
Refs: https://github.com/nodejs/node/pull/13822
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-19 15:02:04 -04:00
Refael Ackermann
959bdfda44
http: guard against failed sockets creation
...
PR-URL: https://github.com/nodejs/node/pull/13839
Fixes: https://github.com/nodejs/node/issues/13045
Fixes: https://github.com/nodejs/node/issues/13831
Refs: https://github.com/nodejs/node/issues/13352
Refs: https://github.com/nodejs/node/issues/13548#issuecomment-307177400
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
2017-07-19 15:02:04 -04:00
Rich Trott
602dd03231
test: refactor test-http-invalidheaderfield
...
* use common.mustNotCall() to confirm callback is not invoked
* whitespace change per test-writing guide
PR-URL: https://github.com/nodejs/node/pull/13996
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-07-19 15:02:03 -04:00
Refael Ackermann
66a6a5ea57
test: mark test-npm-install flaky on arm
...
PR-URL: https://github.com/nodejs/node/pull/14035
Refs: https://github.com/nodejs/node/issues/14015
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-07-19 15:02:00 -04:00
Nataly Shrits
e0e18313b6
test: replace indexOf with includes and startsWith
...
PR-URL: https://github.com/nodejs/node/pull/13852
Refs: https://github.com/nodejs/node/issues/12586
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
2017-07-19 15:01:59 -04:00
Rich Trott
f1ef692454
test: refactor test-fs-options-immutable
...
* Reorder require() statements per test-writing guide
* Use common.mustNotCall() to check that callback is not invoked
* Use common.mustCall() to check that callback is invoked
PR-URL: https://github.com/nodejs/node/pull/13977
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2017-07-18 19:57:36 +02:00
Rich Trott
bb198dcda9
test: refactor test-crypto-pbkdf2
...
* re-order require() and crypto check per test writing guide
* use common.mustNotCall() to confirm callback is not invoked
PR-URL: https://github.com/nodejs/node/pull/13975
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-07-18 19:57:35 +02:00
Rich Trott
100ccf9ad4
test: refactor test-fs-watchfile
...
* use `common.mustNotCall()` to confirm callback is not called
* reorder modules to conform with test-writing guide
* match full error message in `assert.throws()`
PR-URL: https://github.com/nodejs/node/pull/13721
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:57:23 +02:00
cjihrig
f7383eb80e
test: verify isNativeError accepts internal errors
...
This commit verifies that Node's internal errors are recognized
by V8's IsNativeError(), which is exposed in Node as
process.binding('util').isNativeError().
PR-URL: https://github.com/nodejs/node/pull/13965
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-07-18 19:57:21 +02:00
Rich Trott
071ecb0dd2
test: refactor test-child-process-send-type-error
...
* Add exit listener to child process to check return code. Previously,
child process faiilure would not cause the test to fail.
* Use common.mustNotCall() to guarantee callback is not invoked.
* Insert blank line per test writing guide.
PR-URL: https://github.com/nodejs/node/pull/13904
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-07-18 19:57:18 +02:00
Rich Trott
3d0b66a7c2
benchmark,lib,test: use braces for multiline block
...
For if/else and loops where the bodies span more than one line, use
curly braces.
Original-PR-URL: https://github.com/nodejs/node/pull/13828
Ref: https://github.com/nodejs/node/pull/13623#discussion_r123048602
Original-Reviewed-By: Anna Henningsen <anna@addaleax.net >
Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Original-Reviewed-By: Michaël Zasso <targos@protonmail.com >
Original-Reviewed-By: James M Snell <jasnell@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/13995
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-07-18 19:57:15 +02:00
João Reis
e5d32b8b13
test: mark test-fs-readdir-ucs2 flaky
...
PR-URL: https://github.com/nodejs/node/pull/13989
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-07-18 19:57:14 +02:00
Tobias Nießen
fa9e647385
test: fix failure in test-icu-data-dir.js
...
This fixes a broken test on Windows caused by EOL conversion.
PR-URL: https://github.com/nodejs/node/pull/13987
Refs: https://github.com/nodejs/node/pull/13940
Refs: https://github.com/nodejs/node/issues/13986
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-07-18 19:57:13 +02:00
Timothy Gu
dff506c5c5
src: add missing new line to printed message
...
PR-URL: https://github.com/nodejs/node/pull/13940
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
2017-07-18 19:57:13 +02:00
Timothy Gu
98cb59e9f0
src: revise character width calculation
...
- Categorize all nonspacing marks (Mn) and enclosing marks (Me) as
0-width
- Categorize all spacing marks (Mc) as non-0-width.
- Treat soft hyphens (a format character Cf) as non-0-width.
- Do not treat all unassigned code points as 0-width; instead, let ICU
select the default for that character per UAX #11 .
- Avoid getting the General_Category of a character multiple times as it
is an intensive operation.
Refs: http://unicode.org/reports/tr11/
PR-URL: https://github.com/nodejs/node/pull/13918
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:57:12 +02:00
Timothy Gu
b4b27b2edd
readline: properly handle 0-width characters
...
PR-URL: https://github.com/nodejs/node/pull/13918
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:57:11 +02:00
Rich Trott
b43547acc6
test: refactor test-cluster-basic
...
* Use common.mustNotCall() to check that callback is not invoked.
* Add space per test writing guide.
PR-URL: https://github.com/nodejs/node/pull/13905
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:57:08 +02:00
Rich Trott
98ec8aaa30
test: refactor test-vm-sigint
...
* Use common.mustNotCall() to confirm SIGINT listeners are not being
invoked.
* Improve assertion check on integer child argument.
* Add blank line per test writing guide.
PR-URL: https://github.com/nodejs/node/pull/13902
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:57:05 +02:00
Rich Trott
949d1b1d4a
test: refactor test-tls-two-cas-one-string
...
* order require() statements per test writing guide
* add keydir variable to make readFileSync() calls more readable
* make `next` argument to test() optional
* use common.mustCall() to guarantee second test runs
PR-URL: https://github.com/nodejs/node/pull/13896
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
2017-07-18 19:57:04 +02:00
Daniel Bevenius
6120a0de6c
test: skip fips tests using OpenSSL config file
...
The motivation for this commit is that we are building Node with
--shared-openssl and in our case the system OpenSSL version
supports FIPS.
The tests in test-crypto-fips that toggle fips mode on/off using the
config file option might succeed and return 1 instead of an error
being thrown from OpenSSL (which is what happens for a default build
but the error is not processed/displayed in any way at the moment):
openssl config failed: error:060B10A7:digital envelope
routines:ALG_MODULE_INIT:fips mode not supported
Note that this only concerns the test that use the configuration file
option which is different from when calling the fips setter as
the handling of the configuration file is handled by OpenSSL, so it
is not possible for us to try to call the fips setter as that would
throw an error ("Error: Cannot set FIPS mode in a non-FIPS build.").
The suggestion is to skips these tests when --shared-openssl is used.
PR-URL: https://github.com/nodejs/node/pull/13786
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:56:55 +02:00
Refael Ackermann
5579bc8fb6
src,fs: calculate times as unsigned long
...
PR-URL: https://github.com/nodejs/node/pull/13281
Fixes: https://github.com/nodejs/node/issues/13255
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:56:54 +02:00
Rich Trott
74aed0b6bd
test: refactor test-tls-invoked-queued
...
* use common.mustCall()/common.mustNotCall() as appropriate
* reorder require() statements per test writing guide
* add comment
PR-URL: https://github.com/nodejs/node/pull/13893
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:56:49 +02:00
Rich Trott
a767367123
test: refactor test-tls-env-extra-ca
...
* Use `common.mustCall()` to guarantee callback invocations
* Order modules according to test writing guide
PR-URL: https://github.com/nodejs/node/pull/13886
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2017-07-18 19:56:48 +02:00
Julien Klepatch
265957334c
test: make http(s)-set-timeout-server more similar
...
Make test-http(s)-set-timeout-server tests more similar and resolve the
following issues:
* `test-https-set-timeout-server.js` was missing some `assert`
statements, including with `http` module
* Both files were missing some calls to `common.mustCall()`
* Both files were calling `createServer()` in different ways
PR-URL: https://github.com/nodejs/node/pull/13822
Refs: https://github.com/nodejs/node/issues/13588
Refs: https://github.com/nodejs/node/pull/13625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:56:46 +02:00
cjihrig
16f2600ecf
child_process: emit IPC messages on next tick
...
This commit fixes a regression related to IPC 'message'
events. When messages are not emitted in the next tick,
a 'message' handler that throws can break the IPC read
loop.
Refs: https://github.com/nodejs/node/pull/6909
Refs: https://github.com/nodejs/node/pull/13459
Refs: https://github.com/nodejs/node/pull/13648
PR-URL: https://github.com/nodejs/node/pull/13856
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2017-07-18 19:56:41 +02:00
XadillaX
005e343339
test: remove require('buffer') from 4 test files
...
We don't use the global Buffer throughout the lib/ to avoid circular
dependency issues in core, but we actually don't need to require it on
test files. So remove them on:
+ test/parallel/test-stream-uint8array.js
+ test/parallel/test-stream2-finish-pipe.js
+ test/parallel/test-tls-session-cache.js
+ test/parallel/test-vm-cached-data.js
Refs: https://github.com/nodejs/node/issues/13836
PR-URL: https://github.com/nodejs/node/pull/13844
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-07-18 19:56:39 +02:00
lena
df3c2929b9
test: remove unnecessary require('buffer').Buffer
...
Remove unnecessary imports from:
* test/parallel/test-buffer-nopendingdep-map.js
* test/parallel/test-buffer-pending-deprecation.js
* test/parallel/test-buffer-sharedarraybuffer.js
* test/parallel/test-buffer-slow.js
* test/parallel/test-buffer-tojson.js
* test/parallel/test-buffer-zero-fill.js
Refs: https://github.com/nodejs/node/issues/13836
PR-URL: https://github.com/nodejs/node/pull/13851
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:56:38 +02:00
Zongmin Lei
ec3761b1da
test: remove require('buffer') from 4 test files
...
Remove superfluous import from:
* test/parallel/test-buffer-fakes.js
* test/parallel/test-buffer-includes.js
* test/parallel/test-buffer-indexof.js
* test/parallel/test-buffer-new.js
Refs: https://github.com/nodejs/node/issues/13836
PR-URL: https://github.com/nodejs/node/pull/13846
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jackson Tian <shyvo1987@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2017-07-18 19:56:37 +02:00
OriLev
c3c6699bb3
test: remove require('buffer') from 4 buffer tests
...
Remove superfluous import from:
* test/parallel/test-buffer-alloc.js
* test/parallel/test-buffer-arraybuffer.js
* test/parallel/test-buffer-badhex.js
* test/parallel/test-buffer-bytelength.js
Refs: https://github.com/nodejs/node/issues/13836
PR-URL: https://github.com/nodejs/node/pull/13855
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:56:36 +02:00
sallen450
4a6604193f
test: remove require('buffer') on 6 fs test files
...
* test/parallel/test-fs-mkdtemp.js
* test/parallel/test-fs-read-zero-length.js
* test/parallel/test-fs-read.js
* test/parallel/test-fs-whatwg-url.js
* test/parallel/test-fs-write-string-coerce.js
* test/parallel/test-fs-write.js
PR-URL: https://github.com/nodejs/node/pull/13845
Refs: https://github.com/nodejs/node/issues/13836
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
2017-07-18 19:56:35 +02:00
XadillaX
ebe7bb29aa
dns: make dns.setServers support customized port
...
allow `dns.setServers` parameter to contain port
e.g.
```
dns.setServers([ '103.238.225.181:666' ]);
```
And `dns.getServers` will return IP with port if not the default port.
PR-URL: https://github.com/nodejs/node/pull/13723
Refs: https://github.com/nodejs/node/issues/7903
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-07-18 19:56:24 +02:00
James M Snell
683f743e61
buffer: support boxed strings and toPrimitive
...
Add support for `Buffer.from(new String('...'))` and
`Buffer.from({[Symbol.toPrimitive]() { return '...'; }})`
PR-URL: https://github.com/nodejs/node/pull/13725
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-07-18 19:56:23 +02:00
Vse Mozhet Byt
7e3bab779a
test: use string instead of RegExp in split()
...
PR-URL: https://github.com/nodejs/node/pull/13710
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2017-07-18 19:56:21 +02:00
Vse Mozhet Byt
0e857a5ee4
test: remove needless RegExp flags
...
* /m is needless if ^ and $ are not used
* /g is needless in split()
* /g is needless in test() with one-time RegExp/String
PR-URL: https://github.com/nodejs/node/pull/13690
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:56:20 +02:00
Roman Reiss
864abc567e
src,lib,test,doc: correct misspellings
...
PR-URL: https://github.com/nodejs/node/pull/13719
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2017-07-18 19:56:18 +02:00
Daniel Bevenius
022c6d080c
test: add crypto check to test-tls-wrap-econnreset
...
Currently, there are a few test-tls-wrap-econnreset test that fail when
Node is configured --without-ssl:
Error: Node.js is not compiled with openssl crypto support
This commit adds crypto checks and skips these tests if no crypto
support unavailable.
PR-URL: https://github.com/nodejs/node/pull/13691
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-18 19:56:17 +02:00
cjihrig
bf22514ae4
test: increase util.callbackify() coverage
...
This commit adds coverage for util.callbackify() type checking.
PR-URL: https://github.com/nodejs/node/pull/13705
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2017-07-18 19:56:16 +02:00
James M Snell
e8780ba7ae
errors: add missing ERR_ prefix on util.callbackify error
...
The `FALSY_VALUE_REJECTION` error code added by
https://github.com/nodejs/node/pull/12712 did not have the `ERR_` prefix,
nor was it added to the errors.md documentation. Add the prefix in for
consistency.
Original-PR-URL: https://github.com/nodejs/node/pull/13604
Original-Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Original-Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Original-Reviewed-By: Anna Henningsen <anna@addaleax.net >
Original-Reviewed-By: Refael Ackermann <refack@gmail.com >
Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Original-Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/13750
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-07-18 19:56:15 +02:00
Refael Ackermann
8cba959a93
util: add callbackify
...
Add `util.callbackify(function)` for creating callback style functions
from functions returning a `Thenable`
Original-PR-URL: https://github.com/nodejs/node/pull/12712
Fixes: https://github.com/nodejs/CTC/issues/109
Original-Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Original-Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Original-Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Original-Reviewed-By: Anna Henningsen <anna@addaleax.net >
PR-URL: https://github.com/nodejs/node/pull/13750
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-07-18 19:56:14 +02:00
Anna Henningsen
7794030700
buffer: add constants object
...
Add `buffer.constants`, containing length limits for `Buffer` and
`string` instances.
This could be useful for programmers to tell whether a value can
be turned into a string or not.
Ref: https://github.com/nodejs/node/issues/13465
PR-URL: https://github.com/nodejs/node/pull/13467
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2017-07-11 19:16:45 +02:00
Anna Henningsen
8f37f5dd01
async_hooks: proper id stacking for Promises
...
Until now, the async_hooks PromiseHook did not register the Promise’s
async id and trigger id on the id stack, so inside the `.then()` handler
those ids would be invalid.
To fix this, add push and pop calls to its `before` and `after` parts,
respectively. Some care needs to be taken for the cases that the
Promise hook is being disabled or enabled during the execution
of a Promise handler; in the former case, actually removing the hook
is delayed by adding another task to the microtask queue, in the latter
case popping the id off the async id stack is skipped if the ids don’t
match.
Fixes: https://github.com/nodejs/node/issues/13583
PR-URL: https://github.com/nodejs/node/pull/13585
Reviewed-By: Trevor Norris <trevnorris@gmail.com >
2017-07-11 19:16:44 +02:00
Sam Roberts
a839aede3e
net: return this from getConnections()
...
PR-URL: https://github.com/nodejs/node/pull/13553
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-11 19:16:41 +02:00
Sam Roberts
69f806cc55
net: return this from destroy()
...
PR-URL: https://github.com/nodejs/node/pull/13530
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-11 19:16:40 +02:00
José F. Romaniello
e2d325403f
tls: add host and port info to ECONNRESET errors
...
Add more information to the "ECONNRESET" errors generated when the
socket hang ups before establishing the secure connection.
These kind of errors are really hard to troubleshoot without this info.
PR-URL: https://github.com/nodejs/node/pull/7476
Reviewed-By: Trevor Norris <trevnorris@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
Reviewed-By: Yazhong Liu <yorkiefixer@gmail.com >
2017-07-11 19:16:39 +02:00