mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 23:56:58 +00:00

This commit adds a method to internal/process that allows access to bindings that are not intended to be used by user code. It has a separate cache object and modlist in order to avoid collisions. You can use NODE_MODULE_CONTEXT_AWARE_INTERNAL to register a C++ module as an internal. PR-URL: https://github.com/nodejs/node/pull/15759 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
11 lines
263 B
JavaScript
11 lines
263 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
assert.strictEqual(undefined, process._internalBinding);
|
|
assert.strictEqual(undefined, process.internalBinding);
|
|
assert.throws(() => {
|
|
process.binding('module_wrap');
|
|
}, /No such module/);
|