Skip to content

Commit e675657

Browse files
improved docstrings
1 parent 13dc967 commit e675657

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ inline js_proxy_t *js_get_or_create_proxy(JSContext *cx, T *native_obj) {
118118

119119
/**
120120
* Gets or creates a JSObject based on native_obj.
121-
If native_obj is subclass of Ref, do what it needs to do
121+
If native_obj is subclass of Ref, it will use the jsb_ref functions.
122+
Otherwise it will Root the newly created JSObject
122123
*/
123124
template<class T>
124125
JSObject* js_get_or_create_jsobject(JSContext *cx, typename std::enable_if<!std::is_base_of<cocos2d::Ref,T>::value,T>::type *native_obj)
@@ -137,6 +138,11 @@ JSObject* js_get_or_create_jsobject(JSContext *cx, typename std::enable_if<!std:
137138
return proxy->obj;
138139
}
139140

141+
/**
142+
* Gets or creates a JSObject based on native_obj.
143+
If native_obj is subclass of Ref, it will use the jsb_ref functions.
144+
Otherwise it will Root the newly created JSObject
145+
*/
140146
template<class T>
141147
JSObject* js_get_or_create_jsobject(JSContext *cx, typename std::enable_if<std::is_base_of<cocos2d::Ref,T>::value,T>::type *native_obj)
142148
{

0 commit comments

Comments
 (0)