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
This commit is contained in:
Martin Konicek 2017-03-08 04:35:51 -08:00 committed by Facebook Github Bot
parent 7978f7a27b
commit adf650debc
1 changed files with 4 additions and 2 deletions

View File

@ -2215,6 +2215,7 @@ function unforkEvent(event: ?AnimatedEvent | ?Function, listener: Function): voi
class AnimatedEvent { class AnimatedEvent {
_argMapping: Array<?Mapping>; _argMapping: Array<?Mapping>;
_listeners: Array<Function> = []; _listeners: Array<Function> = [];
_callListeners: Function;
_attachedEvent: ?{ _attachedEvent: ?{
detach: () => void, detach: () => void,
}; };
@ -2228,6 +2229,7 @@ class AnimatedEvent {
if (config.listener) { if (config.listener) {
this.__addListener(config.listener); this.__addListener(config.listener);
} }
this._callListeners = this._callListeners.bind(this);
this._attachedEvent = null; this._attachedEvent = null;
this.__isNative = shouldUseNativeDriver(config); this.__isNative = shouldUseNativeDriver(config);
@ -2281,9 +2283,9 @@ class AnimatedEvent {
}; };
} }
_callListeners = (...args) => { _callListeners(...args) {
this._listeners.forEach(listener => listener(...args)); this._listeners.forEach(listener => listener(...args));
}; }
_validateMapping() { _validateMapping() {
const traverse = (recMapping, recEvt, key) => { const traverse = (recMapping, recEvt, key) => {