facebookarchive/prepack

Review all FatalError throws

Open

#2.020 geöffnet am 24. Mai 2018

Auf GitHub ansehen
 (2 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)JavaScript (14.268 Stars) (520 Forks)batch import
bughelp wanted

Beschreibung

I've seen a few code snippets like this:

    // todo: emit a diagnostic messsage
    throw new FatalError();

This is problematic for two reasons:

  1. User doesn't get any useful feedback.
  2. Worse, on the command-line it will show up as an internal error, because there must not be a FatalError without a CompilerDiagnostic thingy having been issued.

Concrete work items:

  1. Review all places in the code where a FatalError is thrown, and make sure that a corresponding CompilerDiagnostic thingy was issued before.
  2. Rethink best practices, as it is too easy to create mismatches between FatalError and CompilerDiagnostic (how did this get past code review?).

Contributor Guide