From b6db58c6472002cd81821a106816398942d4d0a4 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 2 Jun 2011 18:39:44 +0200 Subject: Fix formatError for FF4 and Opera Other browsers prepend "Error: " to stack, but FF4 and Opera do not. So when formatting error we prepend it by hand, when not present... --- src/Angular.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index 3789dcbe..4dbdc220 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -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; } -- cgit v1.2.3