mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-09-11 14:46:37 +03:00
Return correct recovery code for FatalError (#2548)
Summary: In support of #2547. Sometimes, it is more desirable (less costly, better for debugging) to flag a warning for a possibly anomalous condition, than to assume that it is anomalous and enforce it as an error. This change exposes warnings that a user upgrades to errors, so that they can then be enforced as such. Pull Request resolved: https://github.com/facebook/prepack/pull/2548 Differential Revision: D9884632 Pulled By: sb98052 fbshipit-source-id: c47b57a21aa047b0f3fa2672508f8fb23c04942a
This commit is contained in:
parent
8ba4fbc916
commit
47f6f4b495
@ -425,7 +425,7 @@ function run(
|
||||
}
|
||||
if (compilerDiagnostic.location) compilerDiagnostics.set(compilerDiagnostic.location, compilerDiagnostic);
|
||||
else compilerDiagnosticsList.push(compilerDiagnostic);
|
||||
return "Recover";
|
||||
return compilerDiagnostic.severity === "FatalError" ? "Fail" : "Recover";
|
||||
}
|
||||
|
||||
function printDiagnostics(caughtFatalError: boolean, caughtUnexpectedError: boolean = false): boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user