facebookarchive/prepack

Fuse adjacent JOIN_GENERATORS with same path condition

Open

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

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

描述

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

贡献者指南