AutoJSAPI jsapi; jsapi.init();
JS::RootedValue result(jsapi.cx()); JS::AutoValueArray<1> args(jsapi.cx()); // Arguments array for the function call args[0].setDouble(3.14); // Set the first argument as a double value jsapi.callFunction("myFunction", args, &result); // Call the JavaScript function "myFunction" with the arguments, store the result in the "result" objectThis example calls a JavaScript function named "myFunction" with a single argument of type `double`. The result of the function call is stored in a `JS::RootedValue` object named `result`. Package library: AutoJSAPI is a part of the SpiderMonkey JavaScript engine, which is embedded in the Gecko engine used by Mozilla Firefox and other Mozilla applications. Therefore, it is included in the Mozilla SpiderMonkey library.