GlobalInstanceof checks if the value is an instance of the given global constructor
(name string)
| 832 | |
| 833 | // GlobalInstanceof checks if the value is an instance of the given global constructor |
| 834 | func (v *Value) GlobalInstanceof(name string) bool { |
| 835 | ctor := v.ctx.Globals().Get(name) |
| 836 | defer ctor.Free() |
| 837 | if ctor.IsUndefined() { |
| 838 | return false |
| 839 | } |
| 840 | return C.JS_IsInstanceOf(v.ctx.ref, v.ref, ctor.ref) == 1 |
| 841 | } |
| 842 | |
| 843 | // getTypedArrayInfo is a helper function to extract TypedArray information using C API |
| 844 | func (v *Value) getTypedArrayInfo() (buffer *Value, byteOffset, byteLength, bytesPerElement int) { |