I have Global JavaScript object structured like below,
foo Object
> gee property
>> nee() function
>> zee() function
I used two possible ways to call the nee function, see below,
1 Method
emscripten::val::global("foo").call<void>("gee.nee");
2 Method
emscripten::val::global("foo['gee']").call<void>("nee");
However, none of these working at all instead output errors, see below,
1 Method Output
TypeError: handle[name] is not a function
2 Method Output
TypeError: Cannot read property 'nee' of undefined,TypeError: Cannot read property 'nee' of undefined
I was able to do Object Key based verification through emscripten::val of the Object and can confirm both Object and Property are in Global Scope.
Even though, I was not able to run Object Keys through emscripten::val to grab the functions inside gee Property.
But using Client Side JS, I was able to run Object Keys to grab functions inside gee Property.
I can call same Function through EM_JS but it's not suitable for my project for some obvious reasons.
So, I would like to hear the right way to call this function through emscripten::val?
On May 18, 2020, at 4:23, gerald-dotcom <wregr...@gmail.com> wrote:I have Global JavaScript object structured like below,
foo Object > gee property >> nee() function >> zee() function
I used two possible ways to call the nee function, see below,
1 Method
emscripten::val::global("foo").call<void>("gee.nee");
2 Method
emscripten::val::global("foo['gee']").call<void>("nee");