decord/source/1404_setFunctionLength.js

70 lines
1.9 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 1404
// Function ID: 1405
// Name: setFunctionLength
// Dependencies: [1405, 540, 541, 542, 1406]
// Module 1404 (setFunctionLength)
let closure_2 = require("hasPropertyDescriptors")();
let closure_3 = require("getEvalledConstructor")("%Math.floor%");
2026-08-04 21:03:28 +00:00
export default function setFunctionLength(fn, num) {
if (typeof fn !== "function") {
2026-07-29 08:29:29 +00:00
const tmp25 = new require(541)("`fn` is not a function");
throw tmp25;
} else {
2026-08-04 21:03:28 +00:00
if (typeof num === "number") {
if (num >= 0) {
if (num <= 4294967295) {
if (callback(num) === num) {
2026-07-29 08:29:29 +00:00
let flag = true;
let flag2 = true;
2026-08-04 21:03:28 +00:00
if ("length" in fn) {
2026-07-29 08:29:29 +00:00
flag = true;
flag2 = true;
if (require(542)) {
2026-08-04 21:03:28 +00:00
const tmp4 = tmp2(542)(fn, "length");
2026-07-29 08:29:29 +00:00
let tmp5 = tmp4;
if (tmp4) {
tmp5 = !tmp4.configurable;
}
let flag3 = true;
if (tmp5) {
flag3 = false;
}
let tmp6 = tmp4;
if (tmp4) {
tmp6 = !tmp4.writable;
}
flag = true;
flag2 = flag3;
if (tmp6) {
flag = false;
flag2 = flag3;
}
}
tmp2 = require;
}
if (!flag2) {
flag2 = flag;
}
if (!flag2) {
flag2 = !tmp;
}
if (flag2) {
const tmp10 = require(1406) /* defineDataProperty */;
if (closure_2) {
2026-08-04 21:03:28 +00:00
tmp10(fn, "length", num, true, true);
2026-07-29 08:29:29 +00:00
} else {
2026-08-04 21:03:28 +00:00
tmp10(fn, "length", num);
2026-07-29 08:29:29 +00:00
}
}
2026-08-04 21:03:28 +00:00
return fn;
2026-07-29 08:29:29 +00:00
}
}
}
}
const tmp19 = new require(541)("`length` must be a positive 32-bit integer");
throw tmp19;
}
};