From baae49c61b3a93d529842ba61447427297a145db Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Wed, 17 Oct 2018 09:45:11 +0200 Subject: [PATCH 1/2] util,console: handle symbols as defined in the spec The `console` functions rely on the `util.format()` behavior. It did not follow the whatwg spec when it comes to symbols in combination with the %d, %i and %f format specifiers. Using a symbol argument in combination with one of these specifiers resulted in an error instead of returning `'NaN'`. This is now fixed by this patch. --- doc/api/util.md | 4 ++++ lib/util.js | 11 ++++++++++- test/parallel/test-util-format.js | 16 ++++------------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 8b2e7d2e41141e..9c4c6cca40d784 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -183,6 +183,10 @@ property take precedence over `--trace-deprecation` and