Skip to content

Commit f9a0b52

Browse files
committed
util: keep proxies opaque in util.inspect when showProxy is false (lint fixed)
1 parent 51cb28c commit f9a0b52

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/parallel/test-util-inspect-proxy.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,10 @@ assert.strictEqual(util.inspect(proxy11), expected11);
191191
const nestedThrowingProxy = new Proxy(throwingProxy, {});
192192

193193
// showProxy: false must NOT trigger proxy traps
194-
assert.doesNotThrow(() => {
195-
const result = util.inspect(throwingProxy, { showProxy: false });
196-
assert.strictEqual(result, '{}');
197-
});
194+
// Directly inspect proxies; it should not throw
195+
const result1 = util.inspect(throwingProxy, { showProxy: false });
196+
assert.strictEqual(result1, '{}');
198197

199-
assert.doesNotThrow(() => {
200-
const result = util.inspect(nestedThrowingProxy, { showProxy: false });
201-
assert.strictEqual(result, '{}');
202-
});
198+
const result2 = util.inspect(nestedThrowingProxy, { showProxy: false });
199+
assert.strictEqual(result2, '{}');
203200
}

0 commit comments

Comments
 (0)