aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-base-prototype-accessors-enumerability.js
blob: f59aced197c5150c0433ae0a0466f97828823ed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict';

require('../common');

// This tests that the prototype accessors added by StreamBase::AddMethods
// are not enumerable. They could be enumerated when inspecting the prototype
// with util.inspect or the inspector protocol.

const assert = require('assert');

// Or anything that calls StreamBase::AddMethods when setting up its prototype
const TTY = process.binding('tty_wrap').TTY;

{
  assert.strictEqual(TTY.prototype.propertyIsEnumerable('bytesRead'), false);
  assert.strictEqual(TTY.prototype.propertyIsEnumerable('fd'), false);
  assert.strictEqual(
    TTY.prototype.propertyIsEnumerable('_externalStream'), false);
}