decord/source/4628_ArrayCreate.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 4628
// Function ID: 4629
2026-07-29 08:29:29 +00:00
// Name: ArrayCreate
2026-08-12 06:57:52 +00:00
// Dependencies: [540, 4625, 541, 4629, 560, 4630, 562]
2026-07-29 08:29:29 +00:00
2026-08-12 06:57:52 +00:00
// Module 4628 (ArrayCreate)
2026-07-29 08:29:29 +00:00
let closure_2 = require("getEvalledConstructor")("%Array.prototype%");
export default function ArrayCreate(arg0) {
2026-08-12 06:57:52 +00:00
if (require(4625) /* isInteger */(arg0)) {
2026-07-29 08:29:29 +00:00
if (arg0 >= 0) {
2026-08-12 06:57:52 +00:00
if (arg0 > tmp(4629)) {
2026-07-29 08:29:29 +00:00
const tmp12 = new tmp(560)("length is greater than (2**32 - 1)");
throw tmp12;
} else {
const tmp3 = arguments.length > 1 ? arguments[1] : closure_2;
const items = [];
if (tmp3 !== closure_2) {
2026-08-12 06:57:52 +00:00
if (tmp(4630)) {
tmp(4630)(items, tmp3);
2026-07-29 08:29:29 +00:00
} else {
const tmp7 = new tmp(562)("ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]");
throw tmp7;
}
}
if (0 !== arg0) {
items.length = arg0;
}
return items;
}
}
}
throw new require(541)("Assertion failed: `length` must be an integer Number >= 0");
};