check for loc value on comments before attempting to adjust it
This commit is contained in:
parent
66599c3779
commit
a298075949
@ -344,7 +344,7 @@ class CodeGenerator {
|
||||
|
||||
//
|
||||
if (comment.type === "CommentBlock" && this.format.indent.adjustMultilineComment) {
|
||||
var offset = comment.loc.start.column;
|
||||
var offset = comment.loc && comment.loc.start.column;
|
||||
if (offset) {
|
||||
var newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
|
||||
val = val.replace(newlineRegex, "\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user