facebookarchive/prepack

Comment update in __abstract

Open

#1.950 geöffnet am 12. Mai 2018

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (14.268 Stars) (520 Forks)batch import
enhancementhelp wantedquestion

Beschreibung

I was trying to read the through the test files and needed to look up the __abstract call. I noticed the helpful comment in src/intrinsics/prepack/global.js:61

  // Helper function to model values that are obtained from the environment,
  // and whose concrete values are not known at Prepack-time.
  // __abstract(typeNameOrTemplate, name, options) creates a new abstract value
  // where typeNameOrTemplate can be...
  // - 'string', 'boolean', 'number', 'object', 'function' or
  // - ':string', ':boolean', ':number', ':object', ':function' to indicate that
  //   the abstract value represents a function that only returns values of the specified type, or
  // - an actual object defining known properties.
  // If the abstract value gets somehow embedded in the final heap,
  // it will be referred to by the supplied name in the generated code.

Then I jumped into src/utils.js:54 and see that getTypeFromName supports more types now - empty, void, null, boolean, string, symbol, number, object, array, function, integral

Just making a small low priority issue to update comment if that's the right move. Also available to help update as well.

Contributor Guide