From cd8631ef093a8e5524fbecd087f0d13500842d4e Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 4 Dec 2015 18:42:31 -0800 Subject: [PATCH] sfunction "create" uses new optimized code ...although this code should never be called --- cocos/renderer/CCGLProgramState.h | 2 +- .../auto/api/jsb_cocos2dx_auto_api.js | 28 - .../js-bindings/auto/jsb_cocos2dx_3d_auto.cpp | 73 +- .../auto/jsb_cocos2dx_audioengine_auto.cpp | 14 + .../js-bindings/auto/jsb_cocos2dx_auto.cpp | 2711 ++++++----------- .../js-bindings/auto/jsb_cocos2dx_auto.hpp | 2 - .../jsb_cocos2dx_experimental_video_auto.cpp | 16 +- ...jsb_cocos2dx_experimental_webView_auto.cpp | 16 +- .../auto/jsb_cocos2dx_extension_auto.cpp | 144 +- .../auto/jsb_cocos2dx_navmesh_auto.cpp | 50 +- .../auto/jsb_cocos2dx_physics3d_auto.cpp | 38 +- .../auto/jsb_cocos2dx_studio_auto.cpp | 515 +--- .../js-bindings/auto/jsb_cocos2dx_ui_auto.cpp | 278 +- .../js-bindings/manual/ScriptingCore.cpp | 26 + .../js-bindings/manual/ScriptingCore.h | 17 + tools/tojs/cocos2dx.ini | 4 +- tools/tojs/genbindings.py | 26 +- 17 files changed, 1324 insertions(+), 2636 deletions(-) diff --git a/cocos/renderer/CCGLProgramState.h b/cocos/renderer/CCGLProgramState.h index ba070a4e30..21b042dcc1 100644 --- a/cocos/renderer/CCGLProgramState.h +++ b/cocos/renderer/CCGLProgramState.h @@ -437,7 +437,7 @@ public: protected: GLProgramState(); - ~GLProgramState(); + virtual ~GLProgramState(); bool init(GLProgram* program); void resetGLProgram(); void updateUniformsAndAttributes(); diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index fd86408908..cb6def48a1 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -4879,20 +4879,6 @@ getElapsed : function ( */ cc.Sequence = { -/** - * @method initWithTwoActions - * @param {cc.FiniteTimeAction} arg0 - * @param {cc.FiniteTimeAction} arg1 - * @return {bool} - */ -initWithTwoActions : function ( -finitetimeaction, -finitetimeaction -) -{ - return false; -}, - /** * @method Sequence * @constructor @@ -5033,20 +5019,6 @@ RepeatForever : function ( */ cc.Spawn = { -/** - * @method initWithTwoActions - * @param {cc.FiniteTimeAction} arg0 - * @param {cc.FiniteTimeAction} arg1 - * @return {bool} - */ -initWithTwoActions : function ( -finitetimeaction, -finitetimeaction -) -{ - return false; -}, - /** * @method Spawn * @constructor 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 056782ac66..c9b90c6f4e 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp @@ -126,17 +126,11 @@ bool js_cocos2dx_3d_Animation3D_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animation3D_create : Error processing arguments"); - cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animation3D::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animation3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -145,17 +139,11 @@ bool js_cocos2dx_3d_Animation3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animation3D_create : Error processing arguments"); - cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animation3D::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animation3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_3d_Animation3D_create : wrong number of arguments"); @@ -589,6 +577,7 @@ bool js_cocos2dx_3d_Animate3D_getTransitionTime(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + double ret = cocos2d::Animate3D::getTransitionTime(); jsval jsret = JSVAL_NULL; jsret = DOUBLE_TO_JSVAL(ret); @@ -619,6 +608,7 @@ bool js_cocos2dx_3d_Animate3D_createWithFrames(JSContext *cx, uint32_t argc, jsv ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_createWithFrames : Error processing arguments"); + cocos2d::Animate3D* ret = cocos2d::Animate3D::createWithFrames(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; do { @@ -650,6 +640,7 @@ bool js_cocos2dx_3d_Animate3D_createWithFrames(JSContext *cx, uint32_t argc, jsv ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_createWithFrames : Error processing arguments"); + cocos2d::Animate3D* ret = cocos2d::Animate3D::createWithFrames(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; do { @@ -799,17 +790,11 @@ bool js_cocos2dx_3d_TextureCube_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(4), &arg4); ok &= jsval_to_std_string(cx, args.get(5), &arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_TextureCube_create : Error processing arguments"); - cocos2d::TextureCube* ret = cocos2d::TextureCube::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::TextureCube*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TextureCube::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TextureCube")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_3d_TextureCube_create : wrong number of arguments"); @@ -898,17 +883,11 @@ bool js_cocos2dx_3d_AttachNode_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_AttachNode_create : Error processing arguments"); - cocos2d::AttachNode* ret = cocos2d::AttachNode::create(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); - args.rval().set(jsret); + + auto ret = cocos2d::AttachNode::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::AttachNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_3d_AttachNode_create : wrong number of arguments"); @@ -1167,6 +1146,7 @@ bool js_cocos2dx_3d_BillBoard_createWithTexture(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_BillBoard_createWithTexture : Error processing arguments"); + cocos2d::BillBoard* ret = cocos2d::BillBoard::createWithTexture(arg0); jsval jsret = JSVAL_NULL; do { @@ -1194,6 +1174,7 @@ bool js_cocos2dx_3d_BillBoard_createWithTexture(JSContext *cx, uint32_t argc, js } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_BillBoard_createWithTexture : Error processing arguments"); + cocos2d::BillBoard* ret = cocos2d::BillBoard::createWithTexture(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -3476,6 +3457,7 @@ bool js_cocos2dx_3d_Sprite3DCache_getInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Sprite3DCache* ret = cocos2d::Sprite3DCache::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -4362,6 +4344,7 @@ bool js_cocos2dx_3d_Bundle3D_createBundle(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Bundle3D* ret = cocos2d::Bundle3D::createBundle(); jsval jsret = JSVAL_NULL; do { @@ -4420,6 +4403,7 @@ bool js_cocos2dx_3d_Bundle3D_loadObj(JSContext *cx, uint32_t argc, jsval *vp) ok = false; ok &= jsval_to_std_string(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadObj : Error processing arguments"); + bool ret = cocos2d::Bundle3D::loadObj(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -4441,6 +4425,7 @@ bool js_cocos2dx_3d_Bundle3D_loadObj(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(3), &arg3); std::string arg4_tmp; ok &= jsval_to_std_string(cx, args.get(4), &arg4_tmp); arg4 = arg4_tmp.c_str(); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadObj : Error processing arguments"); + bool ret = cocos2d::Bundle3D::loadObj(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); 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 fd778cd515..7dea6a6a6b 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp @@ -193,6 +193,7 @@ bool js_cocos2dx_audioengine_AudioEngine_lazyInit(JSContext *cx, uint32_t argc, { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + bool ret = cocos2d::experimental::AudioEngine::lazyInit(); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -213,6 +214,7 @@ bool js_cocos2dx_audioengine_AudioEngine_setCurrentTime(JSContext *cx, uint32_t ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_setCurrentTime : Error processing arguments"); + bool ret = cocos2d::experimental::AudioEngine::setCurrentTime(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -231,6 +233,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getVolume(JSContext *cx, uint32_t argc, int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_getVolume : Error processing arguments"); + double ret = cocos2d::experimental::AudioEngine::getVolume(arg0); jsval jsret = JSVAL_NULL; jsret = DOUBLE_TO_JSVAL(ret); @@ -313,6 +316,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getMaxAudioInstance(JSContext *cx, uint { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + int ret = cocos2d::experimental::AudioEngine::getMaxAudioInstance(); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -331,6 +335,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getCurrentTime(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_getCurrentTime : Error processing arguments"); + double ret = cocos2d::experimental::AudioEngine::getCurrentTime(arg0); jsval jsret = JSVAL_NULL; jsret = DOUBLE_TO_JSVAL(ret); @@ -349,6 +354,7 @@ bool js_cocos2dx_audioengine_AudioEngine_setMaxAudioInstance(JSContext *cx, uint int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_setMaxAudioInstance : Error processing arguments"); + bool ret = cocos2d::experimental::AudioEngine::setMaxAudioInstance(arg0); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -367,6 +373,7 @@ bool js_cocos2dx_audioengine_AudioEngine_isLoop(JSContext *cx, uint32_t argc, js int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_isLoop : Error processing arguments"); + bool ret = cocos2d::experimental::AudioEngine::isLoop(arg0); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -479,6 +486,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); + int ret = cocos2d::experimental::AudioEngine::play2d(arg0); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -491,6 +499,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js ok &= jsval_to_std_string(cx, args.get(0), &arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); + int ret = cocos2d::experimental::AudioEngine::play2d(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -505,6 +514,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js arg1 = JS::ToBoolean(args.get(1)); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); + int ret = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -529,6 +539,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( arg3, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); + int ret = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -547,6 +558,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getState(JSContext *cx, uint32_t argc, int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_getState : Error processing arguments"); + int ret = (int)cocos2d::experimental::AudioEngine::getState(arg0); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -597,6 +609,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getDuration(JSContext *cx, uint32_t arg int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_getDuration : Error processing arguments"); + double ret = cocos2d::experimental::AudioEngine::getDuration(arg0); jsval jsret = JSVAL_NULL; jsret = DOUBLE_TO_JSVAL(ret); @@ -629,6 +642,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getDefaultProfile(JSContext *cx, uint32 { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::experimental::AudioProfile* ret = cocos2d::experimental::AudioEngine::getDefaultProfile(); jsval jsret = JSVAL_NULL; do { diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index a2aedfa7b5..7ebd3791af 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -766,6 +766,7 @@ bool js_cocos2dx_Texture2D_getDefaultAlphaPixelFormat(JSContext *cx, uint32_t ar { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + int ret = (int)cocos2d::Texture2D::getDefaultAlphaPixelFormat(); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -1710,17 +1711,11 @@ bool js_cocos2dx_Component_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Component* ret = cocos2d::Component::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::Component::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Component")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Component_create : wrong number of arguments"); @@ -5164,17 +5159,11 @@ bool js_cocos2dx_Node_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Node* ret = cocos2d::Node::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::Node::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Node")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Node_create : wrong number of arguments"); @@ -5620,6 +5609,7 @@ bool js_cocos2dx_Scene_createWithSize(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg0; ok &= jsval_to_ccsize(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Scene_createWithSize : Error processing arguments"); + cocos2d::Scene* ret = cocos2d::Scene::createWithSize(arg0); jsval jsret = JSVAL_NULL; do { @@ -5641,17 +5631,11 @@ bool js_cocos2dx_Scene_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Scene* ret = cocos2d::Scene::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::Scene::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Scene")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Scene_create : wrong number of arguments"); @@ -6307,6 +6291,7 @@ bool js_cocos2dx_GLView_getGLContextAttrs(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + GLContextAttrs ret = cocos2d::GLView::getGLContextAttrs(); jsval jsret = JSVAL_NULL; #pragma warning NO CONVERSION FROM NATIVE FOR GLContextAttrs; @@ -7673,6 +7658,7 @@ 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 { @@ -8055,6 +8041,7 @@ bool js_cocos2dx_AsyncTaskPool_getInstance(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::AsyncTaskPool* ret = cocos2d::AsyncTaskPool::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -8739,17 +8726,11 @@ bool js_cocos2dx_Speed_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Speed_create : Error processing arguments"); - cocos2d::Speed* ret = cocos2d::Speed::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Speed*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Speed::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Speed")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Speed_create : wrong number of arguments"); @@ -8930,17 +8911,11 @@ bool js_cocos2dx_Follow_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Follow_create : Error processing arguments"); - cocos2d::Follow* ret = cocos2d::Follow::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Follow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Follow::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Follow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -8957,17 +8932,11 @@ bool js_cocos2dx_Follow_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= jsval_to_ccrect(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Follow_create : Error processing arguments"); - cocos2d::Follow* ret = cocos2d::Follow::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Follow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Follow::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Follow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Follow_create : wrong number of arguments"); @@ -10431,17 +10400,11 @@ bool js_cocos2dx_GLProgramState_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_create : Error processing arguments"); - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::create(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); - args.rval().set(jsret); + + auto ret = cocos2d::GLProgramState::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::GLProgramState")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_GLProgramState_create : wrong number of arguments"); @@ -10456,6 +10419,7 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(JSContext *cx, uint std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName : Error processing arguments"); + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); jsval jsret = JSVAL_NULL; do { @@ -10489,6 +10453,7 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgram(JSContext *cx, uint32_t JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_getOrCreateWithGLProgram : Error processing arguments"); + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); jsval jsret = JSVAL_NULL; do { @@ -10518,6 +10483,7 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithShaders(JSContext *cx, uint32_t a ok &= jsval_to_std_string(cx, args.get(1), &arg1); ok &= jsval_to_std_string(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_getOrCreateWithShaders : Error processing arguments"); + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithShaders(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; do { @@ -11539,17 +11505,11 @@ bool js_cocos2dx_AnimationFrame_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= jsval_to_ccvaluemap(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AnimationFrame_create : Error processing arguments"); - cocos2d::AnimationFrame* ret = cocos2d::AnimationFrame::create(arg0, arg1, arg2); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::AnimationFrame::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::AnimationFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_AnimationFrame_create : wrong number of arguments"); @@ -12105,6 +12065,7 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, cocos2d::Vector arg0; ok &= jsval_to_ccvector(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_createWithSpriteFrames : Error processing arguments"); + cocos2d::Animation* ret = cocos2d::Animation::createWithSpriteFrames(arg0); jsval jsret = JSVAL_NULL; do { @@ -12124,6 +12085,7 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, ok &= jsval_to_ccvector(cx, args.get(0), &arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_createWithSpriteFrames : Error processing arguments"); + cocos2d::Animation* ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -12145,6 +12107,7 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_createWithSpriteFrames : Error processing arguments"); + cocos2d::Animation* ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; do { @@ -12386,46 +12349,6 @@ void js_register_cocos2dx_ActionInterval(JSContext *cx, JS::HandleObject global) JSClass *jsb_cocos2d_Sequence_class; JSObject *jsb_cocos2d_Sequence_prototype; -bool js_cocos2dx_Sequence_initWithTwoActions(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::Sequence* cobj = (cocos2d::Sequence *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Sequence_initWithTwoActions : Invalid Native Object"); - if (argc == 2) { - cocos2d::FiniteTimeAction* arg0 = nullptr; - cocos2d::FiniteTimeAction* arg1 = nullptr; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JS::RootedObject tmpObj(cx, args.get(0).toObjectOrNull()); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::FiniteTimeAction*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - do { - if (args.get(1).isNull()) { arg1 = nullptr; break; } - if (!args.get(1).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JS::RootedObject tmpObj(cx, args.get(1).toObjectOrNull()); - jsProxy = jsb_get_js_proxy(tmpObj); - arg1 = (cocos2d::FiniteTimeAction*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Sequence_initWithTwoActions : Error processing arguments"); - bool ret = cobj->initWithTwoActions(arg0, arg1); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Sequence_initWithTwoActions : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} bool js_cocos2dx_Sequence_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12478,7 +12401,6 @@ void js_register_cocos2dx_Sequence(JSContext *cx, JS::HandleObject global) { }; static JSFunctionSpec funcs[] = { - JS_FN("initWithTwoActions", js_cocos2dx_Sequence_initWithTwoActions, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("ctor", js_cocos2dx_Sequence_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -12608,17 +12530,11 @@ bool js_cocos2dx_Repeat_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Repeat_create : Error processing arguments"); - cocos2d::Repeat* ret = cocos2d::Repeat::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Repeat*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Repeat::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Repeat")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Repeat_create : wrong number of arguments"); @@ -12808,17 +12724,11 @@ bool js_cocos2dx_RepeatForever_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RepeatForever_create : Error processing arguments"); - cocos2d::RepeatForever* ret = cocos2d::RepeatForever::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RepeatForever*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::RepeatForever::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::RepeatForever")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_RepeatForever_create : wrong number of arguments"); @@ -12909,46 +12819,6 @@ void js_register_cocos2dx_RepeatForever(JSContext *cx, JS::HandleObject global) JSClass *jsb_cocos2d_Spawn_class; JSObject *jsb_cocos2d_Spawn_prototype; -bool js_cocos2dx_Spawn_initWithTwoActions(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::Spawn* cobj = (cocos2d::Spawn *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Spawn_initWithTwoActions : Invalid Native Object"); - if (argc == 2) { - cocos2d::FiniteTimeAction* arg0 = nullptr; - cocos2d::FiniteTimeAction* arg1 = nullptr; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JS::RootedObject tmpObj(cx, args.get(0).toObjectOrNull()); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::FiniteTimeAction*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - do { - if (args.get(1).isNull()) { arg1 = nullptr; break; } - if (!args.get(1).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JS::RootedObject tmpObj(cx, args.get(1).toObjectOrNull()); - jsProxy = jsb_get_js_proxy(tmpObj); - arg1 = (cocos2d::FiniteTimeAction*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Spawn_initWithTwoActions : Error processing arguments"); - bool ret = cobj->initWithTwoActions(arg0, arg1); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Spawn_initWithTwoActions : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} bool js_cocos2dx_Spawn_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -13001,7 +12871,6 @@ void js_register_cocos2dx_Spawn(JSContext *cx, JS::HandleObject global) { }; static JSFunctionSpec funcs[] = { - JS_FN("initWithTwoActions", js_cocos2dx_Spawn_initWithTwoActions, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("ctor", js_cocos2dx_Spawn_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -13864,17 +13733,11 @@ bool js_cocos2dx_SkewTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SkewTo_create : Error processing arguments"); - cocos2d::SkewTo* ret = cocos2d::SkewTo::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SkewTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SkewTo::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SkewTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SkewTo_create : wrong number of arguments"); @@ -14001,17 +13864,11 @@ bool js_cocos2dx_SkewBy_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SkewBy_create : Error processing arguments"); - cocos2d::SkewBy* ret = cocos2d::SkewBy::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SkewBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SkewBy::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SkewBy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SkewBy_create : wrong number of arguments"); @@ -14142,17 +13999,11 @@ bool js_cocos2dx_JumpBy_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpBy_create : Error processing arguments"); - cocos2d::JumpBy* ret = cocos2d::JumpBy::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::JumpBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::JumpBy::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::JumpBy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_JumpBy_create : wrong number of arguments"); @@ -14283,17 +14134,11 @@ bool js_cocos2dx_JumpTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTo_create : Error processing arguments"); - cocos2d::JumpTo* ret = cocos2d::JumpTo::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::JumpTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::JumpTo::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::JumpTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_JumpTo_create : wrong number of arguments"); @@ -14976,17 +14821,11 @@ bool js_cocos2dx_Blink_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Blink_create : Error processing arguments"); - cocos2d::Blink* ret = cocos2d::Blink::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Blink*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Blink::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Blink")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Blink_create : wrong number of arguments"); @@ -15109,17 +14948,11 @@ bool js_cocos2dx_FadeTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_uint16(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeTo_create : Error processing arguments"); - cocos2d::FadeTo* ret = cocos2d::FadeTo::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeTo::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeTo_create : wrong number of arguments"); @@ -15244,17 +15077,11 @@ bool js_cocos2dx_FadeIn_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeIn_create : Error processing arguments"); - cocos2d::FadeIn* ret = cocos2d::FadeIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeIn_create : wrong number of arguments"); @@ -15379,17 +15206,11 @@ bool js_cocos2dx_FadeOut_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOut_create : Error processing arguments"); - cocos2d::FadeOut* ret = cocos2d::FadeOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOut_create : wrong number of arguments"); @@ -15689,17 +15510,11 @@ bool js_cocos2dx_TintBy_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), &arg2); ok &= jsval_to_int32(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TintBy_create : Error processing arguments"); - cocos2d::TintBy* ret = cocos2d::TintBy::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TintBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TintBy::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TintBy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TintBy_create : wrong number of arguments"); @@ -15796,17 +15611,11 @@ bool js_cocos2dx_DelayTime_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DelayTime_create : Error processing arguments"); - cocos2d::DelayTime* ret = cocos2d::DelayTime::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::DelayTime*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::DelayTime::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::DelayTime")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_DelayTime_create : wrong number of arguments"); @@ -15940,17 +15749,11 @@ bool js_cocos2dx_ReverseTime_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ReverseTime_create : Error processing arguments"); - cocos2d::ReverseTime* ret = cocos2d::ReverseTime::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ReverseTime*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ReverseTime::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ReverseTime")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ReverseTime_create : wrong number of arguments"); @@ -16179,17 +15982,11 @@ bool js_cocos2dx_Animate_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animate_create : Error processing arguments"); - cocos2d::Animate* ret = cocos2d::Animate::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animate*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animate::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animate")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Animate_create : wrong number of arguments"); @@ -16423,17 +16220,11 @@ bool js_cocos2dx_TargetedAction_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TargetedAction_create : Error processing arguments"); - cocos2d::TargetedAction* ret = cocos2d::TargetedAction::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TargetedAction*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TargetedAction::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TargetedAction")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TargetedAction_create : wrong number of arguments"); @@ -16610,17 +16401,11 @@ bool js_cocos2dx_ActionFloat_create(JSContext *cx, uint32_t argc, jsval *vp) } while(0) ; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionFloat_create : Error processing arguments"); - cocos2d::ActionFloat* ret = cocos2d::ActionFloat::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionFloat*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ActionFloat::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ActionFloat")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ActionFloat_create : wrong number of arguments"); @@ -17145,6 +16930,7 @@ 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 { @@ -18010,6 +17796,7 @@ bool js_cocos2dx_Properties_parseVec3(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec3 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec3(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -18038,6 +17825,7 @@ bool js_cocos2dx_Properties_parseAxisAngle(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseAxisAngle : Error processing arguments"); + bool ret = cocos2d::Properties::parseAxisAngle(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -18058,6 +17846,7 @@ bool js_cocos2dx_Properties_parseVec2(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); std::vector tempData;ok &= jsval_to_vector_vec2(cx, args.get(1), &tempData);arg1=tempData.data(); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec2 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec2(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -18076,6 +17865,7 @@ bool js_cocos2dx_Properties_createNonRefCounted(JSContext *cx, uint32_t argc, js std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_createNonRefCounted : Error processing arguments"); + cocos2d::Properties* ret = cocos2d::Properties::createNonRefCounted(arg0); jsval jsret = JSVAL_NULL; do { @@ -18111,6 +17901,7 @@ bool js_cocos2dx_Properties_parseVec4(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec4 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec4(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -18969,6 +18760,7 @@ bool js_cocos2dx_FileUtils_getInstance(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::FileUtils* ret = cocos2d::FileUtils::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -20033,17 +19825,11 @@ bool js_cocos2dx_EventListenerAcceleration_create(JSContext *cx, uint32_t argc, } while(0) ; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventListenerAcceleration_create : Error processing arguments"); - cocos2d::EventListenerAcceleration* ret = cocos2d::EventListenerAcceleration::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventListenerAcceleration*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EventListenerAcceleration::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EventListenerAcceleration")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EventListenerAcceleration_create : wrong number of arguments"); @@ -20155,17 +19941,11 @@ bool js_cocos2dx_EventListenerCustom_create(JSContext *cx, uint32_t argc, jsval } while(0) ; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventListenerCustom_create : Error processing arguments"); - cocos2d::EventListenerCustom* ret = cocos2d::EventListenerCustom::create(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); - args.rval().set(jsret); + + auto ret = cocos2d::EventListenerCustom::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EventListenerCustom")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EventListenerCustom_create : wrong number of arguments"); @@ -21343,17 +21123,11 @@ bool js_cocos2dx_OrbitCamera_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); ok &= JS::ToNumber( cx, args.get(6), &arg6) && !isnan(arg6); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_OrbitCamera_create : Error processing arguments"); - cocos2d::OrbitCamera* ret = cocos2d::OrbitCamera::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::OrbitCamera*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::OrbitCamera::create(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::OrbitCamera")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_OrbitCamera_create : wrong number of arguments"); @@ -21897,17 +21671,11 @@ bool js_cocos2dx_EaseRateAction_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseRateAction_create : Error processing arguments"); - cocos2d::EaseRateAction* ret = cocos2d::EaseRateAction::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseRateAction*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseRateAction::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseRateAction")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseRateAction_create : wrong number of arguments"); @@ -21984,17 +21752,11 @@ bool js_cocos2dx_EaseIn_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseIn_create : Error processing arguments"); - cocos2d::EaseIn* ret = cocos2d::EaseIn::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseIn::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseIn_create : wrong number of arguments"); @@ -22100,17 +21862,11 @@ bool js_cocos2dx_EaseOut_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseOut_create : Error processing arguments"); - cocos2d::EaseOut* ret = cocos2d::EaseOut::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseOut::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseOut_create : wrong number of arguments"); @@ -22216,17 +21972,11 @@ bool js_cocos2dx_EaseInOut_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseInOut_create : Error processing arguments"); - cocos2d::EaseInOut* ret = cocos2d::EaseInOut::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseInOut::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseInOut_create : wrong number of arguments"); @@ -22330,17 +22080,11 @@ bool js_cocos2dx_EaseExponentialIn_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseExponentialIn_create : Error processing arguments"); - cocos2d::EaseExponentialIn* ret = cocos2d::EaseExponentialIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseExponentialIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseExponentialIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseExponentialIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseExponentialIn_create : wrong number of arguments"); @@ -22444,17 +22188,11 @@ bool js_cocos2dx_EaseExponentialOut_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseExponentialOut_create : Error processing arguments"); - cocos2d::EaseExponentialOut* ret = cocos2d::EaseExponentialOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseExponentialOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseExponentialOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseExponentialOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseExponentialOut_create : wrong number of arguments"); @@ -22558,17 +22296,11 @@ bool js_cocos2dx_EaseExponentialInOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseExponentialInOut_create : Error processing arguments"); - cocos2d::EaseExponentialInOut* ret = cocos2d::EaseExponentialInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseExponentialInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseExponentialInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseExponentialInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseExponentialInOut_create : wrong number of arguments"); @@ -22672,17 +22404,11 @@ bool js_cocos2dx_EaseSineIn_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseSineIn_create : Error processing arguments"); - cocos2d::EaseSineIn* ret = cocos2d::EaseSineIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseSineIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseSineIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseSineIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseSineIn_create : wrong number of arguments"); @@ -22786,17 +22512,11 @@ bool js_cocos2dx_EaseSineOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseSineOut_create : Error processing arguments"); - cocos2d::EaseSineOut* ret = cocos2d::EaseSineOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseSineOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseSineOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseSineOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseSineOut_create : wrong number of arguments"); @@ -22900,17 +22620,11 @@ bool js_cocos2dx_EaseSineInOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseSineInOut_create : Error processing arguments"); - cocos2d::EaseSineInOut* ret = cocos2d::EaseSineInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseSineInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseSineInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseSineInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseSineInOut_create : wrong number of arguments"); @@ -23638,17 +23352,11 @@ bool js_cocos2dx_EaseBounceIn_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBounceIn_create : Error processing arguments"); - cocos2d::EaseBounceIn* ret = cocos2d::EaseBounceIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBounceIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBounceIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBounceIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBounceIn_create : wrong number of arguments"); @@ -23752,17 +23460,11 @@ bool js_cocos2dx_EaseBounceOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBounceOut_create : Error processing arguments"); - cocos2d::EaseBounceOut* ret = cocos2d::EaseBounceOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBounceOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBounceOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBounceOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBounceOut_create : wrong number of arguments"); @@ -23866,17 +23568,11 @@ bool js_cocos2dx_EaseBounceInOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBounceInOut_create : Error processing arguments"); - cocos2d::EaseBounceInOut* ret = cocos2d::EaseBounceInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBounceInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBounceInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBounceInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBounceInOut_create : wrong number of arguments"); @@ -23980,17 +23676,11 @@ bool js_cocos2dx_EaseBackIn_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBackIn_create : Error processing arguments"); - cocos2d::EaseBackIn* ret = cocos2d::EaseBackIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBackIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBackIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBackIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBackIn_create : wrong number of arguments"); @@ -24094,17 +23784,11 @@ bool js_cocos2dx_EaseBackOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBackOut_create : Error processing arguments"); - cocos2d::EaseBackOut* ret = cocos2d::EaseBackOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBackOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBackOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBackOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBackOut_create : wrong number of arguments"); @@ -24208,17 +23892,11 @@ bool js_cocos2dx_EaseBackInOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBackInOut_create : Error processing arguments"); - cocos2d::EaseBackInOut* ret = cocos2d::EaseBackInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBackInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBackInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBackInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBackInOut_create : wrong number of arguments"); @@ -24348,17 +24026,11 @@ bool js_cocos2dx_EaseBezierAction_create(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBezierAction_create : Error processing arguments"); - cocos2d::EaseBezierAction* ret = cocos2d::EaseBezierAction::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBezierAction*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBezierAction::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBezierAction")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBezierAction_create : wrong number of arguments"); @@ -24463,17 +24135,11 @@ bool js_cocos2dx_EaseQuadraticActionIn_create(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuadraticActionIn_create : Error processing arguments"); - cocos2d::EaseQuadraticActionIn* ret = cocos2d::EaseQuadraticActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuadraticActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuadraticActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuadraticActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuadraticActionIn_create : wrong number of arguments"); @@ -24577,17 +24243,11 @@ bool js_cocos2dx_EaseQuadraticActionOut_create(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuadraticActionOut_create : Error processing arguments"); - cocos2d::EaseQuadraticActionOut* ret = cocos2d::EaseQuadraticActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuadraticActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuadraticActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuadraticActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuadraticActionOut_create : wrong number of arguments"); @@ -24691,17 +24351,11 @@ bool js_cocos2dx_EaseQuadraticActionInOut_create(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuadraticActionInOut_create : Error processing arguments"); - cocos2d::EaseQuadraticActionInOut* ret = cocos2d::EaseQuadraticActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuadraticActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuadraticActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuadraticActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuadraticActionInOut_create : wrong number of arguments"); @@ -24805,17 +24459,11 @@ bool js_cocos2dx_EaseQuarticActionIn_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuarticActionIn_create : Error processing arguments"); - cocos2d::EaseQuarticActionIn* ret = cocos2d::EaseQuarticActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuarticActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuarticActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuarticActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuarticActionIn_create : wrong number of arguments"); @@ -24919,17 +24567,11 @@ bool js_cocos2dx_EaseQuarticActionOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuarticActionOut_create : Error processing arguments"); - cocos2d::EaseQuarticActionOut* ret = cocos2d::EaseQuarticActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuarticActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuarticActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuarticActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuarticActionOut_create : wrong number of arguments"); @@ -25033,17 +24675,11 @@ bool js_cocos2dx_EaseQuarticActionInOut_create(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuarticActionInOut_create : Error processing arguments"); - cocos2d::EaseQuarticActionInOut* ret = cocos2d::EaseQuarticActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuarticActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuarticActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuarticActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuarticActionInOut_create : wrong number of arguments"); @@ -25147,17 +24783,11 @@ bool js_cocos2dx_EaseQuinticActionIn_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuinticActionIn_create : Error processing arguments"); - cocos2d::EaseQuinticActionIn* ret = cocos2d::EaseQuinticActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuinticActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuinticActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuinticActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuinticActionIn_create : wrong number of arguments"); @@ -25261,17 +24891,11 @@ bool js_cocos2dx_EaseQuinticActionOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuinticActionOut_create : Error processing arguments"); - cocos2d::EaseQuinticActionOut* ret = cocos2d::EaseQuinticActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuinticActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuinticActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuinticActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuinticActionOut_create : wrong number of arguments"); @@ -25375,17 +24999,11 @@ bool js_cocos2dx_EaseQuinticActionInOut_create(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuinticActionInOut_create : Error processing arguments"); - cocos2d::EaseQuinticActionInOut* ret = cocos2d::EaseQuinticActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuinticActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuinticActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuinticActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuinticActionInOut_create : wrong number of arguments"); @@ -25489,17 +25107,11 @@ bool js_cocos2dx_EaseCircleActionIn_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCircleActionIn_create : Error processing arguments"); - cocos2d::EaseCircleActionIn* ret = cocos2d::EaseCircleActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCircleActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCircleActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCircleActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCircleActionIn_create : wrong number of arguments"); @@ -25603,17 +25215,11 @@ bool js_cocos2dx_EaseCircleActionOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCircleActionOut_create : Error processing arguments"); - cocos2d::EaseCircleActionOut* ret = cocos2d::EaseCircleActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCircleActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCircleActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCircleActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCircleActionOut_create : wrong number of arguments"); @@ -25717,17 +25323,11 @@ bool js_cocos2dx_EaseCircleActionInOut_create(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCircleActionInOut_create : Error processing arguments"); - cocos2d::EaseCircleActionInOut* ret = cocos2d::EaseCircleActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCircleActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCircleActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCircleActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCircleActionInOut_create : wrong number of arguments"); @@ -25831,17 +25431,11 @@ bool js_cocos2dx_EaseCubicActionIn_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCubicActionIn_create : Error processing arguments"); - cocos2d::EaseCubicActionIn* ret = cocos2d::EaseCubicActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCubicActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCubicActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCubicActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCubicActionIn_create : wrong number of arguments"); @@ -25945,17 +25539,11 @@ bool js_cocos2dx_EaseCubicActionOut_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCubicActionOut_create : Error processing arguments"); - cocos2d::EaseCubicActionOut* ret = cocos2d::EaseCubicActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCubicActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCubicActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCubicActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCubicActionOut_create : wrong number of arguments"); @@ -26059,17 +25647,11 @@ bool js_cocos2dx_EaseCubicActionInOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCubicActionInOut_create : Error processing arguments"); - cocos2d::EaseCubicActionInOut* ret = cocos2d::EaseCubicActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCubicActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCubicActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCubicActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCubicActionInOut_create : wrong number of arguments"); @@ -26207,17 +25789,11 @@ bool js_cocos2dx_Show_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Show* ret = cocos2d::Show::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Show*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Show::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Show")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Show_create : wrong number of arguments"); @@ -26309,17 +25885,11 @@ bool js_cocos2dx_Hide_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Hide* ret = cocos2d::Hide::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Hide*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Hide::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Hide")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Hide_create : wrong number of arguments"); @@ -26411,17 +25981,11 @@ bool js_cocos2dx_ToggleVisibility_create(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ToggleVisibility* ret = cocos2d::ToggleVisibility::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ToggleVisibility*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ToggleVisibility::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ToggleVisibility")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ToggleVisibility_create : wrong number of arguments"); @@ -26520,34 +26084,22 @@ bool js_cocos2dx_RemoveSelf_create(JSContext *cx, uint32_t argc, jsval *vp) JS::CallArgs args = JS::CallArgsFromVp(argc, vp); bool ok = true; if (argc == 0) { - cocos2d::RemoveSelf* ret = cocos2d::RemoveSelf::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RemoveSelf*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::RemoveSelf::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::RemoveSelf")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 1) { bool arg0; arg0 = JS::ToBoolean(args.get(0)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RemoveSelf_create : Error processing arguments"); - cocos2d::RemoveSelf* ret = cocos2d::RemoveSelf::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RemoveSelf*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::RemoveSelf::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::RemoveSelf")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_RemoveSelf_create : wrong number of arguments"); @@ -26650,17 +26202,11 @@ bool js_cocos2dx_FlipX_create(JSContext *cx, uint32_t argc, jsval *vp) bool arg0; arg0 = JS::ToBoolean(args.get(0)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipX_create : Error processing arguments"); - cocos2d::FlipX* ret = cocos2d::FlipX::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FlipX*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FlipX::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FlipX")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FlipX_create : wrong number of arguments"); @@ -26779,17 +26325,11 @@ bool js_cocos2dx_FlipY_create(JSContext *cx, uint32_t argc, jsval *vp) bool arg0; arg0 = JS::ToBoolean(args.get(0)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipY_create : Error processing arguments"); - cocos2d::FlipY* ret = cocos2d::FlipY::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FlipY*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FlipY::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FlipY")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FlipY_create : wrong number of arguments"); @@ -26908,17 +26448,11 @@ bool js_cocos2dx_Place_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Vec2 arg0; ok &= jsval_to_vector2(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Place_create : Error processing arguments"); - cocos2d::Place* ret = cocos2d::Place::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Place*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Place::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Place")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Place_create : wrong number of arguments"); @@ -27392,17 +26926,11 @@ bool js_cocos2dx_StopGrid_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::StopGrid* ret = cocos2d::StopGrid::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::StopGrid*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::StopGrid::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::StopGrid")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_StopGrid_create : wrong number of arguments"); @@ -27504,17 +27032,11 @@ bool js_cocos2dx_ReuseGrid_create(JSContext *cx, uint32_t argc, jsval *vp) int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ReuseGrid_create : Error processing arguments"); - cocos2d::ReuseGrid* ret = cocos2d::ReuseGrid::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ReuseGrid*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ReuseGrid::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ReuseGrid")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ReuseGrid_create : wrong number of arguments"); @@ -27705,17 +27227,11 @@ bool js_cocos2dx_Waves3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves3D_create : Error processing arguments"); - cocos2d::Waves3D* ret = cocos2d::Waves3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Waves3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Waves3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Waves3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Waves3D_create : wrong number of arguments"); @@ -27846,17 +27362,11 @@ bool js_cocos2dx_FlipX3D_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipX3D_create : Error processing arguments"); - cocos2d::FlipX3D* ret = cocos2d::FlipX3D::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FlipX3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FlipX3D::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FlipX3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FlipX3D_create : wrong number of arguments"); @@ -27954,17 +27464,11 @@ bool js_cocos2dx_FlipY3D_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipY3D_create : Error processing arguments"); - cocos2d::FlipY3D* ret = cocos2d::FlipY3D::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FlipY3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FlipY3D::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FlipY3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FlipY3D_create : wrong number of arguments"); @@ -28190,17 +27694,11 @@ bool js_cocos2dx_Lens3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_vector2(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Lens3D_create : Error processing arguments"); - cocos2d::Lens3D* ret = cocos2d::Lens3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Lens3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Lens3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Lens3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Lens3D_create : wrong number of arguments"); @@ -28442,17 +27940,11 @@ bool js_cocos2dx_Ripple3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(4), &arg4); ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Ripple3D_create : Error processing arguments"); - cocos2d::Ripple3D* ret = cocos2d::Ripple3D::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::Ripple3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Ripple3D::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Ripple3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Ripple3D_create : wrong number of arguments"); @@ -28573,17 +28065,11 @@ bool js_cocos2dx_Shaky3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Shaky3D_create : Error processing arguments"); - cocos2d::Shaky3D* ret = cocos2d::Shaky3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Shaky3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Shaky3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Shaky3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Shaky3D_create : wrong number of arguments"); @@ -28774,17 +28260,11 @@ bool js_cocos2dx_Liquid_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Liquid_create : Error processing arguments"); - cocos2d::Liquid* ret = cocos2d::Liquid::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Liquid*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Liquid::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Liquid")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Liquid_create : wrong number of arguments"); @@ -28987,17 +28467,11 @@ bool js_cocos2dx_Waves_create(JSContext *cx, uint32_t argc, jsval *vp) arg4 = JS::ToBoolean(args.get(4)); arg5 = JS::ToBoolean(args.get(5)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves_create : Error processing arguments"); - cocos2d::Waves* ret = cocos2d::Waves::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::Waves*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Waves::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Waves")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Waves_create : wrong number of arguments"); @@ -29234,17 +28708,11 @@ bool js_cocos2dx_Twirl_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(3), &arg3); ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Twirl_create : Error processing arguments"); - cocos2d::Twirl* ret = cocos2d::Twirl::create(arg0, arg1, arg2, arg3, arg4); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Twirl*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Twirl::create(arg0, arg1, arg2, arg3, arg4); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Twirl")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Twirl_create : wrong number of arguments"); @@ -29807,17 +29275,11 @@ bool js_cocos2dx_PageTurn3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_PageTurn3D_create : Error processing arguments"); - cocos2d::PageTurn3D* ret = cocos2d::PageTurn3D::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PageTurn3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::PageTurn3D::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::PageTurn3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_PageTurn3D_create : wrong number of arguments"); @@ -29907,17 +29369,11 @@ bool js_cocos2dx_ProgressTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressTo_create : Error processing arguments"); - cocos2d::ProgressTo* ret = cocos2d::ProgressTo::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ProgressTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ProgressTo::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ProgressTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ProgressTo_create : wrong number of arguments"); @@ -30044,17 +29500,11 @@ bool js_cocos2dx_ProgressFromTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressFromTo_create : Error processing arguments"); - cocos2d::ProgressFromTo* ret = cocos2d::ProgressFromTo::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ProgressFromTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ProgressFromTo::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ProgressFromTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ProgressFromTo_create : wrong number of arguments"); @@ -30185,17 +29635,11 @@ bool js_cocos2dx_ShakyTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ShakyTiles3D_create : Error processing arguments"); - cocos2d::ShakyTiles3D* ret = cocos2d::ShakyTiles3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ShakyTiles3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ShakyTiles3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ShakyTiles3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ShakyTiles3D_create : wrong number of arguments"); @@ -30310,17 +29754,11 @@ bool js_cocos2dx_ShatteredTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ShatteredTiles3D_create : Error processing arguments"); - cocos2d::ShatteredTiles3D* ret = cocos2d::ShatteredTiles3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ShatteredTiles3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ShatteredTiles3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ShatteredTiles3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ShatteredTiles3D_create : wrong number of arguments"); @@ -30499,17 +29937,11 @@ bool js_cocos2dx_ShuffleTiles_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ShuffleTiles_create : Error processing arguments"); - cocos2d::ShuffleTiles* ret = cocos2d::ShuffleTiles::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ShuffleTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ShuffleTiles::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ShuffleTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ShuffleTiles_create : wrong number of arguments"); @@ -30681,17 +30113,11 @@ bool js_cocos2dx_FadeOutTRTiles_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutTRTiles_create : Error processing arguments"); - cocos2d::FadeOutTRTiles* ret = cocos2d::FadeOutTRTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOutTRTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOutTRTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOutTRTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOutTRTiles_create : wrong number of arguments"); @@ -30793,17 +30219,11 @@ bool js_cocos2dx_FadeOutBLTiles_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutBLTiles_create : Error processing arguments"); - cocos2d::FadeOutBLTiles* ret = cocos2d::FadeOutBLTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOutBLTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOutBLTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOutBLTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOutBLTiles_create : wrong number of arguments"); @@ -30901,17 +30321,11 @@ bool js_cocos2dx_FadeOutUpTiles_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutUpTiles_create : Error processing arguments"); - cocos2d::FadeOutUpTiles* ret = cocos2d::FadeOutUpTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOutUpTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOutUpTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOutUpTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOutUpTiles_create : wrong number of arguments"); @@ -31009,17 +30423,11 @@ bool js_cocos2dx_FadeOutDownTiles_create(JSContext *cx, uint32_t argc, jsval *vp ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutDownTiles_create : Error processing arguments"); - cocos2d::FadeOutDownTiles* ret = cocos2d::FadeOutDownTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOutDownTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOutDownTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOutDownTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOutDownTiles_create : wrong number of arguments"); @@ -31439,17 +30847,11 @@ bool js_cocos2dx_WavesTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_WavesTiles3D_create : Error processing arguments"); - cocos2d::WavesTiles3D* ret = cocos2d::WavesTiles3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::WavesTiles3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::WavesTiles3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::WavesTiles3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_WavesTiles3D_create : wrong number of arguments"); @@ -31644,17 +31046,11 @@ bool js_cocos2dx_JumpTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTiles3D_create : Error processing arguments"); - cocos2d::JumpTiles3D* ret = cocos2d::JumpTiles3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::JumpTiles3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::JumpTiles3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::JumpTiles3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_JumpTiles3D_create : wrong number of arguments"); @@ -31781,17 +31177,11 @@ bool js_cocos2dx_SplitRows_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SplitRows_create : Error processing arguments"); - cocos2d::SplitRows* ret = cocos2d::SplitRows::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SplitRows*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SplitRows::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SplitRows")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SplitRows_create : wrong number of arguments"); @@ -31898,17 +31288,11 @@ bool js_cocos2dx_SplitCols_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SplitCols_create : Error processing arguments"); - cocos2d::SplitCols* ret = cocos2d::SplitCols::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SplitCols*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SplitCols::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SplitCols")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SplitCols_create : wrong number of arguments"); @@ -32023,17 +31407,11 @@ bool js_cocos2dx_ActionTween_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionTween_create : Error processing arguments"); - cocos2d::ActionTween* ret = cocos2d::ActionTween::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionTween*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ActionTween::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ActionTween")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ActionTween_create : wrong number of arguments"); @@ -32367,17 +31745,11 @@ bool js_cocos2dx_AtlasNode_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AtlasNode_create : Error processing arguments"); - cocos2d::AtlasNode* ret = cocos2d::AtlasNode::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AtlasNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::AtlasNode::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::AtlasNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_AtlasNode_create : wrong number of arguments"); @@ -33440,17 +32812,11 @@ bool js_cocos2dx_DrawNode_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::DrawNode* ret = cocos2d::DrawNode::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::DrawNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::DrawNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::DrawNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_DrawNode_create : wrong number of arguments"); @@ -34912,6 +34278,7 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithBMFont : Error processing arguments"); + cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -34933,6 +34300,7 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithBMFont : Error processing arguments"); + cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; do { @@ -34956,6 +34324,7 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithBMFont : Error processing arguments"); + cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; do { @@ -34981,6 +34350,7 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); ok &= jsval_to_vector2(cx, args.get(4), &arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithBMFont : Error processing arguments"); + cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; do { @@ -35002,17 +34372,11 @@ bool js_cocos2dx_Label_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Label* ret = cocos2d::Label::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::Label::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Label_create : wrong number of arguments"); @@ -35124,6 +34488,7 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval ok &= jsval_to_std_string(cx, args.get(1), &arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); + cocos2d::Label* ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; do { @@ -35147,6 +34512,7 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= jsval_to_ccsize(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); + cocos2d::Label* ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; do { @@ -35172,6 +34538,7 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval ok &= jsval_to_ccsize(cx, args.get(3), &arg3); ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); + cocos2d::Label* ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; do { @@ -35199,6 +34566,7 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); ok &= jsval_to_int32(cx, args.get(5), (int32_t *)&arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); + cocos2d::Label* ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; do { @@ -36904,6 +36272,7 @@ bool js_cocos2dx_LabelTTF_createWithFontDefinition(JSContext *cx, uint32_t argc, ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_FontDefinition(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_createWithFontDefinition : Error processing arguments"); + cocos2d::LabelTTF* ret = cocos2d::LabelTTF::createWithFontDefinition(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -37032,17 +36401,11 @@ bool js_cocos2dx_Layer_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Layer* ret = cocos2d::Layer::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Layer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Layer::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Layer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Layer_create : wrong number of arguments"); @@ -37134,17 +36497,11 @@ bool js_cocos2dx___LayerRGBA_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::__LayerRGBA* ret = cocos2d::__LayerRGBA::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::__LayerRGBA*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::__LayerRGBA::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::__LayerRGBA")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx___LayerRGBA_create : wrong number of arguments"); @@ -38989,6 +38346,7 @@ bool js_cocos2dx_MenuItemFont_getFontSize(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + int ret = cocos2d::MenuItemFont::getFontSize(); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -39003,6 +38361,7 @@ bool js_cocos2dx_MenuItemFont_getFontName(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const std::string& ret = cocos2d::MenuItemFont::getFontName(); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -41174,17 +40533,11 @@ bool js_cocos2dx_ParticleBatchNode_create(JSContext *cx, uint32_t argc, jsval *v std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleBatchNode_create : Error processing arguments"); - cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::create(arg0); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleBatchNode::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -41193,17 +40546,11 @@ bool js_cocos2dx_ParticleBatchNode_create(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleBatchNode_create : Error processing arguments"); - cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::create(arg0, arg1); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleBatchNode::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleBatchNode_create : wrong number of arguments"); @@ -41226,6 +40573,7 @@ bool js_cocos2dx_ParticleBatchNode_createWithTexture(JSContext *cx, uint32_t arg JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleBatchNode_createWithTexture : Error processing arguments"); + cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::createWithTexture(arg0); jsval jsret = JSVAL_NULL; do { @@ -41253,6 +40601,7 @@ bool js_cocos2dx_ParticleBatchNode_createWithTexture(JSContext *cx, uint32_t arg } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleBatchNode_createWithTexture : Error processing arguments"); + cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::createWithTexture(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -43441,17 +42790,11 @@ bool js_cocos2dx_ParticleSystem_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_create : Error processing arguments"); - cocos2d::ParticleSystem* ret = cocos2d::ParticleSystem::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSystem*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSystem::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSystem")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSystem_create : wrong number of arguments"); @@ -43466,6 +42809,7 @@ bool js_cocos2dx_ParticleSystem_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleSystem* ret = cocos2d::ParticleSystem::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -43821,6 +43165,7 @@ bool js_cocos2dx_ParticleSystemQuad_createWithTotalParticles(JSContext *cx, uint int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystemQuad_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -43911,17 +43256,11 @@ bool js_cocos2dx_ParticleFire_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleFire* ret = cocos2d::ParticleFire::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFire*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFire::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFire")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFire_create : wrong number of arguments"); @@ -43936,6 +43275,7 @@ bool js_cocos2dx_ParticleFire_createWithTotalParticles(JSContext *cx, uint32_t a int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleFire_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleFire* ret = cocos2d::ParticleFire::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -44063,17 +43403,11 @@ bool js_cocos2dx_ParticleFireworks_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleFireworks* ret = cocos2d::ParticleFireworks::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFireworks*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFireworks::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFireworks")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFireworks_create : wrong number of arguments"); @@ -44088,6 +43422,7 @@ bool js_cocos2dx_ParticleFireworks_createWithTotalParticles(JSContext *cx, uint3 int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleFireworks_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleFireworks* ret = cocos2d::ParticleFireworks::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -44217,17 +43552,11 @@ bool js_cocos2dx_ParticleSun_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleSun* ret = cocos2d::ParticleSun::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSun*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSun::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSun")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSun_create : wrong number of arguments"); @@ -44242,6 +43571,7 @@ bool js_cocos2dx_ParticleSun_createWithTotalParticles(JSContext *cx, uint32_t ar int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSun_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleSun* ret = cocos2d::ParticleSun::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -44371,17 +43701,11 @@ bool js_cocos2dx_ParticleGalaxy_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleGalaxy* ret = cocos2d::ParticleGalaxy::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleGalaxy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleGalaxy::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleGalaxy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleGalaxy_create : wrong number of arguments"); @@ -44396,6 +43720,7 @@ bool js_cocos2dx_ParticleGalaxy_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleGalaxy_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleGalaxy* ret = cocos2d::ParticleGalaxy::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -44525,17 +43850,11 @@ bool js_cocos2dx_ParticleFlower_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleFlower* ret = cocos2d::ParticleFlower::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFlower*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFlower::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFlower")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFlower_create : wrong number of arguments"); @@ -44550,6 +43869,7 @@ bool js_cocos2dx_ParticleFlower_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleFlower_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleFlower* ret = cocos2d::ParticleFlower::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -44679,17 +43999,11 @@ bool js_cocos2dx_ParticleMeteor_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleMeteor* ret = cocos2d::ParticleMeteor::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleMeteor*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleMeteor::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleMeteor")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleMeteor_create : wrong number of arguments"); @@ -44704,6 +44018,7 @@ bool js_cocos2dx_ParticleMeteor_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleMeteor_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleMeteor* ret = cocos2d::ParticleMeteor::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -44833,17 +44148,11 @@ bool js_cocos2dx_ParticleSpiral_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleSpiral* ret = cocos2d::ParticleSpiral::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSpiral*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSpiral::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSpiral")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSpiral_create : wrong number of arguments"); @@ -44858,6 +44167,7 @@ bool js_cocos2dx_ParticleSpiral_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSpiral_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleSpiral* ret = cocos2d::ParticleSpiral::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -44987,17 +44297,11 @@ bool js_cocos2dx_ParticleExplosion_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleExplosion* ret = cocos2d::ParticleExplosion::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleExplosion*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleExplosion::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleExplosion")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleExplosion_create : wrong number of arguments"); @@ -45012,6 +44316,7 @@ bool js_cocos2dx_ParticleExplosion_createWithTotalParticles(JSContext *cx, uint3 int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleExplosion_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleExplosion* ret = cocos2d::ParticleExplosion::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -45141,17 +44446,11 @@ bool js_cocos2dx_ParticleSmoke_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleSmoke* ret = cocos2d::ParticleSmoke::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSmoke*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSmoke::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSmoke")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSmoke_create : wrong number of arguments"); @@ -45166,6 +44465,7 @@ bool js_cocos2dx_ParticleSmoke_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSmoke_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleSmoke* ret = cocos2d::ParticleSmoke::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -45295,17 +44595,11 @@ bool js_cocos2dx_ParticleSnow_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleSnow* ret = cocos2d::ParticleSnow::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSnow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSnow::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSnow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSnow_create : wrong number of arguments"); @@ -45320,6 +44614,7 @@ bool js_cocos2dx_ParticleSnow_createWithTotalParticles(JSContext *cx, uint32_t a int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSnow_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleSnow* ret = cocos2d::ParticleSnow::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -45449,17 +44744,11 @@ bool js_cocos2dx_ParticleRain_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleRain* ret = cocos2d::ParticleRain::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleRain*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleRain::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleRain")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleRain_create : wrong number of arguments"); @@ -45474,6 +44763,7 @@ bool js_cocos2dx_ParticleRain_createWithTotalParticles(JSContext *cx, uint32_t a int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleRain_createWithTotalParticles : Error processing arguments"); + cocos2d::ParticleRain* ret = cocos2d::ParticleRain::createWithTotalParticles(arg0); jsval jsret = JSVAL_NULL; do { @@ -45862,17 +45152,11 @@ bool js_cocos2dx_ProgressTimer_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressTimer_create : Error processing arguments"); - cocos2d::ProgressTimer* ret = cocos2d::ProgressTimer::create(arg0); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::ProgressTimer::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ProgressTimer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ProgressTimer_create : wrong number of arguments"); @@ -46276,17 +45560,11 @@ bool js_cocos2dx_ProtectedNode_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ProtectedNode* ret = cocos2d::ProtectedNode::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ProtectedNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ProtectedNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ProtectedNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ProtectedNode_create : wrong number of arguments"); @@ -48296,17 +47574,11 @@ bool js_cocos2dx_TransitionScene_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionScene_create : Error processing arguments"); - cocos2d::TransitionScene* ret = cocos2d::TransitionScene::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionScene*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionScene::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionScene")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionScene_create : wrong number of arguments"); @@ -48453,17 +47725,11 @@ bool js_cocos2dx_TransitionSceneOriented_create(JSContext *cx, uint32_t argc, js } while (0); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSceneOriented_create : Error processing arguments"); - cocos2d::TransitionSceneOriented* ret = cocos2d::TransitionSceneOriented::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSceneOriented*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSceneOriented::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSceneOriented")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSceneOriented_create : wrong number of arguments"); @@ -48570,17 +47836,11 @@ bool js_cocos2dx_TransitionRotoZoom_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionRotoZoom_create : Error processing arguments"); - cocos2d::TransitionRotoZoom* ret = cocos2d::TransitionRotoZoom::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionRotoZoom*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionRotoZoom::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionRotoZoom")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionRotoZoom_create : wrong number of arguments"); @@ -48686,17 +47946,11 @@ bool js_cocos2dx_TransitionJumpZoom_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionJumpZoom_create : Error processing arguments"); - cocos2d::TransitionJumpZoom* ret = cocos2d::TransitionJumpZoom::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionJumpZoom*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionJumpZoom::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionJumpZoom")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionJumpZoom_create : wrong number of arguments"); @@ -48864,17 +48118,11 @@ bool js_cocos2dx_TransitionMoveInL_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInL_create : Error processing arguments"); - cocos2d::TransitionMoveInL* ret = cocos2d::TransitionMoveInL::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionMoveInL*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionMoveInL::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionMoveInL")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionMoveInL_create : wrong number of arguments"); @@ -48982,17 +48230,11 @@ bool js_cocos2dx_TransitionMoveInR_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInR_create : Error processing arguments"); - cocos2d::TransitionMoveInR* ret = cocos2d::TransitionMoveInR::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionMoveInR*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionMoveInR::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionMoveInR")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionMoveInR_create : wrong number of arguments"); @@ -49098,17 +48340,11 @@ bool js_cocos2dx_TransitionMoveInT_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInT_create : Error processing arguments"); - cocos2d::TransitionMoveInT* ret = cocos2d::TransitionMoveInT::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionMoveInT*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionMoveInT::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionMoveInT")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionMoveInT_create : wrong number of arguments"); @@ -49214,17 +48450,11 @@ bool js_cocos2dx_TransitionMoveInB_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInB_create : Error processing arguments"); - cocos2d::TransitionMoveInB* ret = cocos2d::TransitionMoveInB::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionMoveInB*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionMoveInB::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionMoveInB")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionMoveInB_create : wrong number of arguments"); @@ -49392,17 +48622,11 @@ bool js_cocos2dx_TransitionSlideInL_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInL_create : Error processing arguments"); - cocos2d::TransitionSlideInL* ret = cocos2d::TransitionSlideInL::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSlideInL*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSlideInL::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSlideInL")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSlideInL_create : wrong number of arguments"); @@ -49510,17 +48734,11 @@ bool js_cocos2dx_TransitionSlideInR_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInR_create : Error processing arguments"); - cocos2d::TransitionSlideInR* ret = cocos2d::TransitionSlideInR::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSlideInR*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSlideInR::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSlideInR")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSlideInR_create : wrong number of arguments"); @@ -49626,17 +48844,11 @@ bool js_cocos2dx_TransitionSlideInB_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInB_create : Error processing arguments"); - cocos2d::TransitionSlideInB* ret = cocos2d::TransitionSlideInB::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSlideInB*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSlideInB::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSlideInB")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSlideInB_create : wrong number of arguments"); @@ -49742,17 +48954,11 @@ bool js_cocos2dx_TransitionSlideInT_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInT_create : Error processing arguments"); - cocos2d::TransitionSlideInT* ret = cocos2d::TransitionSlideInT::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSlideInT*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSlideInT::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSlideInT")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSlideInT_create : wrong number of arguments"); @@ -49895,17 +49101,11 @@ bool js_cocos2dx_TransitionShrinkGrow_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionShrinkGrow_create : Error processing arguments"); - cocos2d::TransitionShrinkGrow* ret = cocos2d::TransitionShrinkGrow::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionShrinkGrow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionShrinkGrow::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionShrinkGrow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionShrinkGrow_create : wrong number of arguments"); @@ -51149,17 +50349,11 @@ bool js_cocos2dx_TransitionCrossFade_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionCrossFade_create : Error processing arguments"); - cocos2d::TransitionCrossFade* ret = cocos2d::TransitionCrossFade::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionCrossFade*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionCrossFade::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionCrossFade")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionCrossFade_create : wrong number of arguments"); @@ -51302,17 +50496,11 @@ bool js_cocos2dx_TransitionTurnOffTiles_create(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionTurnOffTiles_create : Error processing arguments"); - cocos2d::TransitionTurnOffTiles* ret = cocos2d::TransitionTurnOffTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionTurnOffTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionTurnOffTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionTurnOffTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionTurnOffTiles_create : wrong number of arguments"); @@ -51481,17 +50669,11 @@ bool js_cocos2dx_TransitionSplitCols_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSplitCols_create : Error processing arguments"); - cocos2d::TransitionSplitCols* ret = cocos2d::TransitionSplitCols::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSplitCols*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSplitCols::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSplitCols")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSplitCols_create : wrong number of arguments"); @@ -51599,17 +50781,11 @@ bool js_cocos2dx_TransitionSplitRows_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSplitRows_create : Error processing arguments"); - cocos2d::TransitionSplitRows* ret = cocos2d::TransitionSplitRows::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSplitRows*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSplitRows::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSplitRows")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSplitRows_create : wrong number of arguments"); @@ -51781,17 +50957,11 @@ bool js_cocos2dx_TransitionFadeTR_create(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeTR_create : Error processing arguments"); - cocos2d::TransitionFadeTR* ret = cocos2d::TransitionFadeTR::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFadeTR*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionFadeTR::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionFadeTR")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionFadeTR_create : wrong number of arguments"); @@ -51899,17 +51069,11 @@ bool js_cocos2dx_TransitionFadeBL_create(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeBL_create : Error processing arguments"); - cocos2d::TransitionFadeBL* ret = cocos2d::TransitionFadeBL::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFadeBL*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionFadeBL::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionFadeBL")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionFadeBL_create : wrong number of arguments"); @@ -52015,17 +51179,11 @@ bool js_cocos2dx_TransitionFadeUp_create(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeUp_create : Error processing arguments"); - cocos2d::TransitionFadeUp* ret = cocos2d::TransitionFadeUp::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFadeUp*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionFadeUp::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionFadeUp")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionFadeUp_create : wrong number of arguments"); @@ -52131,17 +51289,11 @@ bool js_cocos2dx_TransitionFadeDown_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeDown_create : Error processing arguments"); - cocos2d::TransitionFadeDown* ret = cocos2d::TransitionFadeDown::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFadeDown*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionFadeDown::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionFadeDown")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionFadeDown_create : wrong number of arguments"); @@ -52312,17 +51464,11 @@ bool js_cocos2dx_TransitionPageTurn_create(JSContext *cx, uint32_t argc, jsval * } while (0); arg2 = JS::ToBoolean(args.get(2)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionPageTurn_create : Error processing arguments"); - cocos2d::TransitionPageTurn* ret = cocos2d::TransitionPageTurn::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionPageTurn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionPageTurn::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionPageTurn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionPageTurn_create : wrong number of arguments"); @@ -52430,17 +51576,11 @@ bool js_cocos2dx_TransitionProgress_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgress_create : Error processing arguments"); - cocos2d::TransitionProgress* ret = cocos2d::TransitionProgress::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgress*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgress::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgress")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgress_create : wrong number of arguments"); @@ -52546,17 +51686,11 @@ bool js_cocos2dx_TransitionProgressRadialCCW_create(JSContext *cx, uint32_t argc JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressRadialCCW_create : Error processing arguments"); - cocos2d::TransitionProgressRadialCCW* ret = cocos2d::TransitionProgressRadialCCW::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressRadialCCW*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressRadialCCW::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressRadialCCW")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressRadialCCW_create : wrong number of arguments"); @@ -52662,17 +51796,11 @@ bool js_cocos2dx_TransitionProgressRadialCW_create(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressRadialCW_create : Error processing arguments"); - cocos2d::TransitionProgressRadialCW* ret = cocos2d::TransitionProgressRadialCW::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressRadialCW*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressRadialCW::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressRadialCW")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressRadialCW_create : wrong number of arguments"); @@ -52778,17 +51906,11 @@ bool js_cocos2dx_TransitionProgressHorizontal_create(JSContext *cx, uint32_t arg JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressHorizontal_create : Error processing arguments"); - cocos2d::TransitionProgressHorizontal* ret = cocos2d::TransitionProgressHorizontal::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressHorizontal*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressHorizontal::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressHorizontal")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressHorizontal_create : wrong number of arguments"); @@ -52894,17 +52016,11 @@ bool js_cocos2dx_TransitionProgressVertical_create(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressVertical_create : Error processing arguments"); - cocos2d::TransitionProgressVertical* ret = cocos2d::TransitionProgressVertical::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressVertical*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressVertical::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressVertical")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressVertical_create : wrong number of arguments"); @@ -53010,17 +52126,11 @@ bool js_cocos2dx_TransitionProgressInOut_create(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressInOut_create : Error processing arguments"); - cocos2d::TransitionProgressInOut* ret = cocos2d::TransitionProgressInOut::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressInOut::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressInOut_create : wrong number of arguments"); @@ -53126,17 +52236,11 @@ bool js_cocos2dx_TransitionProgressOutIn_create(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressOutIn_create : Error processing arguments"); - cocos2d::TransitionProgressOutIn* ret = cocos2d::TransitionProgressOutIn::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressOutIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressOutIn::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressOutIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressOutIn_create : wrong number of arguments"); @@ -53842,6 +52946,7 @@ bool js_cocos2dx_Camera_createOrthographic(JSContext *cx, uint32_t argc, jsval * ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_createOrthographic : Error processing arguments"); + cocos2d::Camera* ret = cocos2d::Camera::createOrthographic(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; do { @@ -53863,6 +52968,7 @@ bool js_cocos2dx_Camera_getVisitingCamera(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const cocos2d::Camera* ret = cocos2d::Camera::getVisitingCamera(); jsval jsret = JSVAL_NULL; do { @@ -53884,17 +52990,11 @@ bool js_cocos2dx_Camera_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Camera* ret = cocos2d::Camera::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::Camera::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Camera")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Camera_create : wrong number of arguments"); @@ -53915,6 +53015,7 @@ bool js_cocos2dx_Camera_createPerspective(JSContext *cx, uint32_t argc, jsval *v ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_createPerspective : Error processing arguments"); + cocos2d::Camera* ret = cocos2d::Camera::createPerspective(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; do { @@ -53936,6 +53037,7 @@ bool js_cocos2dx_Camera_getDefaultViewport(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const cocos2d::experimental::Viewport& ret = cocos2d::Camera::getDefaultViewport(); jsval jsret = JSVAL_NULL; #pragma warning NO CONVERSION FROM NATIVE FOR Viewport; @@ -53967,6 +53069,7 @@ bool js_cocos2dx_Camera_getDefaultCamera(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Camera* ret = cocos2d::Camera::getDefaultCamera(); jsval jsret = JSVAL_NULL; do { @@ -54166,6 +53269,7 @@ bool js_cocos2dx_CameraBackgroundBrush_createSkyboxBrush(JSContext *cx, uint32_t ok &= jsval_to_std_string(cx, args.get(4), &arg4); ok &= jsval_to_std_string(cx, args.get(5), &arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundBrush_createSkyboxBrush : Error processing arguments"); + cocos2d::CameraBackgroundSkyBoxBrush* ret = cocos2d::CameraBackgroundBrush::createSkyboxBrush(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; do { @@ -54193,6 +53297,7 @@ bool js_cocos2dx_CameraBackgroundBrush_createColorBrush(JSContext *cx, uint32_t ok &= jsval_to_cccolor4f(cx, args.get(0), &arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundBrush_createColorBrush : Error processing arguments"); + cocos2d::CameraBackgroundColorBrush* ret = cocos2d::CameraBackgroundBrush::createColorBrush(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -54214,6 +53319,7 @@ bool js_cocos2dx_CameraBackgroundBrush_createNoneBrush(JSContext *cx, uint32_t a { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::CameraBackgroundBrush* ret = cocos2d::CameraBackgroundBrush::createNoneBrush(); jsval jsret = JSVAL_NULL; do { @@ -54236,6 +53342,7 @@ bool js_cocos2dx_CameraBackgroundBrush_createDepthBrush(JSContext *cx, uint32_t JS::CallArgs args = JS::CallArgsFromVp(argc, vp); bool ok = true; if (argc == 0) { + cocos2d::CameraBackgroundDepthBrush* ret = cocos2d::CameraBackgroundBrush::createDepthBrush(); jsval jsret = JSVAL_NULL; do { @@ -54253,6 +53360,7 @@ bool js_cocos2dx_CameraBackgroundBrush_createDepthBrush(JSContext *cx, uint32_t double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundBrush_createDepthBrush : Error processing arguments"); + cocos2d::CameraBackgroundDepthBrush* ret = cocos2d::CameraBackgroundBrush::createDepthBrush(arg0); jsval jsret = JSVAL_NULL; do { @@ -54366,17 +53474,11 @@ bool js_cocos2dx_CameraBackgroundDepthBrush_create(JSContext *cx, uint32_t argc, double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundDepthBrush_create : Error processing arguments"); - cocos2d::CameraBackgroundDepthBrush* ret = cocos2d::CameraBackgroundDepthBrush::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundDepthBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundDepthBrush::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundDepthBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_CameraBackgroundDepthBrush_create : wrong number of arguments"); @@ -54479,17 +53581,11 @@ bool js_cocos2dx_CameraBackgroundColorBrush_create(JSContext *cx, uint32_t argc, ok &= jsval_to_cccolor4f(cx, args.get(0), &arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundColorBrush_create : Error processing arguments"); - cocos2d::CameraBackgroundColorBrush* ret = cocos2d::CameraBackgroundColorBrush::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundColorBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundColorBrush::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundColorBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_CameraBackgroundColorBrush_create : wrong number of arguments"); @@ -56005,17 +55101,11 @@ bool js_cocos2dx_DirectionLight_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_vector3(cx, args.get(0), &arg0); ok &= jsval_to_cccolor3b(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DirectionLight_create : Error processing arguments"); - cocos2d::DirectionLight* ret = cocos2d::DirectionLight::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::DirectionLight*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::DirectionLight::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::DirectionLight")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_DirectionLight_create : wrong number of arguments"); @@ -56140,17 +55230,11 @@ bool js_cocos2dx_PointLight_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_cccolor3b(cx, args.get(1), &arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_PointLight_create : Error processing arguments"); - cocos2d::PointLight* ret = cocos2d::PointLight::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PointLight*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::PointLight::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::PointLight")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_PointLight_create : wrong number of arguments"); @@ -56448,17 +55532,11 @@ bool js_cocos2dx_SpotLight_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpotLight_create : Error processing arguments"); - cocos2d::SpotLight* ret = cocos2d::SpotLight::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::SpotLight*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SpotLight::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SpotLight")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SpotLight_create : wrong number of arguments"); @@ -56549,17 +55627,11 @@ bool js_cocos2dx_AmbientLight_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Color3B arg0; ok &= jsval_to_cccolor3b(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AmbientLight_create : Error processing arguments"); - cocos2d::AmbientLight* ret = cocos2d::AmbientLight::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AmbientLight*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::AmbientLight::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::AmbientLight")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_AmbientLight_create : wrong number of arguments"); @@ -57533,6 +56605,7 @@ 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 { @@ -58076,17 +57149,11 @@ bool js_cocos2dx_Pass_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Pass_create : Error processing arguments"); - cocos2d::Pass* ret = cocos2d::Pass::create(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); - args.rval().set(jsret); + + auto ret = cocos2d::Pass::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Pass")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Pass_create : wrong number of arguments"); @@ -58119,6 +57186,7 @@ bool js_cocos2dx_Pass_createWithGLProgramState(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Pass_createWithGLProgramState : Error processing arguments"); + cocos2d::Pass* ret = cocos2d::Pass::createWithGLProgramState(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -58345,17 +57413,11 @@ bool js_cocos2dx_Technique_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_create : Error processing arguments"); - cocos2d::Technique* ret = cocos2d::Technique::create(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); - args.rval().set(jsret); + + auto ret = cocos2d::Technique::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Technique")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Technique_create : wrong number of arguments"); @@ -58388,6 +57450,7 @@ bool js_cocos2dx_Technique_createWithGLProgramState(JSContext *cx, uint32_t argc JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_createWithGLProgramState : Error processing arguments"); + cocos2d::Technique* ret = cocos2d::Technique::createWithGLProgramState(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -58699,6 +57762,7 @@ bool js_cocos2dx_Material_createWithFilename(JSContext *cx, uint32_t argc, jsval std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithFilename : Error processing arguments"); + cocos2d::Material* ret = cocos2d::Material::createWithFilename(arg0); jsval jsret = JSVAL_NULL; do { @@ -58732,6 +57796,7 @@ bool js_cocos2dx_Material_createWithGLStateProgram(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithGLStateProgram : Error processing arguments"); + cocos2d::Material* ret = cocos2d::Material::createWithGLStateProgram(arg0); jsval jsret = JSVAL_NULL; do { @@ -58765,6 +57830,7 @@ bool js_cocos2dx_Material_createWithProperties(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithProperties : Error processing arguments"); + cocos2d::Material* ret = cocos2d::Material::createWithProperties(arg0); jsval jsret = JSVAL_NULL; do { @@ -59412,6 +58478,7 @@ bool js_cocos2dx_Device_getDPI(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + int ret = cocos2d::Device::getDPI(); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -59618,6 +58685,7 @@ bool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Application* ret = cocos2d::Application::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -59840,6 +58908,7 @@ 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 { @@ -60487,17 +59556,11 @@ bool js_cocos2dx_SpriteBatchNode_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_create : Error processing arguments"); - cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::create(arg0); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::SpriteBatchNode::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SpriteBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -60506,17 +59569,11 @@ bool js_cocos2dx_SpriteBatchNode_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_ssize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_create : Error processing arguments"); - cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::create(arg0, arg1); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::SpriteBatchNode::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SpriteBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SpriteBatchNode_create : wrong number of arguments"); @@ -60539,6 +59596,7 @@ bool js_cocos2dx_SpriteBatchNode_createWithTexture(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_createWithTexture : Error processing arguments"); + cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::createWithTexture(arg0); jsval jsret = JSVAL_NULL; do { @@ -60566,6 +59624,7 @@ bool js_cocos2dx_SpriteBatchNode_createWithTexture(JSContext *cx, uint32_t argc, } while (0); ok &= jsval_to_ssize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_createWithTexture : Error processing arguments"); + cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::createWithTexture(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -61010,6 +60069,7 @@ 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 { @@ -61597,17 +60657,11 @@ bool js_cocos2dx_ParallaxNode_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParallaxNode* ret = cocos2d::ParallaxNode::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParallaxNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParallaxNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParallaxNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParallaxNode_create : wrong number of arguments"); @@ -62871,17 +61925,11 @@ bool js_cocos2dx_TMXMapInfo_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXMapInfo_create : Error processing arguments"); - cocos2d::TMXMapInfo* ret = cocos2d::TMXMapInfo::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXMapInfo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TMXMapInfo::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TMXMapInfo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TMXMapInfo_create : wrong number of arguments"); @@ -62898,6 +61946,7 @@ bool js_cocos2dx_TMXMapInfo_createWithXML(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXMapInfo_createWithXML : Error processing arguments"); + cocos2d::TMXMapInfo* ret = cocos2d::TMXMapInfo::createWithXML(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -63596,17 +62645,11 @@ bool js_cocos2dx_TMXLayer_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg2, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXLayer_create : Error processing arguments"); - cocos2d::TMXLayer* ret = cocos2d::TMXLayer::create(arg0, arg1, arg2); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::TMXLayer::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TMXLayer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TMXLayer_create : wrong number of arguments"); @@ -64107,17 +63150,11 @@ bool js_cocos2dx_TMXTiledMap_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXTiledMap_create : Error processing arguments"); - cocos2d::TMXTiledMap* ret = cocos2d::TMXTiledMap::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXTiledMap*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TMXTiledMap::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TMXTiledMap")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_create : wrong number of arguments"); @@ -64134,6 +63171,7 @@ bool js_cocos2dx_TMXTiledMap_createWithXML(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXTiledMap_createWithXML : Error processing arguments"); + cocos2d::TMXTiledMap* ret = cocos2d::TMXTiledMap::createWithXML(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -64390,17 +63428,11 @@ bool js_cocos2dx_TileMapAtlas_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TileMapAtlas_create : Error processing arguments"); - cocos2d::TileMapAtlas* ret = cocos2d::TileMapAtlas::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TileMapAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TileMapAtlas::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TileMapAtlas")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TileMapAtlas_create : wrong number of arguments"); @@ -64975,6 +64007,7 @@ bool js_cocos2dx_SimpleAudioEngine_getInstance(JSContext *cx, uint32_t argc, jsv { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + CocosDenshion::SimpleAudioEngine* ret = CocosDenshion::SimpleAudioEngine::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -65068,17 +64101,11 @@ bool js_cocos2dx_ComponentJS_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ComponentJS_create : Error processing arguments"); - cocos2d::ComponentJS* ret = cocos2d::ComponentJS::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ComponentJS*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ComponentJS::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ComponentJS")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ComponentJS_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index 68fb107c0b..652fb03bc7 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -646,7 +646,6 @@ bool js_cocos2dx_Sequence_constructor(JSContext *cx, uint32_t argc, jsval *vp); void js_cocos2dx_Sequence_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_Sequence(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); -bool js_cocos2dx_Sequence_initWithTwoActions(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sequence_Sequence(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_Repeat_class; @@ -682,7 +681,6 @@ bool js_cocos2dx_Spawn_constructor(JSContext *cx, uint32_t argc, jsval *vp); void js_cocos2dx_Spawn_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_Spawn(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); -bool js_cocos2dx_Spawn_initWithTwoActions(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Spawn_Spawn(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_RotateTo_class; diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp index 2d87a26e5f..1535421b80 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp @@ -269,17 +269,11 @@ bool js_cocos2dx_experimental_video_VideoPlayer_create(JSContext *cx, uint32_t a { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::experimental::ui::VideoPlayer* ret = cocos2d::experimental::ui::VideoPlayer::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::experimental::ui::VideoPlayer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::experimental::ui::VideoPlayer::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::experimental::ui::VideoPlayer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp index ade5c7a40f..70a5486074 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp @@ -329,17 +329,11 @@ bool js_cocos2dx_experimental_webView_WebView_create(JSContext *cx, uint32_t arg { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::experimental::ui::WebView* ret = cocos2d::experimental::ui::WebView::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::experimental::ui::WebView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::experimental::ui::WebView::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::experimental::ui::WebView")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_experimental_webView_WebView_create : wrong number of arguments"); 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 e43c4c1b5f..bd5c6891b3 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp @@ -272,17 +272,11 @@ bool js_cocos2dx_extension_Control_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::extension::Control* ret = cocos2d::extension::Control::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::Control*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::Control::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::Control")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_Control_create : wrong number of arguments"); @@ -1740,17 +1734,11 @@ bool js_cocos2dx_extension_ControlHuePicker_create(JSContext *cx, uint32_t argc, } while (0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlHuePicker_create : Error processing arguments"); - cocos2d::extension::ControlHuePicker* ret = cocos2d::extension::ControlHuePicker::create(arg0, arg1); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlHuePicker::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlHuePicker")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlHuePicker_create : wrong number of arguments"); @@ -2036,17 +2024,11 @@ bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_create(JSContext *c } while (0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_create : Error processing arguments"); - cocos2d::extension::ControlSaturationBrightnessPicker* ret = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlSaturationBrightnessPicker")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_create : wrong number of arguments"); @@ -2349,17 +2331,11 @@ bool js_cocos2dx_extension_ControlColourPicker_create(JSContext *cx, uint32_t ar { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::extension::ControlColourPicker* ret = cocos2d::extension::ControlColourPicker::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlColourPicker*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlColourPicker::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlColourPicker")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlColourPicker_create : wrong number of arguments"); @@ -2887,17 +2863,11 @@ bool js_cocos2dx_extension_ControlPotentiometer_create(JSContext *cx, uint32_t a std::string arg1_tmp; ok &= jsval_to_std_string(cx, args.get(1), &arg1_tmp); arg1 = arg1_tmp.c_str(); std::string arg2_tmp; ok &= jsval_to_std_string(cx, args.get(2), &arg2_tmp); arg2 = arg2_tmp.c_str(); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlPotentiometer_create : Error processing arguments"); - cocos2d::extension::ControlPotentiometer* ret = cocos2d::extension::ControlPotentiometer::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlPotentiometer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlPotentiometer::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlPotentiometer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlPotentiometer_create : wrong number of arguments"); @@ -4308,17 +4278,11 @@ bool js_cocos2dx_extension_ControlStepper_create(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlStepper_create : Error processing arguments"); - cocos2d::extension::ControlStepper* ret = cocos2d::extension::ControlStepper::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlStepper*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlStepper::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlStepper")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlStepper_create : wrong number of arguments"); @@ -5840,17 +5804,11 @@ bool js_cocos2dx_extension_TableViewCell_create(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::extension::TableViewCell* ret = cocos2d::extension::TableViewCell::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::extension::TableViewCell::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::TableViewCell")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_TableViewCell_create : wrong number of arguments"); @@ -6869,17 +6827,11 @@ bool js_cocos2dx_extension_AssetsManagerEx_create(JSContext *cx, uint32_t argc, ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_AssetsManagerEx_create : Error processing arguments"); - cocos2d::extension::AssetsManagerEx* ret = cocos2d::extension::AssetsManagerEx::create(arg0, arg1); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::extension::AssetsManagerEx::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::AssetsManagerEx")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_AssetsManagerEx_create : wrong number of arguments"); @@ -7068,17 +7020,11 @@ bool js_cocos2dx_extension_EventListenerAssetsManagerEx_create(JSContext *cx, ui } while(0) ; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_EventListenerAssetsManagerEx_create : Error processing arguments"); - cocos2d::extension::EventListenerAssetsManagerEx* ret = cocos2d::extension::EventListenerAssetsManagerEx::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::EventListenerAssetsManagerEx*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::EventListenerAssetsManagerEx::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::EventListenerAssetsManagerEx")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_EventListenerAssetsManagerEx_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp index 2fa401c859..eec046debb 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp @@ -522,6 +522,7 @@ bool js_cocos2dx_navmesh_NavMeshAgent_getNavMeshAgentComponentName(JSContext *cx { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const std::string& ret = cocos2d::NavMeshAgent::getNavMeshAgentComponentName(); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -540,17 +541,11 @@ bool js_cocos2dx_navmesh_NavMeshAgent_create(JSContext *cx, uint32_t argc, jsval cocos2d::NavMeshAgentParam arg0; ok &= jsval_to_NavMeshAgentParam(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_create : Error processing arguments"); - cocos2d::NavMeshAgent* ret = cocos2d::NavMeshAgent::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::NavMeshAgent*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::NavMeshAgent::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::NavMeshAgent")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_navmesh_NavMeshAgent_create : wrong number of arguments"); @@ -790,17 +785,11 @@ bool js_cocos2dx_navmesh_NavMeshObstacle_create(JSContext *cx, uint32_t argc, js ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshObstacle_create : Error processing arguments"); - cocos2d::NavMeshObstacle* ret = cocos2d::NavMeshObstacle::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::NavMeshObstacle*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::NavMeshObstacle::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::NavMeshObstacle")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_navmesh_NavMeshObstacle_create : wrong number of arguments"); @@ -811,6 +800,7 @@ bool js_cocos2dx_navmesh_NavMeshObstacle_getNavMeshObstacleComponentName(JSConte { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const std::string& ret = cocos2d::NavMeshObstacle::getNavMeshObstacleComponentName(); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -1102,17 +1092,11 @@ bool js_cocos2dx_navmesh_NavMesh_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMesh_create : Error processing arguments"); - cocos2d::NavMesh* ret = cocos2d::NavMesh::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::NavMesh*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::NavMesh::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::NavMesh")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_navmesh_NavMesh_create : wrong number of arguments"); 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 5df53260ed..7339244052 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp @@ -199,6 +199,7 @@ bool js_cocos2dx_physics3d_Physics3DShape_createBox(JSContext *cx, uint32_t argc cocos2d::Vec3 arg0; ok &= jsval_to_vector3(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createBox : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createBox(arg0); jsval jsret = JSVAL_NULL; do { @@ -226,6 +227,7 @@ bool js_cocos2dx_physics3d_Physics3DShape_createCylinder(JSContext *cx, uint32_t ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createCylinder : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createCylinder(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -261,6 +263,7 @@ bool js_cocos2dx_physics3d_Physics3DShape_createConvexHull(JSContext *cx, uint32 } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createConvexHull : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createConvexHull(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -288,6 +291,7 @@ bool js_cocos2dx_physics3d_Physics3DShape_createCapsule(JSContext *cx, uint32_t ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createCapsule : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createCapsule(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -313,6 +317,7 @@ bool js_cocos2dx_physics3d_Physics3DShape_createSphere(JSContext *cx, uint32_t a double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createSphere : Error processing arguments"); + cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createSphere(arg0); jsval jsret = JSVAL_NULL; do { @@ -2055,6 +2060,7 @@ bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DComponentName(JSContex { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + std::string& ret = cocos2d::Physics3DComponent::getPhysics3DComponentName(); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -2723,17 +2729,11 @@ bool js_cocos2dx_physics3d_Physics3DWorld_create(JSContext *cx, uint32_t argc, j #pragma warning NO CONVERSION TO NATIVE FOR Physics3DWorldDes* ok = false; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_create : Error processing arguments"); - cocos2d::Physics3DWorld* ret = cocos2d::Physics3DWorld::create(arg0); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DWorld::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DWorld")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_create : wrong number of arguments"); @@ -5585,17 +5585,11 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_create(JSContext *cx, uint3 ok &= jsval_to_matrix(cx, args.get(3), &arg3); arg4 = JS::ToBoolean(args.get(4)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_create : Error processing arguments"); - cocos2d::Physics3DSliderConstraint* ret = cocos2d::Physics3DSliderConstraint::create(arg0, arg1, arg2, arg3, arg4); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DSliderConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DSliderConstraint::create(arg0, arg1, arg2, arg3, arg4); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DSliderConstraint")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_create : wrong number of arguments"); 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 68b41c8d20..60ee24db9d 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp @@ -707,6 +707,7 @@ 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 { @@ -818,17 +819,11 @@ bool js_cocos2dx_studio_BaseData_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::BaseData* ret = cocostudio::BaseData::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::BaseData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::BaseData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_BaseData_create : wrong number of arguments"); @@ -960,17 +955,11 @@ bool js_cocos2dx_studio_MovementData_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::MovementData* ret = cocostudio::MovementData::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::MovementData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::MovementData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_MovementData_create : wrong number of arguments"); @@ -1120,17 +1109,11 @@ bool js_cocos2dx_studio_AnimationData_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::AnimationData* ret = cocostudio::AnimationData::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::AnimationData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::AnimationData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_AnimationData_create : wrong number of arguments"); @@ -1244,17 +1227,11 @@ bool js_cocos2dx_studio_ContourData_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ContourData* ret = cocostudio::ContourData::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::ContourData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ContourData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ContourData_create : wrong number of arguments"); @@ -1404,17 +1381,11 @@ bool js_cocos2dx_studio_TextureData_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::TextureData* ret = cocostudio::TextureData::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::TextureData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::TextureData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_TextureData_create : wrong number of arguments"); @@ -2036,17 +2007,11 @@ bool js_cocos2dx_studio_Tween_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Tween_create : Error processing arguments"); - cocostudio::Tween* ret = cocostudio::Tween::create(arg0); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::Tween::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::Tween")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_Tween_create : wrong number of arguments"); @@ -2687,17 +2652,11 @@ bool js_cocos2dx_studio_DecorativeDisplay_create(JSContext *cx, uint32_t argc, j { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::DecorativeDisplay* ret = cocostudio::DecorativeDisplay::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::DecorativeDisplay::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::DecorativeDisplay")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_DecorativeDisplay_create : wrong number of arguments"); @@ -3305,17 +3264,11 @@ bool js_cocos2dx_studio_DisplayManager_create(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_DisplayManager_create : Error processing arguments"); - cocostudio::DisplayManager* ret = cocostudio::DisplayManager::create(arg0); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::DisplayManager::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::DisplayManager")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_DisplayManager_create : wrong number of arguments"); @@ -4305,17 +4258,11 @@ bool js_cocos2dx_studio_BatchNode_create(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::BatchNode* ret = cocostudio::BatchNode::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::BatchNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::BatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_BatchNode_create : wrong number of arguments"); @@ -4752,17 +4699,11 @@ bool js_cocos2dx_studio_ArmatureAnimation_create(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ArmatureAnimation_create : Error processing arguments"); - cocostudio::ArmatureAnimation* ret = cocostudio::ArmatureAnimation::create(arg0); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::ArmatureAnimation::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ArmatureAnimation")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ArmatureAnimation_create : wrong number of arguments"); @@ -5328,6 +5269,7 @@ 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 { @@ -6321,6 +6263,7 @@ bool js_cocos2dx_studio_Skin_createWithSpriteFrameName(JSContext *cx, uint32_t a std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Skin_createWithSpriteFrameName : Error processing arguments"); + cocostudio::Skin* ret = cocostudio::Skin::createWithSpriteFrameName(arg0); jsval jsret = JSVAL_NULL; do { @@ -6659,17 +6602,11 @@ bool js_cocos2dx_studio_ComAttribute_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ComAttribute* ret = cocostudio::ComAttribute::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComAttribute*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ComAttribute::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ComAttribute")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ComAttribute_create : wrong number of arguments"); @@ -7304,17 +7241,11 @@ bool js_cocos2dx_studio_ComAudio_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ComAudio* ret = cocostudio::ComAudio::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComAudio*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ComAudio::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ComAudio")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ComAudio_create : wrong number of arguments"); @@ -7659,17 +7590,11 @@ bool js_cocos2dx_studio_ComController_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ComController* ret = cocostudio::ComController::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComController*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ComController::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ComController")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ComController_create : wrong number of arguments"); @@ -8357,17 +8282,11 @@ bool js_cocos2dx_studio_VisibleFrame_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::VisibleFrame* ret = cocostudio::timeline::VisibleFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::VisibleFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::VisibleFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::VisibleFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_VisibleFrame_create : wrong number of arguments"); @@ -8483,17 +8402,11 @@ bool js_cocos2dx_studio_TextureFrame_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::TextureFrame* ret = cocostudio::timeline::TextureFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::TextureFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::TextureFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::TextureFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_TextureFrame_create : wrong number of arguments"); @@ -8609,17 +8522,11 @@ bool js_cocos2dx_studio_RotationFrame_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::RotationFrame* ret = cocostudio::timeline::RotationFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::RotationFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::RotationFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::RotationFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_RotationFrame_create : wrong number of arguments"); @@ -8773,17 +8680,11 @@ bool js_cocos2dx_studio_SkewFrame_create(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::SkewFrame* ret = cocostudio::timeline::SkewFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::SkewFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::SkewFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::SkewFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_SkewFrame_create : wrong number of arguments"); @@ -8863,17 +8764,11 @@ bool js_cocos2dx_studio_RotationSkewFrame_create(JSContext *cx, uint32_t argc, j { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::RotationSkewFrame* ret = cocostudio::timeline::RotationSkewFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::RotationSkewFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::RotationSkewFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::RotationSkewFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_RotationSkewFrame_create : wrong number of arguments"); @@ -9063,17 +8958,11 @@ bool js_cocos2dx_studio_PositionFrame_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::PositionFrame* ret = cocostudio::timeline::PositionFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::PositionFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::PositionFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::PositionFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_PositionFrame_create : wrong number of arguments"); @@ -9251,17 +9140,11 @@ bool js_cocos2dx_studio_ScaleFrame_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::ScaleFrame* ret = cocostudio::timeline::ScaleFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ScaleFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ScaleFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ScaleFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ScaleFrame_create : wrong number of arguments"); @@ -9380,17 +9263,11 @@ bool js_cocos2dx_studio_AnchorPointFrame_create(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::AnchorPointFrame* ret = cocostudio::timeline::AnchorPointFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::AnchorPointFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::AnchorPointFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::AnchorPointFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_AnchorPointFrame_create : wrong number of arguments"); @@ -9660,17 +9537,11 @@ bool js_cocos2dx_studio_InnerActionFrame_create(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::InnerActionFrame* ret = cocostudio::timeline::InnerActionFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::InnerActionFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::InnerActionFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::InnerActionFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_InnerActionFrame_create : wrong number of arguments"); @@ -9794,17 +9665,11 @@ bool js_cocos2dx_studio_ColorFrame_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::ColorFrame* ret = cocostudio::timeline::ColorFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ColorFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ColorFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ColorFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ColorFrame_create : wrong number of arguments"); @@ -9920,17 +9785,11 @@ bool js_cocos2dx_studio_AlphaFrame_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::AlphaFrame* ret = cocostudio::timeline::AlphaFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::AlphaFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::AlphaFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::AlphaFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_AlphaFrame_create : wrong number of arguments"); @@ -10062,17 +9921,11 @@ bool js_cocos2dx_studio_EventFrame_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::EventFrame* ret = cocostudio::timeline::EventFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::EventFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::EventFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::EventFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_EventFrame_create : wrong number of arguments"); @@ -10189,17 +10042,11 @@ bool js_cocos2dx_studio_ZOrderFrame_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::ZOrderFrame* ret = cocostudio::timeline::ZOrderFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ZOrderFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ZOrderFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ZOrderFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ZOrderFrame_create : wrong number of arguments"); @@ -10315,17 +10162,11 @@ bool js_cocos2dx_studio_BlendFuncFrame_create(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::BlendFuncFrame* ret = cocostudio::timeline::BlendFuncFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::BlendFuncFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::BlendFuncFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::BlendFuncFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_BlendFuncFrame_create : wrong number of arguments"); @@ -10716,17 +10557,11 @@ bool js_cocos2dx_studio_Timeline_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::Timeline* ret = cocostudio::timeline::Timeline::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::Timeline::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::Timeline")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_Timeline_create : wrong number of arguments"); @@ -10876,17 +10711,11 @@ bool js_cocos2dx_studio_ActionTimelineData_create(JSContext *cx, uint32_t argc, int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionTimelineData_create : Error processing arguments"); - cocostudio::timeline::ActionTimelineData* ret = cocostudio::timeline::ActionTimelineData::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ActionTimelineData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ActionTimelineData::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ActionTimelineData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ActionTimelineData_create : wrong number of arguments"); @@ -11718,17 +11547,11 @@ bool js_cocos2dx_studio_ActionTimeline_create(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::ActionTimeline* ret = cocostudio::timeline::ActionTimeline::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ActionTimeline::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ActionTimeline")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ActionTimeline_create : wrong number of arguments"); @@ -12545,17 +12368,11 @@ bool js_cocos2dx_studio_SkeletonNode_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::SkeletonNode* ret = cocostudio::timeline::SkeletonNode::create(); - 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); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::SkeletonNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::SkeletonNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_SkeletonNode_create : wrong number of arguments"); @@ -12727,17 +12544,11 @@ bool js_cocos2dx_studio_ComExtensionData_create(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ComExtensionData* ret = cocostudio::ComExtensionData::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComExtensionData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ComExtensionData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ComExtensionData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ComExtensionData_create : wrong number of arguments"); 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 8152e8d146..9b07c0aa33 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp @@ -123,17 +123,11 @@ bool js_cocos2dx_ui_LayoutParameter_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::LayoutParameter* ret = cocos2d::ui::LayoutParameter::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::ui::LayoutParameter::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::LayoutParameter")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_LayoutParameter_create : wrong number of arguments"); @@ -248,17 +242,11 @@ bool js_cocos2dx_ui_LinearLayoutParameter_create(JSContext *cx, uint32_t argc, j { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::LinearLayoutParameter* ret = cocos2d::ui::LinearLayoutParameter::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LinearLayoutParameter*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::LinearLayoutParameter::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::LinearLayoutParameter")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_LinearLayoutParameter_create : wrong number of arguments"); @@ -450,17 +438,11 @@ bool js_cocos2dx_ui_RelativeLayoutParameter_create(JSContext *cx, uint32_t argc, { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::RelativeLayoutParameter* ret = cocos2d::ui::RelativeLayoutParameter::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RelativeLayoutParameter*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RelativeLayoutParameter::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RelativeLayoutParameter")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RelativeLayoutParameter_create : wrong number of arguments"); @@ -2114,6 +2096,7 @@ bool js_cocos2dx_ui_Widget_getCurrentFocusedWidget(JSContext *cx, uint32_t argc, { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::ui::Widget* ret = cocos2d::ui::Widget::getCurrentFocusedWidget(); jsval jsret = JSVAL_NULL; do { @@ -2135,17 +2118,11 @@ bool js_cocos2dx_ui_Widget_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::Widget* ret = cocos2d::ui::Widget::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::ui::Widget::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::Widget")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_Widget_create : wrong number of arguments"); @@ -2971,17 +2948,11 @@ bool js_cocos2dx_ui_Layout_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::Layout* ret = cocos2d::ui::Layout::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::ui::Layout::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::Layout")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_Layout_create : wrong number of arguments"); @@ -2992,6 +2963,7 @@ bool js_cocos2dx_ui_Layout_createInstance(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::Layout::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -4091,6 +4063,7 @@ bool js_cocos2dx_ui_Button_createInstance(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::Button::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -5023,6 +4996,7 @@ bool js_cocos2dx_ui_CheckBox_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::CheckBox::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -5315,6 +5289,7 @@ bool js_cocos2dx_ui_RadioButton_createInstance(JSContext *cx, uint32_t argc, jsv { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::RadioButton::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -5733,17 +5708,11 @@ bool js_cocos2dx_ui_RadioButtonGroup_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::RadioButtonGroup* ret = cocos2d::ui::RadioButtonGroup::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButtonGroup*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RadioButtonGroup::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RadioButtonGroup")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RadioButtonGroup_create : wrong number of arguments"); @@ -6090,6 +6059,7 @@ bool js_cocos2dx_ui_ImageView_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::ImageView::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -6765,6 +6735,7 @@ bool js_cocos2dx_ui_Text_createInstance(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::Text::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -7066,6 +7037,7 @@ bool js_cocos2dx_ui_TextAtlas_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::TextAtlas::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -7489,6 +7461,7 @@ bool js_cocos2dx_ui_LoadingBar_createInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::LoadingBar::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -8627,17 +8600,11 @@ bool js_cocos2dx_ui_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::ScrollView* ret = cocos2d::ui::ScrollView::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ScrollView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::ScrollView::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::ScrollView")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_ScrollView_create : wrong number of arguments"); @@ -8648,6 +8615,7 @@ bool js_cocos2dx_ui_ScrollView_createInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::ScrollView::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -9533,17 +9501,11 @@ bool js_cocos2dx_ui_ListView_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::ListView* ret = cocos2d::ui::ListView::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ListView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::ListView::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::ListView")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_ListView_create : wrong number of arguments"); @@ -9554,6 +9516,7 @@ bool js_cocos2dx_ui_ListView_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::ListView::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -10353,6 +10316,7 @@ bool js_cocos2dx_ui_Slider_createInstance(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::Slider::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -11011,17 +10975,11 @@ bool js_cocos2dx_ui_UICCTextField_create(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_std_string(cx, args.get(1), &arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_UICCTextField_create : Error processing arguments"); - cocos2d::ui::UICCTextField* ret = cocos2d::ui::UICCTextField::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::UICCTextField*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::UICCTextField::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::UICCTextField")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_UICCTextField_create : wrong number of arguments"); @@ -11992,6 +11950,7 @@ bool js_cocos2dx_ui_TextField_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::TextField::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -12277,6 +12236,7 @@ bool js_cocos2dx_ui_TextBMFont_createInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::TextBMFont::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -12825,17 +12785,11 @@ bool js_cocos2dx_ui_PageView_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::PageView* ret = cocos2d::ui::PageView::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::PageView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::PageView::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::PageView")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_PageView_create : wrong number of arguments"); @@ -12846,6 +12800,7 @@ bool js_cocos2dx_ui_PageView_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::PageView::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -12977,6 +12932,7 @@ bool js_cocos2dx_ui_Helper_getSubStringOfUTF8String(JSContext *cx, uint32_t argc ok &= jsval_to_ulong(cx, args.get(1), &arg1); ok &= jsval_to_ulong(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_getSubStringOfUTF8String : Error processing arguments"); + std::string ret = cocos2d::ui::Helper::getSubStringOfUTF8String(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -13003,6 +12959,7 @@ bool js_cocos2dx_ui_Helper_convertBoundingBoxToScreen(JSContext *cx, uint32_t ar JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_convertBoundingBoxToScreen : Error processing arguments"); + cocos2d::Rect ret = cocos2d::ui::Helper::convertBoundingBoxToScreen(arg0); jsval jsret = JSVAL_NULL; jsret = ccrect_to_jsval(cx, ret); @@ -13047,6 +13004,7 @@ bool js_cocos2dx_ui_Helper_seekActionWidgetByActionTag(JSContext *cx, uint32_t a } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_seekActionWidgetByActionTag : Error processing arguments"); + cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekActionWidgetByActionTag(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -13082,6 +13040,7 @@ bool js_cocos2dx_ui_Helper_seekWidgetByName(JSContext *cx, uint32_t argc, jsval } while (0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_seekWidgetByName : Error processing arguments"); + cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekWidgetByName(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -13117,6 +13076,7 @@ bool js_cocos2dx_ui_Helper_seekWidgetByTag(JSContext *cx, uint32_t argc, jsval * } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_seekWidgetByTag : Error processing arguments"); + cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekWidgetByTag(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -13144,6 +13104,7 @@ bool js_cocos2dx_ui_Helper_restrictCapInsetRect(JSContext *cx, uint32_t argc, js ok &= jsval_to_ccrect(cx, args.get(0), &arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_restrictCapInsetRect : Error processing arguments"); + cocos2d::Rect ret = cocos2d::ui::Helper::restrictCapInsetRect(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = ccrect_to_jsval(cx, ret); @@ -13383,17 +13344,11 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_std_string(cx, args.get(4), &arg4); ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementText_create : Error processing arguments"); - cocos2d::ui::RichElementText* ret = cocos2d::ui::RichElementText::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::RichElementText*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RichElementText::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RichElementText")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RichElementText_create : wrong number of arguments"); @@ -13524,17 +13479,11 @@ bool js_cocos2dx_ui_RichElementImage_create(JSContext *cx, uint32_t argc, jsval ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementImage_create : Error processing arguments"); - cocos2d::ui::RichElementImage* ret = cocos2d::ui::RichElementImage::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RichElementImage*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RichElementImage::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RichElementImage")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RichElementImage_create : wrong number of arguments"); @@ -13681,17 +13630,11 @@ bool js_cocos2dx_ui_RichElementCustomNode_create(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( arg3, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementCustomNode_create : Error processing arguments"); - cocos2d::ui::RichElementCustomNode* ret = cocos2d::ui::RichElementCustomNode::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RichElementCustomNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RichElementCustomNode::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RichElementCustomNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RichElementCustomNode_create : wrong number of arguments"); @@ -13922,17 +13865,11 @@ bool js_cocos2dx_ui_RichText_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::RichText* ret = cocos2d::ui::RichText::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RichText*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RichText::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RichText")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RichText_create : wrong number of arguments"); @@ -17460,17 +17397,11 @@ bool js_cocos2dx_ui_LayoutComponent_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::LayoutComponent* ret = cocos2d::ui::LayoutComponent::create(); - 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); - args.rval().set(jsret); + + auto ret = cocos2d::ui::LayoutComponent::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::LayoutComponent")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_LayoutComponent_create : wrong number of arguments"); @@ -17493,6 +17424,7 @@ bool js_cocos2dx_ui_LayoutComponent_bindLayoutComponent(JSContext *cx, uint32_t JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_bindLayoutComponent : Error processing arguments"); + cocos2d::ui::LayoutComponent* ret = cocos2d::ui::LayoutComponent::bindLayoutComponent(arg0); jsval jsret = JSVAL_NULL; do { @@ -17831,17 +17763,11 @@ bool js_cocos2dx_ui_ScrollViewBar_create(JSContext *cx, uint32_t argc, jsval *vp } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollViewBar_create : Error processing arguments"); - cocos2d::ui::ScrollViewBar* ret = cocos2d::ui::ScrollViewBar::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ScrollViewBar*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::ScrollViewBar::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::ScrollViewBar")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_ScrollViewBar_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index 035ef39639..d02b23901f 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -2007,6 +2007,17 @@ JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_clas return js_obj; } +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)); + js_proxy_t* newproxy = jsb_new_proxy(ref, js_obj); + jsb_ref_autoreleased_init(cx, &newproxy->obj, ref, debug); + return js_obj; +} + 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); @@ -2029,6 +2040,21 @@ void jsb_ref_init(JSContext* cx, JS::Heap *obj, Ref* ref, const char* #endif } +void jsb_ref_autoreleased_init(JSContext* cx, JS::Heap *obj, Ref* ref, const char* debug) +{ + // CCLOG("jsb_ref_init: JSObject address = %p. %s", obj->get(), debug); +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS + (void)cx; + (void)obj; + ref->_scriptOwned = true; + // retain it, since the object is autoreleased + ret->retain(); +#else + // don't autorelease it, since it is already autoreleased + JS::AddNamedObjectRoot(cx, obj, debug); +#endif +} + void jsb_ref_finalize(JSFreeOp* fop, JSObject* obj) { #if 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 a57b5ffce4..2fb74be310 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.h +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.h @@ -557,6 +557,14 @@ void jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy); */ void jsb_ref_init(JSContext* cx, JS::Heap *obj, cocos2d::Ref* ref, const char* debug); +/** + * Generic initialization function for subclasses of Ref. + * Similar to jsb_ref_init(), but call it if you know that Ref has been autoreleased + * This function should never be called. It is only added as way to fix + * an issue with the static auto-bindings with the "create" function + */ +void jsb_ref_autoreleased_init(JSContext* cx, JS::Heap *obj, cocos2d::Ref* ref, const char* debug); + /** * Generic finalize used by objects that are subclass of Ref */ @@ -573,6 +581,15 @@ void jsb_ref_rebind(JSContext* cx, JS::HandleObject jsobj, js_proxy_t *js2native */ JSObject* jsb_ref_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 Ref + * Similar to jsb_ref_create_jsobject(), but call it if you know that Ref has been autoreleased + * This function should never be called. It is only added as way to fix + * an issue with the static auto-bindings with the "create" function + */ +JSObject* jsb_ref_autoreleased_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. If it can't find it, it will create a new one associating it to Ref diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index 411003cd71..fb01f08d91 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -87,8 +87,8 @@ skip = Node::[^setPosition$ setGLServerState description getUserObject .*UserDat Range::[*], NotificationObserver::[*], Image::[initWithString initWithImageData], - Sequence::[create], - Spawn::[create], + Sequence::[create init], + Spawn::[create init], RotateTo::[calculateAngles], GLProgram::[getProgram setUniformLocationWith(1|2|3|4)fv setUniformLocationWith(2|3|4)iv setUniformLocationWithMatrix(2|3|4)fv], GLProgramState::[setUniformVec4 setVertexAttribPointer], diff --git a/tools/tojs/genbindings.py b/tools/tojs/genbindings.py index 098311fbc3..22d871bcb0 100755 --- a/tools/tojs/genbindings.py +++ b/tools/tojs/genbindings.py @@ -139,19 +139,19 @@ def main(): tojs_root = '%s/tools/tojs' % project_root output_dir = '%s/cocos/scripting/js-bindings/auto' % project_root - cmd_args = {'cocos2dx.ini' : ('cocos2d-x', 'jsb_cocos2dx_auto'), \ - 'cocos2dx_audioengine.ini' : ('cocos2dx_audioengine', 'jsb_cocos2dx_audioengine_auto'), \ - 'cocos2dx_extension.ini' : ('cocos2dx_extension', 'jsb_cocos2dx_extension_auto'), \ - 'cocos2dx_builder.ini' : ('cocos2dx_builder', 'jsb_cocos2dx_builder_auto'), \ - 'cocos2dx_ui.ini' : ('cocos2dx_ui', 'jsb_cocos2dx_ui_auto'), \ - 'cocos2dx_studio.ini' : ('cocos2dx_studio', 'jsb_cocos2dx_studio_auto'), \ - 'cocos2dx_spine.ini' : ('cocos2dx_spine', 'jsb_cocos2dx_spine_auto'), \ - 'cocos2dx_3d.ini' : ('cocos2dx_3d', 'jsb_cocos2dx_3d_auto'), \ - 'cocos2dx_3d_ext.ini' : ('cocos2dx_3d_extension', 'jsb_cocos2dx_3d_extension_auto'), \ - 'cocos2dx_experimental_webView.ini' : ('cocos2dx_experimental_webView', 'jsb_cocos2dx_experimental_webView_auto'), \ - 'cocos2dx_experimental_video.ini' : ('cocos2dx_experimental_video', 'jsb_cocos2dx_experimental_video_auto'), \ - 'cocos2dx_physics3d.ini' : ('cocos2dx_physics3d', 'jsb_cocos2dx_physics3d_auto'), \ - 'cocos2dx_navmesh.ini' : ('cocos2dx_navmesh', 'jsb_cocos2dx_navmesh_auto'), + cmd_args = {'cocos2dx.ini': ('cocos2d-x', 'jsb_cocos2dx_auto'), + 'cocos2dx_audioengine.ini': ('cocos2dx_audioengine', 'jsb_cocos2dx_audioengine_auto'), + 'cocos2dx_extension.ini': ('cocos2dx_extension', 'jsb_cocos2dx_extension_auto'), + 'cocos2dx_builder.ini': ('cocos2dx_builder', 'jsb_cocos2dx_builder_auto'), + 'cocos2dx_ui.ini': ('cocos2dx_ui', 'jsb_cocos2dx_ui_auto'), + 'cocos2dx_studio.ini': ('cocos2dx_studio', 'jsb_cocos2dx_studio_auto'), + 'cocos2dx_spine.ini': ('cocos2dx_spine', 'jsb_cocos2dx_spine_auto'), + 'cocos2dx_3d.ini': ('cocos2dx_3d', 'jsb_cocos2dx_3d_auto'), + 'cocos2dx_3d_ext.ini': ('cocos2dx_3d_extension', 'jsb_cocos2dx_3d_extension_auto'), + 'cocos2dx_experimental_webView.ini': ('cocos2dx_experimental_webView', 'jsb_cocos2dx_experimental_webView_auto'), + 'cocos2dx_experimental_video.ini': ('cocos2dx_experimental_video', 'jsb_cocos2dx_experimental_video_auto'), + 'cocos2dx_physics3d.ini': ('cocos2dx_physics3d', 'jsb_cocos2dx_physics3d_auto'), + 'cocos2dx_navmesh.ini': ('cocos2dx_navmesh', 'jsb_cocos2dx_navmesh_auto'), } target = 'spidermonkey' generator_py = '%s/generator.py' % cxx_generator_root