mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
fix(pipe) on: length -> indexOf
This commit is contained in:
parent
c4714f66a0
commit
aea9ad99e3
1 changed files with 3 additions and 3 deletions
|
|
@ -63,7 +63,7 @@
|
|||
end: !p.notEnd
|
||||
});
|
||||
|
||||
read.once('end', func);
|
||||
on('end', read, func);
|
||||
}, function(callback) {
|
||||
on('open', write, callback);
|
||||
});
|
||||
|
|
@ -72,9 +72,9 @@
|
|||
|
||||
function on(event, emitter, callback) {
|
||||
var listeners = emitter.listeners(event),
|
||||
length = listeners.length;
|
||||
indexOf = listeners.indexOf(callback);
|
||||
|
||||
if (length <= 1)
|
||||
if (!~indexOf)
|
||||
emitter.once(event, callback);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue