prepack icon indicating copy to clipboard operation
prepack copied to clipboard

Fuse adjacent JOIN_GENERATORS with same path condition

Open NTillmann opened this issue 5 years ago • 0 comments

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

NTillmann avatar Sep 22 '18 01:09 NTillmann