ToBigInt64 returns the value converted to int64 using BigInt semantics.
()
| 261 | |
| 262 | // ToBigInt64 returns the value converted to int64 using BigInt semantics. |
| 263 | func (v *Value) ToBigInt64() (int64, error) { |
| 264 | if !v.hasValidContext() { |
| 265 | return 0, errors.New("value context is not available") |
| 266 | } |
| 267 | |
| 268 | val := C.int64_t(0) |
| 269 | if C.JS_ToBigInt64(v.ctx.ref, &val, v.ref) != 0 { |
| 270 | return 0, v.ctx.Exception() |
| 271 | } |
| 272 | |
| 273 | return int64(val), nil |
| 274 | } |
| 275 | |
| 276 | // ToBigUint64 returns the value converted to uint64 using BigInt semantics. |
| 277 | func (v *Value) ToBigUint64() (uint64, error) { |