Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b68ac4c

Browse files
IgorMinarrodyhaddad
authored andcommitted
perf: optimize internal isWindow call
Each window has a reference to itself, which is pretty unique so we can use that to simplify our isWindow check
1 parent 31faeaa commit b68ac4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Angular.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ function isRegExp(value) {
543543
* @returns {boolean} True if `obj` is a window obj.
544544
*/
545545
function isWindow(obj) {
546-
return obj && obj.document && obj.location && obj.alert && obj.setInterval;
546+
return obj && obj.window === obj;
547547
}
548548

549549

0 commit comments

Comments
 (0)