-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: migrate process.binding to internalBinding
Migrate various modules from using process.binding to internalBinding. PR-URL: #24952 Refs: #22160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
- Loading branch information
Showing
12 changed files
with
52 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 30 additions & 10 deletions
40
test/parallel/test-process-binding-internalbinding-whitelist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,41 @@ | ||
// Flags: --no-warnings | ||
'use strict'; | ||
|
||
require('../common'); | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
|
||
// Assert that whitelisted internalBinding modules are accessible via | ||
// process.binding(). | ||
assert(process.binding('uv')); | ||
assert(process.binding('http_parser')); | ||
assert(process.binding('v8')); | ||
assert(process.binding('stream_wrap')); | ||
assert(process.binding('signal_wrap')); | ||
assert(process.binding('contextify')); | ||
assert(process.binding('url')); | ||
assert(process.binding('spawn_sync')); | ||
assert(process.binding('js_stream')); | ||
assert(process.binding('async_wrap')); | ||
assert(process.binding('buffer')); | ||
assert(process.binding('cares_wrap')); | ||
assert(process.binding('constants')); | ||
assert(process.binding('contextify')); | ||
if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check | ||
assert(process.binding('crypto')); | ||
} | ||
assert(process.binding('fs')); | ||
assert(process.binding('fs_event_wrap')); | ||
assert(process.binding('http_parser')); | ||
if (common.hasIntl) { | ||
assert(process.binding('icu')); | ||
} | ||
assert(process.binding('inspector')); | ||
assert(process.binding('js_stream')); | ||
assert(process.binding('natives')); | ||
assert(process.binding('os')); | ||
assert(process.binding('pipe_wrap')); | ||
assert(process.binding('signal_wrap')); | ||
assert(process.binding('spawn_sync')); | ||
assert(process.binding('stream_wrap')); | ||
assert(process.binding('tcp_wrap')); | ||
if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check | ||
assert(process.binding('tls_wrap')); | ||
} | ||
assert(process.binding('tty_wrap')); | ||
assert(process.binding('udp_wrap')); | ||
assert(process.binding('url')); | ||
assert(process.binding('util')); | ||
assert(process.binding('uv')); | ||
assert(process.binding('v8')); | ||
assert(process.binding('zlib')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters