[jsc-dev] CPP Object passed as parameter

Alexis Barra alexis.barra at gmail.com
Fri Oct 27 13:59:41 PDT 2017


Hey guys,

I want to pass a native object to JS using JSObjectCallAsFunction.

Like I did with the Objective-C wrapper

Person *person = people[0];

NSLog(@"%@", person.firstName);

JSValue *load = context[@"changeName"];

JSValue *loadResult = [load callWithArguments:@[person]];

CPP version.

 JSValueRef exception = 0;

    int argumentCount = 0;

    JSValueRef arguments[argumentCount];

    JSValueRef result = JSObjectCallAsFunction(globalContext, object, 0,
argumentCount, arguments, &exception);


How can I cast a native object to JSValueRef with the C API like
objective-c does?

Thanks!
-- 
Alexis Barra.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/jsc-dev/attachments/20171027/ed41864c/attachment.html>


More information about the jsc-dev mailing list