summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--javascript/duktape/Document.bnd4
-rw-r--r--javascript/duktape/Window.bnd2
-rw-r--r--javascript/duktape/dukky.c4
-rw-r--r--javascript/duktape/dukky.h6
4 files changed, 11 insertions, 5 deletions
diff --git a/javascript/duktape/Document.bnd b/javascript/duktape/Document.bnd
index a51b38dfd..e15f75f48 100644
--- a/javascript/duktape/Document.bnd
+++ b/javascript/duktape/Document.bnd
@@ -35,7 +35,7 @@ method Document::write()
}
duk_concat(ctx, duk_get_top(ctx));
text = duk_safe_to_lstring(ctx, 0, &text_len);
- LOG("Writing %*s", (int)text_len, text);
+ JS_LOG("Writing %*s", (int)text_len, text);
err = dom_node_get_user_data(priv->parent.node,
corestring_dom___ns_key_html_content_data,
@@ -69,7 +69,7 @@ method Document::writeln()
duk_concat(ctx, duk_get_top(ctx));
text = duk_safe_to_lstring(ctx, 0, &text_len);
- LOG("Writeln %*s", (int)text_len, text);
+ JS_LOG("Writeln %*s", (int)text_len, text);
err = dom_node_get_user_data(priv->parent.node,
corestring_dom___ns_key_html_content_data,
&htmlc);
diff --git a/javascript/duktape/Window.bnd b/javascript/duktape/Window.bnd
index ed931c614..81d52809a 100644
--- a/javascript/duktape/Window.bnd
+++ b/javascript/duktape/Window.bnd
@@ -52,7 +52,7 @@ prototype Window()
getter Window::document()
%{
- LOG("priv=%p", priv);
+ JS_LOG("priv=%p", priv);
dom_document *doc = priv->htmlc->document;
dukky_push_node(ctx, (struct dom_node *)doc);
return 1;
diff --git a/javascript/duktape/dukky.c b/javascript/duktape/dukky.c
index 437a3d48a..d583484bf 100644
--- a/javascript/duktape/dukky.c
+++ b/javascript/duktape/dukky.c
@@ -236,7 +236,7 @@ dukky_push_node_klass(duk_context *ctx, struct dom_node *node)
duk_bool_t
dukky_push_node(duk_context *ctx, struct dom_node *node)
{
- LOG("Pushing node %p", node);
+ JS_LOG("Pushing node %p", node);
/* First check if we can find the node */
/* ... */
duk_get_global_string(ctx, NODE_MAGIC);
@@ -251,7 +251,7 @@ dukky_push_node(duk_context *ctx, struct dom_node *node)
/* ... node nodes */
duk_pop(ctx);
/* ... node */
- LOG("Found it memoised");
+ JS_LOG("Found it memoised");
return true;
}
/* ... nodes undefined */
diff --git a/javascript/duktape/dukky.h b/javascript/duktape/dukky.h
index d1fff36aa..212525ebe 100644
--- a/javascript/duktape/dukky.h
+++ b/javascript/duktape/dukky.h
@@ -24,6 +24,12 @@
#ifndef DUKKY_H
#define DUKKY_H
+#ifdef JS_DEBUG
+# define JS_LOG(format, args...) LOG(format , ##args)
+#else
+# define JS_LOG(format, ...) ((void) 0)
+#endif
+
duk_ret_t dukky_create_object(duk_context *ctx, const char *name, int args);
duk_bool_t dukky_push_node_stacked(duk_context *ctx);
duk_bool_t dukky_push_node(duk_context *ctx, struct dom_node *node);