Reviewed By: jeffmo

Differential Revision: D3821852

fbshipit-source-id: 01fd16707cba860a830d682a2af2bdd542605abf
This commit is contained in:
Gabe Levi 2016-09-06 13:36:33 -07:00 коммит произвёл Facebook Github Bot 7
Родитель 300cb03e94
Коммит 85a6f011b6
10 изменённых файлов: 20 добавлений и 13 удалений

Просмотреть файл

@ -47,11 +47,11 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-1]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-1]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
unsafe.enable_getters_and_setters=true
[version]
^0.31.0
^0.32.0

Просмотреть файл

@ -28,9 +28,7 @@ class PromiseTest extends React.Component {
this.testShouldSucceedAsync(),
this.testShouldThrowAsync(),
]).then(() => TestModule.markTestPassed(
// $FlowFixMe found when converting React.createClass to ES6
this.shouldResolve && this.shouldReject &&
// $FlowFixMe found when converting React.createClass to ES6
this.shouldSucceedAsync && this.shouldThrowAsync
));
}

Просмотреть файл

@ -94,7 +94,7 @@ class SwipeableListView extends React.Component {
dataSource: this.props.dataSource,
};
_listViewRef: ?string = null;
_listViewRef: ?ReactElement<any> = null;
_shouldBounceFirstRowOnMount = false;
componentWillMount(): void {
@ -132,7 +132,8 @@ class SwipeableListView extends React.Component {
* (from high 20s to almost consistently 60 fps)
*/
_setListViewScrollable = (value: boolean): void => {
if (this._listViewRef && this._listViewRef.setNativeProps) {
if (this._listViewRef &&
typeof this._listViewRef.setNativeProps === 'function') {
this._listViewRef.setNativeProps({
scrollEnabled: value,
});
@ -141,7 +142,8 @@ class SwipeableListView extends React.Component {
// Passing through ListView's getScrollResponder() function
getScrollResponder = (): ?Object => {
if (this._listViewRef && this._listViewRef.getScrollResponder) {
if (this._listViewRef &&
typeof this._listViewRef.getScrollResponder === 'function') {
return this._listViewRef.getScrollResponder();
}
};

Просмотреть файл

@ -58,7 +58,11 @@ function handleException(e: Error, isFatal: boolean) {
e = new Error(e);
}
(console._errorOriginal || console.error)(e.message);
if (typeof console._errorOriginal === 'function') {
console._errorOriginal(e.message);
} else {
console.error(e.message);
}
reportException(e, isFatal);
}

Просмотреть файл

@ -26,7 +26,7 @@ function parseErrorStack(e: Error): Array<StackFrame> {
var stack = Array.isArray(e.stack) ? e.stack : stacktraceParser.parse(e.stack);
var framesToPop = e.framesToPop || 0;
var framesToPop = typeof e.framesToPop === 'number' ? e.framesToPop : 0;
while (framesToPop--) {
stack.shift();
}

Просмотреть файл

@ -37,6 +37,8 @@ function _allocateCallback(func: Function, type: $Keys<typeof JSTimersExecution.
e.framesToPop = 1;
const stack = parseErrorStack(e);
if (stack) {
/* $FlowFixMe(>=0.32.0) - this seems to be putting something of the wrong
* type into identifiers */
JSTimersExecution.identifiers[freeIndex] = stack.shift();
}
}

Просмотреть файл

@ -46,7 +46,7 @@ const JSTimersExecution = {
timerIDs: [],
immediates: [],
requestIdleCallbacks: [],
identifiers: ([] : [{methodName: string}]),
identifiers: ([] : Array<null | {methodName: string}>),
errors: (null : ?[Error]),

Просмотреть файл

@ -251,6 +251,7 @@ function buildTransitionProps(
position,
progress,
scenes,
// $FlowFixMe(>=0.32.0) - find can return undefined
scene: scenes.find(isSceneActive),
};
}

Просмотреть файл

@ -144,7 +144,7 @@ function isWarningIgnored(warning: string): boolean {
return (
Array.isArray(console.ignoredYellowBox) &&
console.ignoredYellowBox.some(
ignorePrefix => warning.startsWith(ignorePrefix)
ignorePrefix => warning.startsWith(String(ignorePrefix))
)
);
}

Просмотреть файл

@ -207,7 +207,7 @@
"eslint-plugin-babel": "^3.2.0",
"eslint-plugin-flow-vars": "^0.2.1",
"eslint-plugin-react": "^4.2.1",
"flow-bin": "^0.31.1",
"flow-bin": "^0.32.0",
"jest": "15.1.0",
"jest-repl": "15.1.0",
"jest-runtime": "15.1.0",