util: fix constructor/instanceof checks · nodejs/node@c93e267 · GitHub
Skip to content

Commit c93e267

Browse files
mscdexrvagg
authored andcommitted
util: fix constructor/instanceof checks
These new checks are similar to the one introduced in 089d688, 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: #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>
1 parent aaeced9 commit c93e267

2 files changed

Lines changed: 22 additions & 8 deletions

File tree

lib/util.js

Lines changed: 12 additions & 8 deletions

test/parallel/test-util-inspect.js

Lines changed: 10 additions & 0 deletions

0 commit comments

Comments
 (0)