From f488db734b373f76dc74d1f470f3fcb297a9b8ad Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Wed, 24 Aug 2011 14:31:49 -0400 Subject: [PATCH] improving printout of functions --- js-assembler/runtime-src/baselib-format.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/js-assembler/runtime-src/baselib-format.js b/js-assembler/runtime-src/baselib-format.js index 9864dcd..de1a694 100644 --- a/js-assembler/runtime-src/baselib-format.js +++ b/js-assembler/runtime-src/baselib-format.js @@ -66,6 +66,11 @@ if (typeof(x) === 'string') { return escapeString(x.toString()); } + + if (baselib.functions.isProcedure(x)) { + return '#'; + } + if (typeof(x) !== 'object' && typeof(x) !== 'function') { return x.toString(); } @@ -105,6 +110,11 @@ if (typeof(x) === 'string') { return x; } + + if (baselib.functions.isProcedure(x)) { + return '#'; + } + if (typeof(x) !== 'object' && typeof(x) !== 'function') { return x.toString(); } @@ -373,10 +383,16 @@ return wrapper; } + if (baselib.functions.isProcedure(x)) { + node = document.createElement("span"); + node.appendChild(document.createTextNode('#')); + $(node).addClass("procedure"); + return node; + } + if (typeof(x) !== 'object' && typeof(x) !== 'function') { node = document.createElement("span"); node.appendChild(document.createTextNode(x.toString())); - $(node).addClass("procedure"); return node; }