0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-25 08:19:38 +01:00
Commit Graph

30930 Commits

Author SHA1 Message Date
sapics
a80000ec08
src: remove unnecessary calculation in base64.h
PR-URL: https://github.com/nodejs/node/pull/33839
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-06-25 16:44:04 +02:00
Pranshu Srivastava
ac80fed3b8
http2: return this for Http2ServerRequest#setTimeout
Fixes: https://github.com/nodejs/node/issues/33993

PR-URL: https://github.com/nodejs/node/pull/33994
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-06-25 16:26:04 +02:00
Ruben Bridgewater
3646872f60
util: fix width detection for DEL without ICU
This makes sure the DEL character (ASCII 127) is detected as a zero
width character even if Node.js is not built with ICU.

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

PR-URL: https://github.com/nodejs/node/pull/33650
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-25 06:42:38 -07:00
Ruben Bridgewater
66679ce334
util: support Combining Diacritical Marks for Symbols
This adds support for the "Combining Diacritical Marks for Symbols"
unicode group to calculate a zero length width even if Node.js is
built without ICU.

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

PR-URL: https://github.com/nodejs/node/pull/33650
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-25 06:42:34 -07:00
Derek Lewis
e405e82f74 doc: add allowed info strings to style guide
This commit adds the list of agreed-upon info strings to the
documentation style guide to aid with future development and
maintenance.

Refs: https://github.com/nodejs/node/pull/33510
Refs: https://github.com/nodejs/node/pull/33507
Refs: https://github.com/nodejs/node/pull/33483
Refs: https://github.com/nodejs/node/pull/33531
Refs: https://github.com/nodejs/node/pull/33542
Refs: https://github.com/nodejs/node/pull/33028
Refs: https://github.com/nodejs/node/pull/33548
Refs: https://github.com/nodejs/node/pull/33486

PR-URL: https://github.com/nodejs/node/pull/34024
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-24 19:00:21 -07:00
wenningplus
4438852aa1
src: use ToLocal in node_os.cc
PR-URL: https://github.com/nodejs/node/pull/33939
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-24 18:00:51 -07:00
Anna Henningsen
5ef5116311
worker: rename error code to be more accurate
Rename `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`
to `ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST` in order to be more
accurate.

PR-URL: https://github.com/nodejs/node/pull/33872
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-06-24 17:56:55 -07:00
Anna Henningsen
8e12962401
src: handle empty Maybe(Local) in node_util.cc
PR-URL: https://github.com/nodejs/node/pull/33867
Refs: https://github.com/nodejs/node/blob/master/src/README.md#checked-conversion
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-24 17:54:17 -07:00
Anna Henningsen
0fb91acedf
src: disallow JS execution inside FreeEnvironment
This addresses a TODO comment, and aligns the behavior between
worker threads and the main thread.

The primary motivation for this change is to more strictly enforce
the invariant that no JS runs after the `'exit'` event is emitted.

PR-URL: https://github.com/nodejs/node/pull/33874
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-06-24 17:43:29 -07:00
Nathan Blair
409fdba6d5
configure: account for CLANG_VENDOR when checking for llvm version
Fixes: https://github.com/nodejs/node/issues/29536

PR-URL: https://github.com/nodejs/node/pull/33860
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-24 17:10:16 -07:00
Ben Noordhuis
dca816325d
build: configure byte order for mips targets
The build defaulted to the byte order of the host system but
that can be different from the endianness of the target system.

Refs: https://github.com/nodejs/node/issues/33703#issuecomment-644639158

PR-URL: https://github.com/nodejs/node/pull/33898
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-24 16:50:13 -07:00
Denys Otrishko
bd8a7196fc
fs: fix realpath inode link caching
The `fs.realpath` / `fs.realpathSync` cache already seen symbolic links
using the inode number which may be longer that max supported
JS number (2**53) and will therefore be incorrectly handled by possibly
entering infinite loop of calling stat on the same node.

This PR changes those functions (where appropriate) to use
bigint for inode numbers.

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

PR-URL: https://github.com/nodejs/node/pull/33945
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-24 16:37:42 -07:00
sapics
5a0c6a6b5d
src: fix FastStringKey equal operator
PR-URL: https://github.com/nodejs/node/pull/33748
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-24 16:29:37 -07:00
sapics
d4a1c98a54
querystring: fix stringify for empty array
PR-URL: https://github.com/nodejs/node/pull/33918
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-24 16:18:00 -07:00
Denys Otrishko
ca46c3b5dc
timers: allow timers to be used as primitives
This allows timers to be matched to numeric Ids and therefore used
as keys of an Object, passed and stored without storing the Timer instance.

clearTimeout/clearInterval is modified to support numeric/string Ids.

Co-authored-by: Bradley Farias <bradley.meck@gmail.com>
Co-authored-by: Anatoli Papirovski <apapirovski@mac.com>

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

PR-URL: https://github.com/nodejs/node/pull/34017
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-24 16:15:41 -07:00
Robert Nagy
2ccf15b2bf test: ensure finish is emitted before destroy
Adds a test to ensure that 'finish' is emitted
before the socket is destroyed by allow half-open
enforcer.

Refs: 3c07b1793c (commitcomment-38810268)

PR-URL: https://github.com/nodejs/node/pull/33137
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-06-25 01:11:14 +02:00
Denys Otrishko
225a03c5bb
test: print arguments passed to mustNotCall function
Refs: https://github.com/nodejs/node/pull/33949#discussion_r442473532
Signed-off-by: Denys Otrishko <shishugi@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33951
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-24 15:41:44 -07:00
Yash Ladha
1a90d32d92
http: used already defined validator for boolean check
We already importing the validator for integer check. So leveraging the
boolean check validator to remove already defined logic in the code and
thus making it DRY.

PR-URL: https://github.com/nodejs/node/pull/33731
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-24 15:32:22 -07:00
Pranshu Srivastava
4af2539d69
doc: fix lexical sorting of bottom-references in http doc
PR-URL: https://github.com/nodejs/node/pull/34007
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-24 15:27:55 -07:00
Anna Henningsen
53fb2b6b41
src: remove _third_party_main support
Since 7dead8440c, there is a more official alternative that is
tested and comes with a proper API, and since a6c57cc66d, the
`LoadEnvironment(env)` overload is deprecated, which is the closest
thing we can achieve to deprecating `_third_party_main` support.

Thus, we can now consider us able to remove `_third_party_main`
support.

Fixes: https://github.com/nodejs/node/issues/24017
Refs: https://github.com/nodejs/node/pull/30467
Refs: https://github.com/nodejs/node/pull/32858

PR-URL: https://github.com/nodejs/node/pull/33971
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-06-24 15:20:59 -07:00
Denys Otrishko
78ca61e2cf net: check args in net.connect() and socket.connect() calls
Previously Node.js would handle empty `net.connect()` and
`socket.connect()` call as if the user passed empty options object which
doesn't really make sense. This was due to the fact that it uses the
same `normalizeArgs` function as `.listen()` call where such call is
perfectly fine.

This will make it clear what is the problem with such call and how it
can be resolved. It now throws `ERR_MISSING_ARGS` if no arguments were
passed or neither `path` nor `port` is specified.

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

PR-URL: https://github.com/nodejs/node/pull/34022
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-06-24 14:45:10 -07:00
Denys Otrishko
b546a2b469 lib: handle one of args case in ERR_MISSING_ARGS
This makes ERR_MISSING_ARGS handle nested arrays in argument names as
one-of case and will print them as '"arg1" or "arg2" or "arg3"'.

Example:
```js
throw new ERR_MISSING_ARGS(['a', 'b', 'c']);
// will result in message:
// The "a" or "b" or "c" argument must be specified
```

PR-URL: https://github.com/nodejs/node/pull/34022
Fixes: https://github.com/nodejs/node/issues/33930
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-06-24 14:45:08 -07:00
James M Snell
7816e5f7b9
deps: fix indenting of sources in ngtcp2.gyp
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:33 -07:00
James M Snell
213cac0b94
quic: temporarily skip quic-ipv6only test
The dual stack support is currently broken as the QuicSocket endpoints
are not properly accounting for all cases. Needs to be investigated
further.

PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:29 -07:00
James M Snell
99f7c4bb5e
quic: possibly resolve flaky assertion failure in ipv6only test
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:26 -07:00
James M Snell
f5343d1b40
deps: re-enable OPENSSL_NO_QUIC guards
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:22 -07:00
James M Snell
2a5922e483
quic: temporarily disable packetloss tests
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:18 -07:00
James M Snell
9de95f494e
deps: temporary fixup for ngtcp2 to build on windows
The ngtcp2 update uses a gcc builtin that is not available under
_MSC_VER. This floats a patch to fix it.

Upstream PR: https://github.com/ngtcp2/ngtcp2/pull/247

PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:15 -07:00
James M Snell
86e67aaa69
quic: updates to implement for h3-29
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:11 -07:00
Tatsuhiro Tsujikawa
ec7ad1d0ec
deps: cherry-pick akamai/openssl/commit/bf4b08ecfbb7a26ca4b0b9ecaee3b31d18d7bda9
Original Commit Message:

  Fix out-of-bounds read when TLS msg is split up into multiple chunks

  Previously, SSL_provide_quic_data tried to handle this kind of
  situation, but it failed when the length of input data is less than
  SSL3_HM_HEADER_LENGTH.  If that happens, the code might get wrong
  message length by reading value from out-of-bounds region.

PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:07 -07:00
Benjamin Kaduk
c3d85b7637
deps: cherry-pick akamai/openssl/commit/a5a08cb8050bb69120e833456e355f482e392456
Original Commit Message:

  Test KeyUpdate rejection

  For now, just test that we don't generate any, since we don't really
  expose the mechanics for encrypting one and the QUIC API is not
  integrated into the TLSProxy setup.

PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:03 -07:00
Benjamin Kaduk
bad1a150ea
deps: cherry-pick akamai/openssl/commit/d5a13ca6e29f3ff85c731770ab0ee2f2487bf8b3
Original Commit Message:

  Prevent KeyUpdate for QUIC

  QUIC does not use the TLS KeyUpdate message/mechanism, and indeed
  it is an error to generate or receive such a message.  Add the
  necessary checks (noting that the check for receipt should be
  redundant since SSL_provide_quic_data() is the only way to provide
  input to the TLS layer for a QUIC connection).

PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:00 -07:00
Benjamin Kaduk
74cbfd3f36
deps: cherry-pick akamai/openssl/commit/a6282c566d88db11300c82abc3c84a4e2e9ea568
Original Commit Message:

  Some cleanup for the main QUIC changes

  Try to reduce unneeded whitespace changes and wrap new code to 80 columns.
  Reword documentation to attempt to improve clarity.
  Add some more sanity checks and clarifying comments to the code.
  Update referenced I-D versions.

PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:32:56 -07:00
James M Snell
8a9763a8ea
deps: update nghttp3
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:32:53 -07:00
James M Snell
6b27d07779
deps: update ngtcp2
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:32:49 -07:00
Gerhard Stoebich
a2b1b92e30 test: AsyncLocalStorage works with thenables
This adds a test to verify that AsyncLocalStorage works with thenables.

PR-URL: https://github.com/nodejs/node/pull/34008
Refs: https://github.com/nodejs/node/pull/33778
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-24 15:44:49 +02:00
Anna Henningsen
d8f8723577 src: reduce scope of code cache mutex
As indicated in the added comment, this can lead to a deadlock
otherwise. In the concrete instance in which I encountered this,
the relevant nested call is the one to `require('internal/tty')`
inside of the `afterInspector()` function for uncaught exception
handling.

PR-URL: https://github.com/nodejs/node/pull/33980
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-06-24 05:50:53 +02:00
Vse Mozhet Byt
8ada27510d doc: add missing backticks in timers.md
PR-URL: https://github.com/nodejs/node/pull/34030
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-06-23 18:50:15 -07:00
Brian White
336546b075
benchmark: fix EventTarget benchmark
Fixes: https://github.com/nodejs/node/issues/33782

PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:13 -07:00
James M Snell
4629e96c20
events: improve argument handling, start passive
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:13 -07:00
James M Snell
ef91096565
events: support dispatching event from event
Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:12 -07:00
James M Snell
4bbd389d12
events: add event-target tests
PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:12 -07:00
Benjamin Gruenbaum
f3935b811a
event: cancelBubble is a property
Event#cancelBubble is property (and not a function). Change
Event#cancelBubble to a property and add a test.

PR-URL: https://github.com/nodejs/node/pull/33613
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:11 -07:00
Benjamin Gruenbaum
e8f4ac7dad
events: support event handlers
PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:10 -07:00
Benjamin Gruenbaum
9d324f0441
events: expose Event statics
PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:10 -07:00
Zirak
a30babf672
events: Handle a range of this values for dispatchEvent
On the web, dispatchEvent is finicky about its `this` value. An exception is
thrown for `this` values which are not an EventTarget.

PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:09 -07:00
Benjamin Gruenbaum
4b3654e923
events: fix EventTarget support
Remove support for multiple arguments (which don't actually work for
EventTarget). Use our EventTarget implementation rather than a mock.

Refactor `once` code in preparation of `on` using shared code for
supporting `on` with `EventTarget`s.

Support EventTarget in the `events.on` static method

PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:09 -07:00
Denys Otrishko
42d932c59b
events: fix depth in customInspectSymbol and clean up
PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:08 -07:00
Denys Otrishko
5e6ae9aa5d
events: use internal/validators in event_target.js
PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:07 -07:00
Mateusz Krawczuk
91d9cdfffc doc: mention errors thrown by methods called on an unbound dgram.Socket
PR-URL: https://github.com/nodejs/node/pull/33983
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-23 17:04:26 -07:00