facebookarchive / prepack

A JavaScript bundle optimizer.
http://prepack.io
Other
14.22k stars 425 forks source link

Bad command-line for debugDiagnosticSeverity does not crashes Prepack anymore #2545

Closed giftkugel closed 6 years ago

giftkugel commented 6 years ago

This can be a possible fix for https://github.com/facebook/prepack/issues/2509

I have removed the invariant method call and added a value check as used for the invariantMode option.

node lib/prepack-cli.js --debugDiagnosticSeverity foo

will now generate

Unsupported debugDiagnosticSeverity: foo

giftkugel commented 6 years ago

You're welcome, but I am not happy, that I am not passing some checks ... First the yarn prettier-all check failed because I didn't know about it. Now I am failing the flow version; flow check check. 😞

But the old code was passing arg also directly to debuggerConfigArgs.diagnosticSeverity which is Severity type. Did the old code pass the flow type check?