added print_to_string helper method

This commit is contained in:
Mihai Bazon
2012-08-27 10:59:33 +03:00
parent 8d233c38d4
commit a8e49f1536

View File

@@ -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);
};