util: fix check for Array constructor
authorEvan Lucas <evanlucas@me.com>
Mon, 5 Oct 2015 21:29:27 +0000 (16:29 -0500)
committerJames M Snell <jasnell@gmail.com>
Thu, 8 Oct 2015 03:39:15 +0000 (20:39 -0700)
commitb5c51fdba020e989a4ebf01e5c7fd5868283e9a7
tree9c3bdafe709fcf6b626d20c8d4bdab4314fe0e90
parent546e8333baec20da35708238bf1a497ae00122c5
util: fix check for Array constructor

In the event an Array is created in a Debug context, the constructor
will be Array, but !== Array. This adds a check
constructor.name === 'Array' to handle edge cases like that.

PR-URL: https://github.com/nodejs/node/pull/3119
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
lib/util.js
test/parallel/test-util-inspect.js