summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-11-30 11:04:34 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-12-07 00:38:28 +0100
commitc430aebe8683699fc072cb87e5be03af370a3f2f (patch)
tree3f93ee11527492d5295853b93c0252a4afafa423 /test
parentbdb1083ef54cf99c959c554b741e62943b56e2af (diff)
downloadandroid-node-v8-c430aebe8683699fc072cb87e5be03af370a3f2f.tar.gz
android-node-v8-c430aebe8683699fc072cb87e5be03af370a3f2f.tar.bz2
android-node-v8-c430aebe8683699fc072cb87e5be03af370a3f2f.zip
util: improve performance inspecting proxies
This makes sure we do not retrieve the handler in case it's not required. This improves the performance a tiny bit for these cases. PR-URL: https://github.com/nodejs/node/pull/30767 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-util-inspect-proxy.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/parallel/test-util-inspect-proxy.js b/test/parallel/test-util-inspect-proxy.js
index da0512eda1..c684026b19 100644
--- a/test/parallel/test-util-inspect-proxy.js
+++ b/test/parallel/test-util-inspect-proxy.js
@@ -43,10 +43,13 @@ util.inspect(proxyObj, opts);
// getProxyDetails is an internal method, not intended for public use.
// This is here to test that the internals are working correctly.
-const details = processUtil.getProxyDetails(proxyObj);
+let details = processUtil.getProxyDetails(proxyObj, true);
assert.strictEqual(target, details[0]);
assert.strictEqual(handler, details[1]);
+details = processUtil.getProxyDetails(proxyObj, false);
+assert.strictEqual(target, details);
+
assert.strictEqual(
util.inspect(proxyObj, opts),
'Proxy [\n' +
@@ -105,7 +108,7 @@ const expected6 = 'Proxy [\n' +
' ]\n' +
']';
assert.strictEqual(
- util.inspect(proxy1, { showProxy: true, depth: null }),
+ util.inspect(proxy1, { showProxy: 1, depth: null }),
expected1);
assert.strictEqual(util.inspect(proxy2, opts), expected2);
assert.strictEqual(util.inspect(proxy3, opts), expected3);