aboutsummaryrefslogtreecommitdiff
path: root/lib/ast.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ast.js')
-rw-r--r--lib/ast.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/ast.js b/lib/ast.js
index a87e9c58..ad58ec21 100644
--- a/lib/ast.js
+++ b/lib/ast.js
@@ -137,17 +137,17 @@ var AST_Node = DEFNODE("Node", "start end", {
}, null);
(AST_Node.log_function = function(fn, verbose) {
- var printed = Object.create(null);
- if (fn) {
- AST_Node.info = verbose ? function(text, props) {
- log("INFO: " + string_template(text, props));
- } : noop;
- AST_Node.warn = function(text, props) {
- log("WARN: " + string_template(text, props));
- };
- } else {
+ if (!fn) {
AST_Node.info = AST_Node.warn = noop;
+ return;
}
+ var printed = Object.create(null);
+ AST_Node.info = verbose ? function(text, props) {
+ log("INFO: " + string_template(text, props));
+ } : noop;
+ AST_Node.warn = function(text, props) {
+ log("WARN: " + string_template(text, props));
+ };
function log(msg) {
if (printed[msg]) return;