James M Snell
b55f6a0f01
perf_hooks: remove less useful bootstrap marks
...
While `perf_hooks` is still in experimental, remove less useful
bootstrap milestones.
PR-URL: https://github.com/nodejs/node/pull/21247
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2018-06-15 09:05:19 -07:00
Anna Henningsen
7b46e177ba
lib,src: make StatWatcher a HandleWrap
...
Wrapping libuv handles is what `HandleWrap` is there for.
This allows a decent reduction of state tracking machinery
by moving active-ness tracking to JS, and removing all
interaction with garbage collection.
Refs: https://github.com/nodejs/node/pull/21093
PR-URL: https://github.com/nodejs/node/pull/21244
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2018-06-14 13:19:17 +02:00
Ben Noordhuis
078bb0f0a0
crypto: refactor randomBytes()
...
Use the scrypt() infrastructure to reimplement randomBytes() and
randomFill() in a simpler manner.
PR-URL: https://github.com/nodejs/node/pull/20816
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2018-06-13 15:58:59 +02:00
Ben Noordhuis
c188cc5338
crypto: refactor pbkdf2() and pbkdf2Sync() methods
...
Use the scrypt() infrastructure to reimplement pbkdf2() in a simpler
manner.
PR-URL: https://github.com/nodejs/node/pull/20816
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2018-06-13 15:58:56 +02:00
Ben Noordhuis
371103dae8
crypto: add scrypt() and scryptSync() methods
...
Scrypt is a password-based key derivation function that is designed to
be expensive both computationally and memory-wise in order to make
brute-force attacks unrewarding.
OpenSSL has had support for the scrypt algorithm since v1.1.0. Add a
Node.js API modeled after `crypto.pbkdf2()` and `crypto.pbkdf2Sync()`.
Changes:
* Introduce helpers for copying buffers, collecting openssl errors, etc.
* Add new infrastructure for offloading crypto to a worker thread.
* Add a `AsyncWrap` JS class to simplify pbkdf2(), randomBytes() and
scrypt().
Fixes: https://github.com/nodejs/node/issues/8417
PR-URL: https://github.com/nodejs/node/pull/20816
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2018-06-13 15:58:45 +02:00
Anna Henningsen
3217e8e66f
src: re-add Realloc() shrink after reading stream data
...
This would otherwise keep a lot of unused memory lying around,
and in particular add up to a page per chunk of memory overhead
for network reads, potentially opening a DoS vector if the resulting
`Buffer` objects are kept around indefinitely (e.g. stored in a list
and not concatenated until the socket finishes).
This fixes CVE-2018-7164.
Refs: https://github.com/nodejs-private/security/issues/186
Refs: https://github.com/nodejs/node/commit/7c4b09b24bbe7d6a8cbad256f47b30a101a909ea
PR-URL: https://github.com/nodejs-private/node-private/pull/128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2018-06-12 20:46:15 -04:00
Rich Trott
921909961b
test: mark test-inspector-port-zero-cluster flaky
...
Mark test-inspector-port-zero-cluster flaky on Linux. Also,
alphabetize win32 entries in status file.
PR-URL: https://github.com/nodejs/node/pull/21251
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-06-11 16:10:16 -07:00
Rich Trott
ceaf7b3036
test: move inspector-stress-http to sequential
...
test-inspector-stress-http launches 100 simultaneous http requests. It
is unreliable in the parallel directory (as can be seen with
tools/test.py and sufficiently high -j and --repeat values). Move to
sequential.
PR-URL: https://github.com/nodejs/node/pull/21227
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-10 19:36:07 -07:00
Anatoli Papirovski
ff16545f60
test: check gc does not resurrect the loop
...
PR-URL: https://github.com/nodejs/node/pull/21093
Fixes: https://github.com/nodejs/node/issues/18190
Refs: https://github.com/nodejs/node/pull/18307
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-06-09 19:09:47 -07:00
Rich Trott
c46b99e254
test: mark fs-readfile-tostring-fail flaky for all
...
test-fs-readfile-tostring-fail is unreliable until a libuv fix lands.
It had previously been marked flaky on macOS, but it has been observed
to also fail on AIX. Mark it flaky everywhere.
Refs: https://github.com/libuv/libuv/pull/1742
PR-URL: https://github.com/nodejs/node/pull/21177
Reviewed-By: Matheus Marchini <matheus@sthima.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
2018-06-08 15:47:55 -07:00
Anna Henningsen
229dca3dee
test,tools: enable running tests under workers
...
Enable running tests inside workers by passing `--worker`
to `tools/test.py`. A number of tests are marked as skipped,
or have been slightly altered to fit the different environment.
PR-URL: https://github.com/nodejs/node/pull/20876
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Shingo Inoue <leko.noor@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2018-06-06 19:44:11 +02:00
Anna Henningsen
0df031acad
worker: initial implementation
...
Implement multi-threading support for most of the API.
Thanks to Stephen Belanger for reviewing this change in its
original form, to Olivia Hugger for reviewing the
documentation and some of the tests coming along with it,
and to Alexey Orlenko and Timothy Gu for reviewing other
parts of the tests.
Refs: https://github.com/ayojs/ayo/pull/110
Refs: https://github.com/ayojs/ayo/pull/114
Refs: https://github.com/ayojs/ayo/pull/117
PR-URL: https://github.com/nodejs/node/pull/20876
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Shingo Inoue <leko.noor@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2018-06-06 19:43:52 +02:00
Anna Henningsen
e7a2367471
worker: implement MessagePort and MessageChannel
...
Implement `MessagePort` and `MessageChannel` along the lines of
the DOM classes of the same names. `MessagePort`s initially
support transferring only `ArrayBuffer`s.
Thanks to Stephen Belanger for reviewing this change in its
original form, to Benjamin Gruenbaum for reviewing the
added tests in their original form, and to Olivia Hugger
for reviewing the documentation in its original form.
Refs: https://github.com/ayojs/ayo/pull/98
PR-URL: https://github.com/nodejs/node/pull/20876
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Shingo Inoue <leko.noor@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2018-06-06 19:43:44 +02:00
Anatoli Papirovski
d0943bcb69
test: move benchmark-dgram to sequential
...
This test uses hardcoded ports, it should not be located in parallel.
PR-URL: https://github.com/nodejs/node/pull/21144
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2018-06-05 18:55:24 -07:00
Rich Trott
c903a9e0c0
test: avoid empty fixture in module test
...
Refactor test-module-loading to use tmpdir for its empty directory
rather than using a not-actually-empty directory called "empty" in
fixtures.
PR-URL: https://github.com/nodejs/node/pull/21044
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-06-01 23:44:02 +02:00
Matheus Marchini
6d5847917c
test: mark test-fs-readfile-tostring-fail as flaky
...
test-fs-readfile-tostring-fail is failing frequently on OSX machines.
There's a PR to fix this issue in libuv, but while the fix don't land on
Node.js this test should be marked as flaky.
Ref: https://github.com/nodejs/node/issues/16601
Ref: https://github.com/libuv/libuv/pull/1742
PR-URL: https://github.com/nodejs/node/pull/21013
Refs: https://github.com/nodejs/node/issues/16601
Refs: https://github.com/libuv/libuv/pull/1742
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2018-05-30 14:42:58 -03:00
Tobias Nießen
e316655468
lib,src,test: fix comments
...
PR-URL: https://github.com/nodejs/node/pull/20846
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2018-05-22 12:35:17 +04:00
James M Snell
456a8193cb
perf_hooks: always set bootstrapComplete
...
PR-URL: https://github.com/nodejs/node/pull/20768
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-05-19 09:48:35 -07:00
Anna Henningsen
42a4a60645
test: improve assertion in test-performance
...
PR-URL: https://github.com/nodejs/node/pull/20809
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
2018-05-18 16:16:07 +02:00
Rich Trott
9e4ae56cc7
test: improve reliability of http2-session-timeout
...
Check actual expired time rather than relying on a number of calls to
setTimeout() in test-http2-session-timeout more robust.
PR-URL: https://github.com/nodejs/node/pull/20692
Fixes: https://github.com/nodejs/node/issues/20628
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-05-16 08:57:49 +04:00
Alex Fernández
c346cb6929
benchmark: add tls benchmark for legacy SecurePair
...
PR-URL: https://github.com/nodejs/node/pull/20344
Refs: https://github.com/nodejs/node/issues/20263
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2018-05-16 08:54:36 +04:00
Mathias Buus and Matteo Collina
b60b18379d
http2: destroy the socket properly and add tests
...
Fix a bug where the socket wasn't being correctly destroyed and
adjust existing tests, as well as add additional tests.
PR-URL: https://github.com/nodejs/node/pull/19852
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Co-authored-by: Matteo Collina <matteo.collina@gmail.com >
2018-05-13 19:47:40 +02:00
cjihrig
975f6c1f70
fs: move fs/promises to fs.promises
...
PR-URL: https://github.com/nodejs/node/pull/20504
Refs: https://github.com/nodejs/TSC/issues/389
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Shingo Inoue <leko.noor@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
2018-05-07 19:47:42 -04:00
Anatoli Papirovski
602ffd6986
http: refactor outgoing headers processing
...
Use a shared function, for..in instead of Object.keys, do less work in
`setHeader` and instead defer some of it until later, and other minor
changes to improve clarity, as well as a slight boost in performance.
PR-URL: https://github.com/nodejs/node/pull/20250
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-04-27 20:31:25 +02:00
Eugene Ostroukhov
1300103534
inspector: allow concurrent inspector sessions
...
This change enables concurrent inspector sessions, through WebSocket
interface as well as JS interface, in any combination.
PR-URL: https://github.com/nodejs/node/pull/20137
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2018-04-26 12:48:48 -07:00
Joyee Cheung
3152b7c0d3
src: assign ERR_SCRIPT_EXECUTION_* codes in C++
...
Also modifies the error messages so they include more information
and are more consistent.
- The message of ERR_SCRIPT_EXECUTION_INTERRUPTED now mentions
SIGINT and the trailing period is dropped for consistency.
- Added ERR_SCRIPT_EXECUTION_TIMEOUT and include the timeout
in the message.
PR-URL: https://github.com/nodejs/node/pull/20147
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-04-25 23:46:08 +08:00
Anatoli Papirovski
957532ec61
test: fix long-running http benchmarks
...
PR-URL: https://github.com/nodejs/node/pull/20125
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2018-04-22 11:06:36 +02:00
Anatoli Papirovski
a2cf005cef
test: fix long-running buffer benchmarks
...
PR-URL: https://github.com/nodejs/node/pull/20125
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2018-04-22 11:06:30 +02:00
Luigi Pinca
96e82beac3
test: fix test-http-dump-req-when-res-ends
...
Fix test-http-dump-req-when-res-ends and move it back to test/parallel/
PR-URL: https://github.com/nodejs/node/pull/19866
Refs: https://github.com/nodejs/node/pull/19823
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-04-11 09:30:02 +02:00
Joyee Cheung
362694401f
src: rename ERR_STRING_TOO_LARGE to ERR_STRING_TOO_LONG
...
The old error name and message were trying to be consistent with
ERR_BUFFER_TOO_LARGE but they were not really accurate.
The kStringMaxLength was measured in number of characters,
not number of bytes. The name ERR_STRING_TOO_LARGE also
seems a bit awkward. This patch tries to correct them before
they get released to users.
PR-URL: https://github.com/nodejs/node/pull/19864
Refs: https://github.com/nodejs/node/pull/19739
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2018-04-10 01:08:10 +02:00
Santiago Gimeno
5b8c62c60d
test: fix flaky http-client-timeout-agent
...
Close the connection immediately after receiving the `end` event to
avoid that the `timeout` event is fired before the connection closes
gracefully.
Move the test back to parallel.
PR-URL: https://github.com/nodejs/node/pull/19856
Fixes: https://github.com/nodejs/node/issues/19804
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2018-04-10 01:05:41 +02:00
juggernaut451
b80da63b99
benchmark: changed millions and thousands to n
...
PR-URL: https://github.com/nodejs/node/pull/18917
Fixes: https://github.com/nodejs/node/issues/18778
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Weijia Wang <starkwang@126.com >
Reviewed-By: Andreas Madsen <amwebdk@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2018-04-10 00:22:33 +02:00
Joyee Cheung
63eb267c34
src: migrate string_bytes.cc to throw errors with code
...
PR-URL: https://github.com/nodejs/node/pull/19739
Fixes: https://github.com/nodejs/node/issues/3175
Fixes: https://github.com/nodejs/node/issues/9489
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-04-07 17:15:13 +08:00
Matteo Collina
1f29963eac
test,http: fix http dump test
...
Make sure the dump test actually verify what is happening and it is
not flaky.
See: https://github.com/nodejs/node/issues/19139
PR-URL: https://github.com/nodejs/node/pull/19823
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-04-07 10:03:22 +02:00
Rich Trott
a639ec4ca8
test: move test-http-dump-req-when-res-end
...
The implementataion is sensitive to system resource availability, so
move it to sequential instead of running out of parallel directory.
Fixes: https://github.com/nodejs/node/issues/19139
PR-URL: https://github.com/nodejs/node/pull/19819
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-04-06 21:02:36 -07:00
Rich Trott
95dc59010b
test: move http-client-timeout-agent to sequential
...
Move resource-sensitive test from parallel to sequential.
Fixes: https://github.com/nodejs/node/issues/19804
PR-URL: https://github.com/nodejs/node/pull/19809
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-04-06 20:09:30 -07:00
James M Snell
2ec6995555
perf_hooks: simplify perf_hooks
...
Remove the `performance.getEntries()` and `performance.clear*()`
variants and eliminate the accumulation of the global timeline
entries. The design of this particular bit of the API is a memory
leak and performance footgun. The `PerformanceObserver` API is
a better approach to consuming the data in a more transient way.
PR-URL: https://github.com/nodejs/node/pull/19563
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-04-03 13:57:41 -07:00
Eugene Ostroukhov
a9a1f12b42
inspector: report client-visible host and port
...
Node instance may not know the real host and port user sees when
debug frontend connects through the SSH tunnel. This change fixes
'/json/list' response by using the value client provided in the host
header.
PR-URL: https://github.com/nodejs/node/pull/19664
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2018-04-02 10:20:30 -07:00
Weijia Wang
254058109f
tools: add 'spaced-comment' into eslint rules
...
PR-URL: https://github.com/nodejs/node/pull/19596
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
2018-04-01 22:33:13 +08:00
Ruben Bridgewater
c6b6c92185
lib: always show ERR_INVALID_ARG_TYPE received part
...
This makes a effort to make sure all of these errors will actually
also show the received input.
On top of that it refactors a few tests for better maintainability.
It will also change the returned type to always be a simple typeof
instead of special handling null.
PR-URL: https://github.com/nodejs/node/pull/19445
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-03-25 01:45:37 +01:00
Michaël Zasso
4e1f0907da
inspector: migrate errors from C++ to JS
...
Assign a code to a user-facing error.
Turn other internal-only errors to checks.
PR-URL: https://github.com/nodejs/node/pull/19387
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-03-22 08:24:31 +01:00
Michaël Zasso
ab8bf26994
fs,cluster,net: assign error codes to remaining errors
...
After this commit, all errors thrown from JS code in lib have an error
code.
PR-URL: https://github.com/nodejs/node/pull/19373
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-21 20:14:57 +01:00
Rich Trott
1203b13725
test: refactor test-fs-readfile-tostring-fail
...
The test uses both `assert()` and `assert.ok()`. Use just `assert.ok()`.
Remove a comment that does not appear to match the code and does not
seem to explain much beyond the bare code itself.
PR-URL: https://github.com/nodejs/node/pull/19404
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Shingo Inoue <leko.noor@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-03-20 11:02:01 -07:00
Rich Trott
0fb017d684
test: fix flaky test-http2-ping-flood
...
The test is unreliable on some Windows platforms in its current form.
Make it more robust by using `setInterval()` to repeat the flooding
until an error is triggered.
PR-URL: https://github.com/nodejs/node/pull/19395
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-19 10:17:58 -07:00
Joyee Cheung
897f7b6c6b
fs: improve errors in watchFile and unwatchFile
...
- Check if the watcher is active in JS land before
invoking the binding, act as a noop if the state of
the watcher does not match the expectation. This
avoids firing 'stop' when the watcher is already
stopped.
- Update comments, validate more arguments and
the type of the handle.
- Handle the errors from uv_fs_poll_start
- Create an `IsActive` helper method on StatWatcher
PR-URL: https://github.com/nodejs/node/pull/19345
Refs: https://github.com/nodejs/node/pull/19089
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-03-19 07:40:47 +08:00
Rich Trott
879f521c65
test: fix flaky test-http2-settings-flood
...
The test is unreliable on some Windows platforms in its current form.
Make it more robust by using `setInterval()` to repeat the flooding
until an error is triggered.
Fixes: https://github.com/nodejs/node/issues/18251
PR-URL: https://github.com/nodejs/node/pull/19349
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
2018-03-16 10:26:55 -07:00
Joyee Cheung
8484b40b3d
src: put bootstrappers in lib/internal/bootstrap/
...
Create `lib/internal/bootstrap/` and put bootstrappers there:
Before:
```
lib/internal
├── ...
├── bootstrap_loaders.js
└── bootstrap_node.js
```
After:
```
lib/internal
├── ...
└── bootstrap
├── loaders.js
└── node.js
```
PR-URL: https://github.com/nodejs/node/pull/19177
Refs: https://github.com/nodejs/node/pull/19112
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2018-03-15 20:50:34 +08:00
Anna Henningsen
67f1d76956
src: introduce native-layer stream piping
...
Provide a way to create pipes between native `StreamBase` instances
that acts more directly than a `.pipe()` call would.
PR-URL: https://github.com/nodejs/node/pull/18936
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-03-15 12:53:13 +01:00
Rich Trott
5e23b65a87
test: fix test-cluster-send-handle-large-payload
...
test-cluster-send-handle-large-payload is susceptible to failure if it
is competing for resources. Move to `sequential` directory so it is not
competing with other tests.
Fixes: https://github.com/nodejs/node/issues/14844
PR-URL: https://github.com/nodejs/node/pull/19311
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
2018-03-14 22:28:18 -07:00
Rich Trott
da226eaa86
test: fix assertion argument order
...
Fix the assertion argument order so that it will report "actual" and
"expected" correctly when the test fails.
Ref: https://github.com/nodejs/node/issues/19263
PR-URL: https://github.com/nodejs/node/pull/19264
Refs: https://github.com/nodejs/node/issues/19263
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 >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2018-03-12 08:42:21 -07:00