if (start && !start._comments_dumped) {
start._comments_dumped = true;
var comments = start.comments_before;
+
+ // XXX: ugly fix for https://github.com/mishoo/UglifyJS2/issues/112
+ // if this node is `return` or `throw`, we cannot allow comments before
+ // the returned or thrown value.
+ if (self instanceof AST_Exit &&
+ self.value && self.value.start.comments_before.length > 0) {
+ comments = (comments || []).concat(self.value.start.comments_before);
+ self.value.start.comments_before = [];
+ }
+
if (c.test) {
comments = comments.filter(function(comment){
return c.test(comment.value);