Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Bad command-line crashes Prepack #2509

Open
NTillmann opened this issue Aug 30, 2018 · 0 comments
Open

Bad command-line crashes Prepack #2509

NTillmann opened this issue Aug 30, 2018 · 0 comments

Comments

@NTillmann
Copy link
Contributor

This triggers an invariant violation.

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

It shouldn't. The command-line argument processing should rather print a user-friendly error message in such cases and exit, like it already happens for most or all other bad arguments.

facebook-github-bot pushed a commit that referenced this issue Sep 12, 2018
… anymore (#2545)

Summary:
This can be a possible fix for #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`
Pull Request resolved: #2545

Differential Revision: D9800485

Pulled By: hermanventer

fbshipit-source-id: edc24b4a812b4e32f9c48e05a0799bf4af431991
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant