decord/source/4600_ToNumber.js

29 lines
761 B
JavaScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 4600
// Function ID: 4601
2026-07-29 08:29:29 +00:00
// Name: ToNumber
2026-08-12 06:57:52 +00:00
// Dependencies: [540, 4601, 4602, 541, 4607]
2026-07-29 08:29:29 +00:00
2026-08-12 06:57:52 +00:00
// Module 4600 (ToNumber)
2026-07-29 08:29:29 +00:00
let closure_2 = require("getEvalledConstructor")("%Number%");
export default function ToNumber(arg0) {
let tmp3 = arg0;
2026-08-12 06:57:52 +00:00
if (!require(4601) /* isPrimitive */(arg0)) {
tmp3 = tmp(4602)(arg0, closure_2);
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
if (typeof tmp3 === "symbol") {
2026-07-29 08:29:29 +00:00
const tmp12 = new tmp(541)("Cannot convert a Symbol value to a number");
throw tmp12;
2026-08-04 21:03:28 +00:00
} else if (typeof tmp3 === "bigint") {
2026-07-29 08:29:29 +00:00
const tmp8 = new tmp(541)("Conversion from 'BigInt' to 'number' is not allowed.");
throw tmp8;
} else {
2026-08-04 21:03:28 +00:00
if (typeof tmp3 === "string") {
2026-08-12 06:57:52 +00:00
let tmp5 = tmp(4607)(tmp3);
2026-07-29 08:29:29 +00:00
} else {
tmp5 = +tmp3;
}
return tmp5;
}
};