amdclean icon indicating copy to clipboard operation
amdclean copied to clipboard

AMD destroys multiline return statements

Open aleventhal opened this issue 9 years ago • 3 comments

The following code is altered so that undefined is returned, rather than 99:

function shouldReturn99(event) {
  return
  99;
}

AMDClean adds a semicolon after the return, as follows:

;(function() {
function shouldReturn99(event) {
  return;
  99;
}
}());

aleventhal avatar Jan 07 '16 21:01 aleventhal

@aleventhal nope, it should return undefined.

finom avatar Feb 08 '16 19:02 finom

According to my browser, @finom is right

ooxi avatar Feb 09 '16 08:02 ooxi

Should be closed. See also: http://ecma-international.org/ecma-262/5.1/#sec-7.9

Neonit avatar Sep 06 '17 06:09 Neonit