diff options
author | cjihrig <cjihrig@gmail.com> | 2018-08-23 10:20:12 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-08-29 12:28:51 -0400 |
commit | df073cdda4d9f3afb5ae7a5dd0bd153537b66181 (patch) | |
tree | 81e9886842ec2cd1aab4218d01c1d43c393864a6 /test/pseudo-tty | |
parent | 1abbe0a2123e8333922894258389c2d5c1568472 (diff) | |
download | node-new-df073cdda4d9f3afb5ae7a5dd0bd153537b66181.tar.gz |
tty: make process.binding('tty_wrap') internal
PR-URL: https://github.com/nodejs/node/pull/22477
Refs: https://github.com/nodejs/node/issues/22160
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'test/pseudo-tty')
-rw-r--r-- | test/pseudo-tty/ref_keeps_node_running.js | 4 | ||||
-rw-r--r-- | test/pseudo-tty/test-async-wrap-getasyncid-tty.js | 2 | ||||
-rw-r--r-- | test/pseudo-tty/test-handle-wrap-isrefed-tty.js | 4 | ||||
-rw-r--r-- | test/pseudo-tty/test-tty-window-size.js | 4 | ||||
-rw-r--r-- | test/pseudo-tty/test-tty-wrap.js | 2 |
5 files changed, 11 insertions, 5 deletions
diff --git a/test/pseudo-tty/ref_keeps_node_running.js b/test/pseudo-tty/ref_keeps_node_running.js index 7832e9ee21..52761c140e 100644 --- a/test/pseudo-tty/ref_keeps_node_running.js +++ b/test/pseudo-tty/ref_keeps_node_running.js @@ -1,8 +1,10 @@ +// Flags: --expose-internals --no-warnings 'use strict'; require('../common'); -const { TTY, isTTY } = process.binding('tty_wrap'); +const { internalBinding } = require('internal/test/binding'); +const { TTY, isTTY } = internalBinding('tty_wrap'); const strictEqual = require('assert').strictEqual; strictEqual(isTTY(0), true, 'fd 0 is not a TTY'); diff --git a/test/pseudo-tty/test-async-wrap-getasyncid-tty.js b/test/pseudo-tty/test-async-wrap-getasyncid-tty.js index 030ae9fdff..80ffe9e7cc 100644 --- a/test/pseudo-tty/test-async-wrap-getasyncid-tty.js +++ b/test/pseudo-tty/test-async-wrap-getasyncid-tty.js @@ -5,9 +5,9 @@ const common = require('../common'); const assert = require('assert'); -const tty_wrap = process.binding('tty_wrap'); const { internalBinding } = require('internal/test/binding'); const { TTYWRAP } = internalBinding('async_wrap').Providers; +const tty_wrap = internalBinding('tty_wrap'); const providers = { TTYWRAP }; // Make sure that the TTYWRAP Provider is tested. diff --git a/test/pseudo-tty/test-handle-wrap-isrefed-tty.js b/test/pseudo-tty/test-handle-wrap-isrefed-tty.js index 33b59b3f1a..3654d4a15f 100644 --- a/test/pseudo-tty/test-handle-wrap-isrefed-tty.js +++ b/test/pseudo-tty/test-handle-wrap-isrefed-tty.js @@ -1,3 +1,4 @@ +// Flags: --expose-internals --no-warnings 'use strict'; // see also test/parallel/test-handle-wrap-isrefed.js @@ -6,7 +7,8 @@ const common = require('../common'); const strictEqual = require('assert').strictEqual; const ReadStream = require('tty').ReadStream; const tty = new ReadStream(0); -const isTTY = process.binding('tty_wrap').isTTY; +const { internalBinding } = require('internal/test/binding'); +const isTTY = internalBinding('tty_wrap').isTTY; strictEqual(isTTY(0), true, 'tty_wrap: stdin is not a TTY'); strictEqual(Object.getPrototypeOf(tty._handle).hasOwnProperty('hasRef'), true, 'tty_wrap: hasRef() missing'); diff --git a/test/pseudo-tty/test-tty-window-size.js b/test/pseudo-tty/test-tty-window-size.js index 782b66802e..2a9891bd19 100644 --- a/test/pseudo-tty/test-tty-window-size.js +++ b/test/pseudo-tty/test-tty-window-size.js @@ -1,8 +1,10 @@ +// Flags: --expose-internals --no-warnings 'use strict'; const common = require('../common'); const assert = require('assert'); const { WriteStream } = require('tty'); -const { TTY } = process.binding('tty_wrap'); +const { internalBinding } = require('internal/test/binding'); +const { TTY } = internalBinding('tty_wrap'); const getWindowSize = TTY.prototype.getWindowSize; function monkeyPatchGetWindowSize(fn) { diff --git a/test/pseudo-tty/test-tty-wrap.js b/test/pseudo-tty/test-tty-wrap.js index cb961d0403..917f04869a 100644 --- a/test/pseudo-tty/test-tty-wrap.js +++ b/test/pseudo-tty/test-tty-wrap.js @@ -3,7 +3,7 @@ require('../common'); const { internalBinding } = require('internal/test/binding'); -const { TTY } = process.binding('tty_wrap'); +const { TTY } = internalBinding('tty_wrap'); const { WriteWrap } = internalBinding('stream_wrap'); const handle = new TTY(1); |