Keep the js comment on a single line if the herecomment is on a single line.

This commit is contained in:
lucasb-eyer
2013-04-15 00:11:58 +02:00
parent f21dc7a96e
commit ccc7c4404d
2 changed files with 2 additions and 2 deletions

View File

@@ -821,7 +821,7 @@
Comment.prototype.compileNode = function(o, level) {
var code;
code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n");
code = "/*" + (multident(this.comment, this.tab)) + (__indexOf.call(this.comment, '\n') >= 0 ? "\n" + this.tab : '') + "*/\n";
if ((level || o.level) === LEVEL_TOP) {
code = o.indent + code;
}

View File

@@ -553,7 +553,7 @@ exports.Comment = class Comment extends Base
makeReturn: THIS
compileNode: (o, level) ->
code = '/*' + multident(@comment, @tab) + "\n#{@tab}*/\n"
code = "/*#{multident @comment, @tab}#{if '\n' in @comment then "\n#{@tab}" else ''}*/\n"
code = o.indent + code if (level or o.level) is LEVEL_TOP
[@makeCode code]