Skip to content

Commit 680aa0c

Browse files
committed
Merge pull request #1562 from CocosRobot/update_js_bindings_1426698251
[AUTO] : updating jsbinding automatically
2 parents ed11807 + ab3e4ce commit 680aa0c

File tree

7 files changed

+14
-77
lines changed

7 files changed

+14
-77
lines changed

frameworks/js-bindings/bindings/auto/jsb_cocos2dx_3d_auto.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3125,18 +3125,9 @@ void js_register_cocos2dx_3d_BillBoard(JSContext *cx, JS::HandleObject global) {
31253125
}
31263126

31273127
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj) {
3128-
// first, try to get the ns
3129-
JS::RootedValue nsval(cx);
3128+
// Get the ns
31303129
JS::RootedObject ns(cx);
3131-
JS_GetProperty(cx, obj, "cc", &nsval);
3132-
if (nsval == JSVAL_VOID) {
3133-
ns = JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr());
3134-
nsval = OBJECT_TO_JSVAL(ns);
3135-
JS_SetProperty(cx, obj, "cc", nsval);
3136-
} else {
3137-
JS_ValueToObject(cx, nsval, &ns);
3138-
}
3139-
//obj = ns;
3130+
get_or_create_js_obj(cx, obj, "cc", &ns);
31403131

31413132
js_register_cocos2dx_3d_Animate3D(cx, ns);
31423133
js_register_cocos2dx_3d_Sprite3D(cx, ns);

frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65823,18 +65823,9 @@ void js_register_cocos2dx_AsyncTaskPool(JSContext *cx, JS::HandleObject global)
6582365823
}
6582465824

6582565825
void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) {
65826-
// first, try to get the ns
65827-
JS::RootedValue nsval(cx);
65826+
// Get the ns
6582865827
JS::RootedObject ns(cx);
65829-
JS_GetProperty(cx, obj, "cc", &nsval);
65830-
if (nsval == JSVAL_VOID) {
65831-
ns = JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr());
65832-
nsval = OBJECT_TO_JSVAL(ns);
65833-
JS_SetProperty(cx, obj, "cc", nsval);
65834-
} else {
65835-
JS_ValueToObject(cx, nsval, &ns);
65836-
}
65837-
//obj = ns;
65828+
get_or_create_js_obj(cx, obj, "cc", &ns);
6583865829

6583965830
js_register_cocos2dx_Action(cx, ns);
6584065831
js_register_cocos2dx_FiniteTimeAction(cx, ns);

frameworks/js-bindings/bindings/auto/jsb_cocos2dx_builder_auto.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,18 +1766,9 @@ void js_register_cocos2dx_builder_CCBReader(JSContext *cx, JS::HandleObject glob
17661766
}
17671767

17681768
void register_all_cocos2dx_builder(JSContext* cx, JS::HandleObject obj) {
1769-
// first, try to get the ns
1770-
JS::RootedValue nsval(cx);
1769+
// Get the ns
17711770
JS::RootedObject ns(cx);
1772-
JS_GetProperty(cx, obj, "cc", &nsval);
1773-
if (nsval == JSVAL_VOID) {
1774-
ns = JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr());
1775-
nsval = OBJECT_TO_JSVAL(ns);
1776-
JS_SetProperty(cx, obj, "cc", nsval);
1777-
} else {
1778-
JS_ValueToObject(cx, nsval, &ns);
1779-
}
1780-
//obj = ns;
1771+
get_or_create_js_obj(cx, obj, "cc", &ns);
17811772

17821773
js_register_cocos2dx_builder_CCBAnimationManager(cx, ns);
17831774
js_register_cocos2dx_builder_CCBReader(cx, ns);

frameworks/js-bindings/bindings/auto/jsb_cocos2dx_extension_auto.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7837,18 +7837,9 @@ void js_register_cocos2dx_extension_EventListenerAssetsManagerEx(JSContext *cx,
78377837
}
78387838

78397839
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj) {
7840-
// first, try to get the ns
7841-
JS::RootedValue nsval(cx);
7840+
// Get the ns
78427841
JS::RootedObject ns(cx);
7843-
JS_GetProperty(cx, obj, "cc", &nsval);
7844-
if (nsval == JSVAL_VOID) {
7845-
ns = JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr());
7846-
nsval = OBJECT_TO_JSVAL(ns);
7847-
JS_SetProperty(cx, obj, "cc", nsval);
7848-
} else {
7849-
JS_ValueToObject(cx, nsval, &ns);
7850-
}
7851-
//obj = ns;
7842+
get_or_create_js_obj(cx, obj, "cc", &ns);
78527843

78537844
js_register_cocos2dx_extension_AssetsManagerEx(cx, ns);
78547845
js_register_cocos2dx_extension_Control(cx, ns);

frameworks/js-bindings/bindings/auto/jsb_cocos2dx_spine_auto.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,18 +1846,9 @@ void js_register_cocos2dx_spine_SkeletonAnimation(JSContext *cx, JS::HandleObjec
18461846
}
18471847

18481848
void register_all_cocos2dx_spine(JSContext* cx, JS::HandleObject obj) {
1849-
// first, try to get the ns
1850-
JS::RootedValue nsval(cx);
1849+
// Get the ns
18511850
JS::RootedObject ns(cx);
1852-
JS_GetProperty(cx, obj, "sp", &nsval);
1853-
if (nsval == JSVAL_VOID) {
1854-
ns = JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr());
1855-
nsval = OBJECT_TO_JSVAL(ns);
1856-
JS_SetProperty(cx, obj, "sp", nsval);
1857-
} else {
1858-
JS_ValueToObject(cx, nsval, &ns);
1859-
}
1860-
//obj = ns;
1851+
get_or_create_js_obj(cx, obj, "sp", &ns);
18611852

18621853
js_register_cocos2dx_spine_SkeletonRenderer(cx, ns);
18631854
js_register_cocos2dx_spine_SkeletonAnimation(cx, ns);

frameworks/js-bindings/bindings/auto/jsb_cocos2dx_studio_auto.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12781,18 +12781,9 @@ void js_register_cocos2dx_studio_ActionTimeline(JSContext *cx, JS::HandleObject
1278112781
}
1278212782

1278312783
void register_all_cocos2dx_studio(JSContext* cx, JS::HandleObject obj) {
12784-
// first, try to get the ns
12785-
JS::RootedValue nsval(cx);
12784+
// Get the ns
1278612785
JS::RootedObject ns(cx);
12787-
JS_GetProperty(cx, obj, "ccs", &nsval);
12788-
if (nsval == JSVAL_VOID) {
12789-
ns = JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr());
12790-
nsval = OBJECT_TO_JSVAL(ns);
12791-
JS_SetProperty(cx, obj, "ccs", nsval);
12792-
} else {
12793-
JS_ValueToObject(cx, nsval, &ns);
12794-
}
12795-
//obj = ns;
12786+
get_or_create_js_obj(cx, obj, "ccs", &ns);
1279612787

1279712788
js_register_cocos2dx_studio_Frame(cx, ns);
1279812789
js_register_cocos2dx_studio_ScaleFrame(cx, ns);

frameworks/js-bindings/bindings/auto/jsb_cocos2dx_ui_auto.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15724,18 +15724,9 @@ void js_register_cocos2dx_ui_LayoutComponent(JSContext *cx, JS::HandleObject glo
1572415724
}
1572515725

1572615726
void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj) {
15727-
// first, try to get the ns
15728-
JS::RootedValue nsval(cx);
15727+
// Get the ns
1572915728
JS::RootedObject ns(cx);
15730-
JS_GetProperty(cx, obj, "ccui", &nsval);
15731-
if (nsval == JSVAL_VOID) {
15732-
ns = JS_NewObject(cx, NULL, JS::NullPtr(), JS::NullPtr());
15733-
nsval = OBJECT_TO_JSVAL(ns);
15734-
JS_SetProperty(cx, obj, "ccui", nsval);
15735-
} else {
15736-
JS_ValueToObject(cx, nsval, &ns);
15737-
}
15738-
//obj = ns;
15729+
get_or_create_js_obj(cx, obj, "ccui", &ns);
1573915730

1574015731
js_register_cocos2dx_ui_Widget(cx, ns);
1574115732
js_register_cocos2dx_ui_Layout(cx, ns);

0 commit comments

Comments
 (0)