esmangle icon indicating copy to clipboard operation
esmangle copied to clipboard

remove wasted return statement

Open Constellation opened this issue 13 years ago • 1 comments

function t() {
  if (a) {
    ...
  }
  return;
}

should be transformed to

function t() {
  if (a) {
    ...
  }
}
function f() {
  return void 0;
}

to

function t() { }

We should check control flow and eliminate wasted return statement.

Constellation avatar Sep 23 '12 12:09 Constellation

Quoted:

function a(a){return void a()}

which would hopefully be further reduced to this program:

function a(a){a()}

Constellation avatar Jan 01 '14 13:01 Constellation