Bootstrap per-realm callbacks like `prepare_stack_trace_callback` in the ShadowRealm. This enables stack trace decoration in the ShadowRealm. PR-URL: https://github.com/nodejs/node/pull/47107 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
27 lines
591 B
JavaScript
27 lines
591 B
JavaScript
// Flags: --expose-internals
|
|
|
|
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
assert.throws(
|
|
() => {
|
|
require('internal/bootstrap/realm');
|
|
}, {
|
|
code: 'MODULE_NOT_FOUND',
|
|
message: /Cannot find module 'internal\/bootstrap\/realm'/
|
|
}
|
|
);
|
|
|
|
assert.throws(
|
|
() => {
|
|
const source = 'module.exports = require("internal/bootstrap/realm")';
|
|
const { internalBinding } = require('internal/test/binding');
|
|
internalBinding('natives').owo = source;
|
|
require('owo');
|
|
}, {
|
|
code: 'MODULE_NOT_FOUND',
|
|
message: /Cannot find module 'owo'/
|
|
}
|
|
);
|