Files
asciidisco.com/build/node_modules/prepack/lib/intrinsics/node/bootstrap.js
2023-08-01 13:49:46 +02:00

29 lines
954 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (realm) {
// Extract the bootstrap source code from the hosting Node version.
var nodeSourceCode = process.binding("natives");
var bootstrapSource = nodeSourceCode["internal/bootstrap_node"];
var bootstrapFilename = "bootstrap_node.js";
if (!bootstrapSource) {
throw new _errors.FatalError("The node-cli mode is only compatible with Node 7.");
}
// We evaluate bootstrap script to get the bootstrap function.
var bootstrapFn = realm.$GlobalEnv.execute(bootstrapSource, bootstrapFilename, "");
if (!(bootstrapFn instanceof _index.FunctionValue) || !bootstrapFn.$Call) {
throw new _errors.FatalError("The node bootstrap script should always yield a function.");
}
return bootstrapFn;
};
var _errors = require("../../errors.js");
var _index = require("../../values/index.js");
//# sourceMappingURL=bootstrap.js.map