From adf650debc6f2b0a6093490585b23f07ab2a86eb Mon Sep 17 00:00:00 2001 From: Martin Konicek Date: Wed, 8 Mar 2017 04:35:51 -0800 Subject: [PATCH] Use different function syntax that the JS parser used to build the website can understand Summary: For some reason the parser doesn't support that syntax. It fails with: ``` Cannot parse file ../Libraries/Animated/src/AnimatedImplementation.js Error: parseSource returned falsy at parseAPIInferred (/home/ubuntu/react-native/website/server/extractDocs.js:343:13) ``` Reviewed By: sahrens Differential Revision: D4669961 fbshipit-source-id: 3536c94b8f385f5810c47544c4a72c8c785bf0e5 --- Libraries/Animated/src/AnimatedImplementation.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/Animated/src/AnimatedImplementation.js b/Libraries/Animated/src/AnimatedImplementation.js index bbe47147f..65190e608 100644 --- a/Libraries/Animated/src/AnimatedImplementation.js +++ b/Libraries/Animated/src/AnimatedImplementation.js @@ -2215,6 +2215,7 @@ function unforkEvent(event: ?AnimatedEvent | ?Function, listener: Function): voi class AnimatedEvent { _argMapping: Array; _listeners: Array = []; + _callListeners: Function; _attachedEvent: ?{ detach: () => void, }; @@ -2228,6 +2229,7 @@ class AnimatedEvent { if (config.listener) { this.__addListener(config.listener); } + this._callListeners = this._callListeners.bind(this); this._attachedEvent = null; this.__isNative = shouldUseNativeDriver(config); @@ -2281,9 +2283,9 @@ class AnimatedEvent { }; } - _callListeners = (...args) => { + _callListeners(...args) { this._listeners.forEach(listener => listener(...args)); - }; + } _validateMapping() { const traverse = (recMapping, recEvt, key) => {