Skip to content

Commit

Permalink
Use Object.prototype.hasOwnProperty for doc in IE8
Browse files Browse the repository at this point in the history
Test Plan: Loaded ballmer-peak example in IE8 without errors and interacted with the text field.
  • Loading branch information
sophiebits committed May 19, 2014
1 parent 0c6bee0 commit 5507954
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/browser/ReactEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]] = {};
}
Expand Down

0 comments on commit 5507954

Please sign in to comment.