decord/source/12799_assign.js

133 lines
3.3 KiB
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 12799
// Function ID: 12800
2026-07-29 08:29:29 +00:00
// Name: assign
2026-07-20 16:05:17 +00:00
// Dependencies: []
2026-08-05 07:35:12 +00:00
// Module 12799 (assign)
2026-07-23 10:11:24 +00:00
const exports = setTyped;
2026-08-04 21:03:28 +00:00
let tmp = typeof Uint8Array !== "undefined";
if (typeof Uint8Array !== "undefined") {
2026-07-23 10:11:24 +00:00
let _Uint16Array = Uint16Array;
2026-08-04 21:03:28 +00:00
tmp = typeof Uint16Array !== "undefined";
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
let _Int32Array = Int32Array;
2026-08-04 21:03:28 +00:00
tmp = typeof Int32Array !== "undefined";
2026-07-20 16:05:17 +00:00
}
setTyped.assign = (arg0) => {
let arr;
2026-07-29 08:29:29 +00:00
const call = slice.call;
if (typeof call === "unknown") {
let substr = slice(1);
} else {
substr = call(arguments, 1);
}
if (substr.length) {
2026-07-20 16:05:17 +00:00
while (true) {
2026-07-29 08:29:29 +00:00
arr = substr.shift();
2026-07-20 16:05:17 +00:00
if (arr) {
2026-08-04 21:03:28 +00:00
if (typeof arr !== "object") {
2026-07-20 16:05:17 +00:00
break;
} else {
2026-07-29 08:29:29 +00:00
let tmp10 = arr;
for (const key10013 in arr) {
let tmp11 = key10013;
let _Object = Object;
let call2 = hasOwnProperty.call;
if (typeof call2 === "unknown") {
let hasOwnPropertyResult = hasOwnProperty(key10013);
} else {
hasOwnPropertyResult = call2(arr, key10013);
}
if (!hasOwnPropertyResult) {
continue;
} else {
arg0[key10013] = arr[key10013];
2026-07-20 16:05:17 +00:00
continue;
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
}
}
}
const _TypeError = TypeError;
const typeError = new TypeError(arr + "must be non-object");
throw typeError;
}
return arg0;
};
setTyped.shrinkBuf = (subarray) => {
if (subarray.length === arg1) {
return subarray;
} else if (subarray.subarray) {
let subarrayResult = subarray.subarray(0, arg1);
} else {
subarray.length = arg1;
subarrayResult = subarray;
}
};
let closure_1 = {
arraySet(subarray, subarray2) {
if (subarray2.subarray) {
if (subarray.subarray) {
const result = subarray.set(subarray2.subarray(arg2, arg2 + arg3), arg4);
}
}
for (let num = 0; num < arg3; num = num + 1) {
subarray[arg4 + num] = subarray2[arg2 + num];
}
},
flattenChunks(arg0) {
let num = 0;
let num2 = 0;
let num3 = 0;
if (0 < arg0.length) {
do {
2026-07-29 08:29:29 +00:00
num = num + arg0[num2].length;
num2 = num2 + 1;
num3 = num;
} while (num2 < length);
2026-07-20 16:05:17 +00:00
}
const uint8Array = new Uint8Array(num3);
let num4 = 0;
2026-07-29 08:29:29 +00:00
for (let num5 = 0; num5 < length2; num5 = num5 + 1) {
let arr = arg0[num5];
let result = uint8Array.set(arr, num4);
num4 = num4 + arr.length;
2026-07-20 16:05:17 +00:00
}
return uint8Array;
}
};
let closure_2 = {
arraySet(arg0, arg1, arg2, arg3, arg4) {
for (let num = 0; num < arg3; num = num + 1) {
arg0[arg4 + num] = arg1[arg2 + num];
}
},
flattenChunks(arg0) {
const concat = [].concat;
return concat.apply([], arg0);
}
};
setTyped.setTyped = (arg0) => {
2026-07-23 10:11:24 +00:00
let obj = exports;
2026-07-20 16:05:17 +00:00
if (arg0) {
const _Uint8Array = Uint8Array;
obj.Buf8 = Uint8Array;
const _Uint16Array = Uint16Array;
obj.Buf16 = Uint16Array;
const _Int32Array = Int32Array;
obj.Buf32 = Int32Array;
obj = obj.assign(obj, closure_1);
} else {
const _Array = Array;
obj.Buf8 = Array;
const _Array2 = Array;
obj.Buf16 = Array;
const _Array3 = Array;
obj.Buf32 = Array;
obj = obj.assign(obj, closure_2);
}
};
setTyped.setTyped(tmp);