facebookarchive/prepack

Fuse adjacent JOIN_GENERATORS with same path condition

Open

#2,565 opened on 2018年9月22日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)JavaScript (14,268 stars) (520 forks)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.)

コントリビューターガイド