appcelerator/hyperloop-common — pull request #13 by infosia (2014-06-11 02:40:29+00:00)
Title: Add support for function and struct

Add support for function and struct

structs are treated as pointer inside native object. NativeObject->release should be responsible for deleting it.

(e.g. CGPointMake)
```c++
EXPORTAPI JSValueRef CGPointMake_function(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
auto x$0 = static_cast(JSValueToNumber(ctx,arguments[0],exception));
auto y$1 = static_cast(JSValueToNumber(ctx,arguments[1],exception));
CGPoint cgpoint$ = CGPointMake(x$0, y$1);
CGPoint * cgpoint = (CGPoint *)malloc(sizeof(CGPoint));
memcpy(cgpoint,&cgpoint$,sizeof(CGPoint));
return CGPoint_ToJSValue(ctx,cgpoint,exception);
}
```