facebookarchive/prepack

Comment update in __abstract

Open

#1,950 创建于 2018年5月12日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (14,268 star) (520 fork)batch import
enhancementhelp wantedquestion

描述

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.

贡献者指南