decord/source/4601_ToNumber.js

29 lines
761 B
JavaScript
Raw Normal View History

2026-08-13 07:00:46 +00:00
// Module ID: 4601
// Function ID: 4602
2026-07-29 08:29:29 +00:00
// Name: ToNumber
2026-08-13 07:00:46 +00:00
// Dependencies: [540, 4602, 4603, 541, 4608]
2026-07-29 08:29:29 +00:00
2026-08-13 07:00:46 +00:00
// Module 4601 (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-13 07:00:46 +00:00
if (!require(4602) /* isPrimitive */(arg0)) {
tmp3 = tmp(4603)(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-13 07:00:46 +00:00
let tmp5 = tmp(4608)(tmp3);
2026-07-29 08:29:29 +00:00
} else {
tmp5 = +tmp3;
}
return tmp5;
}
};