Skip to content

Instantly share code, notes, and snippets.

@crazy2be
Created July 1, 2011 05:45
Show Gist options
  • Save crazy2be/1057936 to your computer and use it in GitHub Desktop.
Save crazy2be/1057936 to your computer and use it in GitHub Desktop.
My daily WTF.
func nativecallback_CallAsFunction_go(data_ptr unsafe.Pointer, ctx unsafe.Pointer, obj unsafe.Pointer, thisObject unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception *unsafe.Pointer) unsafe.Pointer {
defer func() {
if r := recover(); r != nil {
*exception = unsafe.Pointer(recover_to_javascript((*Context)(ctx), r))
}
}()
data := (*object_data)(data_ptr)
ret := data.val.Interface().(GoFunctionCallback)(
(*Context)(ctx), (*Object)(obj), (*Object)(thisObject), (*[1 << 14]*Value)(arguments)[0:argumentCount])
return unsafe.Pointer(ret)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment