Commit Graph
372 Commits
Author SHA1 Message Date
René 1c8799df7e util: canonicalize namespaced tags in inspect()
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/63257
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-27 21:15:40 +00:00
Hamid Reza Ghavami f509cf1d08 util: allow single-line format when break length is infinite
Signed-off-by: Hamid Reza Ghavami <hamidr.ghavami@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64238
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2026-08-24 14:31:34 +00:00
Dushyant Singh HadaandCursor 5b316e5402 util: fix OSC 8 hyperlink stripping in stripVTControlCharacters
The bundled ansi-regex OSC pattern used a restrictive URI
character class that failed when URIs contained RFC 3986-valid
characters such as parentheses.

Match OSC sequences generically as ESC ] ... ST, aligned with
ansi-regex v6.2.0.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: dushyant <dushyanthada90@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64319
Fixes: https://github.com/nodejs/node/issues/64313
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-24 03:14:23 +00:00
Richard Gibson a48e33fb6f util: fix formatting of functions returned from getters
Fixes: https://github.com/nodejs/node/issues/64838
Signed-off-by: Richard Gibson <richard.gibson@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64839
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-22 05:07:59 +00:00
Ayoub Mabrouk cc60845420 util: use more primordials in comparisons.js
PR-URL: https://github.com/nodejs/node/pull/61198
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-08-17 10:44:15 +02:00
avivkeller 4a5eb1cf73 repl: add basic syntax highlighting
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64591
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-25 23:56:46 -07:00
Chengzhong Wu 5022b94fb5 lib: add perfetto support
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/64565
Refs: https://github.com/nodejs/diagnostics/issues/654
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
2026-07-24 14:00:18 +00:00
Paul Bouchon 9df0e9b4d4 assert,util: fix TypeError on Maps with null keys
`assert.deepStrictEqual`, `assert.notDeepStrictEqual`, and
`util.isDeepStrictEqual` threw a `TypeError` instead of returning a
result when one Map had a `null` key with an object value, the other
had an object key with a deeply-equal value but no `null` key, and
both maps were the same size.

In that case `mapObjectEquiv` skipped its primitive and `null` key
handling, which was gated on `array.length !== a.size`, and passed
the `null` key (which is `typeof 'object'`) to the object comparator.
That comparator reads `key.constructor` without a null guard, so it
threw. Handle primitive and `null` keys unconditionally, resolving
them directly against the other map.

Fixes: https://github.com/nodejs/node/issues/64433
Signed-off-by: Paul Bouchon <mail@bitpshr.net>
PR-URL: https://github.com/nodejs/node/pull/64441
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-07-18 16:38:07 +00:00
Antoine du Hamel 5520388f3b lib: use assignFunctionName util where it makes sense
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64515
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-07-17 11:00:54 +00:00
Livia Medeirosandlouiellan 727e2bce8e lib,tools: add node-core/func-name-matching lint rule
And rename functions accordingly.

Signed-off-by: LiviaMedeiros <livia@cirno.name>
Co-authored-by: louiellan <louie.lou.llaneta@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/57901
Refs: https://github.com/nodejs/node/issues/57899
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-07-14 15:30:56 +02:00
Ijtihed Kilani ff58f43f45 util: fix OOM in inspect color stack formatting
Signed-off-by: Ijtihed Kilani <ijtihedk@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64022
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-06-23 19:21:47 +00:00
Daijiro Wachi 5ee27e3f24 util: fix scientific notation formatting
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63823
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-06-16 02:30:40 +00:00
Daijiro Wachi 3ad2463848 util: fix -0 formatting when numericSeparator is enabled
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63815
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-06-15 17:55:40 +09:00
Filip Skokan b3ae59d7c6 crypto: harden KeyObject internal slots
Move KeyObject type and handle storage behind NativeKeyObject and
expose it to JS through a module-private slot reader, mirroring the
CryptoKey hardening. Cache the native slot tuple in a private field
and lazily derive secret and asymmetric metadata from the cached
KeyObjectHandle.

Update internal crypto, QUIC, and comparison callers to use private
helpers instead of public KeyObject accessors. Keep getKeyObjectSlots
restricted to internal/crypto/keys with an ESLint guard.

Add regression coverage for brand checks, hidden slots, clone and
transfer behavior, own-property reflection, and post-clone crypto
operations. Extend the CryptoKey brand test to assert getSlots is not
reachable through the public constructor or prototype chain.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63111
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-05-08 07:10:03 +00:00
Filip Skokan 25f80fb764 src: decouple KeyObject and CryptoKey and move CryptoKey to src
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62924
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-05-04 00:09:07 +02:00
René 1bc6394601 lib: use js-only implementation of isDataView()
PR-URL: https://github.com/nodejs/node/pull/62780
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-04-18 20:04:06 +00:00
Ruben Bridgewater 8db9d43c45 assert,util: fix stale nested cycle memo entries
Temporary nested cycle-tracking entries could remain in the memory set
after a successful comparison. If a later sibling comparison reused one
of those objects, deepStrictEqual could incorrectly fail for equivalent
structures.
This cleans up the temporary nested entries after the nested
comparison returns.

Fixes: https://github.com/nodejs/node/issues/62422
PR-URL: https://github.com/nodejs/node/pull/62509
Fixes: https://github.com/nodejs/node/issues/62422
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-04-09 16:48:25 +00:00
Hiroki Osame febcecdaaf util: add fast path to stripVTControlCharacters
PR-URL: https://github.com/nodejs/node/pull/61833
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-02-24 19:30:35 +00:00
Ruben Bridgewater 27a7bbc624 assert: fix loose deepEqual arrays with undefined and null failing
The comparison has to accept these as identical.

Fixes: https://github.com/nodejs/node/issues/61583
PR-URL: https://github.com/nodejs/node/pull/61587
Reviewed-By: Jithil P Ponnan <jithil@outlook.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2026-02-01 13:00:17 +00:00
Ruben Bridgewater 955d347884 assert,util: fix deep comparison for sets and maps with mixed types
When comparing a Set or a Map and they contain primitives as keys
as well as objects, the primitives would always be skipped. That
is not correct, since that may only be skipped in case all keys
are objects.

Fixes: https://github.com/nodejs/node/issues/61386
PR-URL: https://github.com/nodejs/node/pull/61388
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-01-17 01:12:45 +00:00
Ruben Bridgewater 5c8ce910bd assert,util: improve comparison performance
This makes sure that the toStringTag symbol is used, if available
instead of calculating the toString() value each time, if not
needed (the type checks make a brand check, so there is no need to
check the toStringTag, if non is defined on the object).

PR-URL: https://github.com/nodejs/node/pull/61176
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-12-29 16:50:44 +00:00
Ruben Bridgewater 9120924de1 util: fix nested proxy inspection
Fixes: https://github.com/nodejs/node/issues/61061
PR-URL: https://github.com/nodejs/node/pull/61077
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2025-12-22 22:22:04 +00:00
Ruben Bridgewater fc1d6d6b4c assert,util: fix deep comparing invalid dates skipping properties
The property comparison of invalid dates regressed when starting
to handle invalid dates as being equal.

PR-URL: https://github.com/nodejs/node/pull/61076
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-12-22 19:30:35 +00:00
Ruben Bridgewater a968e4e672 assert,util: improve deep comparison performance
PR-URL: https://github.com/nodejs/node/pull/61076
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-12-22 19:30:34 +00:00
Ruben Bridgewater 26b7fd2009 util: limit inspect to only show own properties
`Error`'s `cause` and `errors` properties would be visible even if these
were not own properties. This is changed to align with all other
parts of the `inspect` handling.

Fixes: https://github.com/nodejs/node/issues/60717
PR-URL: https://github.com/nodejs/node/pull/61032
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-12-22 14:06:14 +01:00
Ruben Bridgewater dc97b507d0 util: mark proxied objects as such when inspecting them
Fixes: https://github.com/nodejs/node/issues/60964
PR-URL: https://github.com/nodejs/node/pull/61029
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2025-12-20 17:02:17 +00:00
azadgupta1 060deae99b util: fix parseArgs skipping positional arg with --eval and --print
PR-URL: https://github.com/nodejs/node/pull/60814
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
2025-12-11 01:09:02 +00:00
Yves M. ca5956cb7a util: safely inspect getter errors whose message throws
PR-URL: https://github.com/nodejs/node/pull/60684
Fixes: https://github.com/nodejs/node/issues/60683
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-11-27 11:06:24 +00:00
Ge Gao fbef1cf438 util: fix stylize of special properties in inspect
Previously, formatExtraProperties applied ctx.stylize to the entire
'[key]: value' string. This caused the colon and space to be styled,
making the output inconsistent with normal object properties.

Now, only the key itself is stylized, and the colon and space remain
unstyled, aligning with the formatting of regular properties.

Refs: https://github.com/nodejs/node/pull/60131
PR-URL: https://github.com/nodejs/node/pull/60479
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-31 08:33:38 +00:00
Antoine du Hamel 2fb82c8c28 util: use more defensive code when inspecting error objects
PR-URL: https://github.com/nodejs/node/pull/60139
Fixes: https://github.com/nodejs/node/issues/60107
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-20 18:14:39 +00:00
Ruben Bridgewater 70e7c1511f util: mark special properties when inspecting them
This makes sure special properties (such as a byteLength, buffer,
and more) are marked that they are not regular properties. They
are mostly getters, that just seemed even more of a breaking change.
Thus, they just use square brackets for now.

On top of that, it makes inspecting detached DataViews robust.
Inspecting those failed so far.

PR-URL: https://github.com/nodejs/node/pull/60131
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-10-18 21:29:35 +02:00
Ruben Bridgewater c2536adc28 console,util: improve array inspection performance
There is no need to do the own property check, since the descriptor
is needed right afterwards anyway.

PR-URL: https://github.com/nodejs/node/pull/60037
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-09-30 15:32:40 +02:00
Miguel Marcondes Filho aa6838c252 lib: update inspect output format for subclasses
PR-URL: https://github.com/nodejs/node/pull/59687
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-21 06:28:45 +00:00
Miguel Marcondes Filho 4ed9d21880 lib: update isDeepStrictEqual to support options
PR-URL: https://github.com/nodejs/node/pull/59762
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-14 00:39:49 +00:00
Ruben Bridgewater 60c1fbcf65 util: inspect objects with throwing Symbol.toStringTag
`util.inspect()` should handle all kinds of input, even if it is
not well defined. Throwing is something that is meant to be worked
around in all known cases. This fixes issues inspecting objects
where accessing the Symbol.toStringTag would cause an error. The
symbol is just ignored in that case.

Refs: https://github.com/nodejs/node/issues/55539
Refs: https://github.com/nodejs/node/pull/55544
PR-URL: https://github.com/nodejs/node/pull/59860
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-14 00:07:06 +00:00
Ruben Bridgewater 0319ba51d8 util: fix debuglog.enabled not being present with callback logger
The method returned by the callback is missing the .enabled property.
This is added in a consistent way that it also verifies that it's a
getter.

Fixes: https://github.com/nodejs/node/issues/56676
PR-URL: https://github.com/nodejs/node/pull/59858
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-14 00:06:57 +00:00
sangwook 670d7ab7f2 util: fix numericSeparator with negative fractional numbers
Fix util.inspect() formatting bug where negative fractional numbers
between -1 and 0 lost their minus sign when numericSeparator was true.
Fixed formatNumber function to preserve sign by using original string
representation. Also corrected test expectations for scientific notation
to not apply numeric separators.
Fixes: https://github.com/nodejs/node/issues/59376

PR-URL: https://github.com/nodejs/node/pull/59379
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-08 20:10:50 +00:00
Ruben Bridgewater 0f58a3d0cb util: hide duplicated stack frames when using util.inspect
Long stack traces often have duplicated stack frames from recursive
calls. These make it difficult to identify important parts of the
stack. This hides the duplicated ones and notifies the user which
lines were hidden.

PR-URL: https://github.com/nodejs/node/pull/59447
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-09-05 17:15:12 +00:00
Ruben Bridgewater fdef0725de util,console: colorize regexp groups, character classes, etc
This adds a parser to parse the regular expression and to highlight
different parts of a regular expression in case colors are active.

It is a one time pass algorithm and should therefore not cause too
much overhead during parsing.

As side effect, it is now possible to create individual styles to
colorize inspected values values as a user likes. This might for
example be expanded to numbers with numeric separators, highlighting
the separators or decimal points different.

It would in theory also be possible to return a changed string.
That is however not the intention for this API as it is only
triggered in case colors are active.

PR-URL: https://github.com/nodejs/node/pull/59710
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-09-05 14:29:21 +00:00
Filip Skokan 9d744b5b63 crypto: use CryptoKey internal slots in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59538
Fixes: https://github.com/nodejs/node/issues/59535
Fixes: https://github.com/nodejs/node/issues/59534
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-21 14:14:57 +00:00
Ruben Bridgewater 7c9fbc15bc assert,util: fail promise comparison in deep equal checks
It is impossible to look into the content of a promise and its
state. This aligns the comparison with WeakMaps and WeakSets.
Only reference equal promises will pass the check in the future.

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

PR-URL: https://github.com/nodejs/node/pull/59448
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-08-19 10:22:35 +00:00
Ruben Bridgewater 8973589620 util: fix error's namespaced node_modules highlighting using inspect
When inspecting errors, node_modules are highlighted with an
underscore. So far namespaced modules only highlighted the namespace
but not the rest of the module name. This is fixed by matching the
full name.
As drive-by it improves the performance slightly by removing the
regular expression in favor of indexOf to identify the right spot.

PR-URL: https://github.com/nodejs/node/pull/59446
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-08-19 10:22:25 +00:00
Mark S. Miller 3f51cb6229 util: add some additional error classes to wellKnownPrototypes
PR-URL: https://github.com/nodejs/node/pull/59456
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-08-19 11:00:24 +02:00
theanarkh b87312ba08 lib: add trace-sigint APIs
PR-URL: https://github.com/nodejs/node/pull/59040
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-11 09:14:44 +00:00
Yagiz Nizipli 0fd1ecded6 meta: enable jsdoc/check-tag-names rule
PR-URL: https://github.com/nodejs/node/pull/58521
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-07-18 09:28:21 +00:00
Ruben Bridgewater 11222f1a27 assert,util: handle invalid dates as equal in deep comparison
Invalid dates are now handled as equal in all deep comparisons.

PR-URL: https://github.com/nodejs/node/pull/57627
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-21 04:00:23 +00:00
Sam Verschueren ea5d37ecbe util: inspect: do not crash on an Error stack pointing to itself
PR-URL: https://github.com/nodejs/node/pull/58196
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-16 23:36:47 +00:00
Livia Medeiros afd318db67 assert: support Float16Array in loose deep equality checks
PR-URL: https://github.com/nodejs/node/pull/57881
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-19 17:04:03 +00:00
Ruben Bridgewater 733e0fc2c4 assert,util: fix constructor lookup in deep equal comparison
The latest performance optimization did not take into account that
an object may have a property called constructor. This is addressed
in this PR by adding a new fast path and using fallbacks.

PR-URL: https://github.com/nodejs/node/pull/57876
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-04-19 11:10:40 +00:00
Shima Ryuhei d8e9e05a27 util: fix formatting of objects with built-in Symbol.toPrimitive
Fixes: https://github.com/nodejs/node/issues/57818
PR-URL: https://github.com/nodejs/node/pull/57832
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-04-17 13:35:56 +00:00