Unverified Commit 5518664d authored by Ruben Bridgewater's avatar Ruben Bridgewater
Browse files

util: if present, fallback to `toString` using the %s formatter

This makes sure that `util.format` uses `String` to stringify an object
in case the object has an own property named `toString` with type
`function`. That way objects that do not have such function are still
inspected using `util.inspect` and the old behavior is preserved as
well.

PR-URL: https://github.com/nodejs/node/pull/27621
Refs: https://github.com/facebook/jest/issues/8443


Reviewed-By: default avatarRoman Reiss <me@silverwind.io>
parent 182b48aa
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment