From 067b91b3efcebab4180cdf1ba23b126a986dea02 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sat, 11 Dec 2021 13:58:11 -0800 Subject: [PATCH] Removed IE/PhantomJS support code --- lib/jasmine-core/jasmine.js | 18 ++++-------------- src/core/util.js | 18 ++++-------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 154f89ef..1feb18e8 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -676,20 +676,10 @@ getJasmineRequireObj().util = function(j$) { }; util.errorWithStack = function errorWithStack() { - // Don't throw and catch if we don't have to, because it makes it harder - // for users to debug their code with exception breakpoints. - var error = new Error(); - - if (error.stack) { - return error; - } - - // But some browsers (e.g. Phantom) only provide a stack trace if we throw. - try { - throw new Error(); - } catch (e) { - return e; - } + // Don't throw and catch. That makes it harder for users to debug their + // code with exception breakpoints, and it's unnecessary since all + // supported environments populate new Error().stack + return new Error(); }; function callerFile() { diff --git a/src/core/util.js b/src/core/util.js index cd4631f6..b65a1113 100644 --- a/src/core/util.js +++ b/src/core/util.js @@ -90,20 +90,10 @@ getJasmineRequireObj().util = function(j$) { }; util.errorWithStack = function errorWithStack() { - // Don't throw and catch if we don't have to, because it makes it harder - // for users to debug their code with exception breakpoints. - var error = new Error(); - - if (error.stack) { - return error; - } - - // But some browsers (e.g. Phantom) only provide a stack trace if we throw. - try { - throw new Error(); - } catch (e) { - return e; - } + // Don't throw and catch. That makes it harder for users to debug their + // code with exception breakpoints, and it's unnecessary since all + // supported environments populate new Error().stack + return new Error(); }; function callerFile() {