| 18 | // Make sure all the constants objects don't inherit from Object.prototype |
| 19 | const inheritedProperties = Object.getOwnPropertyNames(Object.prototype); |
| 20 | function test(obj) { |
| 21 | assert(obj); |
| 22 | assert.strictEqual(Object.prototype.toString.call(obj), '[object Object]'); |
| 23 | assert.strictEqual(Object.getPrototypeOf(obj), null); |
| 24 | |
| 25 | inheritedProperties.forEach((property) => { |
| 26 | assert.strictEqual(property in obj, false); |
| 27 | }); |
| 28 | } |
| 29 | |
| 30 | [ |
| 31 | constants, constants.crypto, constants.fs, constants.internal, constants.os, constants.trace, |