mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
7c6f0147df
This commit does three things: 1. Uses an exposed counter rather than a hidden array for tracking dest streams that may have multiple inputs. This allows for significantly faster lookups, since the counter can be checked in constant time rather than searching an array for the dest object. (A proper O(1) WeakMap would be better, but that may have to wait for Harmony.) 2. Calls the 'end' event logic when there is an 'error' event on the source object (and then throws if there are no other error listeners.) This is important, because otherwise 'error' events would lead to memory leaks. 3. Clean up the style a bit. Function Declarations are not allowed within blocks in ES strict. Prefer Function Declarations to Function Expressions, because hoisting allows for more expressive ordering of logic. Downside: It adds "_pipeCount" as part of the Stream API. It'll work fine if the member is missing, but if anyone tries to use it for some other purpose, it can mess things up. |
||
---|---|---|
.. | ||
_debugger.js | ||
_linklist.js | ||
assert.js | ||
buffer.js | ||
child_process.js | ||
console.js | ||
constants.js | ||
crypto.js | ||
dgram.js | ||
dns.js | ||
events.js | ||
freelist.js | ||
fs.js | ||
http.js | ||
https.js | ||
module.js | ||
net.js | ||
os.js | ||
path.js | ||
querystring.js | ||
readline.js | ||
repl.js | ||
stream.js | ||
string_decoder.js | ||
sys.js | ||
timers.js | ||
tls.js | ||
tty_posix.js | ||
tty_win32.js | ||
tty.js | ||
url.js | ||
util.js | ||
vm.js |