aboutsummaryrefslogtreecommitdiff
path: root/node_modules/react-dom/lib/SyntheticEvent.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/react-dom/lib/SyntheticEvent.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/react-dom/lib/SyntheticEvent.js')
-rw-r--r--node_modules/react-dom/lib/SyntheticEvent.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/node_modules/react-dom/lib/SyntheticEvent.js b/node_modules/react-dom/lib/SyntheticEvent.js
index 6b745cccc..61d869bb1 100644
--- a/node_modules/react-dom/lib/SyntheticEvent.js
+++ b/node_modules/react-dom/lib/SyntheticEvent.js
@@ -102,7 +102,6 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg
}
_assign(SyntheticEvent.prototype, {
-
preventDefault: function () {
this.defaultPrevented = true;
var event = this.nativeEvent;
@@ -112,8 +111,8 @@ _assign(SyntheticEvent.prototype, {
if (event.preventDefault) {
event.preventDefault();
+ // eslint-disable-next-line valid-typeof
} else if (typeof event.returnValue !== 'unknown') {
- // eslint-disable-line valid-typeof
event.returnValue = false;
}
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
@@ -127,8 +126,8 @@ _assign(SyntheticEvent.prototype, {
if (event.stopPropagation) {
event.stopPropagation();
+ // eslint-disable-next-line valid-typeof
} else if (typeof event.cancelBubble !== 'unknown') {
- // eslint-disable-line valid-typeof
// The ChangeEventPlugin registers a "propertychange" event for
// IE. This event does not support bubbling or cancelling, and
// any references to cancelBubble throw "Member not found". A
@@ -177,7 +176,6 @@ _assign(SyntheticEvent.prototype, {
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
}
}
-
});
SyntheticEvent.Interface = EventInterface;
@@ -193,7 +191,7 @@ if (process.env.NODE_ENV !== 'production') {
return new Proxy(constructor.apply(that, args), {
set: function (target, prop, value) {
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
- process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
+ process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
didWarnForAddedNewProperty = true;
}
target[prop] = value;
@@ -262,6 +260,6 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
function warn(action, result) {
var warningCondition = false;
- process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
+ process.env.NODE_ENV !== 'production' ? warning(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
}
} \ No newline at end of file