decord/source/4511_ToNumber.js

29 lines
761 B
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 4511
// Function ID: 4512
2026-07-29 08:29:29 +00:00
// Name: ToNumber
2026-08-05 07:35:12 +00:00
// Dependencies: [540, 4512, 4513, 541, 4518]
2026-07-29 08:29:29 +00:00
2026-08-05 07:35:12 +00:00
// Module 4511 (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-05 07:35:12 +00:00
if (!require(4512) /* isPrimitive */(arg0)) {
tmp3 = tmp(4513)(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-05 07:35:12 +00:00
let tmp5 = tmp(4518)(tmp3);
2026-07-29 08:29:29 +00:00
} else {
tmp5 = +tmp3;
}
return tmp5;
}
};