Im trying to write a scritable plugin and I am using mozilla's example below as my guide, as well as looking at firebreath to see how it wraps the code. I am getting stuck on the return value to javascript.
When javascript calls my function the Allocate,HasProperty,HasMethod,Invoke all get called. I return back the result in Invoke and the javascript variable is undefined or crashes the browser when modifying the result.
STRINGZ_TO_NPVARIANT(_strdup("Hello World"), *result);