Look on __reactBoundContext for displayName

This commit is contained in:
Charles Marsh
2014-08-20 08:44:33 +08:00
parent cf45a40bb8
commit 0ecc7e5a7f
@@ -312,8 +312,11 @@ var SimpleEventPlugin = {
var returnValue = EventPluginUtils.executeDispatch(event, listener, domID);
if (__DEV__) {
if (typeof returnValue === 'boolean') {
var eventHandlerName = (listener.__reactBoundContext &&
listener.__reactBoundContext.constructor.displayName) ||
'<<anonymous>>';
monitorCodeUse('react_event_return_false', {
eventHandlerName: listener.__reactBoundMethod.displayName
eventHandlerName: eventHandlerName
});
console.warn(
'Returning `false` from an event handler is deprecated and will ' +