Here is my test code:
cocos2d::Dictionary dict = cocos2d::Dictionary::create;
dict->setObject, “kk”);
jsval val = ccdictionary_to_jsval->getGlobalContext, dict);
The ScriptingCore is already init, and the global context is valid.
But the code crashed in ccdictionary_to_jsval’s first line:
JSObject jsRet = JS_NewObject(cx, NULL, NULL, NULL);
ccarray_to_jsval also has the same problem.
My cocos2d-x version is 3.0 beta, I found 3.0 alpha1 also has this bug.
But cocos2d-x 3.0 alpha0 works fine.