prepack
Version:
Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.
38 lines (31 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
var _index = require("../../values/index.js");
var _descriptors = require("../../descriptors.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 9.2.7.1
let func = new _index.NativeFunctionValue(realm, "(function() { throw new TypeError(); })", "", 0, context => {
throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);
}); // ECMA262 9.2.7.1
func.setExtensible(false); // ECMA262 9.2.7.1
func.$DefineOwnProperty("length", new _descriptors.PropertyDescriptor({
value: realm.intrinsics.zero,
writable: false,
configurable: false,
enumerable: false
}));
return func;
}
//# sourceMappingURL=ThrowTypeError.js.map