util: fix constructor/instanceof checks
authorBrian White <mscdex@mscdex.net>
Thu, 15 Oct 2015 19:55:42 +0000 (15:55 -0400)
committerMyles Borins <mborins@us.ibm.com>
Tue, 19 Jan 2016 19:52:11 +0000 (11:52 -0800)
commit2d5380ea254ae816d1d6957c81720bf1a0c409fc
treefdb70a387dc503b724690bb0807238a31a847ce0
parentb9c69964bbf0d3f283aa3253b94f1c61f1d54d73
util: fix constructor/instanceof checks

These new checks are similar to the one introduced in 089d68861,
but for other types of objects. Specifically, if an object was
created in a different context, the constructor object will not be
the same as the constructor object in the current context, so we
have to compare constructor names instead.

PR-URL: https://github.com/nodejs/node/pull/3385
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
lib/util.js
test/parallel/test-util-inspect.js