Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
Fix #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Braun authored and David Braun committed Mar 13, 2018
1 parent a0e8ad6 commit 95a575f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
7 changes: 5 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ const Channel = function(length = 0) {
const { order, promise } = Order(this);
shifts.push(order);
setImmediate(processOrders);
return Object.freeze(promise);

// Don't freeze promise because Bluebird expects it to be mutable.
return promise;
},

slice: (start, end = Infinity) => {
Expand Down Expand Up @@ -333,7 +335,8 @@ const Channel = function(length = 0) {
setImmediate(processOrders);
}

return Object.freeze(promise);
// Don't freeze promise because Bluebird expects it to be mutable.
return promise;
},

writeOnly: () => writeOnly
Expand Down
12 changes: 0 additions & 12 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,6 @@ describe(`Channel object`, function() {
await channel.push(0, 1, 2);
}, new Error(`Can't push more than one value at a time.`));
});

it(`returns a frozen promise`, function() {
assert.throws(() => {
Channel().push(0).frozen = false;
});
});
});

it(`readOnly`, async function() {
Expand Down Expand Up @@ -375,12 +369,6 @@ describe(`Channel object`, function() {

assert.equal(await channel.shift(), 0);
});

it(`returns a frozen promise`, function() {
assert.throws(() => {
Channel().shift().frozen = false;
});
});
});

describe(`slice`, function() {
Expand Down

0 comments on commit 95a575f

Please sign in to comment.