util: correctly inspect Map/Set Iterators
authorEvan Lucas <evanlucas@me.com>
Tue, 29 Sep 2015 19:30:22 +0000 (14:30 -0500)
committerJames M Snell <jasnell@gmail.com>
Thu, 8 Oct 2015 03:39:15 +0000 (20:39 -0700)
commit8dfdee3733465d64ccf23dd737ad5bc38e610b70
tree4fa2cbec4d55562ff39f73e68a648a2ed1c2af90
parentb5c51fdba020e989a4ebf01e5c7fd5868283e9a7
util: correctly inspect Map/Set Iterators

Previously, a MapIterator or SetIterator would
not be inspected properly. This change makes it possible
to inspect them by creating a Debug Mirror and previewing
the iterators to not consume the actual iterator that
we are trying to inspect.

This change also adds a node_util binding that uses
v8's Value::IsSetIterator and Value::IsMapIterator
to verify that the values passed in are actual iterators.

Fixes: https://github.com/nodejs/node/issues/3107
PR-URL: https://github.com/nodejs/node/pull/3119
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
lib/util.js
node.gyp
src/node_util.cc [new file with mode: 0644]
test/parallel/test-util-inspect.js