Fix formatError for FF4 and Opera

Other browsers prepend "Error: <Exception name>" to stack, but FF4 and Opera do not.
So when formatting error we prepend it by hand, when not present...
This commit is contained in:
Vojta Jina 2011-06-02 18:39:44 +02:00 committed by Igor Minar
parent 4b0f2dfe0c
commit b6db58c647

View file

@ -180,7 +180,8 @@ function forEachSorted(obj, iterator, context) {
function formatError(arg) {
if (arg instanceof Error) {
if (arg.stack) {
arg = arg.stack;
arg = (arg.message && arg.stack.indexOf(arg.message) === -1) ?
'Error: ' + arg.message + '\n' + arg.stack : arg.stack;
} else if (arg.sourceURL) {
arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
}