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

Commit

Permalink
perf: optimize internal isWindow call
Browse files Browse the repository at this point in the history
Each window has a reference to itself, which is pretty unique so we can use
that to simplify our isWindow check
  • Loading branch information
IgorMinar authored and rodyhaddad committed Jun 13, 2014
1 parent 31faeaa commit b68ac4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ function isRegExp(value) {
* @returns {boolean} True if `obj` is a window obj.
*/
function isWindow(obj) {
return obj && obj.document && obj.location && obj.alert && obj.setInterval;
return obj && obj.window === obj;
}


Expand Down

0 comments on commit b68ac4c

Please sign in to comment.