amdclean
amdclean copied to clipboard
A comment in return statement leads to incorrect javascript
If you add a comment just after return
keyword (e.g. JSDoc3 module comment)
define('fail', [], function() {
var x = 1;
return /* fail here */ {
a: x
};
});
then an erroneous line break appears in processed code:
;(function() {
var fail;
fail = function () {
var x = 1;
return /* fail here */
{ a: x };
}();
}());
It is no longer functions as intended because return
statement implicitly returns undefined
. Object {a: x}
becomes orphaned.