facebookarchive/prepack

Review all FatalError throws

Open

#2,020 opened on 2018年5月24日

GitHub で見る
 (2 comments) (2 reactions) (0 assignees)JavaScript (520 forks)batch import
bughelp wanted

Repository metrics

Stars
 (14,268 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

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?).

コントリビューターガイド