prepack
Version:
Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.
26 lines (19 loc) • 787 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (realm) {
// ECMA262 19.2.1
let func = new _index.NativeFunctionValue(realm, "Function", "Function", 1, (context, args, argCount, NewTarget) => {
// 1. Let C be the active function object.
let C = func;
// 2. Let args be the argumentsList that was passed to this function by [[Call]] or [[Construct]].
args = argCount > 0 ? args : [];
// 3. Return ? CreateDynamicFunction(C, NewTarget, "normal", args).
return _singletons.Create.CreateDynamicFunction(realm, C, NewTarget, "normal", args);
});
return func;
};
var _index = require("../../values/index.js");
var _singletons = require("../../singletons.js");
//# sourceMappingURL=Function.js.map