mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use Object.prototype.hasOwnProperty for doc in IE8
Test Plan: Loaded ballmer-peak example in IE8 without errors and interacted with the text field.
This commit is contained in:
@@ -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