mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 15:35:41 +00:00

Migrate various modules from using process.binding to internalBinding. PR-URL: https://github.com/nodejs/node/pull/24952 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
27 lines
590 B
JavaScript
27 lines
590 B
JavaScript
// Flags: --expose-internals
|
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
common.expectsError(
|
|
() => {
|
|
require('internal/bootstrap/loaders');
|
|
}, {
|
|
code: 'MODULE_NOT_FOUND',
|
|
message: /Cannot find module 'internal\/bootstrap\/loaders'/
|
|
}
|
|
);
|
|
|
|
common.expectsError(
|
|
() => {
|
|
const source = 'module.exports = require("internal/bootstrap/loaders")';
|
|
const { internalBinding } = require('internal/test/binding');
|
|
internalBinding('natives').owo = source;
|
|
require('owo');
|
|
}, {
|
|
code: 'MODULE_NOT_FOUND',
|
|
message: /Cannot find module 'owo'/
|
|
}
|
|
);
|