func (ctx *Context) newErrorOrPanic(message string) C.JSValueRef { obj, err := ctx.NewError(message) if err != nil { panic("newErrorOrPanic: " + err.Error()) } // Any JSObjectRef can be safely cast to a JSValueRef. // https://lists.webkit.org/pipermail/webkit-dev/2009-May/007530.html return C.JSValueRef(obj.ref) }
func (ctx *Context) NewValueFrom(raw RawValue) *Value { return ctx.newValue(C.JSValueRef(raw)) }
// ToValue returns the JSValueRef wrapper for the object. // // Any JSObjectRef can be safely cast to a JSValueRef. // https://lists.webkit.org/pipermail/webkit-dev/2009-May/007530.html func (obj *Object) ToValue() *Value { if obj == nil { panic("ToValue() called on nil *Object!") } return obj.ctx.newValue(C.JSValueRef(obj.ref)) }