From f053d7f9ba050ab776bb3d8995723afb4162ff4b Mon Sep 17 00:00:00 2001 From: jaufgang Date: Thu, 19 Nov 2015 20:08:07 -0500 Subject: [PATCH 1/2] fixes issue #56 --- src/common/libs/queue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/libs/queue.js b/src/common/libs/queue.js index e08c6b0..c002b1f 100644 --- a/src/common/libs/queue.js +++ b/src/common/libs/queue.js @@ -66,7 +66,7 @@ Queue.prototype = { handler: function(fn, context) { this._runOrStore(function() { - fn.apply(context, this.getErrors()); + fn.apply(context, this.hasErrors()? this.getErrors() : [null]); }); return this; }, From ca9afab6b013a1b1690dd0163613f9373573a11e Mon Sep 17 00:00:00 2001 From: Joel Aufgang Date: Fri, 20 Nov 2015 10:34:06 -0500 Subject: [PATCH 2/2] Updated test to pass for issue #56 fixed in previous commit --- test/NormalizedCollection/Record.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/NormalizedCollection/Record.spec.js b/test/NormalizedCollection/Record.spec.js index 2357edd..592c6a2 100644 --- a/test/NormalizedCollection/Record.spec.js +++ b/test/NormalizedCollection/Record.spec.js @@ -432,7 +432,7 @@ describe('Record', function() { expect(spy).not.toHaveBeenCalled(); } }); - expect(spy).toHaveBeenCalledWith(); + expect(spy).toHaveBeenCalledWith(null); }); it('triggers callback with correct context', function() { @@ -450,7 +450,7 @@ describe('Record', function() { _.each(refs, function(ref) { try { ref.flush(); } catch(e) {} }); - expect(spy).toHaveBeenCalledWith(); + expect(spy).toHaveBeenCalledWith(null); }); it('returns an error if any path returns an error', function() {