aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkzc <zaxxon2011@gmail.com>2016-05-03 15:08:40 -0400
committerRichard van Velzen <rvanvelzen@experty.com>2016-05-04 20:11:45 +0200
commita0e03c9df47c411a40bceef02af2ce3dd1a329cc (patch)
tree93080c8910992672242fc99bdfbd352ced6c56db /lib
parent6641dcafb60091f0f944fcd5269ca67cb66ada2a (diff)
downloadtracifyjs-a0e03c9df47c411a40bceef02af2ce3dd1a329cc.tar.gz
tracifyjs-a0e03c9df47c411a40bceef02af2ce3dd1a329cc.zip
Retain comments before AST_Constants during mangle.
Diffstat (limited to 'lib')
-rw-r--r--lib/output.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/output.js b/lib/output.js
index a59066fc..f8787582 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -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) {