mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
PR-URL: https://github.com/nodejs/node/pull/61128 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
20 lines
432 B
JavaScript
20 lines
432 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const util = require('util');
|
|
|
|
const symbol = util.inspect.custom;
|
|
|
|
const eventTargetInspect = EventTarget.prototype[symbol];
|
|
|
|
const fakeEventTarget = {
|
|
[symbol]: eventTargetInspect,
|
|
someOtherField: 42
|
|
};
|
|
|
|
// Should not throw when calling the custom inspect method
|
|
const output = util.inspect(fakeEventTarget);
|
|
|
|
assert.strictEqual(typeof output, 'string');
|