Rich Trott
f3e078fdce
doc: reduce CI options in COLLABORATOR_GUIDE.md
...
PR-URL: https://github.com/nodejs/node/pull/19458
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
2018-03-21 20:14:25 -07:00
Gabriel Schulhof
be470943fb
n-api: re-write test_make_callback
...
This re-writes the test in C by dropping std::vector<napi_value> in
favour of a C99 variable length array, and by dropping the anonymous
namespace in favour of static function declarations.
PR-URL: https://github.com/nodejs/node/pull/19448
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2018-03-21 19:16:43 -04:00
Sameer Srivastava
9b34ea6161
cluster: add support for NODE_OPTIONS="--inspect"
...
When using cluster and --inspect as cli argument it is correctly
handled and each worker will use a different port, this was
fixed by #13619 . But when env var NODE_OPTIONS="--inspect"
is set this logic doesn't apply and the workers will fail as they
try to attach to the same port.
Fixes: https://github.com/nodejs/node/issues/19026
PR-URL: https://github.com/nodejs/node/pull/19165
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2018-03-21 15:27:54 -04:00
Michaël Zasso
6a9f049968
tools,lib: forbid native Error constructors
...
This adds a rule that forbids the use of native Error constructors in
the `lib` directory. This is to encourage use of the `internal/errors`
mechanism. The rule is disabled for errors that are not created with
the `internal/errors` module but are still assigned 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:15:33 +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
Michaël Zasso
fddcd6253b
test: move ESM fixtures to fixtures dir
...
Also consistently import the `common` module where possible.
PR-URL: https://github.com/nodejs/node/pull/19409
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Khaidi Chu <i@2333.moe >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2018-03-21 20:08:30 +01:00
Luigi Pinca
9b7a6914a7
net: emit 'close' after 'end'
...
Currently the writable side of the socket is closed as soon as `UV_EOF`
is read regardless of the state of the socket. This allows the handle
to be closed before `'end'` is emitted and thus `'close'` can be
emitted before `'end'` if the socket is paused.
This commit prevents the handle from being closed until `'end'` is
emitted ensuring the correct order of events.
PR-URL: https://github.com/nodejs/node/pull/19241
Fixes: https://github.com/nodejs/node/issues/19166
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2018-03-21 18:28:16 +01:00
Luigi Pinca
74553465e6
test: refactor test-cluster-send-deadlock
...
Wait for the sockets to be connected before closing them and remove
unneeded `setTimeout()`.
PR-URL: https://github.com/nodejs/node/pull/19241
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2018-03-21 18:24:10 +01:00
Myles Borins
0ac4ef9a4c
doc: fix changelog
...
s/9\.7\.1/9\.8\.0
PR-URL: https://github.com/nodejs/node/pull/19515
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-03-21 16:13:53 +00:00
Myles Borins
0fc3592255
2018-03-21, Version 9.9.0 (Current)
...
Notable changes:
* assert:
- From now on all error messages produced by `assert` in strict mode
will produce a error diff. (Ruben Bridgewater)
https://github.com/nodejs/node/pull/17615
- From now on it is possible to use a validation object in throws
instead of the other possibilities. (Ruben Bridgewater)
https://github.com/nodejs/node/pull/17584
* crypto:
- allow passing null as IV unless required (Tobias Nießen)
https://github.com/nodejs/node/pull/18644
* fs:
- support as and as+ flags in stringToFlags() (Sarat Addepalli)
https://github.com/nodejs/node/pull/18801
* tls:
- expose Finished messages in TLSSocket (Anton Salikhmetov)
https://github.com/nodejs/node/pull/19102
* tty:
- Add getColorDepth function to determine if terminal supports colors
(Ruben Bridgewater) https://github.com/nodejs/node/pull/17615
* util:
- add util.inspect compact option (Ruben Bridgewater)
https://github.com/nodejs/node/pull/17576
* **Added new collaborators**
- [watson](https://github.com/watson ) Thomas Watson
PR-URL: https://github.com/nodejs/node/pull/19428
2018-03-21 15:47:12 +00:00
Tobias Nießen
81f88e30dd
crypto: doc-only deprecate createCipher/Decipher
...
createCipher and createDecipher are cryptographically weak, can cause
severe security issues when used improperly and are unsupported in FIPS
mode.
PR-URL: https://github.com/nodejs/node/pull/19343
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Minwoo Jung <minwoo@nodesource.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
2018-03-21 12:28:47 +01:00
Vse Mozhet Byt
1d42b2018f
tools: fix nits in tools/doc/preprocess.js
...
PR-URL: https://github.com/nodejs/node/pull/19473
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2018-03-21 12:40:10 +02:00
Myles Borins
41193bcf2f
deps: patch V8 to 6.5.254.41
...
PR-URL: https://github.com/nodejs/node/pull/19432
Refs: https://github.com/v8/v8/compare/6.5.254.40...6.5.254.41
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-03-21 10:13:33 +00:00
Vse Mozhet Byt
3662934b5a
doc: fix paragraph order in stream.md
...
Place `writable.destroy()`, `readable.destroy()`,
and `readable.read()` in the proper ABC order.
PR-URL: https://github.com/nodejs/node/pull/19501
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-03-21 04:53:00 +02:00
Ruben Bridgewater
1b8746fb95
doc: update collaborator guide
...
This also updates some parts of the onboarding. It is mainly about
how to handle pull requests, how and when to start a CI, when to add
the `ready` label and some other minor changes.
PR-URL: https://github.com/nodejs/node/pull/19116
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Minwoo Jung <minwoo@nodesource.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Chen Gang <gangc.cxy@foxmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Glen Keane <glenkeane.94@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-03-21 00:59:05 +01:00
Steven
cb69a7d22e
doc: add note about browsers and HTTP/2
...
PR-URL: https://github.com/nodejs/node/pull/19476
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-20 23:50:12 +02:00
Ali Ijaz Sheikh
2725acf1c2
doc: fix/improve inspector profiler example
...
The first parameter to the callback is `err`. Fix that. Expand example
to demonstrate an actual write to disk.
PR-URL: https://github.com/nodejs/node/pull/19379
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-03-20 14:29:06 -07:00
Mathias Buus
c1695d8bad
n-api: add napi_fatal_exception
...
Add function to trigger and uncaught exception.
Useful if an async callback throws an exception with
no way to recover.
PR-URL: https://github.com/nodejs/node/pull/19337
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2018-03-20 15:48:14 -04: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
Trivikram
6a958d2bf8
doc: add trivikr to collaborators
...
trivikr is nominated as node core collaborator for his work on http2
https://github.com/nodejs/node/commits?author=trivikr
Refs: https://github.com/nodejs/node/issues/19067
PR-URL: https://github.com/nodejs/node/pull/19384
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Matheus Marchini <matheus@sthima.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2018-03-20 08:47:52 -07:00
Vse Mozhet Byt
14460d595f
tools: fix logic nit in tools/doc/generate.js
...
PR-URL: https://github.com/nodejs/node/pull/19475
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-03-20 17:06:13 +02:00
Daniel Bevenius
5a4a1cba24
async_hooks: add copyHooks function
...
This commit introduces a copyHooks function that can be used by
storeActiveHooks and restoreActiveHooks to remove some code duplication.
PR-URL: https://github.com/nodejs/node/pull/19391
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
2018-03-20 07:42:00 +01:00
Daniel Bevenius
489b916c7d
src: remove unused stdlib.h include
...
Commit 870229e665 ("src: Add ABORT
macro") replaced the abort call with the abort macro in util-inl.h.
This commit removes the include as it is not needed anymore.
PR-URL: https://github.com/nodejs/node/pull/19427
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-03-20 07:33:45 +01:00
James M Snell
1f356a26ae
perf_hooks,trace_events: fix timescale on bootstrap marks
...
PR-URL: https://github.com/nodejs/node/pull/19450
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-03-19 20:36:51 -07:00
cjihrig
7c73cd4c70
net: emit error on invalid address family
...
This commit adds proper error handling to net.connect() when
a custom lookup() function returns an invalid address family.
PR-URL: https://github.com/nodejs/node/pull/19415
Fixes: https://github.com/nodejs/node/issues/19407
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-19 14:49:34 -04: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
Gabriel Schulhof
f24d0ec201
n-api: separate out async_hooks test
...
Place the test_make_callback async_hooks-related test into its own file.
PR-URL: https://github.com/nodejs/node/pull/19392
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2018-03-19 09:24:06 -04:00
Ivan Filenko
45c86e33e1
doc: add note to readable stream async iterator
...
PR-URL: https://github.com/nodejs/node/pull/19331
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-18 18:59:22 -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
Joyee Cheung
301f6cc553
fs: remove watcher state errors for fs.watch
...
- Remove ERR_FS_WATCHER_ALREADY_STARTED and
ERR_FS_WATCHER_NOT_STARTED because those two situations should
result in noop instead of errors for consistency with the
documented behavior of fs.watchFile.
This partially reverts https://github.com/nodejs/node/pull/19089
- Update comments about this behavior.
Refs: https://github.com/nodejs/node/pull/19089
PR-URL: https://github.com/nodejs/node/pull/19345
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:39 +08:00
Joyee Cheung
897cec43c6
fs: fix memory leak in WriteString
...
In the async case, if the buffer was copied instead of being moved
then the buf will not get deleted after the request is done.
This was introduced when the FSReqWrap:: Ownership was
removed in 4b9ba9b , and ReleaseEarly was no longer called upon
destruction of FSReqWrap.
Create a custom Init function so we can use the MaybeStackBuffer in
the FSReqBase to copy the string in the async case. The data will
then get destructed when the FSReqBase is destructed.
Fixes: https://github.com/nodejs/node/issues/19356
PR-URL: https://github.com/nodejs/node/pull/19357
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-19 07:25:55 +08:00
Myles Borins
9c9324768f
deps: patch V8 to 6.5.254.40
...
PR-URL: https://github.com/nodejs/node/pull/19380
Refs: https://github.com/v8/v8/compare/6.5.254.38...6.5.254.40
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2018-03-18 16:45:00 -04:00
Daniel Bevenius
18abca7b49
src: fix minor typo in comment stream_base.h
...
PR-URL: https://github.com/nodejs/node/pull/19429
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-03-18 20:54:20 +01:00
Ujjwal Sharma
d54e0f8e52
test: rename regression tests file names
...
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the tests conform to the
standard test structure.
- Rename test-regress-GH-io-1068 to test-tty-stdin-end
- Rename test-regress-GH-io-1811 to test-zlib-kmaxlength-rangeerror
- Rename test-regress-GH-node-9326 to test-kill-segfault-freebsd
- Rename test-timers-regress-GH-9765 to test-timers-setimmediate-infinite-loop
- Rename test-tls-pfx-gh-5100-regr to test-tls-pfx-authorizationerror
- Rename test-tls-regr-gh-5108 to test-tls-tlswrap-segfault
PR-URL: https://github.com/nodejs/node/pull/19332
Fixes: https://github.com/nodejs/node/issues/19105
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Weijia Wang <starkwang@126.com >
Reviewed-By: Yuta Hiroto <hello@hiroppy.me >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Shingo Inoue <leko.noor@gmail.com >
2018-03-18 18:55:09 +01:00
James M Snell
d74184c2fa
http2: some general code improvements
...
PR-URL: https://github.com/nodejs/node/pull/19400
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-03-18 09:08:44 -07:00
James M Snell
224941bd8c
http2: clean up Http2Settings
...
Use of a MaybeStackBuffer was just silly. Fix a long standing todo
Reduce code duplication a bit.
PR-URL: https://github.com/nodejs/node/pull/19400
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-03-18 09:08:30 -07:00
James M Snell
49799f3163
http2: don't aggressively inline
...
Most of the inlines were leftovers from a much older design
iteration and are largely pointless or counter productive.
PR-URL: https://github.com/nodejs/node/pull/19400
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-03-18 09:08:13 -07:00
Tobias Nießen
19f3927d92
crypto: deprecate Decipher.finaltol
...
PR-URL: https://github.com/nodejs/node/pull/19353
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-03-18 15:33:05 +01:00
Daniel Bevenius
6050add95e
src: fix indentation of params in env-inl.h
...
PR-URL: https://github.com/nodejs/node/pull/19390
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-03-18 12:17:22 +01:00
Daniel Bevenius
8c46fa6903
async_hooks: remove async_wrap from async_hooks.js
...
This commit removes the builtin async_wrap module from
lib/async_hooks.js.
The motivation for this is that lib/async_hooks.js requires
lib/internal/async_hooks which also binds async_wrap. Instead of
lib/async_hooks.js also binding async_wrap it now only has to require
the internal async_hooks and access it's exports.
There might be a very good reason for doing it the current way but the
reason is not obvious to me. Hopefully someone can shed some light on
this.
PR-URL: https://github.com/nodejs/node/pull/19368
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Andreas Madsen <amwebdk@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-03-18 12:08:38 +01:00
Daniel Bevenius
75ff301ae0
src: make AsyncWrap constructors delegate
...
Currently, there is an AsyncWrap constructor that is only used by
PromiseWrap. This constructor has a body which is very similar
to the other AsyncWrap constructor.
This commit suggests updating the private constructor that is used
by PromiseWrap and also have the second constructor delegate to this
one to avoid the code duplication.
PR-URL: https://github.com/nodejs/node/pull/19366
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Minwoo Jung <minwoo@nodesource.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-03-18 11:56:45 +01:00
Ruben Bridgewater
1329844a08
Revert "util: use blue on non-windows systems for number/bigint"
...
This reverts commit 1708af369b .
Numbers are much more difficult to read in blue and it would be good
to have a consistent output throughout all OS.
PR-URL: https://github.com/nodejs/node/pull/19256
Refs: https://github.com/nodejs/node/pull/18925
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2018-03-17 17:55:03 +01:00
Anna Henningsen
2e376184f2
fs: fix createReadStream(…, {end: n}) for non-seekable fds
...
82bdf8fba2 fixed an issue by silently modifying the `start`
option for the case when only `end` is passed, in order to perform
reads from a specified range in the file.
However, that approach does not work for non-seekable files, since
a numeric `start` option means that positioned reads will be used
to read data from the file.
This patch fixes that, and instead ends reading after a specified
size by adjusting the read buffer size.
This way we avoid re-introducing the bug that 82bdf8fba2 fixed,
and align behaviour with the native file stream mechanism
introduced in https://github.com/nodejs/node/pull/18936 as well.
PR-URL: https://github.com/nodejs/node/pull/19329
Fixes: https://github.com/nodejs/node/issues/19240
Refs: https://github.com/nodejs/node/pull/18121
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chen Gang <gangc.cxy@foxmail.com >
2018-03-17 12:36:29 +01:00
Michaël Zasso
893432ad92
util: add boxed BigInt formatting to util.inspect
...
Before:
> Object(7n)
BigInt {}
After:
> Object(7n)
[BigInt: 7n]
PR-URL: https://github.com/nodejs/node/pull/19341
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2018-03-17 11:37:53 +01:00
Michael Dawson
6a5a9ad62d
n-api: add missing exception checking
...
Add checks for a pending exception in napi_make_callback
after the callback has been invoked. If there is a pending
exception then we need to avoid checking the result as that
will not be able to complete properly.
Add additional checks to the unit test for napi_make_callback
to catch this case.
PR-URL: https://github.com/nodejs/node/pull/19362
Fixes: https://github.com/nodejs/node-addon-api/issues/235
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-03-16 19:01:24 -04:00
James M Snell
96cb4fb795
perf_hooks,trace_events: emit perf milestone trace events
...
Emit the perf_hooks node timing milestones as trace events.
PR-URL: https://github.com/nodejs/node/pull/19175
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-03-16 10:54:05 -07: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
Kyle Robinson Young
d20f1f004c
doc: fix typos on n-api
...
PR-URL: https://github.com/nodejs/node/pull/19385
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-03-16 15:36:45 +02:00
Daniel Bevenius
9f3e5a0941
src: remove unused uv.h include from async_wrap.cc
...
PR-URL: https://github.com/nodejs/node/pull/19342
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Khaidi Chu <i@2333.moe >
2018-03-16 08:11:07 +01:00
Daniel Bevenius
3802e43c0f
src: fix indenting of wrap->EmitTraceEventBefore
...
PR-URL: https://github.com/nodejs/node/pull/19340
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-16 08:02:45 +01:00