You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Assume that there is an object and one of its properties is an object with DOMTokenList as its prototype. In Chrome and FireFox, this will cause different errors when copying the object. In both cases, the error actually occurs in forEach().
For Chrome:
Chrome will throw an exception at line 267 (of Angular.js) because its version of DOMTokenList implements its own version of forEach, which causes an invalid invocation error.
For FireFox:
FireFox will throw an exception at line 203 (of Angular.js) because of the following:
(in copy)
var emptyObject = Object.create(Object.getPrototypeOf(source));
destination = copy(source, emptyObject, stackSource, stackDest);
Essentially, the problem is this: DOMTokenList has a read-only length property. As an interface, this requires that its implementing object define a length property. A new, empty object is created. It is then iterated over in order to delete any existing properties. During this iteration, forEach() calls isArrayLike(), which subsequently checks to see if there is a length property. This causes an error, as the read-only property is checked and does not exist on the object.
The FireFox issue may also be causing the Chrome issue. I have not fully tested this.
My current workaround is to comment out the part where it calls the native forEach and to change the property removal to just be a for loop.