diff --git a/CHANGELOG b/CHANGELOG index 92420af5cc..f41bce130f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,10 @@ cocos2d-x-3.0beta2 ?.? ? [NEW] Renderer: Added BatchCommand. This command is not "batchable" with other commands, but improves performance in about 10% [NEW] LuaBindings: Bindings-generator supports to bind namespace for lua. + [FIX] JSB: Pure JS class which is inherited from cc.Class will trigger an irrelevant log. + [FIX] JSB: Mac and iOS Simulator should also use SpiderMonkey which was built in RELEASE mode. + [FIX] JSB: Crash when running JSB projects on iOS device in DEBUG mode. + [FIX] JSB: Crash when Firefox connects to JSB application on Mac platform. [FIX] Uses EventDispatcher to access event in LUA testcase. [FIX] Exposes SAXParser class to JS, it is used for parsing XML in JS. [FIX] Uses unified `desktop/CCEGLView.h/cpp` for desktop platforms (windows, mac, linux). diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 2ee1321928..ab43aa8b01 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -cf66879460037639be60615c3aeeb56e799daaeb \ No newline at end of file +3c7f70ab861d6d3348d4f598cf492b29b306d9d9 \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 779b19e39d..3389050ae0 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -c4a10d83e31c57266fcc9caf7ff46b2bb98706e1 \ No newline at end of file +c958533394964fe0c38bd60c272a0b48ec38d9d6 \ No newline at end of file diff --git a/cocos/2d/CCConfiguration.cpp b/cocos/2d/CCConfiguration.cpp index dbdf12ea14..940c9fdb9b 100644 --- a/cocos/2d/CCConfiguration.cpp +++ b/cocos/2d/CCConfiguration.cpp @@ -75,7 +75,7 @@ bool Configuration::init() _valueDict["cocos2d.x.compiled_with_gl_state_cache"] = Value(true); #endif -#ifdef DEBUG +#if COCOS2D_DEBUG _valueDict["cocos2d.x.build_type"] = Value("DEBUG"); #else _valueDict["cocos2d.x.build_type"] = Value("RELEASE"); diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index c45e10851e..f7c8bcdd35 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -351,7 +351,7 @@ void Director::calculateDeltaTime() _deltaTime = MAX(0, _deltaTime); } -#ifdef DEBUG +#if COCOS2D_DEBUG // If we are debugging our code, prevent big delta time if (_deltaTime > 0.2f) { diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index e8828b9aa8..f1e3854dee 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit e8828b9aa8b1bfdf08bc3c077ec2cc1ebd9b9c82 +Subproject commit f1e3854deef8fdf4def2894f525017f00261a217 diff --git a/cocos/scripting/javascript/bindings/ScriptingCore.cpp b/cocos/scripting/javascript/bindings/ScriptingCore.cpp index 6510b90167..7394916768 100644 --- a/cocos/scripting/javascript/bindings/ScriptingCore.cpp +++ b/cocos/scripting/javascript/bindings/ScriptingCore.cpp @@ -46,7 +46,7 @@ #include "js_bindings_config.h" -#if DEBUG +#if COCOS2D_DEBUG #define TRACE_DEBUGGER_SERVER(...) CCLOG(__VA_ARGS__) #else #define TRACE_DEBUGGER_SERVER(...) @@ -568,7 +568,7 @@ JSBool ScriptingCore::runScript(const char *path, JSObject* global, JSContext* c if (script) { jsval rval; filename_script[path] = script; - JSAutoCompartment ac(cx, global); + evaluatedOK = JS_ExecuteScript(cx, global, script, &rval); if (JS_FALSE == evaluatedOK) { cocos2d::log("(evaluatedOK == JS_FALSE)"); @@ -704,7 +704,7 @@ JSBool ScriptingCore::dumpRoot(JSContext *cx, uint32_t argc, jsval *vp) { // JS_DumpNamedRoots is only available on DEBUG versions of SpiderMonkey. // Mac and Simulator versions were compiled with DEBUG. -#if DEBUG +#if COCOS2D_DEBUG // JSContext *_cx = ScriptingCore::getInstance()->getGlobalContext(); // JSRuntime *rt = JS_GetRuntime(_cx); // JS_DumpNamedRoots(rt, dumpNamedRoot, NULL); @@ -1408,6 +1408,9 @@ void ScriptingCore::enableDebugger() JS_SetDebugMode(_cx, JS_TRUE); _debugGlobal = NewGlobalObject(_cx, true); + // Adds the debugger object to root, otherwise it may be collected by GC. + JS_AddObjectRoot(_cx, &_debugGlobal); + JS_WrapObject(_cx, &_debugGlobal); JSAutoCompartment ac(_cx, _debugGlobal); // these are used in the debug program diff --git a/cocos/scripting/javascript/script/jsb_cocos2d.js b/cocos/scripting/javascript/script/jsb_cocos2d.js index 3237113d99..2ab020b08a 100644 --- a/cocos/scripting/javascript/script/jsb_cocos2d.js +++ b/cocos/scripting/javascript/script/jsb_cocos2d.js @@ -651,10 +651,13 @@ cc.Class.extend = function (prop) { function Class() { // All construction is actually done in the init method if (!initializing) { - if (!this.ctor) - cc.log("No ctor function found, please set `classes_need_extend` section at `ini` file as `tools/tojs/cocos2dx.ini`"); - else + if (!this.ctor) { + if (this.__nativeObj) + cc.log("No ctor function found! Please check whether `classes_need_extend` section in `ini` file like which in `tools/tojs/cocos2dx.ini`"); + } + else { this.ctor.apply(this, arguments); + } } } diff --git a/external/spidermonkey/include/mac/js-config.h b/external/spidermonkey/include/mac/js-config.h index ae4f2abf71..672d79ca0a 100644 --- a/external/spidermonkey/include/mac/js-config.h +++ b/external/spidermonkey/include/mac/js-config.h @@ -20,7 +20,7 @@ /* Define to 1 if SpiderMonkey should support the ability to perform entirely too much GC. */ -#define JS_GC_ZEAL 1 +/* #undef JS_GC_ZEAL */ /* Define to 1 if the header is present and useable. See jscpucfg.h. */ diff --git a/external/spidermonkey/prebuilt/ios/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/ios/libjs_static.a.REMOVED.git-id index 3aa7da9b21..6249ee2757 100644 --- a/external/spidermonkey/prebuilt/ios/libjs_static.a.REMOVED.git-id +++ b/external/spidermonkey/prebuilt/ios/libjs_static.a.REMOVED.git-id @@ -1 +1 @@ -1267f1437ae315da4c23e0fc5e7e3f70b4b3c8e2 \ No newline at end of file +1541255b60cd30b2a7f3424c2ef7b1f85f8474b7 \ No newline at end of file diff --git a/external/spidermonkey/prebuilt/mac/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/mac/libjs_static.a.REMOVED.git-id index e3f35605ac..4ed807de75 100644 --- a/external/spidermonkey/prebuilt/mac/libjs_static.a.REMOVED.git-id +++ b/external/spidermonkey/prebuilt/mac/libjs_static.a.REMOVED.git-id @@ -1 +1 @@ -2385a209e3aa59896599e079658d761fd2985c9a \ No newline at end of file +b49342959d039cb5961a5874f38ac882feadaf82 \ No newline at end of file diff --git a/tools/bindings-generator b/tools/bindings-generator index 6ae9f506f5..8fd59c24bf 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit 6ae9f506f5ac7288bd27d11594a8a8f4e6e8a7d1 +Subproject commit 8fd59c24bf5b46d2e02a8173ac19cdfc877263c5 diff --git a/tools/tojs/cocos2dx_studio.ini b/tools/tojs/cocos2dx_studio.ini index 64cd414f96..4d4e9e6e60 100644 --- a/tools/tojs/cocos2dx_studio.ini +++ b/tools/tojs/cocos2dx_studio.ini @@ -79,4 +79,4 @@ abstract_classes = ColliderDetector ColliderBody ArmatureDataManager ComAttribut # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. script_control_cpp = no -classes_need_extend = Armature +classes_need_extend = Armature ComController