facebookarchive/prepack

Review all FatalError throws

Open

#2,020 创建于 2018年5月24日

在 GitHub 查看
 (2 评论) (2 反应) (0 负责人)JavaScript (14,268 star) (520 fork)batch import
bughelp wanted

描述

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

贡献者指南