Merge pull request #2120 from dumganhar/master

fixed #1811: Fixing complication error on win32 after this pull request (https://github.com/cocos2d/cocos2d-x/pull/2119
This commit is contained in:
James Chen 2013-03-07 23:18:53 -08:00
commit f98d4518d0
2 changed files with 9 additions and 2 deletions

View File

@ -294,6 +294,10 @@ public:
operator char*() {
return (char*)buffer;
}
private:
/* Copy and assignment are not supported. */
JSStringWrapper(const JSStringWrapper &another);
JSStringWrapper &operator=(const JSStringWrapper &another);
};
JSBool jsb_set_reserved_slot(JSObject *obj, uint32_t idx, jsval value);

View File

@ -80,8 +80,11 @@ JSBool JSBCore_log(JSContext *cx, uint32_t argc, jsval *vp)
JSString *string = NULL;
JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "S", &string);
if (string) {
JSAutoByteString log_str(cx, string);
CCLOG(log_str.ptr());
char* log_str = JS_EncodeString(cx, string);
if (log_str) {
CCLOG(log_str);
JS_free(cx, (void*)log_str);
}
}
return JS_TRUE;