Merge pull request #1564 from spicyj/hop-ie8

Use Object.prototype.hasOwnProperty for doc in IE8
This commit is contained in:
Paul O’Shannessy
2014-05-19 13:15:25 -07:00
+3 -1
View File
@@ -129,7 +129,9 @@ var topEventMapping = {
var topListenersIDKey = "_reactListenersID" + String(Math.random()).slice(2);
function getListeningForDocument(mountAt) {
if (!mountAt.hasOwnProperty(topListenersIDKey)) {
// In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
// directly.
if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
mountAt[topListenersIDKey] = reactTopListenersCounter++;
alreadyListeningTo[mountAt[topListenersIDKey]] = {};
}