diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 36f1e822..93cf9a75 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -4150,12 +4150,6 @@ getJasmineRequireObj().GlobalErrors = function(j$) { throw new Error('popListener expects a listener'); } - if (listener !== handlers[handlers.length - 1]) { - throw new Error( - 'popListener was passed a different listener than the current one' - ); - } - handlers.pop(); }; } diff --git a/spec/core/GlobalErrorsSpec.js b/spec/core/GlobalErrorsSpec.js index 38ee5a55..4fb41c21 100644 --- a/spec/core/GlobalErrorsSpec.js +++ b/spec/core/GlobalErrorsSpec.js @@ -90,16 +90,6 @@ describe('GlobalErrors', function() { }).toThrowError('popListener expects a listener'); }); - it('throws when the argument to #popListener is not the current listener', function() { - var errors = new jasmineUnderTest.GlobalErrors({}); - errors.pushListener(function() {}); - expect(function() { - errors.popListener(function() {}); - }).toThrowError( - 'popListener was passed a different listener than the current one' - ); - }); - it('uninstalls itself, putting back a previous callback', function() { var originalCallback = jasmine.createSpy('error'), fakeGlobal = { onerror: originalCallback }, diff --git a/src/core/GlobalErrors.js b/src/core/GlobalErrors.js index 4e8fb7eb..f0253b2d 100644 --- a/src/core/GlobalErrors.js +++ b/src/core/GlobalErrors.js @@ -101,12 +101,6 @@ getJasmineRequireObj().GlobalErrors = function(j$) { throw new Error('popListener expects a listener'); } - if (listener !== handlers[handlers.length - 1]) { - throw new Error( - 'popListener was passed a different listener than the current one' - ); - } - handlers.pop(); }; }