mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 22:41:28 +08:00
Deploy v0.32.0
Reviewed By: jeffmo Differential Revision: D3821852 fbshipit-source-id: 01fd16707cba860a830d682a2af2bdd542605abf
This commit is contained in:
committed by
Facebook Github Bot 7
parent
300cb03e94
commit
85a6f011b6
@@ -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]),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user