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:Roman Reiss <me@silverwind.io>
parent
182b48aa
Please register or sign in to comment