cocos2d / bindings-generator

JSBindings generator for C++
170 stars 153 forks source link

Indention fix for static and overload function and overload function fix #13

Closed dumganhar closed 11 years ago

dumganhar commented 11 years ago

In overloaded function, if there are the same arguments but with one or more different type. 'If else' may fails since String can't be converted to Object by JSVAL_TO_OBJECT. So we need to check whether the jsval is an object. If not, break with 'ok = JS_FALSE'.

e.g. cc.MotionStreak.create(2, 3, 32, cc.GREEN, string); // here, 'string' isn't an object, so the binding glue codes will crash in JSVAL_TO_OBJECT
       cc.MotionStreak.create(2, 3, 32, cc.GREEN, texture);