mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-09-11 14:46:37 +03:00
remove the undefined invariant violation (#2106)
Summary: Release Note: none This is regarding #2072 Instead of spitting back Invariant Violation: undefined in this case, it will give back the trace error. Also the Invariant Violation: undefined is misleading. The undefined is coming from the invariant format parameter when format isn't supplied. The fix is to add an empty string to format so it won't show undefined. Questions: would you want to separate that throw into a separate util method like invariant? Closes https://github.com/facebook/prepack/pull/2106 Differential Revision: D8394381 Pulled By: NTillmann fbshipit-source-id: 3ed418c335b7db6d88bb1cca5dcc9ac69fed6b5d
This commit is contained in:
parent
e8bbe014af
commit
5b513adc84
@ -9,7 +9,7 @@
|
||||
|
||||
/* @flow strict */
|
||||
|
||||
export default function invariant(condition: boolean, format: string): void {
|
||||
export default function invariant(condition: boolean, format: string = ""): void {
|
||||
if (condition) return;
|
||||
const message = `${format}
|
||||
This is likely a bug in Prepack, not your code. Feel free to open an issue on GitHub.`;
|
||||
|
Loading…
Reference in New Issue
Block a user