diff --git a/spec/core/ExceptionFormatterSpec.js b/spec/core/ExceptionFormatterSpec.js index f718406b..c62e45c2 100644 --- a/spec/core/ExceptionFormatterSpec.js +++ b/spec/core/ExceptionFormatterSpec.js @@ -41,7 +41,8 @@ describe("ExceptionFormatter", function() { describe("#stack", function() { it("formats stack traces from Webkit, Firefox or node.js", function() { - var error = new Error("an error"); + var error; + try { throw new Error("an error") } catch(e) { error = e; }; expect(new j$.ExceptionFormatter().stack(error)).toMatch(/ExceptionFormatterSpec\.js.*\d+/) });