decord/source/__polyfill/04xxx/module_4902.js
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

104 lines
3 KiB
JavaScript

// Module ID: 4902
// Function ID: 4903
// Dependencies: [1454, 4903, 4904, 4905]
// Module 4902
import _mod1454 from "module_1454" /* 1454 */;
import _mod4903 from "module_4903" /* 4903 */;
let tmp = typeof Symbol === "function";
if (typeof Symbol === "function") {
let _Symbol = Symbol;
tmp = typeof Symbol.iterator === "symbol";
}
let closure_2 = tmp;
export default function ToPrimitive(arg0) {
let tmp22;
if (_mod4903(arg0)) {
return arg0;
} else {
let str2 = "default";
if (arguments.length > 1) {
const _String = String;
let str3 = "string";
if (arguments[1] !== String) {
const _Number = Number;
let str4 = "default";
if (arguments[1] === Number) {
str4 = "number";
}
str3 = str4;
}
str2 = str3;
}
if (!closure_2) {
{
let tmp16 = "default" === str2;
if (tmp16) {
tmp16 = tmp(4905)(arg0) || tmp(4904)(arg0);
const tmp15 = tmp(4905)(arg0) || tmp(4904)(arg0);
}
let str8 = str2;
if (tmp16) {
str8 = "string";
}
let str10 = "number";
if ("default" !== str8) {
str10 = str8;
}
if (null == arg0) {
const _TypeError4 = TypeError;
const typeError = new TypeError("Cannot call method on " + arg0);
throw typeError;
} else {
if (typeof str10 === "string") {
const arr = "string" === str10 ? ["toString", "valueOf"] : ["valueOf", "toString"];
let num2 = 0;
if (0 < arr.length) {
while (true) {
let tmp18 = arg0[arr[num2]];
let tmp19 = require;
if (_mod1454(tmp18)) {
let call = tmp18.call;
tmp22 = typeof call === "unknown" ? tmp18() : call(arg0);
if (tmp19(4903)(tmp22)) {
break;
}
}
num2 = num2 + 1;
}
return tmp22;
}
const _TypeError2 = TypeError;
const typeError1 = new TypeError("No default value");
throw typeError1;
}
const _TypeError3 = TypeError;
const typeError2 = new TypeError("hint must be \"string\" or \"number\"");
throw typeError2;
}
}
} else {
const _Symbol = Symbol;
if (Symbol.toPrimitive) {
const _Symbol3 = Symbol;
let tmp8;
if (null != arg0[toPrimitive]) {
tmp8 = tmp6;
if (!tmp(1454)(tmp6)) {
const _TypeError = TypeError;
const _String2 = String;
const text = `${tmp6} returned for property `;
const typeError3 = new TypeError(`${tmp6} returned for property ` + String(toPrimitive) + " of object " + arg0 + " is not a function");
throw typeError3;
}
}
let valueOf = tmp8;
} else if (tmp(4904)(arg0)) {
const _Symbol2 = Symbol;
valueOf = Symbol.prototype.valueOf;
}
}
}
};