facebookarchive/prepack

Fuse adjacent JOIN_GENERATORS with same path condition

Open

#2.565 geöffnet am 22. Sept. 2018

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (14.268 Stars) (520 Forks)batch import
Instant Renderenhancementhelp wantedlevel 2 (easy)

Beschreibung

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

Contributor Guide