From 6323f0314874ebb3e3cd20c6d75e20e37fb6c714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Markb=C3=A5ge?= Date: Wed, 14 Oct 2015 00:08:56 -0700 Subject: [PATCH] Merge pull request #5166 from spicyj/gh-5157 Add feature test for document.createEvent (cherry picked from commit da1135618e7742a32fbc7d411dd3ee080624c54f) --- src/shared/utils/ReactErrorUtils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/utils/ReactErrorUtils.js b/src/shared/utils/ReactErrorUtils.js index d6f2af8e03..d55f827840 100644 --- a/src/shared/utils/ReactErrorUtils.js +++ b/src/shared/utils/ReactErrorUtils.js @@ -61,7 +61,9 @@ if (__DEV__) { * real browser event. */ if (typeof window !== 'undefined' && - typeof window.dispatchEvent === 'function') { + typeof window.dispatchEvent === 'function' && + typeof document !== 'undefined' && + typeof document.createEvent === 'function') { var fakeNode = document.createElement('react'); ReactErrorUtils.invokeGuardedCallback = function(name, func, a, b) { var boundFunc = func.bind(null, a, b);