mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Merge pull request #1564 from spicyj/hop-ie8
Use Object.prototype.hasOwnProperty for doc in IE8
This commit is contained in:
commit
ab58ecefa7
1 file changed
+3
-1
@@ -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]] = {};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user