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

29402 Commits

Author SHA1 Message Date
Alexander Smarus
3188afebf4 src: define noreturn attribute for windows
PR-URL: https://github.com/nodejs/node/pull/31467
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-25 10:08:57 -08:00
Denys Otrishko
08f57265b5 src: reduce code duplication in BootstrapNode
PR-URL: https://github.com/nodejs/node/pull/31465
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-25 09:26:49 -08:00
Anna Henningsen
278d37d90d test: fix test-heapdump-worker
This test was broken by de2c68c7dd.

Refs: https://github.com/nodejs/node/pull/31386

PR-URL: https://github.com/nodejs/node/pull/31494
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-25 08:30:51 -08:00
Ruben Bridgewater
725682cc50 util: fix inspection of typed arrays with unusual length
This makes sure `util.inspect()` does not throw in case the typed
array's length property was set to something invalid. Instead,
always use the original information.

PR-URL: https://github.com/nodejs/node/pull/31458
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-24 21:09:17 -08:00
Eran Levin
67e067eb06 fs: watch signals for recursive incompatibility
This pull request makes fs.watch throw exception,
whenever it is used in an incompatible platform.
For this change following changes were made to api:

1.a new error type has been introduced.
2.fs.watch has been changed accordingly.

Users who use recursive  on
non-windows and osx platforms,
will face a new exception.
For this reason, it's a breaking change.

Fixes: https://github.com/nodejs/node/issues/29901

PR-URL: https://github.com/nodejs/node/pull/29947
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-24 20:57:27 -08:00
Robert Nagy
4fefd181c7 doc: further fix async iterator example
Further fixes an issue with the async iterator example where an
incorrect assumption was made in regards that drain or error
is always invoked after !write().

Fixes: https://github.com/nodejs/node/issues/31365

PR-URL: https://github.com/nodejs/node/pull/31367
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-01-25 00:06:31 +01:00
Robert Nagy
8d14a8cbce doc: add ronag to collaborators
PR-URL: https://github.com/nodejs/node/pull/31498
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-01-24 18:47:14 +01:00
Anna Henningsen
d6f1e395ca
http: make --insecure-http-parser configurable per-stream or per-server
From the issue:

> Some servers deviate from HTTP spec enougth that Node.js can't
> communicate with them, but "work" when `--insecure-http-parser`
> is enabled globally. It would be useful to be able to use this
> mode, as a client, only when connecting to known bad servers.

This is largely equivalent to https://github.com/nodejs/node/pull/31446
in terms of code changes.

Fixes: https://github.com/nodejs/node/issues/31440
Refs: https://github.com/nodejs/node/pull/31446

PR-URL: https://github.com/nodejs/node/pull/31448
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-24 17:54:23 +01:00
cjihrig
748eae93c6
test: add tests for main() argument handling
This test provides missing coverage for __wasi_args_get() and
__wasi_args_sizes_get(), which translate to argc and argv in
WASI applications.

PR-URL: https://github.com/nodejs/node/pull/31426
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-01-24 09:41:46 -05:00
Rich Trott
d32a71542e doc: fix code display in header glitch
Fixes: https://github.com/nodejs/node/issues/31451

PR-URL: https://github.com/nodejs/node/pull/31460
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-24 04:51:54 -08:00
Anna Henningsen
32e7e813e9
src: use custom fprintf alike to write errors to stderr
This allows printing errors that contain nul characters, for example.

Fixes: https://github.com/nodejs/node/issues/28761
Fixes: https://github.com/nodejs/node/issues/31218

PR-URL: https://github.com/nodejs/node/pull/31446
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-23 22:39:00 +01:00
Anna Henningsen
9cc747bfce
src: add C++-style sprintf utility
Add an utility that handles C++-style strings and objects well.

PR-URL: https://github.com/nodejs/node/pull/31446
Fixes: https://github.com/nodejs/node/issues/28761
Fixes: https://github.com/nodejs/node/issues/31218
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-23 22:38:58 +01:00
Tobias Nießen
f6c6236d95 crypto: improve errors in DiffieHellmanGroup
1. The DiffieHellmanGroup class is only instantiated from within
   Node.js, which always passes exactly one argument.
2. Use the existing ERR_CRYPTO_UNKNOWN_DH_GROUP error code for the
   existing "Unknown group" error. The message has not been changed
   to prevent breaking existing applications.

PR-URL: https://github.com/nodejs/node/pull/31445
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-23 15:33:06 -04:00
Tobias Nießen
8c313ceedf crypto: assign and use ERR_CRYPTO_UNKNOWN_CIPHER
PR-URL: https://github.com/nodejs/node/pull/31437
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-23 11:06:14 -08:00
Rich Trott
085a5c7638 benchmark: fix getStringWidth() benchmark
8fb5fe28a4 broke the benchmark for
getStringWidth(). This fixes it up by updating the argument to
`require()` to retrieve `getStringWidth()` from the new internal module
location.

PR-URL: https://github.com/nodejs/node/pull/31476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-01-23 10:52:53 -08:00
Tobias Nießen
ab6ab9c271 tls: simplify errors using ThrowCryptoError
PR-URL: https://github.com/nodejs/node/pull/31436
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-23 10:16:26 -04:00
cjihrig
96058f33a9 test: add wasi test for freopen()
This test provides missing coverage for __wasi_fd_renumber().

PR-URL: https://github.com/nodejs/node/pull/31432
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-01-23 05:22:36 -08:00
cjihrig
30173c6087 deps: uvwasi: cherry-pick eea4508
Original commit message:

    prevent race conditions with uvwasi_fd_close()

    uvwasi_fd_close() performed the following operations:

    - lock the file descriptor mutex
    - close the file
    - release the file descriptor mutex
    - call the file table's remove() function

    Once the fd's mutex is released, another thread could
    acquire it before the fd is removed from the file
    table. If this happens, remove() could destroy a held
    mutex.

    This commit updates uvwasi_fd_close() to perform the
    entire sequence while holding the file table's lock,
    preventing new acquisitions of the fd's mutex.

    Fixes: https://github.com/cjihrig/uvwasi/issues/88

PR-URL: https://github.com/nodejs/node/pull/31432
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-01-23 05:22:27 -08:00
cjihrig
c150f9da7e deps: uvwasi: cherry-pick c3bef8e
Original commit message:
    prevent locking fd table while holding a mutex

    uvwasi_path_rename(), uvwasi_path_link(),
    uvwasi_path_open(), and uvwasi_fd_renumber() operate
    on multiple file descriptors. uvwasi_fd_renumber() has
    been updated prior to this commit, and is not relevant
    here. The other three functions would perform the
    following locking operations:

    - lock the file table
    - acquire a file descriptor mutex
    - unlock the file table
    - unlock the file table again
    - acquire another file descriptor mutex
    - unlock the file table
    - unlock the two mutexes

    Attempting to acquire the second mutex introduced
    the possibility of deadlock because another thread
    could attempt to acquire the first mutex while
    holding the file table lock.

    This commit ensures that multiple mutexes are either:
    - acquired in a single lock of the file table
    - or, only acquired after releasing previously held mutexes

    Fixes: https://github.com/cjihrig/uvwasi/issues/89

PR-URL: https://github.com/nodejs/node/pull/31432
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-01-23 05:22:25 -08:00
cjihrig
28bee2444e deps: uvwasi: cherry-pick ea73af5
Original commit message:

    unlock all fd mutexes in reverse order

    Some functions acquire mutexes for multiple file descriptors.
    This commit ensures that the mutexes are released in the
    reverse order that they are aquired.

PR-URL: https://github.com/nodejs/node/pull/31432
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-01-23 05:22:23 -08:00
cjihrig
8b606d3e26 deps: update to uvwasi 0.0.5
This version improves file descriptor renumbering, and as a result
fixes uvwasi_fd_renumber().

PR-URL: https://github.com/nodejs/node/pull/31432
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-01-23 05:22:20 -08:00
Geoffrey Booth
c692568a09 module: drop support for extensionless main entry points in esm
PR-URL: https://github.com/nodejs/node/pull/31415
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-22 23:21:11 -08:00
Geoffrey Booth
811aa5c71f module: correct docs about when extensionless files are supported
PR-URL: https://github.com/nodejs/node/pull/31415
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-22 23:21:07 -08:00
Geoffrey Booth
04d07ed3ab module: revert #31021
reverses baa3621bb1

PR-URL: https://github.com/nodejs/node/pull/31415
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-22 23:21:02 -08:00
Rich Trott
dc90f925fb test: remove bluebird remnants from test fixture
The test fixture in test/fixtures/bluebird was largely copied from
bluebird, where a regression in Node.js was discovered. Simplify the
test by removing a lot of things that aren't necessary to replicate the
problem. Change name from bluebird to something less likely to cause
someone to believe that we are actually loading bluebird (as we are
not).

PR-URL: https://github.com/nodejs/node/pull/31435
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-01-22 22:10:05 -08:00
Tobias Nießen
9f22fda646 errors: make use of "cannot" consistent
PR-URL: https://github.com/nodejs/node/pull/31420
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-01-22 23:43:57 -04:00
Tobias Nießen
b4f745ec5a doc: fix syntax in N-API documentation
PR-URL: https://github.com/nodejs/node/pull/31466
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2020-01-22 23:41:58 -04:00
Yakov Litvin
4e3dee48c8 doc: add explanatory to path.resolve description
Fixes: https://github.com/nodejs/node/issues/25542

PR-URL: https://github.com/nodejs/node/pull/31430
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-22 19:21:57 -08:00
Anna Henningsen
31b31a3c52
src: harden running native SetImmediate()s slightly
Prevent mistakes like the one fixed by the previous commit
by destroying the callback immediately after it has been called.

PR-URL: https://github.com/nodejs/node/pull/31468
Refs: https://github.com/nodejs/node/pull/31386
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-01-23 02:59:41 +01:00
Anna Henningsen
1046816875
worker: move JoinThread() back into exit callback
de2c68c7dd moved this call to
the destructor, under the assumption that that would essentially
be equivalent to running it as part of the callback since the
worker would be destroyed along with the callback.

However, the actual code in
`Environment::RunAndClearNativeImmediates()` comes with the subtlety
that testing whether a JS exception has been thrown
happens between the invocation of the callback and its destruction,
leaving a possible exception from `JoinThread()` potentially
unhandled (and unintentionally silenced through the `TryCatch`).

This affected exceptions thrown from the `'exit'` event of the
Worker, and made the `parallel/test-worker-message-type-unknown`
test flaky, as the invalid message was sometimes only received
during the Worker thread’s exit handler.

Fix this by moving the `JoinThread()` call back to where it was
before.

Refs: https://github.com/nodejs/node/pull/31386

PR-URL: https://github.com/nodejs/node/pull/31468
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-01-23 02:59:39 +01:00
Ruben Bridgewater
8fb5fe28a4
util: improve unicode support
The array grouping function relies on the width of the characters.
It was not calculated correct so far, since it used the string
length instead.
This improves the unicode output by calculating the mono-spaced
font width (other fonts might differ).

PR-URL: https://github.com/nodejs/node/pull/31319
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-01-22 15:33:03 +01:00
Anna Henningsen
2606e1ed25
report: add support for Workers
Include a report for each sub-Worker of the current Node.js instance.

This adds a feature that is necessary for eventually making the report
feature stable, as was discussed during the last collaborator summit.

Refs: https://github.com/openjs-foundation/summit/pull/240

PR-URL: https://github.com/nodejs/node/pull/31386
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-21 23:51:38 +01:00
Anna Henningsen
880b47d353
src: move MemoryInfo() for worker code to .cc files
This is a) the right thing to do anyway because these functions
can not be inlined by the compiler and b) avoids compilation warnings
in the following commit.

PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-21 23:51:37 +01:00
Anna Henningsen
c78c2771da
src: add interrupts to Environments/Workers
Allow doing what V8’s `v8::Isolate::RequestInterrupt()` does for V8.
This also works when there is no JS code currently executing.

PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-21 23:51:36 +01:00
Anna Henningsen
de2c68c7dd
src: remove AsyncRequest
Remove `AsyncRequest` from the source code, and replace its
usage with threadsafe `SetImmediate()` calls. This has the
advantage of being able to pass in any function, rather than
one that is defined when the `AsyncRequest` is “installed”.

This necessitates two changes:

- The stopping flag (which was only used in one case and ignored
  in the other) is now a direct member of the `Environment` class.
- Workers no longer have their own libuv handles, requiring
  manual management of their libuv ref count.

As a drive-by fix, the `can_call_into_js` variable was turned
into an atomic variable. While there have been no bug reports,
the flag is set from `Stop(env)` calls, which are supposed to
be possible from any thread.

PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-21 23:51:35 +01:00
Anna Henningsen
79a45e2cc3
src: add a threadsafe variant of SetImmediate()
Add a variant of `SetImmediate()` that can be called from any thread.
This allows removing the `AsyncRequest` abstraction and replaces it
with a more generic mechanism.

PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-21 23:51:34 +01:00
Anna Henningsen
29693b5603
src: exclude C++ SetImmediate() from count
There is no real reason to manage a count manually, given that
checking whether there are C++ callbacks is a single pointer
comparison.

This makes it easier to add other kinds of native C++ callbacks
that are managed in a similar way.

PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-21 23:51:33 +01:00
Anna Henningsen
9e4977fe22
src: better encapsulate native immediate list
Refactor for clarity and reusability. Make it more obvious that the
list is a FIFO queue.

PR-URL: https://github.com/nodejs/node/pull/31386
Refs: https://github.com/openjs-foundation/summit/pull/240
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-21 23:51:32 +01:00
Ben Noordhuis
5005c3c72c lib,src: switch Buffer::kMaxLength to size_t
Change the type of `Buffer::kMaxLength` to size_t because upcoming
changes in V8 will allow typed arrays > 2 GB on 64 bits platforms.

Not all platforms handle file reads and writes > 2 GB though so keep
enforcing the 2 GB typed array limit for I/O operations.

Fixes: https://github.com/nodejs/node/issues/31399
Refs: https://github.com/libuv/libuv/pull/1501

PR-URL: https://github.com/nodejs/node/pull/31406
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-01-21 13:55:40 -08:00
cjihrig
da66054e5d test: improve wasi stat test
This commit improved the stat test a bit by verifying that
S_ISDIR() works properly. It also adds missing coverage for
__wasi_path_remove_directory().

PR-URL: https://github.com/nodejs/node/pull/31413
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-21 13:23:54 -08:00
Shelley Vohr
a484f1acf3
2020-01-21, Version 13.7.0 (Current)
Notable changes:

* deps:
  * upgrade to libuv 1.34.1 (cjihrig) https://github.com/nodejs/node/pull/31332
  * upgrade npm to 6.13.6 (Ruy Adorno) https://github.com/nodejs/node/pull/31304
* module
  * add API for interacting with source maps (bcoe) https://github.com/nodejs/node/pull/31132
  * loader getSource, getFormat, transform hooks (Geoffrey Booth) https://github.com/nodejs/node/pull/30986
  * logical conditional exports ordering (Guy Bedford) https://github.com/nodejs/node/pull/31008
  * unflag conditional exports (Guy Bedford) https://github.com/nodejs/node/pull/31001
* process:
  * allow monitoring uncaughtException (Gerhard Stoebich) https://github.com/nodejs/node/pull/31257
* Added new collaborators:
  * [GeoffreyBooth](https://github.com/GeoffreyBooth) - Geoffrey Booth. https://github.com/nodejs/node/pull/31306

PR-URL: https://github.com/nodejs/node/pull/31382
2020-01-21 09:58:13 -08:00
Tobias Nießen
3203febbb2 test: skip keygen tests on arm systems
test-crypto-keygen and test-crypto-dh-stateless are currently flaky
on ARM CI systems due to their slow CPUs.

PR-URL: https://github.com/nodejs/node/pull/31178
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-01-21 10:49:22 -04:00
Tobias Nießen
b4f8537cdc crypto: add crypto.diffieHellman
Currently, Node.js has separate (stateful) APIs for DH/ECDH, and no
support for ECDH-ES. This commit adds a single stateless function to
compute the DH/ECDH/ECDH-ES secret based on two KeyObjects.

PR-URL: https://github.com/nodejs/node/pull/31178
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-01-21 10:49:20 -04:00
Tobias Nießen
c6f8ea8d65 crypto: add DH support to generateKeyPair
This allows using the generateKeyPair API for DH instead of the old
stateful DH APIs.

PR-URL: https://github.com/nodejs/node/pull/31178
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-01-21 10:49:14 -04:00
Tobias Nießen
493fc42977 crypto: simplify DH groups
PR-URL: https://github.com/nodejs/node/pull/31178
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-01-21 10:49:12 -04:00
Tobias Nießen
c9e386c00f crypto: add key type 'dh'
The new key type 'dh' corresponds to EVP_PKEY_DH.

PR-URL: https://github.com/nodejs/node/pull/31178
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-01-21 10:49:09 -04:00
Robert Nagy
f0d2df41f8 fs: change streams to always emit close by default
Previously due to compat reasons 'close' was only emitted if no 'error'.
This removes the compat behavior in order to properly follow expected
streams behavior.

PR-URL: https://github.com/nodejs/node/pull/31408
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-20 21:47:29 -08:00
Rich Trott
dcba12895a test,module: add test for exports cjs loader check
Refs: https://github.com/nodejs/node/pull/31001#issuecomment-576353389

PR-URL: https://github.com/nodejs/node/pull/31427
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-20 21:33:07 -08:00
Guy Bedford
c2c3274631 module: fix check exports issue in cjs module loading
Refs: https://github.com/nodejs/node/pull/31001#issuecomment-576353389

PR-URL: https://github.com/nodejs/node/pull/31427
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-20 21:32:52 -08:00
Harshitha KP
343ddffc1c
doc: document process.std*.fd
Fixes: https://github.com/nodejs/node/issues/28386
Refs: https://github.com/nodejs/node/pull/31292
Refs: https://github.com/nodejs/help/issues/2136

PR-URL: https://github.com/nodejs/node/pull/31395
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-01-20 17:11:05 +01:00