Commit Graph

4 Commits

Author SHA1 Message Date
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
1fbe3351ba
assert: improve partialDeepStrictEqual performance
This implements fast paths for typed arrays, array buffers and sets
and maps that contain only objects as keys.

PR-URL: https://github.com/nodejs/node/pull/57509
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2025-03-19 23:50:56 +00:00
Ruben Bridgewater
ebbc5f7017 assert: implement partial error comparison
assert.partialDeepStrictEqual now also handled error properties as
expected. On top of that, the main implementation also handles
non-string `name` and `message` properties and the comparison is a
tad faster by removing duplicated comparison steps.

As a drive-by fix this also cleans up some code by abstracting code
and renaming variables for clarity.

PR-URL: https://github.com/nodejs/node/pull/57370
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2025-03-12 18:26:17 +00:00
Ruben Bridgewater
096b61131a benchmark: skip running some assert benchmarks by default
These benchmarks are not frequently needed and just slow down the
default benchmark suite. They are kept for users who want to run
them but deactivated by default.

PR-URL: https://github.com/nodejs/node/pull/57370
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2025-03-12 18:26:15 +00:00