util: optimize promise introspection
authorBen Noordhuis <info@bnoordhuis.nl>
Wed, 30 Sep 2015 00:07:56 +0000 (02:07 +0200)
committerRod Vagg <rod@vagg.org>
Fri, 2 Oct 2015 03:39:24 +0000 (13:39 +1000)
commitd8ab4e185dc9f664084bb12a66c8e1d136676e9b
tree352ae0c00fee4e5a4eefe4f6001c95d9d39eea7b
parenta0b35bfcf3856da668c987e2920548da780cde01
util: optimize promise introspection

Use V8's builtin ObjectIsPromise() to check that the value is a promise
before creating the promise mirror.  Reduces garbage collector strain
in the (common) non-promise case, which is beneficial when inspecting
deep object graphs.

PR-URL: https://github.com/nodejs/node/pull/3130
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
lib/util.js