Closed kuankuan2007 closed 10 months ago
Hi @kuankuan2007, ran into the same issue since arguments.callee
within the deepExtend
declaration is deprecated and the strict mode doesn't like that. That being said, this should fix it:
Object.deepExtend = function(destination, source) {
function extendRecursive(dest, src) {
for (var property in src) {
if (src.hasOwnProperty(property)) {
if (src[property] && src[property].constructor && src[property].constructor === Object) {
dest[property] = dest[property] || {};
extendRecursive(dest[property], src[property]);
} else {
dest[property] = src[property];
}
}
}
}
extendRecursive(destination, source);
return destination;
`};
Yes, this is a very good solution.
In version v2.0.0, an error with the word "Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them" appears. I try to fix the problem in the https://github.com/kuankuan2007/particles.js/tree/kuankuan2007