Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions test/parallel/test-accessor-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,16 @@ const UDP = internalBinding('udp_wrap').UDP;
}, TypeError);

const StreamWrapProto = Object.getPrototypeOf(TTY.prototype);
const properties = ['bytesRead', 'fd', '_externalStream'];

// Should not throw for Object.getOwnPropertyDescriptor
assert.strictEqual(
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, 'bytesRead'),
'object'
);

assert.strictEqual(
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, 'fd'),
'object'
);

assert.strictEqual(
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, '_externalStream'),
'object'
);

assert.strictEqual(
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, 'fd'),
'object'
);
properties.forEach((property) => {
// Should not throw for Object.getOwnPropertyDescriptor
assert.strictEqual(
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, property),
'object',
'typeof property descriptor ' + property + ' is not \'object\''
);
});

if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
// There are accessor properties in crypto too
Expand Down