first commit
This commit is contained in:
29
build/node_modules/prepack/lib/intrinsics/node/bootstrap.js
generated
vendored
Normal file
29
build/node_modules/prepack/lib/intrinsics/node/bootstrap.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"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
|
||||
Reference in New Issue
Block a user