From eae9074ceaaa95f96ef9e98d28906a02d8e702db Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 24 Apr 2015 13:51:04 +0200 Subject: [PATCH] Ox.trace: formatting; add documentation --- source/Ox/js/Core.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/Ox/js/Core.js b/source/Ox/js/Core.js index 6144ed5d..153400f5 100644 --- a/source/Ox/js/Core.js +++ b/source/Ox/js/Core.js @@ -272,16 +272,22 @@ Ox.print = function() { return args.join(' '); }; +/*@ +Ox.trace Prints its arguments to the console, followed by a stack trace + (arg, ...) -> String +@*/ Ox.trace = function() { var args = Ox.slice(arguments); try { throw new Error(); } catch (e) { if (e.stack) { - args.push('\n' + e.stack.split('\n').slice(2).join('\n')); + args.push( + '\n' + Ox.clean(e.stack.split('\n').slice(2).join('\n')) + ); } } - Ox.print.apply(null, args); + return Ox.print.apply(null, args); }; /*@