facebookarchive/prepack

Rewrite reportIntrospectionError calls

Open

#1.898 geöffnet am 8. Mai 2018

Auf GitHub ansehen
 (8 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (520 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (14.268 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Once upon a time, Prepack didn't have a real error-handling story besides just throwing an exception. From this time, there are still a ton of reportIntrospectionError calls in the code base.

They should all be rewritten, one by one (separate pull-requests, please) into something like the following.

    let error = new CompilerDiagnostic("appropriate error message", referenceToSourceLocation, "PPxxxx", "FatalError");
    realm.handleError(error);
    throw new FatalError();

Where PPxxxx should be the next currently unused error code; check https://github.com/facebook/prepack/wiki/Prepack-diagnostics for all currently defined error code.

  • Create a new wiki page with the PP error number as its name.
  • Add a link to it from the page that lists all error numbers.

Contributor Guide