Default parameters via embind

40 views
Skip to first unread message

キャロウ マーク

unread,
May 15, 2020, 4:47:08 PM5/15/20
to emscripten-discuss
I’ve gone back to embind as I got no answers to my webidl_binder questions and lacked time for further investigation ...

Is it possible to have parameters for a function called via embind? I tried a simple experiment where the C++ function had 2 default parameters and the JS call did not include those parameters. I got a binding exception so it looks like it isn’t supported but I want to confirm or otherwise.

Related, it is possible for the JS side to only set some fields in a dictionary (value-object)? If the JS side doesn’t set all the fields I get a binding exception here too. What I really want to do is have the JS side fill in most of the fields in the structure while receiving C++ function side fills in the rest before handing the completed structure off to another C++ function for the actual work. I realize I could do this by copying fields from the incoming value-type into a new native structure with all the fields but I’d like to avoid the copy.

Regards

-Mark
signature.asc
Reply all
Reply to author
Forward
0 new messages