Rich Trott
c22eec85b4
debugger: use ERR_DEBUGGER_ERROR in debugger client
...
PR-URL: https://github.com/nodejs/node/pull/39024
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2021-06-15 18:43:10 -07:00
Rich Trott
787cacc869
errors: add ERR_DEBUGGER_ERROR
...
PR-URL: https://github.com/nodejs/node/pull/39024
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2021-06-15 18:43:08 -07:00
Robert Nagy
f4609bdf3f
stream: bypass legacy destroy for pipeline and async iteration
...
PR-URL: https://github.com/nodejs/node/pull/38505
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-06-15 19:43:49 +02:00
XadillaX
7a9635b094
crypto: fix aes crash when tag length too small
...
Fixes: https://github.com/nodejs/node/issues/38883
PR-URL: https://github.com/nodejs/node/pull/38914
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-06-15 14:21:28 +08:00
Robert Nagy
bdcb7389ed
stream: fix pipeline pump
...
Refs: https://github.com/nodejs/node/issues/39005
PR-URL: https://github.com/nodejs/node/pull/39006
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-06-14 08:13:12 -07:00
Voltrex
7a0a8efec1
net: use missing validator
...
The `net` lib module's `lookupAndConnect()` function is missing
a validator.
PR-URL: https://github.com/nodejs/node/pull/38984
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Zeyu Yang <himself65@outlook.com >
2021-06-14 08:09:17 -07:00
Antoine du Hamel
4e17ffc793
module: fix legacy node specifier resolution to resolve "main" field
...
PR-URL: https://github.com/nodejs/node/pull/38979
Fixes: https://github.com/nodejs/node/issues/32103
Fixes: https://github.com/nodejs/node/issues/38739
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
2021-06-13 16:22:34 +02:00
Antoine du Hamel
423ae41625
lib: refactor debuglog init
...
PR-URL: https://github.com/nodejs/node/pull/38838
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com >
2021-06-12 18:55:14 +02:00
Rich Trott
f461158feb
debugger: remove unnecessary boilerplate copyright comment
...
PR-URL: https://github.com/nodejs/node/pull/38952
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2021-06-09 19:07:34 -07:00
Michaël Zasso
f504c9c6b8
Revert "http: make HEAD method to work with keep-alive"
...
This reverts commit 7afa5336ae .
The change breaks clients like cURL.
Fixes: https://github.com/nodejs/node/issues/38922
PR-URL: https://github.com/nodejs/node/pull/38949
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Mary Marchini <oss@mmarchini.me >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
2021-06-08 17:54:28 +02:00
Rich Trott
fa86b36124
debugger: reduce scope of eslint disable comment
...
Current code masks setInterval and setTimeout with promisified versions.
This can be confusing to read and causes lint errors. Replace masking
with use of pSetInterval and pSetTimeout instead.
Move disabling of lint rule from entire file to the one remaining line
(after the above changes) that still needs it.
PR-URL: https://github.com/nodejs/node/pull/38946
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2021-06-07 22:11:44 -07:00
Voltrex
826566e78a
vm: use missing validator
...
The `vm` lib module's `isContext()` function should use a validator.
PR-URL: https://github.com/nodejs/node/pull/38935
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-06-07 07:31:34 -07:00
Qingyu Deng
e0238c4352
child_process: refactor to use validateBoolean
...
PR-URL: https://github.com/nodejs/node/pull/38927
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-06-07 07:29:07 -07:00
Stephen Belanger
1c36eefcdb
async_hooks: switch between native and context hooks correctly
...
🤦 Might help if I remember to disable the _other_ promise
hook implementation when switching between them...
Fixes #38814
Fixes #38815
Refs #36394
PR-URL: https://github.com/nodejs/node/pull/38912
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Bryan English <bryan@bryanenglish.com >
2021-06-05 21:21:03 +02:00
Shelley Vohr
dc253783f4
tls: tweak clientCertEngine argument parsing
...
PR-URL: https://github.com/nodejs/node/pull/38900
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-06-04 11:19:45 +02:00
XadillaX
fc4b9c1d07
child_process: allow options.cwd receive a URL
...
PR-URL: https://github.com/nodejs/node/pull/38862
Fixes: https://github.com/nodejs/node/issues/38861
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2021-06-04 14:33:59 +08:00
Ouyang Yadong
d8797f5994
dns: allow --dns-result-order to change default dns verbatim
...
Allow the `--dns-result-order` option to change the default value
of verbatim in `dns.lookup()`. This is useful when running
Node.js in ipv6-only environments to avoid possible ENETUNREACH
errors.
PR-URL: https://github.com/nodejs/node/pull/38099
Refs: https://github.com/nodejs/node/issues/31566
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2021-06-02 19:28:05 +02:00
Joyee Cheung
2bb0c2013f
lib: include url in bootstrap snapshot and remove unnecessary lazy-loads
...
PR-URL: https://github.com/nodejs/node/pull/38826
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
2021-06-02 13:30:05 +08:00
Rich Trott
fc264dfd8d
debugger: revise async iterator usage to comply with lint rules
...
I'm not sure that this is any clearer than the existing code, but I
don't think it's significantly less clear, and it avoids comment
disabling a lint rule.
PR-URL: https://github.com/nodejs/node/pull/38847
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-06-01 19:46:52 -07:00
Luigi Pinca
152d675cc6
os: add os.devNull
...
Provides the platform-specific file path of the null device.
PR-URL: https://github.com/nodejs/node/pull/38569
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2021-06-01 21:06:18 +02:00
bl-ue
dccf64ee9d
lib: fix typos
...
PR-URL: https://github.com/nodejs/node/pull/38846
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Khaidi Chu <i@2333.moe >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
2021-06-01 12:06:37 +02:00
Rich Trott
910009d5c6
debugger: removed unused function argument
...
PR-URL: https://github.com/nodejs/node/pull/38850
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-05-31 22:19:49 -07:00
Michaël Zasso
f1cbaea74b
debugger: wait for V8 debugger to be enabled
...
Refs: https://github.com/nodejs/node/pull/38273#issuecomment-848438189
PR-URL: https://github.com/nodejs/node/pull/38811
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Beth Griggs <bgriggs@redhat.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-05-28 23:06:13 +02:00
Joyee Cheung
a4ea9fc48e
lib: remove unnecessary lazy loads
...
Now that more modules are included in the snapshot, it's not
necessary to lazy load them anymore
PR-URL: https://github.com/nodejs/node/pull/38737
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2021-05-27 21:46:48 +08:00
Joyee Cheung
9e42b4da09
lib: load internal/fs/watchers and internal/fs/read_file_context early
...
So that they are included in the builtin snapshot
PR-URL: https://github.com/nodejs/node/pull/38737
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2021-05-27 21:46:46 +08:00
Nitzan Uziely
df85d37050
stream: add a non-destroying iterator to Readable
...
add a non-destroying iterator to Readable
fixes: https://github.com/nodejs/node/issues/38491
PR-URL: https://github.com/nodejs/node/pull/38526
Fixes: https://github.com/nodejs/node/issues/38491
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2021-05-25 07:22:29 -07:00
Nitzan Uziely
f9447b71a6
fs: fix rmsync error swallowing
...
fix rmsync swallowing errors instead of throwing them.
fixes: https://github.com/nodejs/node/issues/38683
fixes: https://github.com/nodejs/node/issues/34580
PR-URL: https://github.com/nodejs/node/pull/38684
Fixes: https://github.com/nodejs/node/issues/38683
Fixes: https://github.com/nodejs/node/issues/34580
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-05-25 07:18:05 -07:00
Voltrex
9a7cbe25de
typings: add JSDoc typings for https
...
Added JSDoc typings for the `https` lib module.
PR-URL: https://github.com/nodejs/node/pull/38589
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-05-24 13:11:50 -07:00
Anna Henningsen
dc43066ee9
child_process: retain reference to data with advanced serialization
...
Do the same thing we do for other streams, and retain a reference to
the Buffer that was sent over IPC while the write request is active,
so that it doesn’t get garbage collected while the data is still in
flight.
(This is a good example of why it’s a bad idea that we’re not re-using
the general streams implementation for IPC and instead maintain
separate usage of the low-level I/O primitives.)
Fixes: https://github.com/nodejs/node/issues/34797
PR-URL: https://github.com/nodejs/node/pull/38728
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2021-05-23 16:25:50 +02:00
Voltrex
5ce015ec72
typings: add JSDoc typings for events
...
Added JSDoc typings for the `events` lib module.
PR-URL: https://github.com/nodejs/node/pull/38712
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Masashi Hirano <shisama07@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-05-21 14:18:28 -07:00
Akhil Marsonya
13ec3176ac
events: refactor to use primordials in lib/events
...
Replace code that's vulnerable to Prototype Pollution with Primordials.
PR-URL: https://github.com/nodejs/node/pull/38117
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-05-21 12:55:43 -07:00
Qingyu Deng
b9ef539eae
stream: allow empty string as source of pipeline
...
Fixes: https://github.com/nodejs/node/issues/38721
PR-URL: https://github.com/nodejs/node/pull/38723
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
2021-05-20 09:46:47 -07:00
Joyee Cheung
527da94a3e
bootstrap: include vm and contextify binding into the snapshot
...
In addition, defer the patching of the vm module based on the
value of --experimental-vm-modules to runtime.
PR-URL: https://github.com/nodejs/node/pull/38677
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2021-05-20 01:16:00 +08:00
Rongjian Zhang
5d7b6c2497
lib: refactor to reuse validators
...
PR-URL: https://github.com/nodejs/node/pull/38608
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-05-19 09:22:56 -07:00
Antoine du Hamel
2eeb4e1d94
lib: make primordials Promise methods safe
...
`catch` and `finally` methods on %Promise.prototype% looks up the `then`
property of the instance, making it at risk of prototype pollution.
PR-URL: https://github.com/nodejs/node/pull/38650
Refs: https://tc39.es/ecma262/#sec-promise.prototype.catch
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2021-05-19 09:21:37 -07:00
Voltrex
6e6663b8a4
events: use nullish coalencing operator
...
PR-URL: https://github.com/nodejs/node/pull/38328
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-05-17 12:26:29 -07:00
moander
417c31b69a
errors: remove input from ERR_INVALID_URL message
...
Avoid potentially huge messages and leaked secrets.
PR-URL: https://github.com/nodejs/node/pull/38614
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
2021-05-17 12:17:24 -07:00
Nitzan Uziely
3612229d44
fs: fix async iterator partial writes
...
fix an issue where chunks might be partially written when
using writeFile with an async iterator.
PR-URL: https://github.com/nodejs/node/pull/38615
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-05-17 12:16:27 -07:00
Filip Skokan
3ee1f9a29a
util: add util.types.isKeyObject and util.types.isCryptoKey
...
closes #38611
PR-URL: https://github.com/nodejs/node/pull/38619
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2021-05-17 10:29:18 +02:00
Filip Skokan
2130598e91
crypto: forbid NODE-ED25519 and NODE-ED448 "raw" key export
...
closes #38655
PR-URL: https://github.com/nodejs/node/pull/38668
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-05-17 10:28:37 +02:00
Antoine du Hamel
0996eb71ed
repl: fix Ctrl+C on top level await
...
PR-URL: https://github.com/nodejs/node/pull/38656
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2021-05-15 21:47:55 +02:00
Antoine du Hamel
284f74d6f9
debugger: refactor inspect_repl to use primordials
...
PR-URL: https://github.com/nodejs/node/pull/38551
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-05-14 15:53:34 -07:00
Rongjian Zhang
a03d3afa69
http: refactor to remove redundant argument of _deferToConnect
...
PR-URL: https://github.com/nodejs/node/pull/38598
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2021-05-14 14:43:33 +02:00
Timothy Gu
70157b9cb7
url: forbid certain confusable changes from being introduced by toASCII
...
The legacy url.parse() function attempts to convert Unicode domains
(IDNs) into their ASCII/Punycode form through the use of the toASCII
function. However, toASCII can introduce or remove various characters
that at best invalidate the parsed URL, and at worst cause hostname
spoofing:
url.parse('http://bad.c℀.good.com/ ').href === 'http://bad.ca/c.good.com/ '
(from [1])
url.parse('http://\u00AD/bad.com ').href === 'http:///bad.com/ '
While changes to the legacy URL parser are discouraged in general, the
security implications here outweigh the desire for strict compatibility.
This is since this commit only changes behavior when non-ASCII
characters appear in the hostname, an unusual situation for most use
cases. Additionally, despite the availability of the WHATWG URL API,
url.parse remain widely deployed in the Node.js ecosystem, as
exemplified by the recent un-deprecation of the legacy API.
This change is similar in spirit to CPython 3.8's change [2] fixing
bpo-36216 [3] aka CVE-2019-9636, which also occurred despite potential
compatibility concerns.
[1]: https://hackerone.com/reports/678487
[2]: 16e6f7dee7
[3]: https://bugs.python.org/issue36216
PR-URL: https://github.com/nodejs/node/pull/38631
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2021-05-13 23:04:23 -07:00
James M Snell
2c80048cb7
process: add 'worker' event
...
Provides a new `process.on('worker', (worker) => {})` event that
is triggered by the creation of a new `worker_thread.Worker`.
The use case is to allow hooks to be installed for monitoring
workers without having to modify the call sites around those.
Signed-off-by: James M Snell <jasnell@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/38659
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
2021-05-13 18:12:52 -07:00
Voltrex
89f592cc82
path: inline conditions
...
This condition can be inlined in the first `if` statement since
if the `path`'s length is 0, it'll be a empty string so we can
return that as there's no need for an extra `if` statement.
PR-URL: https://github.com/nodejs/node/pull/38613
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-05-12 07:26:22 -07:00
Antoine du Hamel
4ebb88fea5
module: add support for URL to import.meta.resolve
...
PR-URL: https://github.com/nodejs/node/pull/38587
Refs: https://github.com/nodejs/node/pull/38585
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-05-10 15:09:05 -07:00
Zach Bjornson
8886b63cf6
fs: fix error when writing buffers > INT32_MAX
...
This reverts c380ee6785 .
uv_fs_write returns an int, so it is not possible to ask
it to write more than INT32_MAX.
Instead, validate 'length' is an int32 in JS to avoid
the assertion failure.
PR-URL: https://github.com/nodejs/node/pull/38546
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2021-05-10 15:04:37 -07:00
Rongjian Zhang
1b11398628
dgram: extract cluster lazy loading method to make it testable
...
PR-URL: https://github.com/nodejs/node/pull/38563
Refs: https://coverage.nodejs.org/coverage-26e318a321a872bc/lib/dgram.js.html#L202
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-05-09 09:16:22 +02:00
XadillaX
0b6f0a0ec2
buffer: remove TODOs in atob / btoa
...
Refs: https://github.com/nodejs/node/pull/38433#issuecomment-828426932
PR-URL: https://github.com/nodejs/node/pull/38548
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2021-05-09 09:11:38 +02:00