facebookarchive/prepack

Fuse adjacent JOIN_GENERATORS with same path condition

开放

#2,565 创建于 2018年9月22日

 (0 条评论) (0 个反应) (0 位负责人)JavaScript (520 个派生)batch import
Instant Renderenhancementhelp wantedlevel 2 (easy)

仓库指标

星标
 (14,268 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

This...

let x = __abstract("boolean", "(x)");
if (x) console.log("Hello");
if (x) console.log(" World");

currently prepacks to

(function () {
  var _0 = x;

  if (_0) {
    console.log("Hello");
  }

  if (_0) {
    console.log(" World");
  }
})();

but should Prepack to

(function () {
  var _0 = x;

  if (_0) {
    console.log("Hello");
    console.log(" World");
  }
})();

(Seen arising from actual product code.)

贡献者指南