From 44a53f5404e97004fad6ea36c406b7a27d4f876a Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Thu, 26 Oct 2017 10:03:57 +0800 Subject: [PATCH] fix ci --- cocos2d/core/CCNode.js | 3 +-- test/qunit/unit-es5/test-node.js | 27 --------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 386ef2bf6d..f345764f6a 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -1018,8 +1018,7 @@ var Node = cc.Class({ this._parent = null; } } - else if (CC_TEST ? (/* make CC_JSB mockable*/ Function('return CC_JSB'))() : CC_JSB) { - this._sgNode.release(); + else if (CC_JSB) { this._sgNode._entity = null; this._sgNode = null; } diff --git a/test/qunit/unit-es5/test-node.js b/test/qunit/unit-es5/test-node.js index 8f40d2512c..3b411c84d8 100644 --- a/test/qunit/unit-es5/test-node.js +++ b/test/qunit/unit-es5/test-node.js @@ -365,33 +365,6 @@ test('attach events', function () { cc.engine.off('node-detach-from-scene', onDetach); }); -test('release sg node', function () { - var isJSB = CC_JSB; - CC_JSB = true; - - var parent = new cc.Node(); - var child = new cc.Node(); - child.parent = parent; - - var childReleased = false; - var parentReleased = false; - - child._sgNode.release = function () { - childReleased = true; - }; - parent._sgNode.release = function () { - parentReleased = true; - }; - - parent.destroy(); - cc.Object._deferredDestroy(); - - strictEqual(parentReleased, true, 'should release parent sg node'); - strictEqual(childReleased, true, 'should release child sg node'); - - CC_JSB = isJSB; -}); - test('getBoundingBox', function () { var node = new cc.Node(); node.anchorX = 0.5;