Merge pull request #858 from jareguo/v1.1

fix cc.clone on JSB
This commit is contained in:
Jare Guo
2016-06-30 21:42:22 +08:00
committed by GitHub
+4 -2
View File
@@ -203,8 +203,10 @@ cc.clone = function (obj) {
for (var key in obj) {
var copy = obj[key];
// Beware that typeof null == "object" !
if (((typeof copy) === "object") && copy &&
!(copy instanceof _ccsg.Node) && !(copy instanceof HTMLElement)) {
if (typeof copy === "object" &&
copy &&
!(copy instanceof _ccsg.Node) &&
(CC_JSB || !(copy instanceof HTMLElement))) {
newObj[key] = cc.clone(copy);
} else {
newObj[key] = copy;