prepack
Version:
Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.
35 lines (27 loc) • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
var _index = require("../../values/index.js");
var _singletons = require("../../singletons.js");
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/* strict-local */
function _default(realm) {
// ECMA262 19.2.1
let func = new _index.NativeFunctionValue(realm, "Function", "Function", 1, (context, _args, argCount, NewTarget) => {
let args = _args; // 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;
}
//# sourceMappingURL=Function.js.map