| 451 | } |
| 452 | |
| 453 | std::string gjs_debug_bigint(JS::BigInt* bi) { |
| 454 | // technically this prints the value % INT64_MAX, cast into an int64_t if |
| 455 | // the value is negative, otherwise cast into uint64_t |
| 456 | std::ostringstream out; |
| 457 | if (JS::BigIntIsNegative(bi)) |
| 458 | out << JS::ToBigInt64(bi); |
| 459 | else |
| 460 | out << JS::ToBigUint64(bi); |
| 461 | out << "n (modulo 2^64)"; |
| 462 | return out.str(); |
| 463 | } |
| 464 | |
| 465 | enum Quotes : uint8_t { |
| 466 | DoubleQuotes, |
no outgoing calls