no message

This commit is contained in:
A1300399510
2024-01-26 11:09:20 +08:00
parent bd7c792cbe
commit 2ff4926405
179 changed files with 27287 additions and 2590 deletions

View File

@@ -8,6 +8,9 @@ var gOPD = require('gopd');
var $TypeError = GetIntrinsic('%TypeError%');
var $floor = GetIntrinsic('%Math.floor%');
/** @typedef {(...args: unknown[]) => unknown} Func */
/** @type {<T extends Func = Func>(fn: T, length: number, loose?: boolean) => T} */
module.exports = function setFunctionLength(fn, length) {
if (typeof fn !== 'function') {
throw new $TypeError('`fn` is not a function');
@@ -32,9 +35,9 @@ module.exports = function setFunctionLength(fn, length) {
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
if (hasDescriptors) {
define(fn, 'length', length, true, true);
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
} else {
define(fn, 'length', length);
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
}
}
return fn;