diff --git a/src/renderers/shared/shared/event/SyntheticEvent.js b/src/renderers/shared/shared/event/SyntheticEvent.js index 81bb3d784c8f..eab9877a1d04 100644 --- a/src/renderers/shared/shared/event/SyntheticEvent.js +++ b/src/renderers/shared/shared/event/SyntheticEvent.js @@ -210,6 +210,33 @@ Object.assign(SyntheticEvent.prototype, { SyntheticEvent.Interface = EventInterface; +/** + * Helper to reduce boilerplate when creating subclasses. + * + * @param {function} Class + * @param {?object} Interface + */ +SyntheticEvent.augmentClass = function(Class, Interface) { + var Super = this; + + var E = function() {}; + E.prototype = Super.prototype; + var prototype = new E(); + + Object.assign(prototype, Class.prototype); + Class.prototype = prototype; + Class.prototype.constructor = Class; + + Class.Interface = Object.assign({}, Super.Interface, Interface); + Class.augmentClass = Super.augmentClass; + + PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler); +}; + +/** Proxying after everything set on SyntheticEvent + * to resolve Proxy issue on some WebKit browsers + * in which some Event properties are set to undefined (GH#10010) + */ if (__DEV__) { if (isProxySupported) { /*eslint-disable no-func-assign */ @@ -243,28 +270,6 @@ if (__DEV__) { /*eslint-enable no-func-assign */ } } -/** - * Helper to reduce boilerplate when creating subclasses. - * - * @param {function} Class - * @param {?object} Interface - */ -SyntheticEvent.augmentClass = function(Class, Interface) { - var Super = this; - - var E = function() {}; - E.prototype = Super.prototype; - var prototype = new E(); - - Object.assign(prototype, Class.prototype); - Class.prototype = prototype; - Class.prototype.constructor = Class; - - Class.Interface = Object.assign({}, Super.Interface, Interface); - Class.augmentClass = Super.augmentClass; - - PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler); -}; PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);