mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Keep the js comment on a single line if the herecomment is on a single line.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user