Commit Graph

8425 Commits

Author SHA1 Message Date
Sebastien Ahkrin
693cc2c1c3
lib: replace Int8Array global with primordials
PR-URL: https://github.com/nodejs/node/pull/35397
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
2020-10-04 09:40:54 +02:00
Sebastien Ahkrin
6883c8d30b
lib: replace Int32Array global with primordials
PR-URL: https://github.com/nodejs/node/pull/35397
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
2020-10-04 09:40:52 +02:00
Sebastien Ahkrin
34b7b47849
lib: replace Float64Array global with primordials
PR-URL: https://github.com/nodejs/node/pull/35397
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
2020-10-04 09:40:51 +02:00
himself65
b8f34b295c fs: simplify realpathSync
PR-URL: https://github.com/nodejs/node/pull/35413
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-10-04 08:23:51 +02:00
Leko
4a6005c56a console: add Symbol.toStringTag property
Add Symbol.toStringTag property to console object to follow WPT changes
Update WPT status of console and the repl test case

Refs: https://github.com/web-platform-tests/wpt/pull/24717

PR-URL: https://github.com/nodejs/node/pull/35399
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-10-01 23:52:08 +08:00
Guy Bedford
726143e683 module: refine module type mismatch error cases
PR-URL: https://github.com/nodejs/node/pull/35426
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-09-30 20:46:01 -07:00
Michaël Zasso
a8806535d9
lib: use Object static properties from primordials
PR-URL: https://github.com/nodejs/node/pull/35380
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2020-09-30 17:52:35 +02:00
Michaël Zasso
6c91991f6c
fs: use Promise.resolve from primordials
PR-URL: https://github.com/nodejs/node/pull/35379
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-09-30 08:32:46 +02:00
Guy Bedford
ee9e3e75aa esm: use "node:" namespace for builtins
PR-URL: https://github.com/nodejs/node/pull/35387
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-09-29 18:20:28 -07:00
Michaël Zasso
56e36f41aa fs: fix fs.promises.writeFile with typed arrays
Before this change, only the first part of typed arrays which have more
than 1 byte per element (e.g. Uint16Array) would be written.
This also removes the use of the `slice` method to avoid unnecessary
copying the data.

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

PR-URL: https://github.com/nodejs/node/pull/35376
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-09-29 14:23:52 +00:00
Guy Bedford
1e8cb08edc module: named exports for CJS via static analysis
PR-URL: https://github.com/nodejs/node/pull/35249
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-09-28 18:27:25 -07:00
Rich Trott
eec4a5b671 repl: standardize Control key indications
Throughout our messages and docs, we refer to the Control key in a
surprisingly varied number of ways:

* Control
* Ctrl
* Cntl
* varied capitalization on the above (e.g., ctrl vs. Ctrl)

Then, in key combinations:

* One of the items from the previous list followed by `-`
* ... or followed by `+`
* ... surrounded or not by `<` and `>`
* ... and inside backticks or not
* ... or just `^`

This is the start of standardization on the formulation recommended by
the Microsoft Style Guide (e.g., **Ctrl+C**).

PR-URL: https://github.com/nodejs/node/pull/35270
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-09-28 06:55:07 -07:00
Bartosz Sosnowski
abd8cdfc4e win, child_process: sanitize env variables
On Windows environment variables are case-insensitive. When spawning
child process certain apps can get confused if some of the variables are
duplicated.

This adds a step on Windows to normalizeSpawnArguments that removes such
duplicates, keeping only the first (in lexicographic order) entry in the
env key of options. This is partly already done for the PATH entry.

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

PR-URL: https://github.com/nodejs/node/pull/35210
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-09-24 18:25:18 +02:00
Robert Nagy
6be80e1893 stream: fix legacy pipe error handling
Fixes: https://github.com/nodejs/node/issues/35237

PR-URL: https://github.com/nodejs/node/pull/35257
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-23 04:33:05 -07:00
Dan Fabulich
3b10f7f933
process: change default --unhandled-rejections=throw
This is a semver-major change that resolves DEP0018.

All users that have set an unhandledRejection hook or set a non-default
value for the --unhandled-rejections flag will see no change in behavior
after this change.

Refs: https://nodejs.org/dist/latest/docs/api/deprecations.html#deprecations_dep0018_unhandled_promise_rejections

PR-URL: https://github.com/nodejs/node/pull/33021
Fixes: https://github.com/nodejs/node/issues/20392
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2020-09-22 12:29:32 -07:00
Christoph Tavan
219e9fe600
module: fix crash on multiline named cjs imports
The node process crashes when trying to parse a multiline import
statement for named exports of a CommonJS module:

    TypeError: Cannot read property '0' of null
          at ModuleJob._instantiate (internal/modules/esm/module_job.js:112:77)
          at async ModuleJob.run (internal/modules/esm/module_job.js:137:5)
          at async Loader.import (internal/modules/esm/loader.js:165:24)
          at async rejects.name (file:///***/node/test/es-module/test-esm-cjs-named-error.mjs:56:3)
          at async waitForActual (assert.js:721:5)
          at async rejects (assert.js:830:25),

The reason is that the regexp that is currently used to decorate the
original error fails for multi line import statements.

Unfortunately the undecorated error stack only contains the single line
which causes the import to fail:

    file:///***/node/test/fixtures/es-modules/package-cjs-named-error/multi-line.mjs:2
      comeOn,
      ^^^^^^
    SyntaxError: The requested module './fail.cjs' does not provide an export named 'comeOn'
        at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21)
        at async ModuleJob.run (internal/modules/esm/module_job.js:141:5)
        at async Loader.import (internal/modules/esm/loader.js:165:24)
        at async rejects.name (file:///***/node/test/es-module/test-esm-cjs-named-error.mjs:56:3)
        at async waitForActual (assert.js:721:5)
        at async rejects (assert.js:830:25)

Hence, for multiline import statements we cannot create an equivalent
piece of code that uses default import followed by an object
destructuring assignment.

In any case the node process should definitely not crash. So until we
have a more sophisticated way of extracting the entire problematic
multiline import statement, show the code example only for single-line
imports where the current regexp approach works well.

Refs: https://github.com/nodejs/node/issues/35259

PR-URL: https://github.com/nodejs/node/pull/35275
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-22 12:49:40 -04:00
Robert Nagy
2b9003b165 stream: don't destroy on async iterator success
Destroying on async iterator completion ignores autoDestroy.

PR-URL: https://github.com/nodejs/node/pull/35122
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-09-21 21:38:49 +00:00
Robert Nagy
5461794b12 https: set requestTimeout default to 0
Fixes: https://github.com/nodejs/node/issues/35261

PR-URL: https://github.com/nodejs/node/pull/35264
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-21 08:32:26 -07:00
DrunkenPoney
17ebd464cc readline: fix key name for function keys with modifiers
Fixes: https://github.com/nodejs/node/issues/35251

PR-URL: https://github.com/nodejs/node/pull/35268
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-21 07:42:15 -07:00
Matteo Collina
9c62e0e384 stream: move to internal/streams
Move all the streams constructors to internal/streams
and avoid a circular dependencies between the modules.

See: https://github.com/nodejs/readable-stream/issues/348

PR-URL: https://github.com/nodejs/node/pull/35239
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2020-09-21 08:23:06 +00:00
Daijiro Wachi
a8971f87d3 url: support non-special URLs
Fixes: https://github.com/nodejs/node/issues/34899
Refs: https://github.com/whatwg/url/pull/505
Refs: https://github.com/web-platform-tests/wpt/pull/25113

PR-URL: https://github.com/nodejs/node/pull/34925
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-09-20 14:19:52 +09:00
Guy Bedford
2d868fe822 module: exports pattern support
PR-URL: https://github.com/nodejs/node/pull/34718
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-09-17 18:56:17 -07:00
Jordan Harband
9cf9e4aebc fs: loosen validation to allow objects with an own toString function
PR-URL: https://github.com/nodejs/node/pull/34993
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2020-09-15 16:46:50 -07:00
Antoine du HAMEL
d24eecd7d7 module: use isURLInstance instead of instanceof
PR-URL: https://github.com/nodejs/node/pull/34951
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2020-09-15 22:17:47 +00:00
Matteo Collina
df08d527c2
http: add requestTimeout
This commits introduces a new http.Server option called requestTimeout
with a default value in milliseconds of 0.

If requestTimeout is set to a positive value, the server will start a new
timer set to expire in requestTimeout milliseconds when a new connection
is established. The timer is also set again if new requests after the
first are received on the socket (this handles pipelining and keep-alive
cases).
The timer is cancelled when:

1. the request body is completely received by the server.
2. the response is completed. This handles the case where the
application responds to the client without consuming the request body.
3. the connection is upgraded, like in the WebSocket case.

If the timer expires, then the server responds with status code 408 and
closes the connection.

CVE-2020-8251

PR-URL: https://github.com/nodejs-private/node-private/pull/208
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Co-Authored-By: Paolo Insogna <paolo@cowtech.it>
Co-Authored-By: Robert Nagy <ronagy@icloud.com>
2020-09-15 15:39:54 -04:00
atian25@qq.com
a63e121e33 http: only set keep-alive when not exists
PR-URL: https://github.com/nodejs/node/pull/35138
Fixes: https://github.com/nodejs/node/issues/34561
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-09-12 20:22:56 +08:00
Anna Henningsen
3c564632fa buffer: adjust validation to account for buffer.kMaxLength
PR-URL: https://github.com/nodejs/node/pull/35134
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2020-09-12 11:17:59 +00:00
Arnaud Lefebvre
23d6c42495 http: allow Content-Length header for 304 responses
Fixes: https://github.com/nodejs/node/issues/31037

PR-URL: https://github.com/nodejs/node/pull/34835
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-09-11 16:42:01 -07:00
Rich Trott
f54254afed errors: simplify ERR_REQUIRE_ESM message generation
Because of the condition that starts the `if` block, we know that
`parentPath` must be truthy. So there is no need to check for that in
the template string that generates the error message.

PR-URL: https://github.com/nodejs/node/pull/35123
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2020-09-11 16:26:00 -07:00
Denys Otrishko
b1831fed3a
events: simplify event target agnostic logic in on and once
PR-URL: https://github.com/nodejs/node/pull/34997
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2020-09-11 18:04:40 +03:00
Denys Otrishko
c66e6471e7
lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODING
This will be a start to generalize all argument validation
errors. As currently we throw ARG/OPT, OUT_OF_RANGE, and other more
specific errors.
The OPT errors didn't bring much to the errors as it's just another
variant of ARG error which is sometimes more confusing (some of our code
used OPT errors to denote just argument validation errors presumably
because of similarity of OPT to 'option' and not 'options-object')
and they don't specify the name of the options object where the invalid
value is located. Much better approach would be to just specify path
to the invalid value in the name of the value as it is done in this PR
(i.e. 'options.format', 'options.publicKey.type' etc)

Also since this decreases a variety of errors we have it'd be easier to
reuse validation code across the codebase.

Refs: https://github.com/nodejs/node/pull/31251
Refs: https://github.com/nodejs/node/pull/34070#discussion_r467251009
Signed-off-by: Denys Otrishko <shishugi@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34682
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-11 17:54:42 +03:00
Guy Bedford
3fb7fcd821 esm: better package.json parser errors
PR-URL: https://github.com/nodejs/node/pull/35117
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-11 05:09:44 -07:00
himself65
22c52aac6a module: fix specifier resolution option value
Fixes: https://github.com/nodejs/node/issues/35095

PR-URL: https://github.com/nodejs/node/pull/35098
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-10 07:58:08 -07:00
Rich Trott
40633351bc crypto: improve invalid arg type message for randomInt()
Use "must be a safe integer" rather than "must be safe integer". I
believe the former is more easily understood/clear.

PR-URL: https://github.com/nodejs/node/pull/35089
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-09-09 07:59:02 -07:00
Rich Trott
d7d0fab70e crypto: improve randomInt out-of-range error message
Previously, the crypto.randomInt() message when "max" was less than or
equal to "min" made it sound like the lower bound for "max" was
hard-coded. Make it clear that it is instead dynamic based on the value
of "min".

For crypto.randomInt(10,0):

Before:
RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be > 10. Received 0

After:

RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be greater than the value of "min" (10). Received 0

PR-URL: https://github.com/nodejs/node/pull/35088
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-09-09 07:57:24 -07:00
Robert Nagy
e0d3b758a0 stream: improve Writable.destroy performance
Avoid nextTick if there are no pending callbacks.

PR-URL: https://github.com/nodejs/node/pull/35067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
2020-09-07 09:54:33 -07:00
Rich Trott
ac6ba6b625 crypto: simplify KeyObject constructor
Inline a function that only gets called in the constructor. Make call to
`super()` more straightforward in the process by removing conditional
involving the function as it only ever returns `undefined` or else
throws. That made the code a little hard to understand, as without
looking at the function, one would likely expect it to return `true`
on success rather than `undefined`.

PR-URL: https://github.com/nodejs/node/pull/35064
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-09-07 08:00:39 -07:00
Tobias Nießen
cb2b82bddc crypto: fix randomInt range check
Refs: https://github.com/nodejs/node/pull/34600

PR-URL: https://github.com/nodejs/node/pull/35052
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-09-07 13:20:31 +00:00
Guy Bedford
04865cf6f0 bootstrap: correct --frozen-intrinsics override fix
PR-URL: https://github.com/nodejs/node/pull/35041
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-06 16:48:14 -07:00
Rich Trott
53f7d3ee2c crypto: align parameter names with documentation
Change _cb_ to _callback_ to align with documentation. This is so that
stack traces and error messages align with the documentation. If the
documentation says "callback", then the stack traces and error messages
should indicate that "callback" needs to be function or whatever, rather
than "cb".

PR-URL: https://github.com/nodejs/node/pull/35054
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-09-06 09:59:27 -07:00
Rich Trott
186230527b quic: fix error message on invalid connection ID
If Buffer.from() throws, it does not return a value, so the error
message is always going to report `undefined`. Use the value passed to
Buffer.from() instead.

PR-URL: https://github.com/nodejs/node/pull/35026
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-09-04 22:09:07 -07:00
Oli Lalonde
6e8701b923 crypto: add randomInt function
PR-URL: https://github.com/nodejs/node/pull/34600
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-09-04 10:51:13 +02:00
Daijiro Wachi
3b925219c3 querystring: manage percent character at unescape
Related: https://github.com/nodejs/node/issues/33892
Fixes: https://github.com/nodejs/node/issues/35012

PR-URL: https://github.com/nodejs/node/pull/35013
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-03 20:43:39 -07:00
Rich Trott
e5116b304f quic: remove unused function arguments
validateTransportParams() only takes (and only uses) one argument.

PR-URL: https://github.com/nodejs/node/pull/35010
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-09-03 19:54:10 -07:00
Rich Trott
449f73e05f quic: remove undefined variable
The `reason` variable never gets defined. It's use in a template string
will always end up as the string `'undefined'`.

PR-URL: https://github.com/nodejs/node/pull/35007
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-09-03 05:25:06 -07:00
James M Snell
df1023bb22
events: allow use of AbortController with on
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34912
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-09-02 07:53:47 -07:00
Anna Henningsen
42a793eba3 buffer: also alias BigUInt methods
These were overlooked in 5864fca7bc because of the extra
`Big` in the name. :)

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

PR-URL: https://github.com/nodejs/node/pull/34960
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-09-02 14:22:35 +00:00
Denys Otrishko
e2ffa454d3 stream: fix Readable stream state properties
Looks like they have been accidentally moved in
https://github.com/nodejs/node/pull/31144.

PR-URL: https://github.com/nodejs/node/pull/34886
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
2020-09-01 20:39:17 +00:00
James M Snell
883fc779b6 events: allow use of AbortController with once
Allows an AbortSignal to be passed in to events.once() to cancel
waiting on an event.

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

PR-URL: https://github.com/nodejs/node/pull/34911
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-08-31 15:09:57 +00:00
James M Snell
37a8179673 net: make blocklist family case insensitive
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34864
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-08-31 15:09:47 +00:00