I was able to do following,

    emscripten::val ExampleObject = emscripten::val::object();
    ExampleObjectset("key", value);

It is working, but is this correct way to create native Objects in 
emscripten?

On Tuesday, May 19, 2020 at 2:06:21 PM UTC-5, gerald-dotcom wrote:
>
> I haven't seen a single example of embind::val that pass Object Key Value 
> Pair as an Argument to JavaScript Functions.
>
> Therefore, I decided to try by structuring JSON-style string with C++ and 
> passing it as an argument to that specific function,
>
> '{' + std::string("brandId") + ':' + std::to_string(brandId) + '}'
> However, the Javascript run time not recognize it as an valid Object 
> instead it being parsed as a String literal.
>
> While I'm new to C++, I got slight memory about Struct data type and I 
> decided to give it try, but even though I can pass Struct as an Argument, 
> at run time, it trigger following error,
>
> parameter 1 has unknown type 
> Z9getCarBrandiNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiE10brandStruct
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/ef9f8051-a026-4dae-8572-b26794cbc4e7%40googlegroups.com.

Reply via email to