1

Ok so i have this function in the engine

static bool
myTestFunction(JSContext* cx, unsigned argc, Value* vp)
{
    CallArgs args = CallArgsFromVp(argc, vp);
    int length = args.length();
    if (length==2)
    {
        if (args.get(1).isObject())
        {
            RootedObject obj4(cx,&args.get(1).toObject());
            args.rval().setObject(*obj4);
        }
    }

    return true;
} 

and this statement in the js script

var obj = {ss:"qq"};
var handler = {tt:"vv"};
var prox1 = myTestFunction(obj,handler);
print(prox1);

So the problem is in the last line basically i am just trying to return the second argument but when i print the variable it is giving me this assertion failure

Assertion failure: mStatementDone != reinterpret_cast<bool*>(uintptr_t(-1)), at ../../../dist/include/mozilla/GuardObjects.h:95 Segmentation fault (core dumped)

Now i am really new to SpiderMonkey Engine and have checked everything but haven't been able to figure out what's wrong here. Any help would be really appreciated.

gCoder12
  • 1,643
  • 2
  • 10
  • 5

0 Answers0