YellowBox: Allow Retrying Symbolication

Summary: When symbolication fails, allow retrying without having to reload the current JS VM.

Reviewed By: ejanzer

Differential Revision: D9760666

fbshipit-source-id: 63837c81fe77a9b0b897a858e3d64bc7dcf2c3bd
This commit is contained in:
Tim Yung
2018-09-11 20:38:58 -07:00
committed by Facebook Github Bot
parent 5e6e5e92ca
commit d6b9ec1c1f
4 changed files with 35 additions and 4 deletions

View File

@@ -21,6 +21,10 @@ export type Stack = Array<StackFrame>;
const cache: Map<CacheKey, Promise<Stack>> = new Map();
const YellowBoxSymbolication = {
delete(stack: Stack): void {
cache.delete(getCacheKey(stack));
},
symbolicate(stack: Stack): Promise<Stack> {
const key = getCacheKey(stack);

View File

@@ -63,6 +63,11 @@ class YellowBoxWarning {
: this.stack;
}
retrySymbolicate(callback: () => void): SymbolicationRequest {
YellowBoxSymbolication.delete(this.stack);
return this.symbolicate(callback);
}
symbolicate(callback: () => void): SymbolicationRequest {
let aborted = false;