fix(ext/node): deep assert compatibility#32434
fix(ext/node): deep assert compatibility#32434Tango992 wants to merge 8 commits intodenoland:mainfrom
assert compatibility#32434Conversation
kajukitli
left a comment
There was a problem hiding this comment.
looks good overall - nice to get 100% assert coverage.
couple small things to note (not blockers):
-
tc_scope rethrow pattern in util.rs - the pattern is sound, but the dummy array allocation after rethrow feels weird. might be worth a brief comment like "v8 will discard this return value" or something. minor readability thing.
-
kKeyObject on CryptoKey - clever solution for making WebCrypto keys comparable with Node's KeyObjects. makes sense.
-
isError refactor - good cleanup, consolidating the
isNativeError || ObjectPrototypeIsPrototypeOf(ErrorPrototype, ...)pattern into a single helper. -
console isURL check - the check does
typeof value.href === 'string'before the prototype check which is good for perf (avoids slower prototype lookup on non-URL objects).
Allows https://github.com/nodejs/node/blob/v24.12.0/test/parallel/test-assert-deep.js to pass. This marks 100% coverage of node compat tests related to the
assertmodule.