Warn about attempting to push multiple values at once.
This commit is contained in:
parent
c56f4404f8
commit
f2c26591a1
2 changed files with 24 additions and 9 deletions
|
@ -232,6 +232,8 @@ const Channel = function (bufferLength = 0) {
|
|||
order.reject(new TypeError(
|
||||
`Can't push 'undefined' to channel, use close instead.`
|
||||
))
|
||||
} else if (arguments.length > 1) {
|
||||
order.reject(new Error(`Can't push more than one value at a time.`))
|
||||
} else {
|
||||
pushes.push(order)
|
||||
setImmediate(processOrders)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue