diff --git a/Source/Core/Core.js b/Source/Core/Core.js index b166bb6bd..c937ed6e6 100644 --- a/Source/Core/Core.js +++ b/Source/Core/Core.js @@ -368,6 +368,7 @@ var cloneOf = function(item){ }; Array.implement('clone', function(){ + if(this.slice) return this.slice(0); var i = this.length, clone = new Array(i); while (i--) clone[i] = cloneOf(this[i]); return clone; @@ -397,6 +398,7 @@ Object.extend({ }, clone: function(object){ + if(Object.create) return Object.create(object); var clone = {}; for (var key in object) clone[key] = cloneOf(object[key]); return clone;