Retain comments before AST_Constants during mangle.

This commit is contained in:
kzc
2016-05-03 15:08:40 -04:00
committed by Richard van Velzen
parent 6641dcafb6
commit a0e03c9df4
2 changed files with 29 additions and 0 deletions

View File

@@ -409,6 +409,7 @@ function OutputStream(options) {
AST_Node.DEFMETHOD("print_to_string", function(options){
var s = OutputStream(options);
if (!options) s._readonly = true;
this.print(s);
return s.get();
});
@@ -416,6 +417,7 @@ function OutputStream(options) {
/* -----[ comments ]----- */
AST_Node.DEFMETHOD("add_comments", function(output){
if (output._readonly) return;
var c = output.option("comments"), self = this;
var start = self.start;
if (start && !start._comments_dumped) {