Don't test for stack traces in Safari 5
This commit is contained in:
@@ -41,7 +41,7 @@ describe("ExceptionFormatter", function() {
|
|||||||
|
|
||||||
describe("#stack", function() {
|
describe("#stack", function() {
|
||||||
it("formats stack traces from Webkit, Firefox, node.js or IE10+", function() {
|
it("formats stack traces from Webkit, Firefox, node.js or IE10+", function() {
|
||||||
if (jasmine.getEnv().ieVersion < 10) { return; }
|
if (jasmine.getEnv().ieVersion < 10 || jasmine.getEnv().safariVersion < 6) { return; }
|
||||||
|
|
||||||
var error;
|
var error;
|
||||||
try { throw new Error("an error") } catch(e) { error = e; }
|
try { throw new Error("an error") } catch(e) { error = e; }
|
||||||
|
|||||||
@@ -7,4 +7,13 @@
|
|||||||
|
|
||||||
return match ? parseFloat(match[1]) : Number.MAX_VALUE;
|
return match ? parseFloat(match[1]) : Number.MAX_VALUE;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
env.safariVersion = (function() {
|
||||||
|
var userAgent = jasmine.getGlobal().navigator.userAgent;
|
||||||
|
if (!userAgent) { return Number.MAX_VALUE; }
|
||||||
|
|
||||||
|
var match = /Safari/.exec(userAgent) && /Version\/([0-9]{0,})/.exec(userAgent);
|
||||||
|
|
||||||
|
return match ? parseFloat(match[1]) : Number.MAX_VALUE;
|
||||||
|
})();
|
||||||
})(jasmine.getEnv());
|
})(jasmine.getEnv());
|
||||||
|
|||||||
Reference in New Issue
Block a user