Documentation on xsCallFunction functions. #1536
-
|
Other than being listed in xs.h and appearing as used for call-backs in various code modules, is there documentation for the xsCallFunction functions? It isn't mentioned in the Moddable documentation. Searching the web, it appears there used to be an "XS Host Programming Guide" that described the functions and how they worked, but that is no longer in the Moddable documentation. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Use This JavaScript... this.foo(101)...is implemented in C using xsCall1(xsThis, xsID_foo, xsInteger(101));This JavaScript... let foo = ...; // get the function object into "foo" as appropriate
foo.call(this, 101);...is implemented in C using // get the function object into "xsVar(0)" as appropriate
xsCallFunction1(xsVar(0), xsThis, xsInteger(101)); |
Beta Was this translation helpful? Give feedback.
-
|
That makes sense, and given the usefulness of the |
Beta Was this translation helpful? Give feedback.
Use
xsCallFunction*to call a function when you have a function object. UsexsCall*, by contrast, to call a method of an object by name.This JavaScript...
...is implemented in C using
xsCall*to call thefoomethod ofthis:This JavaScript...
...is implemented in C using
xsCallFunction*to call the functionfoowith a receiver ofthis: