Hi!
I would appreciate advise on how to use ExoticSet 'magic' function and
JS_SetProperty/String/Internal in the following scenario:
I have created by own C++ class, wrapped this with a JS object, and exposed a
few static C++ functions to JS.
I need to intercept property write operations on this JS object. Therefore, I
have also registered a function as 'magic' exoticSet function.
This all works well, the exoticSet static C++ function gets called all fine
whenever creating a new property or setting an existing property on the
wrapping JS object from JS code.
I understand the exoticSet function is responsible to set the JSValue to the
new value. How to set the property value from the exoticSet static C++ function
without causing an infinite loop (using JS_SetProperty -> ExoticSet ->
JS_SetPropertyValue will cause such loop)? How to just set the JSValue
without calling any 'magic' functions?
Note: I want to suffice with just one JS object wrapping the C++ object. In
many other cases I created a separate JS proxy to proxy for the JS object
holding the properties. But in this scenario I do not want to do this.
Thank you!
Best regards
Guido