From a8e49f15361cce98fdecb20535df4b4f0de553ca Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Mon, 27 Aug 2012 10:59:33 +0300 Subject: added print_to_string helper method --- lib/output.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/output.js b/lib/output.js index f83a5c89..307e7cb7 100644 --- a/lib/output.js +++ b/lib/output.js @@ -296,6 +296,12 @@ function OutputStream(options) { }); }; + AST_Node.DEFMETHOD("print_to_string", function(options){ + var s = OutputStream(options); + this.print(s); + return s.get(); + }); + function PARENS(nodetype, func) { nodetype.DEFMETHOD("needs_parens", func); }; -- cgit v1.2.3