ToInt64Ext returns the value converted to int64, accepting BigInt inputs.
()
| 289 | |
| 290 | // ToInt64Ext returns the value converted to int64, accepting BigInt inputs. |
| 291 | func (v *Value) ToInt64Ext() (int64, error) { |
| 292 | if !v.hasValidContext() { |
| 293 | return 0, errors.New("value context is not available") |
| 294 | } |
| 295 | |
| 296 | val := C.int64_t(0) |
| 297 | if C.JS_ToInt64Ext(v.ctx.ref, &val, v.ref) != 0 { |
| 298 | return 0, v.ctx.Exception() |
| 299 | } |
| 300 | |
| 301 | return int64(val), nil |
| 302 | } |
| 303 | |
| 304 | // ToPropertyKey returns the value converted to a JavaScript property key. |
| 305 | func (v *Value) ToPropertyKey() (*Value, error) { |