add Ox.trace (name still TBD): print with stack trace
This commit is contained in:
parent
97233d417d
commit
767a3133b7
1 changed files with 12 additions and 0 deletions
|
@ -273,6 +273,18 @@ Ox.print = function() {
|
||||||
return args.join(' ');
|
return args.join(' ');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ox.print.apply(null, args);
|
||||||
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
Ox.uid <f> Returns a unique id
|
Ox.uid <f> Returns a unique id
|
||||||
() -> <n> Unique id
|
() -> <n> Unique id
|
||||||
|
|
Loading…
Reference in a new issue