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