Permalink
Browse files

simplify code with ||

  • Loading branch information...
1 parent 4f5e1d9 commit 0775aa57a0e2797eb3a8cd5bd04f184992e38d70 @jlaire jlaire committed Mar 30, 2012
Showing with 2 additions and 16 deletions.
  1. +2 −16 src/core/util.js
View
18 src/core/util.js
@@ -21,22 +21,8 @@ jasmine.util.inherit = function(childClass, parentClass) {
};
jasmine.util.formatException = function(e) {
- var lineNumber;
- if (e.line) {
- lineNumber = e.line;
- }
- else if (e.lineNumber) {
- lineNumber = e.lineNumber;
- }
-
- var file;
-
- if (e.sourceURL) {
- file = e.sourceURL;
- }
- else if (e.fileName) {
- file = e.fileName;
- }
+ var lineNumber e.line || e.lineNumber;
+ var file = e.sourceURL || e.fileName;
var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();

0 comments on commit 0775aa5

Please sign in to comment.