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

5169 Commits

Author SHA1 Message Date
Jonathan Buhacoff
d093e788d1
doc: update function description for decipher.setAAD
According to the
[NodeJS CCM example](https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_ccm_mode],
when decrypting the `plaintextLength` parameter actually refers to the
ciphertext length, not the plaintext length:

```
decipher.setAAD(aad, {
  plaintextLength: ciphertext.length
});
```

The same can be seen in the
[OpenSSL docs](https://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption)
where a call to `EVP_DecryptUpdate` passes the ciphertext length:

```
/* Provide the total ciphertext length */
    if(1 != EVP_DecryptUpdate(ctx, NULL, &len, NULL, ciphertext_len))
        handleErrors();
```

This parameter probably should have been called `inputLength` or
`bufferLength` instead of `plaintextLength`, so that it makes sense
both when encrypting and decrypting, but at least we can correct the
sentence in the documentation for now to refer to the correct value.

PR-URL: https://github.com/nodejs/node/pull/33095
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-19 19:28:36 +02:00
Benjamin Gruenbaum
b51d1cfbf2
doc: add comment about highWaterMark limit
Add a comment regarding memory limits and setting highWaterMark

PR-URL: https://github.com/nodejs/node/pull/33432
Reviewd-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-19 19:20:51 +02:00
Joyee Cheung
8b0bdc918e
doc: clarify about the Node.js-only extensions in perf_hooks
- Add clarifications for Node.js-only extensions
- Explain the Web Performance APIs implemented in Node.js and
  clarify that perf_hooks also include other non-Web APIs.
- Prefix exposed interfaces with `perf_hooks.` to distinguish
  them from internal classes.

PR-URL: https://github.com/nodejs/node/pull/33199
Refs: https://github.com/nodejs/node/issues/28635
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-19 22:16:10 +08:00
Antoine du HAMEL
a12a2d892f repl: update deprecation codes
Refs: https://github.com/nodejs/node/pull/33294

PR-URL: https://github.com/nodejs/node/pull/33430
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-05-18 03:20:40 +02:00
Gus Caplan
b46bbf2e19
doc: fix extension in esm example
PR-URL: https://github.com/nodejs/node/pull/33408
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-05-16 21:09:12 -05:00
Ruben Bridgewater
ab7d5200cd
repl: deprecate repl._builtinLibs
This is a manually edited and outdated list of builtin modules.
Instead, it is better to rely upon the officially documented way
to get a list of builtin modules.

As a side by fix this makes sure all exports are in one place. Thus,
it is easier to see what parts are actually exported and which are
not.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33294
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-16 10:54:07 +02:00
Ruben Bridgewater
e11b5d3d7d
repl: deprecate repl.inputStream and repl.outputStream
The stream is exposed twice. As such it's best to rely upon the
.input and .output properties set by readline.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33294
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-16 10:53:54 +02:00
Antoine du HAMEL
985e9c5fe5 module: add specific error for dir import
PR-URL: https://github.com/nodejs/node/pull/33220
Fixes: https://github.com/nodejs/node/issues/33219
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2020-05-15 19:08:39 -07:00
Anna Henningsen
0f232ed692
doc: fix stream example
- Un-break the code for multibyte characters
- Get `fs.createReadStream` from the right module

PR-URL: https://github.com/nodejs/node/pull/33426
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-16 02:28:38 +02:00
Anna Henningsen
c7eeef568c
cli: add --trace-atomics-wait flag
Adds a flag that helps with debugging deadlocks due to incorrectly
implemented `Atomics.wait()` calls.

PR-URL: https://github.com/nodejs/node/pull/33292
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-05-15 19:37:40 +02:00
Anna Henningsen
d3a8a23089
fs: forbid concurrent operations on Dir handle
libuv does not expect concurrent operations on `uv_dir_t` instances,
and will gladly create memory leaks, corrupt data, or crash the
process.

This patch forbids that, and:

- Makes sure that concurrent async operations are run sequentially
- Throws an exception if sync operations are attempted during an
  async operation

The assumption here is that a thrown exception is preferable to
a potential hard crash.

This fully fixes flakiness from `parallel/test-fs-opendir` when
run under ASAN.

PR-URL: https://github.com/nodejs/node/pull/33274
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-15 19:36:50 +02:00
Matteo Collina
2d5d77306f Revert "vm: add importModuleDynamically option to compileFunction"
This reverts commit 74c393dd93.

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

PR-URL: https://github.com/nodejs/node/pull/33364
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-05-15 12:14:35 +02:00
unknown
4780493301
doc: add examples for implementing ESM
Fixes: https://github.com/nodejs/node/issues/28060

PR-URL: https://github.com/nodejs/node/pull/33168
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-05-14 19:57:04 +02:00
Gus Caplan
5ae5262f44
src: add support for TLA
PR-URL: https://github.com/nodejs/node/pull/30370
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-05-14 12:39:23 -05:00
Alba Mendez
1dafaf03cb tls: fix --tls-keylog option
There's a typo that causes only the first socket to be logged
(i.e. when the warning is emitted).

In addition, server sockets aren't logged because `keylog` events
are not emitted on tls.Server, not the socket. This behaviour is
counterintuitive and has caused more bugs in the past, so make all
sockets (server or client) emit 'keylog'. tls.Server will just
re-emit these events.

Refs: https://github.com/nodejs/node/pull/30055
PR-URL: https://github.com/nodejs/node/pull/33366
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-05-14 16:52:52 +02:00
Paolo Insogna
5bb4d01fbe doc: add note about clientError writable handling
PR-URL: https://github.com/nodejs/node/pull/33308
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-12 20:02:49 +02:00
Daniel Bevenius
12b3e0c1ac doc: fix typo in n-api.md
This commit fixes what I think is a typo, even though the section in
question does talk about a environment (env).

PR-URL: https://github.com/nodejs/node/pull/33319
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
2020-05-12 05:39:05 +02:00
Robert Nagy
8a6fab02ad http: emit 'error' on aborted server request
Server requests aka. IncomingMessage emits 'aborted'
instead of 'error' which causes confusion when
the object is used as a regular stream, i.e. if
functions working on streams are passed a
server request object they might not work properly
unless they take this into account.

Refs: https://github.com/nodejs/web-server-frameworks/issues/41

PR-URL: https://github.com/nodejs/node/pull/33172
Fixes: https://github.com/nodejs/node/issues/28172
Refs: https://github.com/nodejs/node/pull/28677
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-05-10 22:11:21 +02:00
cjihrig
cad76da198
http: return this from ClientRequest#destroy()
This commit updates ClientRequest#destroy() to return `this`
for consistency with other writable streams.

PR-URL: https://github.com/nodejs/node/pull/32789
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-09 13:57:28 -04:00
cjihrig
ff6535a433
http: return this from IncomingMessage#destroy()
This commit updates IncomingMessage#destroy() to return `this`
for consistency with other readable streams.

PR-URL: https://github.com/nodejs/node/pull/32789
Fixes: https://github.com/nodejs/node/issues/32772
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-09 13:57:28 -04:00
rickyes
be7fd2d517
fs: add .ref() and .unref() methods to watcher classes
PR-URL: https://github.com/nodejs/node/pull/33134
Fixes: https://github.com/nodejs/node/issues/33096
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-05-09 07:59:08 +02:00
osher
96faea137e
http: expose http.validate-header-name/value
The use-case is for any framework that provides user mw a response
replacement, that collects the desired response state, and applies them
only on conclusion. As such a framework, I'd want to validate the
header names and values as soon as the user-code provides them.
This - to eliminate errors on response-send time, and provide developer
stack trace that contains the line that submits the offending values.

PR-URL: https://github.com/nodejs/node/pull/33119
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-05-09 07:55:55 +02:00
Stephen Belanger
13c5a1629c
async_hooks: move PromiseHook handler to JS
This avoids the need to wrap every promise in an AsyncWrap and also
makes it easier to skip the machinery to track destroy events when
there's no destroy listener.

Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32891
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2020-05-09 07:52:22 +02:00
Robert Nagy
e50ae7a259 doc: add warning for socket.connect reuse
PR-URL: https://github.com/nodejs/node/pull/33204
Refs: https://github.com/nodejs/node/issues/25969
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-05-08 18:03:26 +02:00
Jonathan Buhacoff
d135b508e9
doc: correct description of decipher.setAuthTag in crypto.md
Calling `decipher.setAuthTag` after `decipher.update` will result in
an error like `Unsupported state or unable to authenticate data`.
The example code in
[CCM mode](https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_ccm_mode)
is correct, but to demonstrate the mistake in the documentation you
can take the same example and move the `setAuthTag` call to in between
`update` and `final` you will see the error.
2020-05-08 01:37:26 +02:00
Karol Walasek
d6b19fd537
doc: removed unnecessary util imports from vm examples
PR-URL: https://github.com/nodejs/node/pull/33179
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-08 01:20:10 +02:00
Nikolai Vavilov
dbad1b6515
doc: update Buffer(size) documentation
It returns zero-filled memory since v8.0.0.

PR-URL: https://github.com/nodejs/node/pull/33198
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-08 01:16:03 +02:00
Pranshu Srivastava
280c485d36
doc: add Uint8Array to end and write
PR-URL: https://github.com/nodejs/node/pull/33217
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-05-08 01:10:36 +02:00
Simen Bekkhus
5424f1b844
doc: specify unit of time passed to fs.utimes
PR-URL: https://github.com/nodejs/node/pull/33230
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-05-08 01:06:40 +02:00
Tobias Nießen
c01544de1f
wasi: prevent syscalls before start
PR-URL: https://github.com/nodejs/node/pull/33235
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-05-08 01:02:19 +02:00
Andrey Pechkurov
fedb0f4d54
doc: add troubleshooting guide for AsyncLocalStorage
PR-URL: https://github.com/nodejs/node/pull/33248
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-05-08 01:00:24 +02:00
Andrey Pechkurov
dab51dddc8
doc: remove AsyncWrap mentions from async_hooks.md
AsyncWrap is a private API and should not be mentioned
in the documentation.

PR-URL: https://github.com/nodejs/node/pull/33249
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-08 00:59:42 +02:00
James M Snell
baba42c38b
doc: add warnings about transferring Buffers and ArrayBuffer
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33252
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Mathias Buus <mathiasbuus@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-08 00:59:15 +02:00
Michael Dawson
3662b0c2c7 doc: update napi_async_init documentation
Fixes: https://github.com/nodejs/node/issues/33153

Change documentation to make async_resource required
as opposed to optional in napi-async_init.

Changes over time mean this parameter is required for
proper operation of async hooks (which are still experimental).
This changes the documentation to document what
callers should do. We are doing this only in the doc
in order to avoid a breaking change in N-API. We could
create a new version of the method for which the
parametrer is enforced as mandatory but we should only
do that once async hooks is no longer experimental. In
that case we could deprecate (but not remove this version
of the method).

Signed-off-by: Michael Dawson <michael_dawson@ca.ibm.com>

PR-URL: https://github.com/nodejs/node/pull/33181
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2020-05-06 14:58:14 -04:00
James M Snell
548439a530
doc: doc and test URLSearchParams discrepancy
The WHATWG URL spec is not going to change this behavior so
let's document it

Signed-off-by: James M Snell <jasnell@gmail.com>

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

PR-URL: https://github.com/nodejs/node/pull/33236
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-05-06 10:40:10 -07:00
Michaël Zasso
f446b2058d
2020-05-05, Version 14.2.0 (Current)
Notable changes:

* Track function calls with `assert.CallTracker` (experimental).
  https://github.com/nodejs/node/pull/31982
* Added a `groupIndentation` option to the `Console` constructor.
  https://github.com/nodejs/node/pull/32964

PR-URL: https://github.com/nodejs/node/pull/33232
2020-05-05 20:24:37 +02:00
Myles Borins
1ffd182264
doc: explicitly doc package.exports is breaking
If package authors don't explicitly include all previously supported
entry points introducing package.exports will be a Semver-Major change.

Add a warning about this behavior and offer two potential solutions
for module authors.

Refs: https://github.com/then/is-promise/issues/20

PR-URL: https://github.com/nodejs/node/pull/33074
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-05-05 13:48:26 -04:00
Nikolai Vavilov
c17dcb3253 doc: fix style and grammer in buffer.md
PR-URL: https://github.com/nodejs/node/pull/33194
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-04 16:49:29 -07:00
Ruben Bridgewater
c81e5f699e
doc: mark assert.CallTracker experimental
Some details might still change and it would be good to get feedback
from users before we mark this as stable.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33124
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-04 14:59:32 +02:00
Robert Nagy
36b4c569eb doc: add missing deprecation not
PR-URL: https://github.com/nodejs/node/pull/33203
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-05-04 06:30:00 +02:00
himself65
53eb264cb1 doc: fix a typo in crypto.generateKeyPairSync()
PR-URL: https://github.com/nodejs/node/pull/33187
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-05-03 18:15:50 +08:00
Kevin Locke
7c36ec38f1 doc: add util.types.isArrayBufferView()
This function was added by nodejs/node#15663,
but was never documented. This commit documents it.

PR-URL: https://github.com/nodejs/node/pull/33092
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-05-02 10:32:26 +05:30
白一梓
e9518254d7 doc: fix the spelling error in stream.md
Change `64kb` to `64KB` in  `stream.md`

PR-URL: https://github.com/nodejs/node/pull/31561
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-04-30 18:30:46 -05:00
Joyee Cheung
5f2c4ce74f
vm: fix vm.measureMemory() and introduce execution option
https://github.com/nodejs/node-v8/pull/147 broke the
`vm.measureMemory()` API. It only created a `MeasureMemoryDelegate` and
without actually calling `v8::Isolate::MeasureMemory()` so the returned
promise will never resolve. This was not caught by the tests because
the promise resolvers were not wrapped with `common.mustCall()`.

This patch migrates the API properly and also introduce the newly
added execution option to the API. It also removes support for
specifying contexts to measure - instead we'll just return the
measurements for all contexts in the detailed mode, which is
what the `performance.measureMemory()` prototype in V8 currently does.
We can consider implementing our own `v8::MeasureMemoryDelegate`
to select the target context in `ShouldMeasure()` in the future,
but then we'll also need to implement `MeasurementComplete()`
to assemble the result. For now it's probably too early to do that.

Since this API is still experimental (and guarded with a warning),
such breakage should be acceptable.

Refs: https://github.com/nodejs/node-v8/pull/147

PR-URL: https://github.com/nodejs/node/pull/32988
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-30 17:42:12 +08:00
Guy Bedford
2496db8e09 module: no type module resolver side effects
PR-URL: https://github.com/nodejs/node/pull/33086
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
2020-04-29 22:10:35 -07:00
Ruben Bridgewater
d7b02c3cad
2020-04-29, Version 13.14.0 (Current)
Notable Changes:

* async_hooks**:
  * Merge `run` and `exit` methods (Andrey Pechkurov)
    https://github.com/nodejs/node/pull/31950
  * Prevent sync methods of async storage exiting outer context
    (Stephen Belanger)
    https://github.com/nodejs/node/pull/31950
* vm:
  * Add `importModuleDynamically` option to compileFunction (Gus
    Caplan)
    https://github.com/nodejs/node/pull/32985

New core collaborators:

With this release, we welcome two new Node.js core collaborators:

* Juan José Arboleda @juanarbol
  https://github.com/nodejs/node/pull/32906
* Andrey Pechkurov @puzpuzpuz
  https://github.com/nodejs/node/pull/32817

PR-URL: https://github.com/nodejs/node/pull/33122
2020-04-30 00:24:31 +02:00
Beth Griggs
49db211846
2020-04-29, Version 14.1.0 (Current)
Notable changes:

- deps: upgrade openssl sources to 1.1.1g (Hassaan Pasha)
  [#32971](https://github.com/nodejs/node/pull/32971)
- doc: add juanarbol as collaborator (Juan José Arboleda)
  [#32906](https://github.com/nodejs/node/pull/32906)
- http: doc deprecate abort and improve docs (Robert Nagy)
  [#32807](https://github.com/nodejs/node/pull/32807)
- module: do not warn when accessing `__esModule` of unfinished exports
  (Anna Henningsen) [#33048](https://github.com/nodejs/node/pull/33048)
- n-api: detect deadlocks in thread-safe function (Gabriel Schulhof)
  [#32860](https://github.com/nodejs/node/pull/32860)
- src: deprecate embedder APIs with replacements (Anna Henningsen)
  [#32858](https://github.com/nodejs/node/pull/32858)
- stream:
  - don't emit end after close (Robert Nagy)
    [#33076](https://github.com/nodejs/node/pull/33076)
  - don't wait for close on legacy streams (Robert Nagy)
    [#33058](https://github.com/nodejs/node/pull/33058)
  - pipeline should only destroy un-finished streams (Robert Nagy)
    [#32968](https://github.com/nodejs/node/pull/32968)
- vm: add importModuleDynamically option to compileFunction (Gus Caplan)
  [#32985](https://github.com/nodejs/node/pull/32985)

PR-URL: https://github.com/nodejs/node/pull/33103
2020-04-29 19:33:51 +01:00
Pranshu Srivastava
2cd79700c0 stream: add null check in Readable.from
Throws `ERR_STREAM_NULL_VALUES` error if a null value is passed to
`Readable.from`. Also added docs for the same.

Co-Authored-By: 扩散性百万甜面包 <himself65@outlook.com>
Fixes: https://github.com/nodejs/node/issues/32845
PR-URL: https://github.com/nodejs/node/pull/32873
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-04-29 09:41:31 +02:00
Anna Henningsen
e7b99e027b
worker: add stack size resource limit option
Add `stackSizeMb` to the `resourceLimit` option group.

Refs: https://github.com/nodejs/node/pull/31593#issuecomment-619633820

PR-URL: https://github.com/nodejs/node/pull/33085
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-04-29 05:13:42 +02:00
Ranjan Purbey
393f6914df
doc: improve worker pool example
In the worker pool example, the 'kWorkerFreedEvent' should be emitted
in case of error as well. After adding new worker in the error handler,
the pending tasks should be notified of an available worker.

PR-URL: https://github.com/nodejs/node/pull/33082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-04-29 05:10:22 +02:00