Wrap text
|
|
(function () {
YOUR_NAMESPACE.getStackTrace = (function () {
var mode;
try {(0)()} catch (e) {
mode = e.stack ? 'Firefox' : window.opera ? 'Opera' : 'Other';
}
switch (mode) {
case 'Firefox' : return function () {
try {(0)()} catch (e) {
return e.stack.replace(/^.*?\n/,'').
replace(/(?:\n@:0)?\s+$/m,'').
replace(/^\(/gm,'{anonymous}(').
split("\n");
}
};
case 'Opera' : return function () {
try {(0)()} catch (e) {
var lines = e.message.split("\n"),
ANON = '{anonymous}',
lineRE = /Line\s+(\d+).*?in\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,
i,j,len;
for (i=4,j=0,len=lines.length; i
|