diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp index 0c732036a9..b220ac88be 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp @@ -85,14 +85,11 @@ bool js_cocos2dx_3d_Animation3D_getBoneCurveByName(JSContext *cx, uint32_t argc, JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animation3D_getBoneCurveByName : Error processing arguments"); cocos2d::Animation3D::Curve* ret = cobj->getBoneCurveByName(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation3D::Curve*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animation3D::Curve*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -530,14 +527,11 @@ bool js_cocos2dx_3d_Animate3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animate3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animate3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -558,14 +552,11 @@ bool js_cocos2dx_3d_Animate3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animate3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animate3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -995,14 +986,11 @@ bool js_cocos2dx_3d_BillBoard_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::BillBoard* ret = cocos2d::BillBoard::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::BillBoard*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::BillBoard*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1017,14 +1005,11 @@ bool js_cocos2dx_3d_BillBoard_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::BillBoard* ret = cocos2d::BillBoard::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::BillBoard*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::BillBoard*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1034,14 +1019,11 @@ bool js_cocos2dx_3d_BillBoard_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::BillBoard* ret = cocos2d::BillBoard::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::BillBoard*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::BillBoard*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1053,14 +1035,11 @@ bool js_cocos2dx_3d_BillBoard_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::BillBoard* ret = cocos2d::BillBoard::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::BillBoard*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::BillBoard*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1076,14 +1055,11 @@ bool js_cocos2dx_3d_BillBoard_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::BillBoard* ret = cocos2d::BillBoard::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::BillBoard*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::BillBoard*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1101,14 +1077,11 @@ bool js_cocos2dx_3d_BillBoard_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::BillBoard* ret = cocos2d::BillBoard::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::BillBoard*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::BillBoard*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1242,14 +1215,11 @@ bool js_cocos2dx_3d_Mesh_getSkin(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::MeshSkin* ret = cobj->getSkin(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MeshSkin*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MeshSkin*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1267,14 +1237,11 @@ bool js_cocos2dx_3d_Mesh_getMaterial(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Material* ret = cobj->getMaterial(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Material*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1392,14 +1359,11 @@ bool js_cocos2dx_3d_Mesh_getGLProgramState(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::GLProgramState* ret = cobj->getGLProgramState(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgramState*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1491,14 +1455,11 @@ bool js_cocos2dx_3d_Mesh_getMeshIndexData(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocos2d::MeshIndexData* ret = cobj->getMeshIndexData(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MeshIndexData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MeshIndexData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1940,14 +1901,11 @@ bool js_cocos2dx_3d_Skeleton3D_getBoneByName(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Skeleton3D_getBoneByName : Error processing arguments"); cocos2d::Bone3D* ret = cobj->getBoneByName(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Bone3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Bone3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1969,14 +1927,11 @@ bool js_cocos2dx_3d_Skeleton3D_getRootBone(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Skeleton3D_getRootBone : Error processing arguments"); cocos2d::Bone3D* ret = cobj->getRootBone(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Bone3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Bone3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2014,14 +1969,11 @@ bool js_cocos2dx_3d_Skeleton3D_getBoneByIndex(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Skeleton3D_getBoneByIndex : Error processing arguments"); cocos2d::Bone3D* ret = cobj->getBoneByIndex(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Bone3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Bone3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2266,14 +2218,11 @@ bool js_cocos2dx_3d_Skybox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Skybox* ret = cocos2d::Skybox::create(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Skybox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Skybox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2283,14 +2232,11 @@ bool js_cocos2dx_3d_Skybox_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Skybox* ret = cocos2d::Skybox::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Skybox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Skybox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2517,14 +2463,11 @@ bool js_cocos2dx_3d_Sprite3D_getMaterial(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Sprite3D_getMaterial : Error processing arguments"); cocos2d::Material* ret = cobj->getMaterial(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Material*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2679,14 +2622,11 @@ bool js_cocos2dx_3d_Sprite3D_getMesh(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Mesh* ret = cobj->getMesh(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Mesh*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Mesh*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2715,14 +2655,11 @@ bool js_cocos2dx_3d_Sprite3D_createSprite3DNode(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Sprite3D_createSprite3DNode : Error processing arguments"); cocos2d::Sprite3D* ret = cobj->createSprite3DNode(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2778,14 +2715,11 @@ bool js_cocos2dx_3d_Sprite3D_getMeshByIndex(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Sprite3D_getMeshByIndex : Error processing arguments"); cocos2d::Mesh* ret = cobj->getMeshByIndex(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Mesh*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Mesh*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2879,14 +2813,11 @@ bool js_cocos2dx_3d_Sprite3D_getMeshIndexData(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Sprite3D_getMeshIndexData : Error processing arguments"); cocos2d::MeshIndexData* ret = cobj->getMeshIndexData(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MeshIndexData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MeshIndexData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3000,14 +2931,11 @@ bool js_cocos2dx_3d_Sprite3D_getAttachNode(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Sprite3D_getAttachNode : Error processing arguments"); cocos2d::AttachNode* ret = cobj->getAttachNode(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AttachNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::AttachNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3132,14 +3060,11 @@ bool js_cocos2dx_3d_Sprite3D_getSkeleton(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::Skeleton3D* ret = cobj->getSkeleton(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Skeleton3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Skeleton3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3181,14 +3106,11 @@ bool js_cocos2dx_3d_Sprite3D_getMeshByName(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Sprite3D_getMeshByName : Error processing arguments"); cocos2d::Mesh* ret = cobj->getMeshByName(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Mesh*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Mesh*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3208,14 +3130,11 @@ bool js_cocos2dx_3d_Sprite3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3225,14 +3144,11 @@ bool js_cocos2dx_3d_Sprite3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3248,14 +3164,11 @@ bool js_cocos2dx_3d_Sprite3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3432,14 +3345,11 @@ bool js_cocos2dx_3d_Sprite3DCache_getInstance(JSContext *cx, uint32_t argc, jsva cocos2d::Sprite3DCache* ret = cocos2d::Sprite3DCache::getInstance(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite3DCache*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite3DCache*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4319,14 +4229,11 @@ bool js_cocos2dx_3d_Bundle3D_createBundle(JSContext *cx, uint32_t argc, jsval *v cocos2d::Bundle3D* ret = cocos2d::Bundle3D::createBundle(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Bundle3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Bundle3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_extension_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_extension_auto.cpp index 631eec352b..579fff1384 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_extension_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_extension_auto.cpp @@ -680,14 +680,11 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_clone(JSContext *cx, uint32_t a if (argc == 0) { cocos2d::PUParticleSystem3D* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PUParticleSystem3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::PUParticleSystem3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -773,14 +770,11 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_getParentParticleSystem(JSConte if (argc == 0) { cocos2d::PUParticleSystem3D* ret = cobj->getParentParticleSystem(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PUParticleSystem3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::PUParticleSystem3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1026,14 +1020,11 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_create(JSContext *cx, uint32_t if (!ok) { ok = true; break; } cocos2d::PUParticleSystem3D* ret = cocos2d::PUParticleSystem3D::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PUParticleSystem3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::PUParticleSystem3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1043,14 +1034,11 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_create(JSContext *cx, uint32_t if (argc == 0) { cocos2d::PUParticleSystem3D* ret = cocos2d::PUParticleSystem3D::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PUParticleSystem3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::PUParticleSystem3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1066,14 +1054,11 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_create(JSContext *cx, uint32_t if (!ok) { ok = true; break; } cocos2d::PUParticleSystem3D* ret = cocos2d::PUParticleSystem3D::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PUParticleSystem3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::PUParticleSystem3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp index 7dea6a6a6b..26f0f0c61e 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp @@ -645,14 +645,11 @@ bool js_cocos2dx_audioengine_AudioEngine_getDefaultProfile(JSContext *cx, uint32 cocos2d::experimental::AudioProfile* ret = cocos2d::experimental::AudioEngine::getDefaultProfile(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::experimental::AudioProfile*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::experimental::AudioProfile*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -713,14 +710,11 @@ bool js_cocos2dx_audioengine_AudioEngine_getProfile(JSContext *cx, uint32_t argc if (!ok) { ok = true; break; } cocos2d::experimental::AudioProfile* ret = cocos2d::experimental::AudioEngine::getProfile(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::experimental::AudioProfile*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::experimental::AudioProfile*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -733,14 +727,11 @@ bool js_cocos2dx_audioengine_AudioEngine_getProfile(JSContext *cx, uint32_t argc if (!ok) { ok = true; break; } cocos2d::experimental::AudioProfile* ret = cocos2d::experimental::AudioEngine::getProfile(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::experimental::AudioProfile*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::experimental::AudioProfile*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 364f6ff6da..6c15a2224e 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -36,14 +36,11 @@ bool js_cocos2dx_Texture2D_getGLProgram(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::GLProgram* ret = cobj->getGLProgram(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1219,14 +1216,11 @@ bool js_cocos2dx_Event_getCurrentTarget(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Node* ret = cobj->getCurrentTarget(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1564,14 +1558,11 @@ bool js_cocos2dx_ComponentContainer_get(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ComponentContainer_get : Error processing arguments"); cocos2d::Component* ret = cobj->get(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Component*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Component*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1696,14 +1687,11 @@ bool js_cocos2dx_Component_getOwner(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Node* ret = cobj->getOwner(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2066,14 +2054,11 @@ bool js_cocos2dx_Node_getGLProgram(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::GLProgram* ret = cobj->getGLProgram(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2245,14 +2230,11 @@ bool js_cocos2dx_Node_getChildByName(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_getChildByName : Error processing arguments"); cocos2d::Node* ret = cobj->getChildByName(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2646,14 +2628,11 @@ bool js_cocos2dx_Node_getScene(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Scene* ret = cobj->getScene(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Scene*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Scene*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2671,14 +2650,11 @@ bool js_cocos2dx_Node_getEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::EventDispatcher* ret = cobj->getEventDispatcher(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventDispatcher*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EventDispatcher*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3520,14 +3496,11 @@ bool js_cocos2dx_Node_runAction(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_runAction : Error processing arguments"); cocos2d::Action* ret = cobj->runAction(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Action*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Action*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3638,14 +3611,11 @@ bool js_cocos2dx_Node_getPhysicsBody(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::PhysicsBody* ret = cobj->getPhysicsBody(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PhysicsBody*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::PhysicsBody*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3749,14 +3719,11 @@ bool js_cocos2dx_Node_getGLProgramState(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::GLProgramState* ret = cobj->getGLProgramState(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgramState*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3898,14 +3865,11 @@ bool js_cocos2dx_Node_getActionByTag(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_getActionByTag : Error processing arguments"); cocos2d::Action* ret = cobj->getActionByTag(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Action*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Action*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4024,14 +3988,11 @@ bool js_cocos2dx_Node_getScheduler(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { const cocos2d::Scheduler* ret = cobj->getScheduler(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Scheduler*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Scheduler*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4041,14 +4002,11 @@ bool js_cocos2dx_Node_getScheduler(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Scheduler* ret = cobj->getScheduler(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Scheduler*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Scheduler*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4176,14 +4134,11 @@ bool js_cocos2dx_Node_getParent(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { const cocos2d::Node* ret = cobj->getParent(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4193,14 +4148,11 @@ bool js_cocos2dx_Node_getParent(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Node* ret = cobj->getParent(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4480,14 +4432,11 @@ bool js_cocos2dx_Node_getChildByTag(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_getChildByTag : Error processing arguments"); cocos2d::Node* ret = cobj->getChildByTag(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4643,14 +4592,11 @@ bool js_cocos2dx_Node_getComponent(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_getComponent : Error processing arguments"); cocos2d::Component* ret = cobj->getComponent(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Component*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Component*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4855,14 +4801,11 @@ bool js_cocos2dx_Node_enumerateChildren(JSContext *cx, uint32_t argc, jsval *vp) auto lambda = [=](cocos2d::Node* larg0) -> bool { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -5190,14 +5133,11 @@ bool js_cocos2dx_Node_getActionManager(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { const cocos2d::ActionManager* ret = cobj->getActionManager(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionManager*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionManager*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5207,14 +5147,11 @@ bool js_cocos2dx_Node_getActionManager(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ActionManager* ret = cobj->getActionManager(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionManager*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionManager*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5654,14 +5591,11 @@ bool js_cocos2dx_Scene_getDefaultCamera(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Camera* ret = cobj->getDefaultCamera(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Camera*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Camera*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6668,14 +6602,11 @@ bool js_cocos2dx_Director_getNotificationNode(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocos2d::Node* ret = cobj->getNotificationNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6727,14 +6658,11 @@ bool js_cocos2dx_Director_getTextureCache(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocos2d::TextureCache* ret = cobj->getTextureCache(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TextureCache*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TextureCache*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7018,14 +6946,11 @@ bool js_cocos2dx_Director_getOpenGLView(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::GLView* ret = cobj->getOpenGLView(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLView*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7043,14 +6968,11 @@ bool js_cocos2dx_Director_getRunningScene(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocos2d::Scene* ret = cobj->getRunningScene(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Scene*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Scene*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7518,14 +7440,11 @@ bool js_cocos2dx_Director_getScheduler(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Scheduler* ret = cobj->getScheduler(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Scheduler*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Scheduler*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7627,14 +7546,11 @@ bool js_cocos2dx_Director_getEventDispatcher(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::EventDispatcher* ret = cobj->getEventDispatcher(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventDispatcher*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EventDispatcher*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7700,14 +7616,11 @@ bool js_cocos2dx_Director_getActionManager(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::ActionManager* ret = cobj->getActionManager(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionManager*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionManager*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7720,17 +7633,10 @@ bool js_cocos2dx_Director_getInstance(JSContext *cx, uint32_t argc, jsval *vp) JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Director* ret = cocos2d::Director::getInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Director*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + auto ret = cocos2d::Director::getInstance(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_singleton_get_or_create_jsobject(cx, ret, typeClass, "cocos2d::Director")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Director_getInstance : wrong number of arguments"); @@ -8105,14 +8011,11 @@ bool js_cocos2dx_AsyncTaskPool_getInstance(JSContext *cx, uint32_t argc, jsval * cocos2d::AsyncTaskPool* ret = cocos2d::AsyncTaskPool::getInstance(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AsyncTaskPool*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::AsyncTaskPool*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8234,14 +8137,11 @@ bool js_cocos2dx_Action_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Action* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Action*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Action*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8259,14 +8159,11 @@ bool js_cocos2dx_Action_getOriginalTarget(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocos2d::Node* ret = cobj->getOriginalTarget(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8320,14 +8217,11 @@ bool js_cocos2dx_Action_getTarget(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Node* ret = cobj->getTarget(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8487,14 +8381,11 @@ bool js_cocos2dx_Action_reverse(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Action* ret = cobj->reverse(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Action*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Action*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8754,14 +8645,11 @@ bool js_cocos2dx_Speed_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ActionInterval* ret = cobj->getInnerAction(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -9549,14 +9437,11 @@ bool js_cocos2dx_GLProgramState_setUniformCallback(JSContext *cx, uint32_t argc, auto lambda = [=](cocos2d::GLProgram* larg0, cocos2d::Uniform* larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = uniform_to_jsval(cx, larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -9593,14 +9478,11 @@ bool js_cocos2dx_GLProgramState_setUniformCallback(JSContext *cx, uint32_t argc, auto lambda = [=](cocos2d::GLProgram* larg0, cocos2d::Uniform* larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = uniform_to_jsval(cx, larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -9770,14 +9652,11 @@ bool js_cocos2dx_GLProgramState_setVertexAttribCallback(JSContext *cx, uint32_t auto lambda = [=](cocos2d::VertexAttrib* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::VertexAttrib*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::VertexAttrib*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -9831,14 +9710,11 @@ bool js_cocos2dx_GLProgramState_getNodeBinding(JSContext *cx, uint32_t argc, jsv if (argc == 0) { cocos2d::Node* ret = cobj->getNodeBinding(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10059,14 +9935,11 @@ bool js_cocos2dx_GLProgramState_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::GLProgramState* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgramState*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10162,14 +10035,11 @@ bool js_cocos2dx_GLProgramState_getGLProgram(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::GLProgram* ret = cobj->getGLProgram(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10483,14 +10353,11 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(JSContext *cx, uint cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgramState*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10517,14 +10384,11 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgram(JSContext *cx, uint32_t cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgramState*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10547,14 +10411,11 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithShaders(JSContext *cx, uint32_t a cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithShaders(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgramState*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10674,14 +10535,11 @@ bool js_cocos2dx_SpriteFrame_getTexture(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Texture2D* ret = cobj->getTexture(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10977,14 +10835,11 @@ bool js_cocos2dx_SpriteFrame_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::SpriteFrame* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11128,14 +10983,11 @@ bool js_cocos2dx_SpriteFrame_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11151,14 +11003,11 @@ bool js_cocos2dx_SpriteFrame_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11198,14 +11047,11 @@ bool js_cocos2dx_SpriteFrame_createWithTexture(JSContext *cx, uint32_t argc, jsv if (!ok) { ok = true; break; } cocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::createWithTexture(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11229,14 +11075,11 @@ bool js_cocos2dx_SpriteFrame_createWithTexture(JSContext *cx, uint32_t argc, jsv if (!ok) { ok = true; break; } cocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::createWithTexture(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11434,14 +11277,11 @@ bool js_cocos2dx_AnimationFrame_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::AnimationFrame* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AnimationFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::AnimationFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11459,14 +11299,11 @@ bool js_cocos2dx_AnimationFrame_getSpriteFrame(JSContext *cx, uint32_t argc, jsv if (argc == 0) { cocos2d::SpriteFrame* ret = cobj->getSpriteFrame(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11739,14 +11576,11 @@ bool js_cocos2dx_Animation_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Animation* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12061,14 +11895,11 @@ bool js_cocos2dx_Animation_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Animation* ret = cocos2d::Animation::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12086,14 +11917,11 @@ bool js_cocos2dx_Animation_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Animation* ret = cocos2d::Animation::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12103,14 +11931,11 @@ bool js_cocos2dx_Animation_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Animation* ret = cocos2d::Animation::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12537,14 +12362,11 @@ bool js_cocos2dx_Repeat_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::FiniteTimeAction* ret = cobj->getInnerAction(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FiniteTimeAction*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::FiniteTimeAction*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12733,14 +12555,11 @@ bool js_cocos2dx_RepeatForever_getInnerAction(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocos2d::ActionInterval* ret = cobj->getInnerAction(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13001,14 +12820,11 @@ bool js_cocos2dx_RotateTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RotateTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RotateTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13027,14 +12843,11 @@ bool js_cocos2dx_RotateTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RotateTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RotateTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13050,14 +12863,11 @@ bool js_cocos2dx_RotateTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RotateTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RotateTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13230,14 +13040,11 @@ bool js_cocos2dx_RotateBy_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RotateBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RotateBy*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13253,14 +13060,11 @@ bool js_cocos2dx_RotateBy_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RotateBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RotateBy*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13276,14 +13080,11 @@ bool js_cocos2dx_RotateBy_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RotateBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RotateBy*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13434,14 +13235,11 @@ bool js_cocos2dx_MoveBy_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::MoveBy* ret = cocos2d::MoveBy::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MoveBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MoveBy*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13457,14 +13255,11 @@ bool js_cocos2dx_MoveBy_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::MoveBy* ret = cocos2d::MoveBy::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MoveBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MoveBy*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13615,14 +13410,11 @@ bool js_cocos2dx_MoveTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::MoveTo* ret = cocos2d::MoveTo::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MoveTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MoveTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13638,14 +13430,11 @@ bool js_cocos2dx_MoveTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::MoveTo* ret = cocos2d::MoveTo::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MoveTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MoveTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -14512,14 +14301,11 @@ bool js_cocos2dx_ScaleTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ScaleTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ScaleTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -14535,14 +14321,11 @@ bool js_cocos2dx_ScaleTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ScaleTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ScaleTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -14564,14 +14347,11 @@ bool js_cocos2dx_ScaleTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ScaleTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ScaleTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -14679,14 +14459,11 @@ bool js_cocos2dx_ScaleBy_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ScaleBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ScaleBy*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -14702,14 +14479,11 @@ bool js_cocos2dx_ScaleBy_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ScaleBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ScaleBy*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -14731,14 +14505,11 @@ bool js_cocos2dx_ScaleBy_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ScaleBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ScaleBy*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15382,14 +15153,11 @@ bool js_cocos2dx_TintTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TintTo* ret = cocos2d::TintTo::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TintTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TintTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15411,14 +15179,11 @@ bool js_cocos2dx_TintTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TintTo* ret = cocos2d::TintTo::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TintTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TintTo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15927,14 +15692,11 @@ bool js_cocos2dx_Animate_getAnimation(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { const cocos2d::Animation* ret = cobj->getAnimation(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15944,14 +15706,11 @@ bool js_cocos2dx_Animate_getAnimation(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Animation* ret = cobj->getAnimation(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -16133,14 +15892,11 @@ bool js_cocos2dx_TargetedAction_getForcedTarget(JSContext *cx, uint32_t argc, js if (argc == 0) { const cocos2d::Node* ret = cobj->getForcedTarget(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -16150,14 +15906,11 @@ bool js_cocos2dx_TargetedAction_getForcedTarget(JSContext *cx, uint32_t argc, js if (argc == 0) { cocos2d::Node* ret = cobj->getForcedTarget(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -16971,17 +16724,10 @@ bool js_cocos2dx_Configuration_getInstance(JSContext *cx, uint32_t argc, jsval * JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Configuration* ret = cocos2d::Configuration::getInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Configuration*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + auto ret = cocos2d::Configuration::getInstance(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_singleton_get_or_create_jsobject(cx, ret, typeClass, "cocos2d::Configuration")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Configuration_getInstance : wrong number of arguments"); @@ -17189,14 +16935,11 @@ bool js_cocos2dx_Properties_getNamespace(JSContext *cx, uint32_t argc, jsval *vp if (!ok) { ok = true; break; } cocos2d::Properties* ret = cobj->getNamespace(arg0); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Properties*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -17211,14 +16954,11 @@ bool js_cocos2dx_Properties_getNamespace(JSContext *cx, uint32_t argc, jsval *vp arg1 = JS::ToBoolean(args.get(1)); cocos2d::Properties* ret = cobj->getNamespace(arg0, arg1); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Properties*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -17235,14 +16975,11 @@ bool js_cocos2dx_Properties_getNamespace(JSContext *cx, uint32_t argc, jsval *vp arg2 = JS::ToBoolean(args.get(2)); cocos2d::Properties* ret = cobj->getNamespace(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Properties*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -17552,14 +17289,11 @@ bool js_cocos2dx_Properties_getNextNamespace(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::Properties* ret = cobj->getNextNamespace(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Properties*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -17908,14 +17642,11 @@ bool js_cocos2dx_Properties_createNonRefCounted(JSContext *cx, uint32_t argc, js cocos2d::Properties* ret = cocos2d::Properties::createNonRefCounted(arg0); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Properties*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Properties*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -18803,14 +18534,11 @@ bool js_cocos2dx_FileUtils_getInstance(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::FileUtils* ret = cocos2d::FileUtils::getInstance(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FileUtils*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::FileUtils*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -19095,14 +18823,11 @@ bool js_cocos2dx_EventListener_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::EventListener* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventListener*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EventListener*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -19269,14 +18994,11 @@ bool js_cocos2dx_EventDispatcher_addCustomEventListener(JSContext *cx, uint32_t auto lambda = [=](cocos2d::EventCustom* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventCustom*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EventCustom*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -19294,14 +19016,11 @@ bool js_cocos2dx_EventDispatcher_addCustomEventListener(JSContext *cx, uint32_t JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_addCustomEventListener : Error processing arguments"); cocos2d::EventListenerCustom* ret = cobj->addCustomEventListener(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventListenerCustom*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EventListenerCustom*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -19794,14 +19513,11 @@ bool js_cocos2dx_EventListenerAcceleration_init(JSContext *cx, uint32_t argc, js JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; largv[0] = ccacceleration_to_jsval(cx, *larg0); - do { if (larg1) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Event*)larg1); - largv[1] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[1] = JSVAL_NULL; - } - } while (0); + largv[1] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Event*)larg1)); + } else { + largv[1] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -19842,14 +19558,11 @@ bool js_cocos2dx_EventListenerAcceleration_create(JSContext *cx, uint32_t argc, JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; largv[0] = ccacceleration_to_jsval(cx, *larg0); - do { if (larg1) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Event*)larg1); - largv[1] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[1] = JSVAL_NULL; - } - } while (0); + largv[1] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Event*)larg1)); + } else { + largv[1] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -19958,14 +19671,11 @@ bool js_cocos2dx_EventListenerCustom_create(JSContext *cx, uint32_t argc, jsval auto lambda = [=](cocos2d::EventCustom* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventCustom*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EventCustom*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -21267,14 +20977,11 @@ bool js_cocos2dx_CardinalSplineTo_getPoints(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::PointArray* ret = cobj->getPoints(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PointArray*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::PointArray*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -21560,14 +21267,11 @@ bool js_cocos2dx_ActionEase_getInnerAction(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::ActionInterval* ret = cobj->getInnerAction(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -22909,14 +22613,11 @@ bool js_cocos2dx_EaseElasticIn_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::EaseElasticIn* ret = cocos2d::EaseElasticIn::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseElasticIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EaseElasticIn*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -22940,14 +22641,11 @@ bool js_cocos2dx_EaseElasticIn_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::EaseElasticIn* ret = cocos2d::EaseElasticIn::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseElasticIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EaseElasticIn*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -23056,14 +22754,11 @@ bool js_cocos2dx_EaseElasticOut_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::EaseElasticOut* ret = cocos2d::EaseElasticOut::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseElasticOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EaseElasticOut*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -23087,14 +22782,11 @@ bool js_cocos2dx_EaseElasticOut_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::EaseElasticOut* ret = cocos2d::EaseElasticOut::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseElasticOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EaseElasticOut*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -23203,14 +22895,11 @@ bool js_cocos2dx_EaseElasticInOut_create(JSContext *cx, uint32_t argc, jsval *vp if (!ok) { ok = true; break; } cocos2d::EaseElasticInOut* ret = cocos2d::EaseElasticInOut::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseElasticInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EaseElasticInOut*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -23234,14 +22923,11 @@ bool js_cocos2dx_EaseElasticInOut_create(JSContext *cx, uint32_t argc, jsval *vp if (!ok) { ok = true; break; } cocos2d::EaseElasticInOut* ret = cocos2d::EaseElasticInOut::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseElasticInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::EaseElasticInOut*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -26764,14 +26450,11 @@ bool js_cocos2dx_GridAction_getGrid(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::GridBase* ret = cobj->getGrid(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GridBase*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GridBase*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -28855,14 +28538,11 @@ bool js_cocos2dx_ActionManager_getActionByTag(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionManager_getActionByTag : Error processing arguments"); cocos2d::Action* ret = cobj->getActionByTag(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Action*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Action*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -30662,14 +30342,11 @@ bool js_cocos2dx_TurnOffTiles_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TurnOffTiles* ret = cocos2d::TurnOffTiles::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TurnOffTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TurnOffTiles*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -30685,14 +30362,11 @@ bool js_cocos2dx_TurnOffTiles_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TurnOffTiles* ret = cocos2d::TurnOffTiles::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TurnOffTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TurnOffTiles*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -31563,14 +31237,11 @@ bool js_cocos2dx_AtlasNode_getTexture(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Texture2D* ret = cobj->getTexture(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -31636,14 +31307,11 @@ bool js_cocos2dx_AtlasNode_getTextureAtlas(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TextureAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TextureAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -31966,14 +31634,11 @@ bool js_cocos2dx_ClippingNode_getStencil(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::Node* ret = cobj->getStencil(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -32039,14 +31704,11 @@ bool js_cocos2dx_ClippingNode_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ClippingNode* ret = cocos2d::ClippingNode::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ClippingNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ClippingNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -32056,14 +31718,11 @@ bool js_cocos2dx_ClippingNode_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ClippingNode* ret = cocos2d::ClippingNode::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ClippingNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ClippingNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -34041,14 +33700,11 @@ bool js_cocos2dx_Label_getLetter(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_getLetter : Error processing arguments"); cocos2d::Sprite* ret = cobj->getLetter(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -34455,14 +34111,11 @@ bool js_cocos2dx_Label_createWithCharMap(JSContext *cx, uint32_t argc, jsval *vp if (!ok) { ok = true; break; } cocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Label*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -34484,14 +34137,11 @@ bool js_cocos2dx_Label_createWithCharMap(JSContext *cx, uint32_t argc, jsval *vp if (!ok) { ok = true; break; } cocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Label*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -34504,14 +34154,11 @@ bool js_cocos2dx_Label_createWithCharMap(JSContext *cx, uint32_t argc, jsval *vp if (!ok) { ok = true; break; } cocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Label*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -34887,14 +34534,11 @@ bool js_cocos2dx_LabelAtlas_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -34904,14 +34548,11 @@ bool js_cocos2dx_LabelAtlas_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -34927,14 +34568,11 @@ bool js_cocos2dx_LabelAtlas_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -35078,14 +34716,11 @@ bool js_cocos2dx_LabelBMFont_getLetter(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelBMFont_getLetter : Error processing arguments"); cocos2d::Sprite* ret = cobj->getLetter(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -35320,14 +34955,11 @@ bool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelBMFont*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelBMFont*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -35343,14 +34975,11 @@ bool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelBMFont*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelBMFont*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -35368,14 +34997,11 @@ bool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelBMFont*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelBMFont*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -35396,14 +35022,11 @@ bool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelBMFont*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelBMFont*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -35427,14 +35050,11 @@ bool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelBMFont*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelBMFont*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -36143,14 +35763,11 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelTTF*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelTTF*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -36169,14 +35786,11 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelTTF*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelTTF*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -36197,14 +35811,11 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelTTF*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelTTF*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -36228,14 +35839,11 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelTTF*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelTTF*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -36262,14 +35870,11 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelTTF*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LabelTTF*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -36745,14 +36350,11 @@ bool js_cocos2dx_LayerColor_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LayerColor* ret = cocos2d::LayerColor::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LayerColor*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LayerColor*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -36762,14 +36364,11 @@ bool js_cocos2dx_LayerColor_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::LayerColor* ret = cocos2d::LayerColor::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LayerColor*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LayerColor*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -36782,14 +36381,11 @@ bool js_cocos2dx_LayerColor_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LayerColor* ret = cocos2d::LayerColor::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LayerColor*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LayerColor*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -37176,14 +36772,11 @@ bool js_cocos2dx_LayerGradient_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LayerGradient*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LayerGradient*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -37193,14 +36786,11 @@ bool js_cocos2dx_LayerGradient_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LayerGradient*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LayerGradient*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -37219,14 +36809,11 @@ bool js_cocos2dx_LayerGradient_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LayerGradient*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::LayerGradient*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -37554,14 +37141,11 @@ bool js_cocos2dx_MenuItem_initWithCallback(JSContext *cx, uint32_t argc, jsval * auto lambda = [=](cocos2d::Ref* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -37657,14 +37241,11 @@ bool js_cocos2dx_MenuItem_setCallback(JSContext *cx, uint32_t argc, jsval *vp) auto lambda = [=](cocos2d::Ref* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -37903,14 +37484,11 @@ bool js_cocos2dx_MenuItemLabel_initWithLabel(JSContext *cx, uint32_t argc, jsval auto lambda = [=](cocos2d::Ref* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -37966,14 +37544,11 @@ bool js_cocos2dx_MenuItemLabel_getLabel(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Node* ret = cobj->getLabel(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -38093,14 +37668,11 @@ bool js_cocos2dx_MenuItemAtlasFont_initWithString(JSContext *cx, uint32_t argc, auto lambda = [=](cocos2d::Ref* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -38283,14 +37855,11 @@ bool js_cocos2dx_MenuItemFont_initWithString(JSContext *cx, uint32_t argc, jsval auto lambda = [=](cocos2d::Ref* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -38625,14 +38194,11 @@ bool js_cocos2dx_MenuItemSprite_initWithNormalSprite(JSContext *cx, uint32_t arg auto lambda = [=](cocos2d::Ref* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -38696,14 +38262,11 @@ bool js_cocos2dx_MenuItemSprite_getDisabledImage(JSContext *cx, uint32_t argc, j if (argc == 0) { cocos2d::Node* ret = cobj->getDisabledImage(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -38721,14 +38284,11 @@ bool js_cocos2dx_MenuItemSprite_getSelectedImage(JSContext *cx, uint32_t argc, j if (argc == 0) { cocos2d::Node* ret = cobj->getSelectedImage(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -38746,14 +38306,11 @@ bool js_cocos2dx_MenuItemSprite_getNormalImage(JSContext *cx, uint32_t argc, jsv if (argc == 0) { cocos2d::Node* ret = cobj->getNormalImage(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -38991,14 +38548,11 @@ bool js_cocos2dx_MenuItemImage_initWithNormalImage(JSContext *cx, uint32_t argc, auto lambda = [=](cocos2d::Ref* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -39213,14 +38767,11 @@ bool js_cocos2dx_MenuItemToggle_getSelectedItem(JSContext *cx, uint32_t argc, js if (argc == 0) { cocos2d::MenuItem* ret = cobj->getSelectedItem(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MenuItem*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MenuItem*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -39603,14 +39154,11 @@ bool js_cocos2dx_MotionStreak_getTexture(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::Texture2D* ret = cobj->getTexture(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -39894,14 +39442,11 @@ bool js_cocos2dx_MotionStreak_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::MotionStreak* ret = cocos2d::MotionStreak::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MotionStreak*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MotionStreak*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -39926,14 +39471,11 @@ bool js_cocos2dx_MotionStreak_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::MotionStreak* ret = cocos2d::MotionStreak::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::MotionStreak*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::MotionStreak*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -40078,14 +39620,11 @@ bool js_cocos2dx_NodeGrid_getGrid(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { const cocos2d::GridBase* ret = cobj->getGrid(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GridBase*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GridBase*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -40095,14 +39634,11 @@ bool js_cocos2dx_NodeGrid_getGrid(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::GridBase* ret = cobj->getGrid(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GridBase*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GridBase*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -40141,14 +39677,11 @@ bool js_cocos2dx_NodeGrid_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::NodeGrid* ret = cocos2d::NodeGrid::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::NodeGrid*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::NodeGrid*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -40158,14 +39691,11 @@ bool js_cocos2dx_NodeGrid_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::NodeGrid* ret = cocos2d::NodeGrid::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::NodeGrid*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::NodeGrid*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -40331,14 +39861,11 @@ bool js_cocos2dx_ParticleBatchNode_getTexture(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocos2d::Texture2D* ret = cobj->getTexture(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -40448,14 +39975,11 @@ bool js_cocos2dx_ParticleBatchNode_getTextureAtlas(JSContext *cx, uint32_t argc, if (argc == 0) { cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TextureAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TextureAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -40899,14 +40423,11 @@ bool js_cocos2dx_ParticleSystem_getTexture(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::Texture2D* ret = cobj->getTexture(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -40942,14 +40463,11 @@ bool js_cocos2dx_ParticleSystem_getBatchNode(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::ParticleBatchNode* ret = cobj->getBatchNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ParticleBatchNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -43111,14 +42629,11 @@ bool js_cocos2dx_ParticleSystemQuad_create(JSContext *cx, uint32_t argc, jsval * if (!ok) { ok = true; break; } cocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSystemQuad*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ParticleSystemQuad*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -43128,14 +42643,11 @@ bool js_cocos2dx_ParticleSystemQuad_create(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSystemQuad*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ParticleSystemQuad*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -43148,14 +42660,11 @@ bool js_cocos2dx_ParticleSystemQuad_create(JSContext *cx, uint32_t argc, jsval * if (!ok) { ok = true; break; } cocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSystemQuad*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ParticleSystemQuad*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -44913,14 +44422,11 @@ bool js_cocos2dx_ProgressTimer_getSprite(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::Sprite* ret = cobj->getSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -45401,14 +44907,11 @@ bool js_cocos2dx_ProtectedNode_getProtectedChildByTag(JSContext *cx, uint32_t ar JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProtectedNode_getProtectedChildByTag : Error processing arguments"); cocos2d::Node* ret = cobj->getProtectedChildByTag(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -45666,14 +45169,11 @@ bool js_cocos2dx_Sprite_getTexture(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Texture2D* ret = cobj->getTexture(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -45874,14 +45374,11 @@ bool js_cocos2dx_Sprite_getBatchNode(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::SpriteBatchNode* ret = cobj->getBatchNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteBatchNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -46144,14 +45641,11 @@ bool js_cocos2dx_Sprite_getSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::SpriteFrame* ret = cobj->getSpriteFrame(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -46344,14 +45838,11 @@ bool js_cocos2dx_Sprite_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TextureAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TextureAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -46711,14 +46202,11 @@ bool js_cocos2dx_RenderTexture_getSprite(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::Sprite* ret = cobj->getSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -47032,14 +46520,11 @@ bool js_cocos2dx_RenderTexture_newImage(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Image* ret = cobj->newImage(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Image*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Image*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -47049,14 +46534,11 @@ bool js_cocos2dx_RenderTexture_newImage(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RenderTexture_newImage : Error processing arguments"); cocos2d::Image* ret = cobj->newImage(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Image*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Image*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -47157,14 +46639,11 @@ bool js_cocos2dx_RenderTexture_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RenderTexture*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RenderTexture*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -47186,14 +46665,11 @@ bool js_cocos2dx_RenderTexture_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RenderTexture*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RenderTexture*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -47209,14 +46685,11 @@ bool js_cocos2dx_RenderTexture_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RenderTexture*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RenderTexture*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -47350,14 +46823,11 @@ bool js_cocos2dx_TransitionEaseScene_easeActionWithAction(JSContext *cx, uint32_ JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionEaseScene_easeActionWithAction : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -47419,14 +46889,11 @@ bool js_cocos2dx_TransitionScene_getInScene(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::Scene* ret = cobj->getInScene(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Scene*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Scene*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -48008,14 +47475,11 @@ bool js_cocos2dx_TransitionMoveInL_action(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocos2d::ActionInterval* ret = cobj->action(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -48045,14 +47509,11 @@ bool js_cocos2dx_TransitionMoveInL_easeActionWithAction(JSContext *cx, uint32_t JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInL_easeActionWithAction : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -48512,14 +47973,11 @@ bool js_cocos2dx_TransitionSlideInL_action(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::ActionInterval* ret = cobj->action(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -48549,14 +48007,11 @@ bool js_cocos2dx_TransitionSlideInL_easeActionWithAction(JSContext *cx, uint32_t JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInL_easeActionWithAction : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49028,14 +48483,11 @@ bool js_cocos2dx_TransitionShrinkGrow_easeActionWithAction(JSContext *cx, uint32 JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionShrinkGrow_easeActionWithAction : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49177,14 +48629,11 @@ bool js_cocos2dx_TransitionFlipX_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TransitionFlipX* ret = cocos2d::TransitionFlipX::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFlipX*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionFlipX*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49211,14 +48660,11 @@ bool js_cocos2dx_TransitionFlipX_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TransitionFlipX* ret = cocos2d::TransitionFlipX::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFlipX*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionFlipX*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49330,14 +48776,11 @@ bool js_cocos2dx_TransitionFlipY_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TransitionFlipY* ret = cocos2d::TransitionFlipY::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFlipY*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionFlipY*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49364,14 +48807,11 @@ bool js_cocos2dx_TransitionFlipY_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TransitionFlipY* ret = cocos2d::TransitionFlipY::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFlipY*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionFlipY*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49483,14 +48923,11 @@ bool js_cocos2dx_TransitionFlipAngular_create(JSContext *cx, uint32_t argc, jsva if (!ok) { ok = true; break; } cocos2d::TransitionFlipAngular* ret = cocos2d::TransitionFlipAngular::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFlipAngular*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionFlipAngular*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49517,14 +48954,11 @@ bool js_cocos2dx_TransitionFlipAngular_create(JSContext *cx, uint32_t argc, jsva if (!ok) { ok = true; break; } cocos2d::TransitionFlipAngular* ret = cocos2d::TransitionFlipAngular::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFlipAngular*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionFlipAngular*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49636,14 +49070,11 @@ bool js_cocos2dx_TransitionZoomFlipX_create(JSContext *cx, uint32_t argc, jsval if (!ok) { ok = true; break; } cocos2d::TransitionZoomFlipX* ret = cocos2d::TransitionZoomFlipX::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionZoomFlipX*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionZoomFlipX*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49670,14 +49101,11 @@ bool js_cocos2dx_TransitionZoomFlipX_create(JSContext *cx, uint32_t argc, jsval if (!ok) { ok = true; break; } cocos2d::TransitionZoomFlipX* ret = cocos2d::TransitionZoomFlipX::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionZoomFlipX*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionZoomFlipX*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49789,14 +49217,11 @@ bool js_cocos2dx_TransitionZoomFlipY_create(JSContext *cx, uint32_t argc, jsval if (!ok) { ok = true; break; } cocos2d::TransitionZoomFlipY* ret = cocos2d::TransitionZoomFlipY::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionZoomFlipY*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionZoomFlipY*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49823,14 +49248,11 @@ bool js_cocos2dx_TransitionZoomFlipY_create(JSContext *cx, uint32_t argc, jsval if (!ok) { ok = true; break; } cocos2d::TransitionZoomFlipY* ret = cocos2d::TransitionZoomFlipY::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionZoomFlipY*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionZoomFlipY*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49942,14 +49364,11 @@ bool js_cocos2dx_TransitionZoomFlipAngular_create(JSContext *cx, uint32_t argc, if (!ok) { ok = true; break; } cocos2d::TransitionZoomFlipAngular* ret = cocos2d::TransitionZoomFlipAngular::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionZoomFlipAngular*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionZoomFlipAngular*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -49976,14 +49395,11 @@ bool js_cocos2dx_TransitionZoomFlipAngular_create(JSContext *cx, uint32_t argc, if (!ok) { ok = true; break; } cocos2d::TransitionZoomFlipAngular* ret = cocos2d::TransitionZoomFlipAngular::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionZoomFlipAngular*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionZoomFlipAngular*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -50160,14 +49576,11 @@ bool js_cocos2dx_TransitionFade_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TransitionFade* ret = cocos2d::TransitionFade::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFade*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionFade*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -50194,14 +49607,11 @@ bool js_cocos2dx_TransitionFade_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TransitionFade* ret = cocos2d::TransitionFade::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFade*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TransitionFade*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -50423,14 +49833,11 @@ bool js_cocos2dx_TransitionTurnOffTiles_easeActionWithAction(JSContext *cx, uint JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionTurnOffTiles_easeActionWithAction : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -50559,14 +49966,11 @@ bool js_cocos2dx_TransitionSplitCols_action(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::ActionInterval* ret = cobj->action(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -50596,14 +50000,11 @@ bool js_cocos2dx_TransitionSplitCols_easeActionWithAction(JSContext *cx, uint32_ JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSplitCols_easeActionWithAction : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -50855,14 +50256,11 @@ bool js_cocos2dx_TransitionFadeTR_easeActionWithAction(JSContext *cx, uint32_t a JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeTR_easeActionWithAction : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -50884,14 +50282,11 @@ bool js_cocos2dx_TransitionFadeTR_actionWithSize(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeTR_actionWithSize : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->actionWithSize(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -51355,14 +50750,11 @@ bool js_cocos2dx_TransitionPageTurn_actionWithSize(JSContext *cx, uint32_t argc, JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionPageTurn_actionWithSize : Error processing arguments"); cocos2d::ActionInterval* ret = cobj->actionWithSize(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionInterval*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ActionInterval*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -52424,14 +51816,11 @@ bool js_cocos2dx_Camera_getBackgroundBrush(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::CameraBackgroundBrush* ret = cobj->getBackgroundBrush(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::CameraBackgroundBrush*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -52942,14 +52331,11 @@ bool js_cocos2dx_Camera_getVisitingCamera(JSContext *cx, uint32_t argc, jsval *v const cocos2d::Camera* ret = cocos2d::Camera::getVisitingCamera(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Camera*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Camera*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -53036,14 +52422,11 @@ bool js_cocos2dx_Camera_getDefaultCamera(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Camera* ret = cocos2d::Camera::getDefaultCamera(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Camera*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Camera*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -53702,14 +53085,11 @@ bool js_cocos2dx_CameraBackgroundSkyBoxBrush_create(JSContext *cx, uint32_t argc if (argc == 0) { cocos2d::CameraBackgroundSkyBoxBrush* ret = cocos2d::CameraBackgroundSkyBoxBrush::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundSkyBoxBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::CameraBackgroundSkyBoxBrush*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -53737,14 +53117,11 @@ bool js_cocos2dx_CameraBackgroundSkyBoxBrush_create(JSContext *cx, uint32_t argc if (!ok) { ok = true; break; } cocos2d::CameraBackgroundSkyBoxBrush* ret = cocos2d::CameraBackgroundSkyBoxBrush::create(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundSkyBoxBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::CameraBackgroundSkyBoxBrush*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54299,14 +53676,11 @@ bool js_cocos2dx_GridBase_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::GridBase* ret = cocos2d::GridBase::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GridBase*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GridBase*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54333,14 +53707,11 @@ bool js_cocos2dx_GridBase_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::GridBase* ret = cocos2d::GridBase::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GridBase*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GridBase*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54469,14 +53840,11 @@ bool js_cocos2dx_Grid3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Grid3D* ret = cocos2d::Grid3D::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Grid3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Grid3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54489,14 +53857,11 @@ bool js_cocos2dx_Grid3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Grid3D* ret = cocos2d::Grid3D::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Grid3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Grid3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54523,14 +53888,11 @@ bool js_cocos2dx_Grid3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Grid3D* ret = cocos2d::Grid3D::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Grid3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Grid3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54560,14 +53922,11 @@ bool js_cocos2dx_Grid3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Grid3D* ret = cocos2d::Grid3D::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Grid3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Grid3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54673,14 +54032,11 @@ bool js_cocos2dx_TiledGrid3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TiledGrid3D* ret = cocos2d::TiledGrid3D::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TiledGrid3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TiledGrid3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54693,14 +54049,11 @@ bool js_cocos2dx_TiledGrid3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TiledGrid3D* ret = cocos2d::TiledGrid3D::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TiledGrid3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TiledGrid3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54727,14 +54080,11 @@ bool js_cocos2dx_TiledGrid3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TiledGrid3D* ret = cocos2d::TiledGrid3D::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TiledGrid3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TiledGrid3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -54764,14 +54114,11 @@ bool js_cocos2dx_TiledGrid3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::TiledGrid3D* ret = cocos2d::TiledGrid3D::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TiledGrid3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TiledGrid3D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -56296,14 +55643,11 @@ bool js_cocos2dx_GLProgram_createWithByteArrays(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::GLProgram* ret = cocos2d::GLProgram::createWithByteArrays(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -56319,14 +55663,11 @@ bool js_cocos2dx_GLProgram_createWithByteArrays(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::GLProgram* ret = cocos2d::GLProgram::createWithByteArrays(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -56352,14 +55693,11 @@ bool js_cocos2dx_GLProgram_createWithFilenames(JSContext *cx, uint32_t argc, jsv if (!ok) { ok = true; break; } cocos2d::GLProgram* ret = cocos2d::GLProgram::createWithFilenames(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -56375,14 +55713,11 @@ bool js_cocos2dx_GLProgram_createWithFilenames(JSContext *cx, uint32_t argc, jsv if (!ok) { ok = true; break; } cocos2d::GLProgram* ret = cocos2d::GLProgram::createWithFilenames(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -56584,14 +55919,11 @@ bool js_cocos2dx_GLProgramCache_getGLProgram(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramCache_getGLProgram : Error processing arguments"); cocos2d::GLProgram* ret = cobj->getGLProgram(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgram*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -56616,17 +55948,10 @@ bool js_cocos2dx_GLProgramCache_getInstance(JSContext *cx, uint32_t argc, jsval JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::GLProgramCache* ret = cocos2d::GLProgramCache::getInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramCache*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + auto ret = cocos2d::GLProgramCache::getInstance(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_singleton_get_or_create_jsobject(cx, ret, typeClass, "cocos2d::GLProgramCache")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_GLProgramCache_getInstance : wrong number of arguments"); @@ -56751,14 +56076,11 @@ bool js_cocos2dx_RenderState_getTopmost(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RenderState_getTopmost : Error processing arguments"); cocos2d::RenderState* ret = cobj->getTopmost(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RenderState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RenderState*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -56776,14 +56098,11 @@ bool js_cocos2dx_RenderState_getTexture(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Texture2D* ret = cobj->getTexture(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -56847,14 +56166,11 @@ bool js_cocos2dx_RenderState_getStateBlock(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::RenderState::StateBlock* ret = cobj->getStateBlock(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RenderState::StateBlock*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::RenderState::StateBlock*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57032,14 +56348,11 @@ bool js_cocos2dx_Pass_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Pass* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Pass*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Pass*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57057,14 +56370,11 @@ bool js_cocos2dx_Pass_getGLProgramState(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::GLProgramState* ret = cobj->getGLProgramState(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::GLProgramState*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57082,14 +56392,11 @@ bool js_cocos2dx_Pass_getVertexAttributeBinding(JSContext *cx, uint32_t argc, js if (argc == 0) { cocos2d::VertexAttribBinding* ret = cobj->getVertexAttributeBinding(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::VertexAttribBinding*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::VertexAttribBinding*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57292,14 +56599,11 @@ bool js_cocos2dx_Technique_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Technique* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Technique*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57385,14 +56689,11 @@ bool js_cocos2dx_Technique_getPassByIndex(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_getPassByIndex : Error processing arguments"); cocos2d::Pass* ret = cobj->getPassByIndex(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Pass*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Pass*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57530,14 +56831,11 @@ bool js_cocos2dx_Material_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Material* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Material*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57597,14 +56895,11 @@ bool js_cocos2dx_Material_getTechniqueByIndex(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_getTechniqueByIndex : Error processing arguments"); cocos2d::Technique* ret = cobj->getTechniqueByIndex(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Technique*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57682,14 +56977,11 @@ bool js_cocos2dx_Material_getTechniqueByName(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_getTechniqueByName : Error processing arguments"); cocos2d::Technique* ret = cobj->getTechniqueByName(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Technique*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57735,14 +57027,11 @@ bool js_cocos2dx_Material_getTechnique(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Technique* ret = cobj->getTechnique(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Technique*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -57978,14 +57267,11 @@ bool js_cocos2dx_TextureCache_addImageAsync(JSContext *cx, uint32_t argc, jsval auto lambda = [=](cocos2d::Texture2D* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -58074,14 +57360,11 @@ bool js_cocos2dx_TextureCache_addImage(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Texture2D* ret = cobj->addImage(arg0, arg1); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -58094,14 +57377,11 @@ bool js_cocos2dx_TextureCache_addImage(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::Texture2D* ret = cobj->addImage(arg0); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -58144,14 +57424,11 @@ bool js_cocos2dx_TextureCache_getTextureForKey(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TextureCache_getTextureForKey : Error processing arguments"); cocos2d::Texture2D* ret = cobj->getTextureForKey(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -58663,14 +57940,11 @@ bool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Application* ret = cocos2d::Application::getInstance(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Application*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Application*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -58742,14 +58016,11 @@ bool js_cocos2dx_AnimationCache_getAnimation(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AnimationCache_getAnimation : Error processing arguments"); cocos2d::Animation* ret = cobj->getAnimation(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Animation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -58884,17 +58155,10 @@ bool js_cocos2dx_AnimationCache_getInstance(JSContext *cx, uint32_t argc, jsval JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::AnimationCache* ret = cocos2d::AnimationCache::getInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AnimationCache*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + auto ret = cocos2d::AnimationCache::getInstance(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_singleton_get_or_create_jsobject(cx, ret, typeClass, "cocos2d::AnimationCache")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_AnimationCache_getInstance : wrong number of arguments"); @@ -59040,14 +58304,11 @@ bool js_cocos2dx_SpriteBatchNode_addSpriteWithoutQuad(JSContext *cx, uint32_t ar JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_addSpriteWithoutQuad : Error processing arguments"); cocos2d::SpriteBatchNode* ret = cobj->addSpriteWithoutQuad(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteBatchNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -59277,14 +58538,11 @@ bool js_cocos2dx_SpriteBatchNode_getTexture(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::Texture2D* ret = cobj->getTexture(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Texture2D*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -59318,14 +58576,11 @@ bool js_cocos2dx_SpriteBatchNode_getTextureAtlas(JSContext *cx, uint32_t argc, j if (argc == 0) { cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TextureAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TextureAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -59861,14 +59116,11 @@ bool js_cocos2dx_SpriteFrameCache_getSpriteFrameByName(JSContext *cx, uint32_t a JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteFrameCache_getSpriteFrameByName : Error processing arguments"); cocos2d::SpriteFrame* ret = cobj->getSpriteFrameByName(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::SpriteFrame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -60053,17 +59305,10 @@ bool js_cocos2dx_SpriteFrameCache_getInstance(JSContext *cx, uint32_t argc, jsva JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::SpriteFrameCache* ret = cocos2d::SpriteFrameCache::getInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrameCache*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + auto ret = cocos2d::SpriteFrameCache::getInstance(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_singleton_get_or_create_jsobject(cx, ret, typeClass, "cocos2d::SpriteFrameCache")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SpriteFrameCache_getInstance : wrong number of arguments"); @@ -60390,14 +59635,11 @@ bool js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder(JSContext *cx, uint32_t a if (!ok) { ok = true; break; } cocos2d::TextFieldTTF* ret = cocos2d::TextFieldTTF::textFieldWithPlaceHolder(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TextFieldTTF*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TextFieldTTF*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -60422,14 +59664,11 @@ bool js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder(JSContext *cx, uint32_t a if (!ok) { ok = true; break; } cocos2d::TextFieldTTF* ret = cocos2d::TextFieldTTF::textFieldWithPlaceHolder(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TextFieldTTF*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TextFieldTTF*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -62527,14 +61766,11 @@ bool js_cocos2dx_TMXLayer_getTileSet(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::TMXTilesetInfo* ret = cobj->getTileSet(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXTilesetInfo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TMXTilesetInfo*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -62590,14 +61826,11 @@ bool js_cocos2dx_TMXLayer_getTileAt(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXLayer_getTileAt : Error processing arguments"); cocos2d::Sprite* ret = cobj->getTileAt(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -62849,14 +62082,11 @@ bool js_cocos2dx_TMXTiledMap_getObjectGroup(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXTiledMap_getObjectGroup : Error processing arguments"); cocos2d::TMXObjectGroup* ret = cobj->getObjectGroup(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXObjectGroup*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TMXObjectGroup*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -63121,14 +62351,11 @@ bool js_cocos2dx_TMXTiledMap_getLayer(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXTiledMap_getLayer : Error processing arguments"); cocos2d::TMXLayer* ret = cobj->getLayer(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXLayer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::TMXLayer*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -64037,14 +63264,11 @@ bool js_cocos2dx_SimpleAudioEngine_getInstance(JSContext *cx, uint32_t argc, jsv CocosDenshion::SimpleAudioEngine* ret = CocosDenshion::SimpleAudioEngine::getInstance(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (CocosDenshion::SimpleAudioEngine*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (CocosDenshion::SimpleAudioEngine*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_builder_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_builder_auto.cpp index ff11efdd66..e31d2991aa 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_builder_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_builder_auto.cpp @@ -120,14 +120,11 @@ bool js_cocos2dx_builder_CCBAnimationManager_actionForSoundChannel(JSContext *cx JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_builder_CCBAnimationManager_actionForSoundChannel : Error processing arguments"); cocos2d::Sequence* ret = cobj->actionForSoundChannel(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sequence*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sequence*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -403,14 +400,11 @@ bool js_cocos2dx_builder_CCBAnimationManager_actionForCallbackChannel(JSContext JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_builder_CCBAnimationManager_actionForCallbackChannel : Error processing arguments"); cocos2d::Sequence* ret = cobj->actionForCallbackChannel(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sequence*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sequence*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -618,14 +612,11 @@ bool js_cocos2dx_builder_CCBAnimationManager_getRootNode(JSContext *cx, uint32_t if (argc == 0) { cocos2d::Node* ret = cobj->getRootNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -989,14 +980,11 @@ bool js_cocos2dx_builder_CCBReader_getAnimationManager(JSContext *cx, uint32_t a if (argc == 0) { cocosbuilder::CCBAnimationManager* ret = cobj->getAnimationManager(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocosbuilder::CCBAnimationManager*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocosbuilder::CCBAnimationManager*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp index bd5c6891b3..33d47b4825 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp @@ -712,14 +712,11 @@ bool js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState(JSContext * JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState : Error processing arguments"); cocos2d::ui::Scale9Sprite* ret = cobj->getBackgroundSpriteForState(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -843,14 +840,11 @@ bool js_cocos2dx_extension_ControlButton_getBackgroundSprite(JSContext *cx, uint if (argc == 0) { cocos2d::ui::Scale9Sprite* ret = cobj->getBackgroundSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1032,14 +1026,11 @@ bool js_cocos2dx_extension_ControlButton_getTitleLabel(JSContext *cx, uint32_t a if (argc == 0) { cocos2d::Node* ret = cobj->getTitleLabel(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1097,14 +1088,11 @@ bool js_cocos2dx_extension_ControlButton_getTitleLabelForState(JSContext *cx, ui JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlButton_getTitleLabelForState : Error processing arguments"); cocos2d::Node* ret = cobj->getTitleLabelForState(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1268,14 +1256,11 @@ bool js_cocos2dx_extension_ControlButton_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1285,14 +1270,11 @@ bool js_cocos2dx_extension_ControlButton_create(JSContext *cx, uint32_t argc, js if (argc == 0) { cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1324,14 +1306,11 @@ bool js_cocos2dx_extension_ControlButton_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1350,14 +1329,11 @@ bool js_cocos2dx_extension_ControlButton_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1582,14 +1558,11 @@ bool js_cocos2dx_extension_ControlHuePicker_getSlider(JSContext *cx, uint32_t ar if (argc == 0) { cocos2d::Sprite* ret = cobj->getSlider(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1655,14 +1628,11 @@ bool js_cocos2dx_extension_ControlHuePicker_getBackground(JSContext *cx, uint32_ if (argc == 0) { cocos2d::Sprite* ret = cobj->getBackground(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1830,14 +1800,11 @@ bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow(JSContext if (argc == 0) { cocos2d::Sprite* ret = cobj->getShadow(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1905,14 +1872,11 @@ bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay(JSContex if (argc == 0) { cocos2d::Sprite* ret = cobj->getOverlay(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1930,14 +1894,11 @@ bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider(JSContext if (argc == 0) { cocos2d::Sprite* ret = cobj->getSlider(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1955,14 +1916,11 @@ bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground(JSCon if (argc == 0) { cocos2d::Sprite* ret = cobj->getBackground(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2148,14 +2106,11 @@ bool js_cocos2dx_extension_ControlColourPicker_getHuePicker(JSContext *cx, uint3 if (argc == 0) { cocos2d::extension::ControlHuePicker* ret = cobj->getHuePicker(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlHuePicker*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlHuePicker*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2173,14 +2128,11 @@ bool js_cocos2dx_extension_ControlColourPicker_getcolourPicker(JSContext *cx, ui if (argc == 0) { cocos2d::extension::ControlSaturationBrightnessPicker* ret = cobj->getcolourPicker(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlSaturationBrightnessPicker*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlSaturationBrightnessPicker*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2312,14 +2264,11 @@ bool js_cocos2dx_extension_ControlColourPicker_getBackground(JSContext *cx, uint if (argc == 0) { cocos2d::Sprite* ret = cobj->getBackground(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2481,14 +2430,11 @@ bool js_cocos2dx_extension_ControlPotentiometer_getProgressTimer(JSContext *cx, if (argc == 0) { cocos2d::ProgressTimer* ret = cobj->getProgressTimer(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ProgressTimer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ProgressTimer*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2766,14 +2712,11 @@ bool js_cocos2dx_extension_ControlPotentiometer_getThumbSprite(JSContext *cx, ui if (argc == 0) { cocos2d::Sprite* ret = cobj->getThumbSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3176,14 +3119,11 @@ bool js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite(JSContext *cx, u if (argc == 0) { cocos2d::Sprite* ret = cobj->getSelectedThumbSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3313,14 +3253,11 @@ bool js_cocos2dx_extension_ControlSlider_getBackgroundSprite(JSContext *cx, uint if (argc == 0) { cocos2d::Sprite* ret = cobj->getBackgroundSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3338,14 +3275,11 @@ bool js_cocos2dx_extension_ControlSlider_getThumbSprite(JSContext *cx, uint32_t if (argc == 0) { cocos2d::Sprite* ret = cobj->getThumbSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3453,14 +3387,11 @@ bool js_cocos2dx_extension_ControlSlider_getProgressSprite(JSContext *cx, uint32 if (argc == 0) { cocos2d::Sprite* ret = cobj->getProgressSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3558,14 +3489,11 @@ bool js_cocos2dx_extension_ControlSlider_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlSlider*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlSlider*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3584,14 +3512,11 @@ bool js_cocos2dx_extension_ControlSlider_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlSlider*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlSlider*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3613,14 +3538,11 @@ bool js_cocos2dx_extension_ControlSlider_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlSlider*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlSlider*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3674,14 +3596,11 @@ bool js_cocos2dx_extension_ControlSlider_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlSlider*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlSlider*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3800,14 +3719,11 @@ bool js_cocos2dx_extension_ControlStepper_getMinusSprite(JSContext *cx, uint32_t if (argc == 0) { cocos2d::Sprite* ret = cobj->getMinusSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3947,14 +3863,11 @@ bool js_cocos2dx_extension_ControlStepper_getMinusLabel(JSContext *cx, uint32_t if (argc == 0) { cocos2d::Label* ret = cobj->getMinusLabel(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Label*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3972,14 +3885,11 @@ bool js_cocos2dx_extension_ControlStepper_getPlusLabel(JSContext *cx, uint32_t a if (argc == 0) { cocos2d::Label* ret = cobj->getPlusLabel(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Label*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4181,14 +4091,11 @@ bool js_cocos2dx_extension_ControlStepper_getPlusSprite(JSContext *cx, uint32_t if (argc == 0) { cocos2d::Sprite* ret = cobj->getPlusSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4689,14 +4596,11 @@ bool js_cocos2dx_extension_ControlSwitch_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlSwitch* ret = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlSwitch*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlSwitch*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4772,14 +4676,11 @@ bool js_cocos2dx_extension_ControlSwitch_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocos2d::extension::ControlSwitch* ret = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlSwitch*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ControlSwitch*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5051,14 +4952,11 @@ bool js_cocos2dx_extension_ScrollView_getContainer(JSContext *cx, uint32_t argc, if (argc == 0) { cocos2d::Node* ret = cobj->getContainer(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5569,14 +5467,11 @@ bool js_cocos2dx_extension_ScrollView_create(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ScrollView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ScrollView*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5589,14 +5484,11 @@ bool js_cocos2dx_extension_ScrollView_create(JSContext *cx, uint32_t argc, jsval if (!ok) { ok = true; break; } cocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ScrollView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ScrollView*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5619,14 +5511,11 @@ bool js_cocos2dx_extension_ScrollView_create(JSContext *cx, uint32_t argc, jsval if (!ok) { ok = true; break; } cocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ScrollView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::ScrollView*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6141,14 +6030,11 @@ bool js_cocos2dx_extension_TableView_cellAtIndex(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_TableView_cellAtIndex : Error processing arguments"); cocos2d::extension::TableViewCell* ret = cobj->cellAtIndex(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::TableViewCell*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::TableViewCell*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6166,14 +6052,11 @@ bool js_cocos2dx_extension_TableView_dequeueCell(JSContext *cx, uint32_t argc, j if (argc == 0) { cocos2d::extension::TableViewCell* ret = cobj->dequeueCell(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::TableViewCell*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::TableViewCell*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6281,14 +6164,11 @@ bool js_cocos2dx_extension_EventAssetsManagerEx_getAssetsManagerEx(JSContext *cx if (argc == 0) { cocos2d::extension::AssetsManagerEx* ret = cobj->getAssetsManagerEx(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::AssetsManagerEx*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::AssetsManagerEx*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6761,14 +6641,11 @@ bool js_cocos2dx_extension_AssetsManagerEx_getLocalManifest(JSContext *cx, uint3 if (argc == 0) { const cocos2d::extension::Manifest* ret = cobj->getLocalManifest(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::Manifest*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::Manifest*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6786,14 +6663,11 @@ bool js_cocos2dx_extension_AssetsManagerEx_getRemoteManifest(JSContext *cx, uint if (argc == 0) { const cocos2d::extension::Manifest* ret = cobj->getRemoteManifest(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::Manifest*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::Manifest*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6940,14 +6814,11 @@ bool js_cocos2dx_extension_EventListenerAssetsManagerEx_init(JSContext *cx, uint auto lambda = [=](cocos2d::extension::EventAssetsManagerEx* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::EventAssetsManagerEx*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::EventAssetsManagerEx*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -6997,14 +6868,11 @@ bool js_cocos2dx_extension_EventListenerAssetsManagerEx_create(JSContext *cx, ui auto lambda = [=](cocos2d::extension::EventAssetsManagerEx* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::EventAssetsManagerEx*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::extension::EventAssetsManagerEx*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp index 49a58325e4..50ef644339 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp @@ -66,14 +66,11 @@ bool js_cocos2dx_physics3d_Physics3DShape_getbtShape(JSContext *cx, uint32_t arg if (argc == 0) { btCollisionShape* ret = cobj->getbtShape(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (btCollisionShape*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (btCollisionShape*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -486,14 +483,11 @@ bool js_cocos2dx_physics3d_Physics3DObject_getPhysicsWorld(JSContext *cx, uint32 if (argc == 0) { cocos2d::Physics3DWorld* ret = cobj->getPhysicsWorld(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DWorld*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DWorld*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -740,14 +734,11 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_getRigidBody(JSContext *cx, uint32 if (argc == 0) { btRigidBody* ret = cobj->getRigidBody(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (btRigidBody*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (btRigidBody*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1441,14 +1432,11 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_getConstraint(JSContext *cx, uint3 JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_getConstraint : Error processing arguments"); cocos2d::Physics3DConstraint* ret = cobj->getConstraint(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1821,14 +1809,11 @@ bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DObject(JSContext *cx, if (argc == 0) { cocos2d::Physics3DObject* ret = cobj->getPhysics3DObject(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DObject*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DObject*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1926,14 +1911,11 @@ bool js_cocos2dx_physics3d_Physics3DComponent_create(JSContext *cx, uint32_t arg if (!ok) { ok = true; break; } cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DComponent*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DComponent*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1956,14 +1938,11 @@ bool js_cocos2dx_physics3d_Physics3DComponent_create(JSContext *cx, uint32_t arg if (!ok) { ok = true; break; } cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DComponent*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DComponent*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1989,14 +1968,11 @@ bool js_cocos2dx_physics3d_Physics3DComponent_create(JSContext *cx, uint32_t arg if (!ok) { ok = true; break; } cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DComponent*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DComponent*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2006,14 +1982,11 @@ bool js_cocos2dx_physics3d_Physics3DComponent_create(JSContext *cx, uint32_t arg if (argc == 0) { cocos2d::Physics3DComponent* ret = cocos2d::Physics3DComponent::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DComponent*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DComponent*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2151,14 +2124,11 @@ bool js_cocos2dx_physics3d_PhysicsSprite3D_getPhysicsObj(JSContext *cx, uint32_t if (argc == 0) { cocos2d::Physics3DObject* ret = cobj->getPhysicsObj(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DObject*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DObject*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2559,14 +2529,11 @@ bool js_cocos2dx_physics3d_Physics3DWorld_getPhysicsObject(JSContext *cx, uint32 JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_getPhysicsObject : Error processing arguments"); cocos2d::Physics3DObject* ret = cobj->getPhysicsObject(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DObject*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DObject*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2871,14 +2838,11 @@ bool js_cocos2dx_physics3d_Physics3DConstraint_getBodyA(JSContext *cx, uint32_t if (argc == 0) { cocos2d::Physics3DRigidBody* ret = cobj->getBodyA(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DRigidBody*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DRigidBody*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2932,14 +2896,11 @@ bool js_cocos2dx_physics3d_Physics3DConstraint_getBodyB(JSContext *cx, uint32_t if (argc == 0) { cocos2d::Physics3DRigidBody* ret = cobj->getBodyB(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DRigidBody*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DRigidBody*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3016,14 +2977,11 @@ bool js_cocos2dx_physics3d_Physics3DConstraint_getbtContraint(JSContext *cx, uin if (argc == 0) { btTypedConstraint* ret = cobj->getbtContraint(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (btTypedConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (btTypedConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3275,14 +3233,11 @@ bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_create(JSContext *cx, if (!ok) { ok = true; break; } cocos2d::Physics3DPointToPointConstraint* ret = cocos2d::Physics3DPointToPointConstraint::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DPointToPointConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DPointToPointConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3306,14 +3261,11 @@ bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_create(JSContext *cx, if (!ok) { ok = true; break; } cocos2d::Physics3DPointToPointConstraint* ret = cocos2d::Physics3DPointToPointConstraint::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DPointToPointConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DPointToPointConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3907,14 +3859,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DHingeConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3943,14 +3892,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DHingeConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3974,14 +3920,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DHingeConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4007,14 +3950,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DHingeConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4058,14 +3998,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DHingeConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4111,14 +4048,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3, arg4, arg5, arg6); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DHingeConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4156,14 +4090,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DHingeConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4203,14 +4134,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_create(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::Physics3DHingeConstraint* ret = cocos2d::Physics3DHingeConstraint::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DHingeConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DHingeConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6107,14 +6035,11 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_create(JSContext *cx, ui if (!ok) { ok = true; break; } cocos2d::Physics3DConeTwistConstraint* ret = cocos2d::Physics3DConeTwistConstraint::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DConeTwistConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DConeTwistConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6138,14 +6063,11 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_create(JSContext *cx, ui if (!ok) { ok = true; break; } cocos2d::Physics3DConeTwistConstraint* ret = cocos2d::Physics3DConeTwistConstraint::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DConeTwistConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3DConeTwistConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6473,14 +6395,11 @@ bool js_cocos2dx_physics3d_Physics3D6DofConstraint_create(JSContext *cx, uint32_ if (!ok) { ok = true; break; } cocos2d::Physics3D6DofConstraint* ret = cocos2d::Physics3D6DofConstraint::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3D6DofConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3D6DofConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6521,14 +6440,11 @@ bool js_cocos2dx_physics3d_Physics3D6DofConstraint_create(JSContext *cx, uint32_ if (!ok) { ok = true; break; } cocos2d::Physics3D6DofConstraint* ret = cocos2d::Physics3D6DofConstraint::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3D6DofConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Physics3D6DofConstraint*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp index 508783c048..100035958c 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp @@ -506,14 +506,11 @@ bool js_cocos2dx_spine_SkeletonRenderer_createWithFile(JSContext *cx, uint32_t a if (!ok) { ok = true; break; } spine::SkeletonRenderer* ret = spine::SkeletonRenderer::createWithFile(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (spine::SkeletonRenderer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (spine::SkeletonRenderer*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -531,14 +528,11 @@ bool js_cocos2dx_spine_SkeletonRenderer_createWithFile(JSContext *cx, uint32_t a if (!ok) { ok = true; break; } spine::SkeletonRenderer* ret = spine::SkeletonRenderer::createWithFile(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (spine::SkeletonRenderer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (spine::SkeletonRenderer*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -555,14 +549,11 @@ bool js_cocos2dx_spine_SkeletonRenderer_createWithFile(JSContext *cx, uint32_t a if (!ok) { ok = true; break; } spine::SkeletonRenderer* ret = spine::SkeletonRenderer::createWithFile(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (spine::SkeletonRenderer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (spine::SkeletonRenderer*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -581,14 +572,11 @@ bool js_cocos2dx_spine_SkeletonRenderer_createWithFile(JSContext *cx, uint32_t a if (!ok) { ok = true; break; } spine::SkeletonRenderer* ret = spine::SkeletonRenderer::createWithFile(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (spine::SkeletonRenderer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (spine::SkeletonRenderer*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1362,14 +1350,11 @@ bool js_cocos2dx_spine_SkeletonAnimation_createWithFile(JSContext *cx, uint32_t if (!ok) { ok = true; break; } spine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (spine::SkeletonAnimation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (spine::SkeletonAnimation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1387,14 +1372,11 @@ bool js_cocos2dx_spine_SkeletonAnimation_createWithFile(JSContext *cx, uint32_t if (!ok) { ok = true; break; } spine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (spine::SkeletonAnimation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (spine::SkeletonAnimation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1411,14 +1393,11 @@ bool js_cocos2dx_spine_SkeletonAnimation_createWithFile(JSContext *cx, uint32_t if (!ok) { ok = true; break; } spine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (spine::SkeletonAnimation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (spine::SkeletonAnimation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1437,14 +1416,11 @@ bool js_cocos2dx_spine_SkeletonAnimation_createWithFile(JSContext *cx, uint32_t if (!ok) { ok = true; break; } spine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (spine::SkeletonAnimation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (spine::SkeletonAnimation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp index 7ca25e49fe..660f580f1a 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp @@ -515,14 +515,11 @@ bool js_cocos2dx_studio_ActionManagerEx_stopActionByName(JSContext *cx, uint32_t JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionManagerEx_stopActionByName : Error processing arguments"); cocostudio::ActionObject* ret = cobj->stopActionByName(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ActionObject*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ActionObject*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -546,14 +543,11 @@ bool js_cocos2dx_studio_ActionManagerEx_getActionByName(JSContext *cx, uint32_t JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionManagerEx_getActionByName : Error processing arguments"); cocostudio::ActionObject* ret = cobj->getActionByName(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ActionObject*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ActionObject*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -636,14 +630,11 @@ bool js_cocos2dx_studio_ActionManagerEx_playActionByName(JSContext *cx, uint32_t if (!ok) { ok = true; break; } cocostudio::ActionObject* ret = cobj->playActionByName(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ActionObject*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ActionObject*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -659,14 +650,11 @@ bool js_cocos2dx_studio_ActionManagerEx_playActionByName(JSContext *cx, uint32_t if (!ok) { ok = true; break; } cocostudio::ActionObject* ret = cobj->playActionByName(arg0, arg1); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ActionObject*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ActionObject*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -708,17 +696,10 @@ bool js_cocos2dx_studio_ActionManagerEx_getInstance(JSContext *cx, uint32_t argc JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ActionManagerEx* ret = cocostudio::ActionManagerEx::getInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ActionManagerEx*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + auto ret = cocostudio::ActionManagerEx::getInstance(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_singleton_get_or_create_jsobject(cx, ret, typeClass, "cocostudio::ActionManagerEx")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ActionManagerEx_getInstance : wrong number of arguments"); @@ -908,14 +889,11 @@ bool js_cocos2dx_studio_MovementData_getMovementBoneData(JSContext *cx, uint32_t JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_MovementData_getMovementBoneData : Error processing arguments"); cocostudio::MovementBoneData* ret = cobj->getMovementBoneData(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::MovementBoneData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::MovementBoneData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1044,14 +1022,11 @@ bool js_cocos2dx_studio_AnimationData_getMovement(JSContext *cx, uint32_t argc, JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_AnimationData_getMovement : Error processing arguments"); cocostudio::MovementData* ret = cobj->getMovement(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::MovementData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::MovementData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1316,14 +1291,11 @@ bool js_cocos2dx_studio_TextureData_getContourData(JSContext *cx, uint32_t argc, JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_TextureData_getContourData : Error processing arguments"); cocostudio::ContourData* ret = cobj->getContourData(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ContourData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ContourData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1842,14 +1814,11 @@ bool js_cocos2dx_studio_Tween_getAnimation(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocostudio::ArmatureAnimation* ret = cobj->getAnimation(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ArmatureAnimation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ArmatureAnimation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2185,14 +2154,11 @@ bool js_cocos2dx_studio_ColliderDetector_getBone(JSContext *cx, uint32_t argc, j if (argc == 0) { cocostudio::Bone* ret = cobj->getBone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Bone*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Bone*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2385,14 +2351,11 @@ bool js_cocos2dx_studio_ColliderDetector_create(JSContext *cx, uint32_t argc, js if (!ok) { ok = true; break; } cocostudio::ColliderDetector* ret = cocostudio::ColliderDetector::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ColliderDetector*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ColliderDetector*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2402,14 +2365,11 @@ bool js_cocos2dx_studio_ColliderDetector_create(JSContext *cx, uint32_t argc, js if (argc == 0) { cocostudio::ColliderDetector* ret = cocostudio::ColliderDetector::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ColliderDetector*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ColliderDetector*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2481,14 +2441,11 @@ bool js_cocos2dx_studio_DecorativeDisplay_getColliderDetector(JSContext *cx, uin if (argc == 0) { cocostudio::ColliderDetector* ret = cobj->getColliderDetector(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ColliderDetector*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ColliderDetector*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2506,14 +2463,11 @@ bool js_cocos2dx_studio_DecorativeDisplay_getDisplay(JSContext *cx, uint32_t arg if (argc == 0) { cocos2d::Node* ret = cobj->getDisplay(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2605,14 +2559,11 @@ bool js_cocos2dx_studio_DecorativeDisplay_getDisplayData(JSContext *cx, uint32_t if (argc == 0) { cocostudio::DisplayData* ret = cobj->getDisplayData(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::DisplayData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::DisplayData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2726,14 +2677,11 @@ bool js_cocos2dx_studio_DisplayManager_getCurrentDecorativeDisplay(JSContext *cx if (argc == 0) { cocostudio::DecorativeDisplay* ret = cobj->getCurrentDecorativeDisplay(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::DecorativeDisplay*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::DecorativeDisplay*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2751,14 +2699,11 @@ bool js_cocos2dx_studio_DisplayManager_getDisplayRenderNode(JSContext *cx, uint3 if (argc == 0) { cocos2d::Node* ret = cobj->getDisplayRenderNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3141,14 +3086,11 @@ bool js_cocos2dx_studio_DisplayManager_getDecorativeDisplayByIndex(JSContext *cx JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_DisplayManager_getDecorativeDisplayByIndex : Error processing arguments"); cocostudio::DecorativeDisplay* ret = cobj->getDecorativeDisplayByIndex(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::DecorativeDisplay*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::DecorativeDisplay*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3441,14 +3383,11 @@ bool js_cocos2dx_studio_Bone_getDisplayRenderNode(JSContext *cx, uint32_t argc, if (argc == 0) { cocos2d::Node* ret = cobj->getDisplayRenderNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3512,14 +3451,11 @@ bool js_cocos2dx_studio_Bone_getWorldInfo(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocostudio::BaseData* ret = cobj->getWorldInfo(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::BaseData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::BaseData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3537,14 +3473,11 @@ bool js_cocos2dx_studio_Bone_getTween(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocostudio::Tween* ret = cobj->getTween(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Tween*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Tween*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3562,14 +3495,11 @@ bool js_cocos2dx_studio_Bone_getParentBone(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocostudio::Bone* ret = cobj->getParentBone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Bone*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Bone*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3855,14 +3785,11 @@ bool js_cocos2dx_studio_Bone_getColliderDetector(JSContext *cx, uint32_t argc, j if (argc == 0) { cocostudio::ColliderDetector* ret = cobj->getColliderDetector(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ColliderDetector*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ColliderDetector*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3880,14 +3807,11 @@ bool js_cocos2dx_studio_Bone_getChildArmature(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocostudio::Armature* ret = cobj->getChildArmature(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Armature*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Armature*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4073,14 +3997,11 @@ bool js_cocos2dx_studio_Bone_getDisplayManager(JSContext *cx, uint32_t argc, jsv if (argc == 0) { cocostudio::DisplayManager* ret = cobj->getDisplayManager(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::DisplayManager*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::DisplayManager*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4098,14 +4019,11 @@ bool js_cocos2dx_studio_Bone_getArmature(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocostudio::Armature* ret = cobj->getArmature(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Armature*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Armature*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4125,14 +4043,11 @@ bool js_cocos2dx_studio_Bone_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocostudio::Bone* ret = cocostudio::Bone::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Bone*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Bone*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4142,14 +4057,11 @@ bool js_cocos2dx_studio_Bone_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocostudio::Bone* ret = cocostudio::Bone::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Bone*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Bone*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4498,14 +4410,11 @@ bool js_cocos2dx_studio_ArmatureAnimation_getAnimationData(JSContext *cx, uint32 if (argc == 0) { cocostudio::AnimationData* ret = cobj->getAnimationData(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::AnimationData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::AnimationData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4952,14 +4861,11 @@ bool js_cocos2dx_studio_ArmatureDataManager_getTextureData(JSContext *cx, uint32 JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ArmatureDataManager_getTextureData : Error processing arguments"); cocostudio::TextureData* ret = cobj->getTextureData(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::TextureData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::TextureData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4981,14 +4887,11 @@ bool js_cocos2dx_studio_ArmatureDataManager_getArmatureData(JSContext *cx, uint3 JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ArmatureDataManager_getArmatureData : Error processing arguments"); cocostudio::ArmatureData* ret = cobj->getArmatureData(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ArmatureData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ArmatureData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5010,14 +4913,11 @@ bool js_cocos2dx_studio_ArmatureDataManager_getAnimationData(JSContext *cx, uint JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ArmatureDataManager_getAnimationData : Error processing arguments"); cocostudio::AnimationData* ret = cobj->getAnimationData(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::AnimationData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::AnimationData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5270,17 +5170,10 @@ bool js_cocos2dx_studio_ArmatureDataManager_getInstance(JSContext *cx, uint32_t JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ArmatureDataManager* ret = cocostudio::ArmatureDataManager::getInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ArmatureDataManager*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + auto ret = cocostudio::ArmatureDataManager::getInstance(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_singleton_get_or_create_jsobject(cx, ret, typeClass, "cocostudio::ArmatureDataManager")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ArmatureDataManager_getInstance : wrong number of arguments"); @@ -5364,14 +5257,11 @@ bool js_cocos2dx_studio_Armature_getBone(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Armature_getBone : Error processing arguments"); cocostudio::Bone* ret = cobj->getBone(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Bone*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Bone*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5453,14 +5343,11 @@ bool js_cocos2dx_studio_Armature_getBoneAtPoint(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Armature_getBoneAtPoint : Error processing arguments"); cocostudio::Bone* ret = cobj->getBoneAtPoint(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Bone*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Bone*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5532,14 +5419,11 @@ bool js_cocos2dx_studio_Armature_getParentBone(JSContext *cx, uint32_t argc, jsv if (argc == 0) { cocostudio::Bone* ret = cobj->getParentBone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Bone*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Bone*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5587,14 +5471,11 @@ bool js_cocos2dx_studio_Armature_getBatchNode(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocostudio::BatchNode* ret = cobj->getBatchNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::BatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::BatchNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5795,14 +5676,11 @@ bool js_cocos2dx_studio_Armature_getArmatureData(JSContext *cx, uint32_t argc, j if (argc == 0) { cocostudio::ArmatureData* ret = cobj->getArmatureData(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ArmatureData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ArmatureData*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5856,14 +5734,11 @@ bool js_cocos2dx_studio_Armature_getAnimation(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocostudio::ArmatureAnimation* ret = cobj->getAnimation(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ArmatureAnimation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ArmatureAnimation*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5939,14 +5814,11 @@ bool js_cocos2dx_studio_Armature_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocostudio::Armature* ret = cocostudio::Armature::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Armature*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Armature*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5956,14 +5828,11 @@ bool js_cocos2dx_studio_Armature_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocostudio::Armature* ret = cocostudio::Armature::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Armature*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Armature*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5987,14 +5856,11 @@ bool js_cocos2dx_studio_Armature_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocostudio::Armature* ret = cocostudio::Armature::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Armature*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Armature*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6116,14 +5982,11 @@ bool js_cocos2dx_studio_Skin_getBone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocostudio::Bone* ret = cobj->getBone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Bone*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Bone*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6223,14 +6086,11 @@ bool js_cocos2dx_studio_Skin_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocostudio::Skin* ret = cocostudio::Skin::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Skin*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Skin*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6240,14 +6100,11 @@ bool js_cocos2dx_studio_Skin_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocostudio::Skin* ret = cocostudio::Skin::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Skin*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::Skin*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7713,14 +7570,11 @@ bool js_cocos2dx_studio_ComRender_getNode(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocos2d::Node* ret = cobj->getNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7751,14 +7605,11 @@ bool js_cocos2dx_studio_ComRender_create(JSContext *cx, uint32_t argc, jsval *vp if (!ok) { ok = true; break; } cocostudio::ComRender* ret = cocostudio::ComRender::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComRender*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ComRender*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7768,14 +7619,11 @@ bool js_cocos2dx_studio_ComRender_create(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocostudio::ComRender* ret = cocostudio::ComRender::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComRender*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::ComRender*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7904,14 +7752,11 @@ bool js_cocos2dx_studio_Frame_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocostudio::timeline::Frame* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::Frame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::Frame*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8137,14 +7982,11 @@ bool js_cocos2dx_studio_Frame_getTimeline(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocostudio::timeline::Timeline* ret = cobj->getTimeline(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::Timeline*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::Timeline*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8162,14 +8004,11 @@ bool js_cocos2dx_studio_Frame_getNode(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::Node* ret = cobj->getNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10243,14 +10082,11 @@ bool js_cocos2dx_studio_Timeline_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocostudio::timeline::Timeline* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::Timeline*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::Timeline*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10316,14 +10152,11 @@ bool js_cocos2dx_studio_Timeline_getActionTimeline(JSContext *cx, uint32_t argc, if (argc == 0) { cocostudio::timeline::ActionTimeline* ret = cobj->getActionTimeline(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ActionTimeline*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::ActionTimeline*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10455,14 +10288,11 @@ bool js_cocos2dx_studio_Timeline_getNode(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::Node* ret = cobj->getNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10798,14 +10628,11 @@ bool js_cocos2dx_studio_ActionTimeline_setFrameEventCallFunc(JSContext *cx, uint auto lambda = [=](cocostudio::timeline::Frame* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::Frame*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::Frame*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -11945,14 +11772,11 @@ bool js_cocos2dx_studio_BoneNode_getRootSkeletonNode(JSContext *cx, uint32_t arg if (argc == 0) { cocostudio::timeline::SkeletonNode* ret = cobj->getRootSkeletonNode(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::SkeletonNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::SkeletonNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12120,14 +11944,11 @@ bool js_cocos2dx_studio_BoneNode_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocostudio::timeline::BoneNode* ret = cocostudio::timeline::BoneNode::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::BoneNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::BoneNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12137,14 +11958,11 @@ bool js_cocos2dx_studio_BoneNode_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocostudio::timeline::BoneNode* ret = cocostudio::timeline::BoneNode::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::BoneNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::BoneNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12266,14 +12084,11 @@ bool js_cocos2dx_studio_SkeletonNode_getBoneNode(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_SkeletonNode_getBoneNode : Error processing arguments"); cocostudio::timeline::BoneNode* ret = cobj->getBoneNode(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::BoneNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocostudio::timeline::BoneNode*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp index 9c298b3a48..66846bc243 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp @@ -33,14 +33,11 @@ bool js_cocos2dx_ui_LayoutParameter_clone(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocos2d::ui::LayoutParameter* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LayoutParameter*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LayoutParameter*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -76,14 +73,11 @@ bool js_cocos2dx_ui_LayoutParameter_createCloneInstance(JSContext *cx, uint32_t if (argc == 0) { cocos2d::ui::LayoutParameter* ret = cobj->createCloneInstance(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LayoutParameter*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LayoutParameter*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -646,14 +640,11 @@ bool js_cocos2dx_ui_Widget_getVirtualRenderer(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocos2d::Node* ret = cobj->getVirtualRenderer(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Node*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -879,14 +870,11 @@ bool js_cocos2dx_ui_Widget_getLayoutParameter(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocos2d::ui::LayoutParameter* ret = cobj->getLayoutParameter(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LayoutParameter*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LayoutParameter*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -912,14 +900,11 @@ bool js_cocos2dx_ui_Widget_addCCSEventListener(JSContext *cx, uint32_t argc, jsv auto lambda = [=](cocos2d::Ref* larg0, int larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -1024,14 +1009,11 @@ bool js_cocos2dx_ui_Widget_findNextFocusedWidget(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Widget_findNextFocusedWidget : Error processing arguments"); cocos2d::ui::Widget* ret = cobj->findNextFocusedWidget(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1377,14 +1359,11 @@ bool js_cocos2dx_ui_Widget_clone(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::Widget* ret = cobj->clone(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -1743,14 +1722,11 @@ bool js_cocos2dx_ui_Widget_addTouchEventListener(JSContext *cx, uint32_t argc, j auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::Widget::TouchEventType larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, (int)larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -1869,14 +1845,11 @@ bool js_cocos2dx_ui_Widget_addClickEventListener(JSContext *cx, uint32_t argc, j auto lambda = [=](cocos2d::Ref* larg0) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[1]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; JS::RootedValue rval(cx); bool succeed = func->invoke(1, &largv[0], &rval); if (!succeed && JS_IsExceptionPending(cx)) { @@ -2099,14 +2072,11 @@ bool js_cocos2dx_ui_Widget_getCurrentFocusedWidget(JSContext *cx, uint32_t argc, cocos2d::ui::Widget* ret = cocos2d::ui::Widget::getCurrentFocusedWidget(); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -2427,7 +2397,7 @@ bool js_cocos2dx_ui_Layout_getRenderFile(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -3192,14 +3162,11 @@ bool js_cocos2dx_ui_Button_getTitleRenderer(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::Label* ret = cobj->getTitleRenderer(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Label*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3217,14 +3184,11 @@ bool js_cocos2dx_ui_Button_getRendererClicked(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocos2d::ui::Scale9Sprite* ret = cobj->getRendererClicked(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3242,7 +3206,7 @@ bool js_cocos2dx_ui_Button_getDisabledFile(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::ResourceData ret = cobj->getDisabledFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -3316,7 +3280,7 @@ bool js_cocos2dx_ui_Button_getNormalFile(JSContext *cx, uint32_t argc, jsval *vp if (argc == 0) { cocos2d::ResourceData ret = cobj->getNormalFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -3350,14 +3314,11 @@ bool js_cocos2dx_ui_Button_getRendererDisabled(JSContext *cx, uint32_t argc, jsv if (argc == 0) { cocos2d::ui::Scale9Sprite* ret = cobj->getRendererDisabled(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3790,7 +3751,7 @@ bool js_cocos2dx_ui_Button_getPressedFile(JSContext *cx, uint32_t argc, jsval *v if (argc == 0) { cocos2d::ResourceData ret = cobj->getPressedFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -3826,14 +3787,11 @@ bool js_cocos2dx_ui_Button_getRendererNormal(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::ui::Scale9Sprite* ret = cobj->getRendererNormal(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3929,14 +3887,11 @@ bool js_cocos2dx_ui_Button_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Button* ret = cocos2d::ui::Button::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Button*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Button*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3951,14 +3906,11 @@ bool js_cocos2dx_ui_Button_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Button* ret = cocos2d::ui::Button::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Button*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Button*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -3976,14 +3928,11 @@ bool js_cocos2dx_ui_Button_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Button* ret = cocos2d::ui::Button::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Button*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Button*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4004,14 +3953,11 @@ bool js_cocos2dx_ui_Button_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Button* ret = cocos2d::ui::Button::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Button*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Button*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4021,14 +3967,11 @@ bool js_cocos2dx_ui_Button_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::Button* ret = cocos2d::ui::Button::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Button*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Button*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4164,7 +4107,7 @@ bool js_cocos2dx_ui_AbstractCheckButton_getCrossDisabledFile(JSContext *cx, uint if (argc == 0) { cocos2d::ResourceData ret = cobj->getCrossDisabledFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -4182,7 +4125,7 @@ bool js_cocos2dx_ui_AbstractCheckButton_getBackDisabledFile(JSContext *cx, uint3 if (argc == 0) { cocos2d::ResourceData ret = cobj->getBackDisabledFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -4260,7 +4203,7 @@ bool js_cocos2dx_ui_AbstractCheckButton_getCrossNormalFile(JSContext *cx, uint32 if (argc == 0) { cocos2d::ResourceData ret = cobj->getCrossNormalFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -4298,7 +4241,7 @@ bool js_cocos2dx_ui_AbstractCheckButton_getBackPressedFile(JSContext *cx, uint32 if (argc == 0) { cocos2d::ResourceData ret = cobj->getBackPressedFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -4316,14 +4259,11 @@ bool js_cocos2dx_ui_AbstractCheckButton_getRendererFrontCrossDisabled(JSContext if (argc == 0) { cocos2d::Sprite* ret = cobj->getRendererFrontCrossDisabled(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4341,14 +4281,11 @@ bool js_cocos2dx_ui_AbstractCheckButton_getRendererBackground(JSContext *cx, uin if (argc == 0) { cocos2d::Sprite* ret = cobj->getRendererBackground(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4396,14 +4333,11 @@ bool js_cocos2dx_ui_AbstractCheckButton_getRendererBackgroundDisabled(JSContext if (argc == 0) { cocos2d::Sprite* ret = cobj->getRendererBackgroundDisabled(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4489,7 +4423,7 @@ bool js_cocos2dx_ui_AbstractCheckButton_getBackNormalFile(JSContext *cx, uint32_ if (argc == 0) { cocos2d::ResourceData ret = cobj->getBackNormalFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -4571,14 +4505,11 @@ bool js_cocos2dx_ui_AbstractCheckButton_getRendererFrontCross(JSContext *cx, uin if (argc == 0) { cocos2d::Sprite* ret = cobj->getRendererFrontCross(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4596,14 +4527,11 @@ bool js_cocos2dx_ui_AbstractCheckButton_getRendererBackgroundSelected(JSContext if (argc == 0) { cocos2d::Sprite* ret = cobj->getRendererBackgroundSelected(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4776,14 +4704,11 @@ bool js_cocos2dx_ui_CheckBox_addEventListener(JSContext *cx, uint32_t argc, jsva auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::CheckBox::EventType larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, (int)larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -4832,14 +4757,11 @@ bool js_cocos2dx_ui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::CheckBox* ret = cocos2d::ui::CheckBox::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::CheckBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::CheckBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4866,14 +4788,11 @@ bool js_cocos2dx_ui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::CheckBox* ret = cocos2d::ui::CheckBox::create(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::CheckBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::CheckBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4883,14 +4802,11 @@ bool js_cocos2dx_ui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::CheckBox* ret = cocos2d::ui::CheckBox::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::CheckBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::CheckBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4906,14 +4822,11 @@ bool js_cocos2dx_ui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::CheckBox* ret = cocos2d::ui::CheckBox::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::CheckBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::CheckBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -4931,14 +4844,11 @@ bool js_cocos2dx_ui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::CheckBox* ret = cocos2d::ui::CheckBox::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::CheckBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::CheckBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5046,14 +4956,11 @@ bool js_cocos2dx_ui_RadioButton_addEventListener(JSContext *cx, uint32_t argc, j auto lambda = [=](cocos2d::ui::RadioButton* larg0, cocos2d::ui::RadioButton::EventType larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButton*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RadioButton*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, (int)larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -5102,14 +5009,11 @@ bool js_cocos2dx_ui_RadioButton_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::RadioButton* ret = cocos2d::ui::RadioButton::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RadioButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5136,14 +5040,11 @@ bool js_cocos2dx_ui_RadioButton_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::RadioButton* ret = cocos2d::ui::RadioButton::create(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RadioButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5153,14 +5054,11 @@ bool js_cocos2dx_ui_RadioButton_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::RadioButton* ret = cocos2d::ui::RadioButton::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RadioButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5176,14 +5074,11 @@ bool js_cocos2dx_ui_RadioButton_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::RadioButton* ret = cocos2d::ui::RadioButton::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RadioButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5201,14 +5096,11 @@ bool js_cocos2dx_ui_RadioButton_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::RadioButton* ret = cocos2d::ui::RadioButton::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RadioButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5444,14 +5336,11 @@ bool js_cocos2dx_ui_RadioButtonGroup_addEventListener(JSContext *cx, uint32_t ar auto lambda = [=](cocos2d::ui::RadioButton* larg0, int larg1, cocos2d::ui::RadioButtonGroup::EventType larg2) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[3]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButton*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RadioButton*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, larg1); largv[2] = int32_to_jsval(cx, (int)larg2); JS::RootedValue rval(cx); @@ -5507,14 +5396,11 @@ bool js_cocos2dx_ui_RadioButtonGroup_getRadioButtonByIndex(JSContext *cx, uint32 JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RadioButtonGroup_getRadioButtonByIndex : Error processing arguments"); cocos2d::ui::RadioButton* ret = cobj->getRadioButtonByIndex(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButton*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RadioButton*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5853,7 +5739,7 @@ bool js_cocos2dx_ui_ImageView_getRenderFile(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -5909,14 +5795,11 @@ bool js_cocos2dx_ui_ImageView_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::ImageView* ret = cocos2d::ui::ImageView::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ImageView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::ImageView*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5931,14 +5814,11 @@ bool js_cocos2dx_ui_ImageView_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::ImageView* ret = cocos2d::ui::ImageView::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ImageView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::ImageView*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -5948,14 +5828,11 @@ bool js_cocos2dx_ui_ImageView_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::ImageView* ret = cocos2d::ui::ImageView::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ImageView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::ImageView*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6584,14 +6461,11 @@ bool js_cocos2dx_ui_Text_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Text* ret = cocos2d::ui::Text::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Text*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Text*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6601,14 +6475,11 @@ bool js_cocos2dx_ui_Text_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::Text* ret = cocos2d::ui::Text::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Text*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Text*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6787,7 +6658,7 @@ bool js_cocos2dx_ui_TextAtlas_getRenderFile(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -6863,14 +6734,11 @@ bool js_cocos2dx_ui_TextAtlas_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::TextAtlas* ret = cocos2d::ui::TextAtlas::create(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::TextAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::TextAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -6880,14 +6748,11 @@ bool js_cocos2dx_ui_TextAtlas_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::TextAtlas* ret = cocos2d::ui::TextAtlas::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::TextAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::TextAtlas*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7062,7 +6927,7 @@ bool js_cocos2dx_ui_LoadingBar_getRenderFile(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -7194,14 +7059,11 @@ bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::LoadingBar* ret = cocos2d::ui::LoadingBar::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LoadingBar*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LoadingBar*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7216,14 +7078,11 @@ bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::LoadingBar* ret = cocos2d::ui::LoadingBar::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LoadingBar*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LoadingBar*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7233,14 +7092,11 @@ bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::LoadingBar* ret = cocos2d::ui::LoadingBar::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LoadingBar*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LoadingBar*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7256,14 +7112,11 @@ bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::LoadingBar* ret = cocos2d::ui::LoadingBar::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LoadingBar*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LoadingBar*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7281,14 +7134,11 @@ bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::LoadingBar* ret = cocos2d::ui::LoadingBar::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LoadingBar*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LoadingBar*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7585,14 +7435,11 @@ bool js_cocos2dx_ui_ScrollView_getInnerContainer(JSContext *cx, uint32_t argc, j if (argc == 0) { cocos2d::ui::Layout* ret = cobj->getInnerContainer(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Layout*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Layout*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -7822,14 +7669,11 @@ bool js_cocos2dx_ui_ScrollView_addEventListener(JSContext *cx, uint32_t argc, js auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::ScrollView::EventType larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, (int)larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -8605,14 +8449,11 @@ bool js_cocos2dx_ui_ListView_getCenterItemInCurrentView(JSContext *cx, uint32_t if (argc == 0) { cocos2d::ui::Widget* ret = cobj->getCenterItemInCurrentView(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8816,14 +8657,11 @@ bool js_cocos2dx_ui_ListView_addEventListener(JSContext *cx, uint32_t argc, jsva auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::ListView::EventType larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, (int)larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -8874,14 +8712,11 @@ bool js_cocos2dx_ui_ListView_getTopmostItemInCurrentView(JSContext *cx, uint32_t if (argc == 0) { cocos2d::ui::Widget* ret = cobj->getTopmostItemInCurrentView(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8915,14 +8750,11 @@ bool js_cocos2dx_ui_ListView_getBottommostItemInCurrentView(JSContext *cx, uint3 if (argc == 0) { cocos2d::ui::Widget* ret = cobj->getBottommostItemInCurrentView(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -8958,14 +8790,11 @@ bool js_cocos2dx_ui_ListView_getLeftmostItemInCurrentView(JSContext *cx, uint32_ if (argc == 0) { cocos2d::ui::Widget* ret = cobj->getLeftmostItemInCurrentView(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -9025,14 +8854,11 @@ bool js_cocos2dx_ui_ListView_getItem(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_getItem : Error processing arguments"); cocos2d::ui::Widget* ret = cobj->getItem(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -9161,14 +8987,11 @@ bool js_cocos2dx_ui_ListView_getClosestItemToPosition(JSContext *cx, uint32_t ar JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_getClosestItemToPosition : Error processing arguments"); cocos2d::ui::Widget* ret = cobj->getClosestItemToPosition(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -9186,14 +9009,11 @@ bool js_cocos2dx_ui_ListView_getRightmostItemInCurrentView(JSContext *cx, uint32 if (argc == 0) { cocos2d::ui::Widget* ret = cobj->getRightmostItemInCurrentView(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -9217,14 +9037,11 @@ bool js_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView(JSContext *cx JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView : Error processing arguments"); cocos2d::ui::Widget* ret = cobj->getClosestItemToPositionInCurrentView(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -9524,7 +9341,7 @@ bool js_cocos2dx_ui_Slider_getBallNormalFile(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::ResourceData ret = cobj->getBallNormalFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -9580,7 +9397,7 @@ bool js_cocos2dx_ui_Slider_getBallPressedFile(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocos2d::ResourceData ret = cobj->getBallPressedFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -9680,14 +9497,11 @@ bool js_cocos2dx_ui_Slider_addEventListener(JSContext *cx, uint32_t argc, jsval auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::Slider::EventType larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, (int)larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -9772,7 +9586,7 @@ bool js_cocos2dx_ui_Slider_getProgressBarFile(JSContext *cx, uint32_t argc, jsva if (argc == 0) { cocos2d::ResourceData ret = cobj->getProgressBarFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -9838,7 +9652,7 @@ bool js_cocos2dx_ui_Slider_getBackFile(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ResourceData ret = cobj->getBackFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -9874,7 +9688,7 @@ bool js_cocos2dx_ui_Slider_getBallDisabledFile(JSContext *cx, uint32_t argc, jsv if (argc == 0) { cocos2d::ResourceData ret = cobj->getBallDisabledFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -10025,14 +9839,11 @@ bool js_cocos2dx_ui_Slider_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Slider* ret = cocos2d::ui::Slider::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Slider*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Slider*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10050,14 +9861,11 @@ bool js_cocos2dx_ui_Slider_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Slider* ret = cocos2d::ui::Slider::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Slider*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Slider*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -10067,14 +9875,11 @@ bool js_cocos2dx_ui_Slider_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::Slider* ret = cocos2d::ui::Slider::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Slider*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Slider*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11105,14 +10910,11 @@ bool js_cocos2dx_ui_TextField_addEventListener(JSContext *cx, uint32_t argc, jsv auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::TextField::EventType larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, (int)larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -11661,14 +11463,11 @@ bool js_cocos2dx_ui_TextField_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::TextField* ret = cocos2d::ui::TextField::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::TextField*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::TextField*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11678,14 +11477,11 @@ bool js_cocos2dx_ui_TextField_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::TextField* ret = cocos2d::ui::TextField::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::TextField*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::TextField*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11881,7 +11677,7 @@ bool js_cocos2dx_ui_TextBMFont_getRenderFile(JSContext *cx, uint32_t argc, jsval if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; + jsret = resourcedata_to_jsval(cx, ret); args.rval().set(jsret); return true; } @@ -11924,14 +11720,11 @@ bool js_cocos2dx_ui_TextBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::TextBMFont* ret = cocos2d::ui::TextBMFont::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::TextBMFont*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::TextBMFont*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -11941,14 +11734,11 @@ bool js_cocos2dx_ui_TextBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::TextBMFont* ret = cocos2d::ui::TextBMFont::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::TextBMFont*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::TextBMFont*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12250,14 +12040,11 @@ bool js_cocos2dx_ui_PageView_addEventListener(JSContext *cx, uint32_t argc, jsva auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::PageView::EventType larg1) -> void { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET jsval largv[2]; - do { if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); + largv[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Ref*)larg0)); + } else { + largv[0] = JSVAL_NULL; + }; largv[1] = int32_to_jsval(cx, (int)larg1); JS::RootedValue rval(cx); bool succeed = func->invoke(2, &largv[0], &rval); @@ -12685,14 +12472,11 @@ bool js_cocos2dx_ui_Helper_seekActionWidgetByActionTag(JSContext *cx, uint32_t a cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekActionWidgetByActionTag(arg0, arg1); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12721,14 +12505,11 @@ bool js_cocos2dx_ui_Helper_seekWidgetByName(JSContext *cx, uint32_t argc, jsval cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekWidgetByName(arg0, arg1); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -12757,14 +12538,11 @@ bool js_cocos2dx_ui_Helper_seekWidgetByTag(JSContext *cx, uint32_t argc, jsval * cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekWidgetByTag(arg0, arg1); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Widget*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13674,14 +13452,11 @@ bool js_cocos2dx_ui_HBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::HBox* ret = cocos2d::ui::HBox::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::HBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::HBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13691,14 +13466,11 @@ bool js_cocos2dx_ui_HBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::HBox* ret = cocos2d::ui::HBox::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::HBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::HBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13822,14 +13594,11 @@ bool js_cocos2dx_ui_VBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::VBox* ret = cocos2d::ui::VBox::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::VBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::VBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13839,14 +13608,11 @@ bool js_cocos2dx_ui_VBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::VBox* ret = cocos2d::ui::VBox::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::VBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::VBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13970,14 +13736,11 @@ bool js_cocos2dx_ui_RelativeBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::RelativeBox* ret = cocos2d::ui::RelativeBox::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RelativeBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RelativeBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -13987,14 +13750,11 @@ bool js_cocos2dx_ui_RelativeBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::RelativeBox* ret = cocos2d::ui::RelativeBox::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RelativeBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::RelativeBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -14270,14 +14030,11 @@ bool js_cocos2dx_ui_Scale9Sprite_resizableSpriteWithCapInsets(JSContext *cx, uin JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Scale9Sprite_resizableSpriteWithCapInsets : Error processing arguments"); cocos2d::ui::Scale9Sprite* ret = cobj->resizableSpriteWithCapInsets(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -14412,14 +14169,11 @@ bool js_cocos2dx_ui_Scale9Sprite_getSprite(JSContext *cx, uint32_t argc, jsval * if (argc == 0) { cocos2d::Sprite* ret = cobj->getSprite(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15087,14 +14841,11 @@ bool js_cocos2dx_ui_Scale9Sprite_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15104,14 +14855,11 @@ bool js_cocos2dx_ui_Scale9Sprite_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 0) { cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::create(); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15127,14 +14875,11 @@ bool js_cocos2dx_ui_Scale9Sprite_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15150,14 +14895,11 @@ bool js_cocos2dx_ui_Scale9Sprite_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15170,14 +14912,11 @@ bool js_cocos2dx_ui_Scale9Sprite_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::create(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15200,14 +14939,11 @@ bool js_cocos2dx_ui_Scale9Sprite_createWithSpriteFrameName(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::createWithSpriteFrameName(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15220,14 +14956,11 @@ bool js_cocos2dx_ui_Scale9Sprite_createWithSpriteFrameName(JSContext *cx, uint32 if (!ok) { ok = true; break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::createWithSpriteFrameName(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15258,14 +14991,11 @@ bool js_cocos2dx_ui_Scale9Sprite_createWithSpriteFrame(JSContext *cx, uint32_t a if (!ok) { ok = true; break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::createWithSpriteFrame(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15286,14 +15016,11 @@ bool js_cocos2dx_ui_Scale9Sprite_createWithSpriteFrame(JSContext *cx, uint32_t a if (!ok) { ok = true; break; } cocos2d::ui::Scale9Sprite* ret = cocos2d::ui::Scale9Sprite::createWithSpriteFrame(arg0); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Scale9Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::Scale9Sprite*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15878,14 +15605,11 @@ bool js_cocos2dx_ui_EditBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::EditBox* ret = cocos2d::ui::EditBox::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::EditBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::EditBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15903,14 +15627,11 @@ bool js_cocos2dx_ui_EditBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::EditBox* ret = cocos2d::ui::EditBox::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::EditBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::EditBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15934,14 +15655,11 @@ bool js_cocos2dx_ui_EditBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::EditBox* ret = cocos2d::ui::EditBox::create(arg0, arg1); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::EditBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::EditBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -15975,14 +15693,11 @@ bool js_cocos2dx_ui_EditBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::EditBox* ret = cocos2d::ui::EditBox::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::EditBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::EditBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -16027,14 +15742,11 @@ bool js_cocos2dx_ui_EditBox_create(JSContext *cx, uint32_t argc, jsval *vp) if (!ok) { ok = true; break; } cocos2d::ui::EditBox* ret = cocos2d::ui::EditBox::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::EditBox*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::EditBox*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } @@ -17105,14 +16817,11 @@ bool js_cocos2dx_ui_LayoutComponent_bindLayoutComponent(JSContext *cx, uint32_t cocos2d::ui::LayoutComponent* ret = cocos2d::ui::LayoutComponent::bindLayoutComponent(arg0); jsval jsret = JSVAL_NULL; - do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LayoutComponent*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::ui::LayoutComponent*)ret)); + } else { + jsret = JSVAL_NULL; + }; args.rval().set(jsret); return true; } diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index d02b23901f..6a0acc472c 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -1184,7 +1184,7 @@ bool ScriptingCore::handleTouchesEvent(void* nativeObj, cocos2d::EventTouch::Eve for (const auto& touch : touches) { - JS::RootedValue jsret(_cx, getJSObject(this->_cx, touch)); + JS::RootedValue jsret(_cx, OBJECT_TO_JSVAL(js_get_or_create_jsobject(this->_cx, touch))); if (!JS_SetElement(this->_cx, jsretArr, count, jsret)) { break; @@ -1199,7 +1199,7 @@ bool ScriptingCore::handleTouchesEvent(void* nativeObj, cocos2d::EventTouch::Eve jsval dataVal[2]; dataVal[0] = OBJECT_TO_JSVAL(jsretArr); - dataVal[1] = getJSObject(_cx, event); + dataVal[1] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(_cx, event)); ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), funcName.c_str(), 2, dataVal, jsvalRet); @@ -1237,8 +1237,8 @@ bool ScriptingCore::handleTouchEvent(void* nativeObj, cocos2d::EventTouch::Event if (!p) break; jsval dataVal[2]; - dataVal[0] = getJSObject(_cx, touch); - dataVal[1] = getJSObject(_cx, event); + dataVal[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(_cx, touch)); + dataVal[1] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(_cx, event)); // if (jsvalRet != nullptr) // { @@ -1288,7 +1288,7 @@ bool ScriptingCore::handleMouseEvent(void* nativeObj, cocos2d::EventMouse::Mouse if (!p) break; jsval dataVal[1]; - dataVal[0] = getJSObject(_cx, event); + dataVal[0] = OBJECT_TO_JSVAL(js_get_or_create_jsobject(_cx, event)); // if (jsvalRet != nullptr) // { @@ -1399,7 +1399,7 @@ bool ScriptingCore::handleKeybardEvent(void* nativeObj, cocos2d::EventKeyboard:: jsval args[2] = { int32_to_jsval(_cx, (int32_t)keyCode), - getJSObject(_cx, event) + OBJECT_TO_JSVAL(js_get_or_create_jsobject(_cx, event)) }; if (isPressed) @@ -1426,8 +1426,8 @@ bool ScriptingCore::handleFocusEvent(void* nativeObj, cocos2d::ui::Widget* widge return false; jsval args[2] = { - getJSObject(_cx, widgetLoseFocus), - getJSObject(_cx, widgetGetFocus) + OBJECT_TO_JSVAL(js_get_or_create_jsobject(_cx, widgetLoseFocus)), + OBJECT_TO_JSVAL(js_get_or_create_jsobject(_cx, widgetGetFocus)) }; bool ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onFocusChanged", 2, args); @@ -1446,7 +1446,7 @@ int ScriptingCore::executeCustomTouchesEvent(EventTouch::EventCode eventType, int count = 0; for (auto& touch : touches) { - jsval jsret = getJSObject(this->_cx, touch); + jsval jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(this->_cx, touch)); JS::RootedValue jsval(_cx, jsret); if (!JS_SetElement(this->_cx, jsretArr, count, jsval)) { break; @@ -1475,7 +1475,7 @@ int ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType, JS::RootedValue retval(_cx); std::string funcName = getTouchFuncName(eventType); - jsval jsTouch = getJSObject(this->_cx, pTouch); + jsval jsTouch = OBJECT_TO_JSVAL(js_get_or_create_jsobject(this->_cx, pTouch)); executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), funcName.c_str(), 1, &jsTouch, &retval); @@ -1495,7 +1495,7 @@ int ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType, std::string funcName = getTouchFuncName(eventType); - jsval jsTouch = getJSObject(this->_cx, pTouch); + jsval jsTouch = OBJECT_TO_JSVAL(js_get_or_create_jsobject(this->_cx, pTouch)); executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), funcName.c_str(), 1, &jsTouch, retval); @@ -1996,9 +1996,10 @@ void jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy) // // Ref functions // + +// ref_create JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug) { - // JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET JS::RootedObject proto(cx, typeClass->proto.ref()); JS::RootedObject parent(cx, typeClass->parentProto.ref()); JS::RootedObject js_obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); @@ -2009,7 +2010,6 @@ JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_clas JSObject* jsb_ref_autoreleased_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug) { - // JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET JS::RootedObject proto(cx, typeClass->proto.ref()); JS::RootedObject parent(cx, typeClass->parentProto.ref()); JS::RootedObject js_obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); @@ -2018,6 +2018,17 @@ JSObject* jsb_ref_autoreleased_create_jsobject(JSContext *cx, cocos2d::Ref *ref, return js_obj; } +JSObject* jsb_ref_singleton_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug) +{ + JS::RootedObject proto(cx, typeClass->proto.ref()); + JS::RootedObject parent(cx, typeClass->parentProto.ref()); + JS::RootedObject js_obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + js_proxy_t* newproxy = jsb_new_proxy(ref, js_obj); + jsb_ref_singleton_init(cx, &newproxy->obj, ref, debug); + return js_obj; +} + +// get_or_create JSObject* jsb_ref_get_or_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug) { auto proxy = jsb_get_native_proxy(ref); @@ -2027,6 +2038,16 @@ JSObject* jsb_ref_get_or_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_ty return jsb_ref_create_jsobject(cx, ref, typeClass, debug); } +JSObject* jsb_ref_singleton_get_or_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug) +{ + auto proxy = jsb_get_native_proxy(ref); + if (proxy) + return proxy->obj; + // else + return jsb_ref_singleton_create_jsobject(cx, ref, typeClass, debug); +} + +// ref_init void jsb_ref_init(JSContext* cx, JS::Heap *obj, Ref* ref, const char* debug) { // CCLOG("jsb_ref_init: JSObject address = %p. %s", obj->get(), debug); @@ -2034,7 +2055,9 @@ void jsb_ref_init(JSContext* cx, JS::Heap *obj, Ref* ref, const char* (void)cx; (void)obj; ref->_scriptOwned = true; + // don't retain it. #else + // autorelease it ref->autorelease(); JS::AddNamedObjectRoot(cx, obj, debug); #endif @@ -2055,6 +2078,21 @@ void jsb_ref_autoreleased_init(JSContext* cx, JS::Heap *obj, Ref* ref #endif } +void jsb_ref_singleton_init(JSContext* cx, JS::Heap *obj, Ref* ref, const char* debug) +{ + // CCLOG("jsb_ref_singleton_init: JSObject address = %p. %s", obj->get(), debug); +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS + (void)cx; + (void)obj; + ref->_scriptOwned = true; + // don't retain it: it is a singleton +#else + // don't autorelease it: it is a singleton + JS::AddNamedObjectRoot(cx, obj, debug); +#endif +} + +// finalize void jsb_ref_finalize(JSFreeOp* fop, JSObject* obj) { #if CC_ENABLE_GC_FOR_NATIVE_OBJECTS @@ -2081,6 +2119,7 @@ void jsb_ref_finalize(JSFreeOp* fop, JSObject* obj) #endif } +// rebind void jsb_ref_rebind(JSContext* cx, JS::HandleObject jsobj, js_proxy_t *js2native_proxy, cocos2d::Ref* oldRef, cocos2d::Ref* newRef, const char* debug) { #if not CC_ENABLE_GC_FOR_NATIVE_OBJECTS diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.h b/cocos/scripting/js-bindings/manual/ScriptingCore.h index 2fb74be310..e5f8587ad6 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.h +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.h @@ -565,6 +565,12 @@ void jsb_ref_init(JSContext* cx, JS::Heap *obj, cocos2d::Ref* ref, co */ void jsb_ref_autoreleased_init(JSContext* cx, JS::Heap *obj, cocos2d::Ref* ref, const char* debug); +/** + * Generic initialization function for Singletons + * Similar to jsb_ref_init(), but call it to initialize singletons + */ +void jsb_ref_singleton_init(JSContext* cx, JS::Heap *obj, cocos2d::Ref* ref, const char* debug); + /** * Generic finalize used by objects that are subclass of Ref */ @@ -589,6 +595,11 @@ JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_clas */ JSObject* jsb_ref_autoreleased_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug); +/** + * Creates a new JSObject of a certain type (typeClass) and creates a proxy associated with and the Singleton (ref) + * Similar to jsb_ref_create_jsobject(), but call it if you know that Ref is a Singleton + */ +JSObject* jsb_ref_singleton_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug); /** It will try to get the associated JSObjct for ref. @@ -596,17 +607,11 @@ JSObject* jsb_ref_autoreleased_create_jsobject(JSContext *cx, cocos2d::Ref *ref, */ JSObject* jsb_ref_get_or_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug); - -template -jsval getJSObject(JSContext* cx, T* nativeObj) -{ - if (!nativeObj) - { - return JSVAL_NULL; - } - js_proxy_t *proxy = js_get_or_create_proxy(cx, nativeObj); - return proxy ? OBJECT_TO_JSVAL(proxy->obj) : JSVAL_NULL; -} +/** + It will try to get the associated JSObjct for ref. + If it can't find it, it will create a new one associating it to Ref + */ +JSObject* jsb_ref_singleton_get_or_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug); void removeJSObject(JSContext* cx, void* nativeObj); diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 0c7db4750f..836aadaebe 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -4498,10 +4498,14 @@ bool js_cocos2dx_SpriteBatchNode_getDescendants(JSContext *cx, uint32_t argc, js JS::RootedObject jsretArr(cx, JS_NewArrayObject(cx, 0)); size_t vSize = ret.size(); JS::RootedValue jsret(cx); + + js_type_class_t *typeClass = nullptr; + if (ret.size() > 0) + typeClass = js_get_type_from_native(ret[0]); for (size_t i = 0; i < vSize; i++) { - proxy = js_get_or_create_proxy(cx, ret[i]); - jsret = OBJECT_TO_JSVAL(proxy->obj); + auto jsobj = jsb_ref_get_or_create_jsobject(cx, ret[i], typeClass, "cocos2d::Sprite"); + jsret = OBJECT_TO_JSVAL(jsobj); JS_SetElement(cx, jsretArr, static_cast(i), jsret); } args.rval().set(OBJECT_TO_JSVAL(jsretArr)); diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp index 209f313ae8..e9eb1e91e0 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp @@ -105,9 +105,9 @@ inline js_proxy_t *js_get_or_create_proxy(JSContext *cx, T *native_obj) { JS::RootedObject js_obj(cx, JS_NewObject(cx, typeProxy->jsclass, proto, parent)); proxy = jsb_new_proxy(native_obj, js_obj); #ifdef DEBUG - AddNamedObjectRoot(cx, &proxy->obj, typeid(*native_obj).name()); + JS::AddNamedObjectRoot(cx, &proxy->obj, typeid(*native_obj).name()); #else - AddObjectRoot(cx, &proxy->obj); + JS::AddObjectRoot(cx, &proxy->obj); #endif return proxy; } else { @@ -116,6 +116,49 @@ inline js_proxy_t *js_get_or_create_proxy(JSContext *cx, T *native_obj) { return NULL; } +/** + * Gets or creates a JSObject based on native_obj. + If native_obj is subclass of Ref, it will use the jsb_ref functions. + Otherwise it will Root the newly created JSObject + */ +template +JSObject* js_get_or_create_jsobject(JSContext *cx, typename std::enable_if::value,T>::type *native_obj) +{ +// CCLOG("js_get_or_create_jsobject NO REF: %s", typeid(native_obj).name()); + js_proxy_t *proxy = jsb_get_native_proxy(native_obj); + if (!proxy) + { + js_type_class_t* typeClass = js_get_type_from_native(native_obj); + JS::RootedObject proto(cx, typeClass->proto.ref().get()); + JS::RootedObject parent(cx, typeClass->parentProto.ref().get()); + JS::RootedObject js_obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + proxy = jsb_new_proxy(native_obj, js_obj); +#ifdef DEBUG + AddNamedObjectRoot(cx, &proxy->obj, typeid(*native_obj).name()); +#else + AddObjectRoot(cx, &proxy->obj); +#endif + } + return proxy->obj; +} + +/** + * Gets or creates a JSObject based on native_obj. + If native_obj is subclass of Ref, it will use the jsb_ref functions. + Otherwise it will Root the newly created JSObject + */ +template +JSObject* js_get_or_create_jsobject(JSContext *cx, typename std::enable_if::value,T>::type *native_obj) +{ + js_proxy_t *proxy = jsb_get_native_proxy(native_obj); + if (proxy) + return proxy->obj; + + // else + js_type_class_t* typeClass = js_get_type_from_native(native_obj); + return jsb_ref_autoreleased_create_jsobject(cx, native_obj, typeClass, typeid(*native_obj).name()); +} + JS::Value anonEvaluate(JSContext *cx, JS::HandleObject thisObj, const char* string); void register_cocos2dx_js_core(JSContext* cx, JS::HandleObject obj); diff --git a/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp b/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp index 83440d28e1..b0abd3acd2 100644 --- a/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp +++ b/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp @@ -57,7 +57,7 @@ bool js_EventListenerTouchOneByOne_create(JSContext *cx, uint32_t argc, jsval *v ScriptingCore::getInstance()->handleTouchEvent(ret, EventTouch::EventCode::CANCELLED, touch, event); }; - jsval jsret = getJSObject(cx, ret); + jsval jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, ret)); args.rval().set(jsret); return true; } @@ -88,7 +88,7 @@ bool js_EventListenerTouchAllAtOnce_create(JSContext *cx, uint32_t argc, jsval * ScriptingCore::getInstance()->handleTouchesEvent(ret, EventTouch::EventCode::CANCELLED, touches, event); }; - jsval jsret = getJSObject(cx, ret); + jsval jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, ret)); args.rval().set(jsret); return true; } @@ -119,7 +119,7 @@ bool js_EventListenerMouse_create(JSContext *cx, uint32_t argc, jsval *vp) ScriptingCore::getInstance()->handleMouseEvent(ret, EventMouse::MouseEventType::MOUSE_SCROLL, event); }; - jsval jsret = getJSObject(cx, ret); + jsval jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, ret)); args.rval().set(jsret); return true; } @@ -142,7 +142,7 @@ bool js_EventListenerKeyboard_create(JSContext *cx, uint32_t argc, jsval *vp) ScriptingCore::getInstance()->handleKeybardEvent(ret, keyCode, false, event); }; - jsval jsret = getJSObject(cx, ret); + jsval jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, ret)); args.rval().set(jsret); return true; } @@ -160,7 +160,7 @@ bool js_EventListenerFocus_create(JSContext *cx, uint32_t argc, jsval *vp) ScriptingCore::getInstance()->handleFocusEvent(ret, widgetLoseFocus, widgetGetFocus); }; - jsval jsret = getJSObject(cx, ret); + jsval jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, ret)); JS::CallArgs args = JS::CallArgsFromVp(argc, vp); args.rval().set(jsret); diff --git a/tools/bindings-generator b/tools/bindings-generator index 1054d94db6..b940871c1d 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit 1054d94db6d97d99d67bac22baa1d3345e2d9d0f +Subproject commit b940871c1dfff94c0220364539dd9d0583995719