0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib
isaacs 7c6f0147df Better stream.pipe() tracking.
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.
2011-04-27 22:08:21 -07:00
..
_debugger.js Auto completion of built-in debugger suggests prefix match rather than partial match. 2011-04-11 17:28:28 -07:00
_linklist.js Update copyright headers 2011-03-14 17:37:05 -07:00
assert.js Lint 2011-01-06 16:06:27 -08:00
buffer.js Closes GH-843. Fix SlowBuffer.prototype.slice 2011-03-29 10:47:14 -07:00
child_process.js Update copyright headers 2011-03-14 17:37:05 -07:00
console.js Update copyright headers 2011-03-14 17:37:05 -07:00
constants.js Update copyright headers 2011-03-14 17:37:05 -07:00
crypto.js Update copyright headers 2011-03-14 17:37:05 -07:00
dgram.js Update copyright headers 2011-03-14 17:37:05 -07:00
dns.js Update copyright headers 2011-03-14 17:37:05 -07:00
events.js Added support for removing .once listeners 2011-03-25 11:51:29 -07:00
freelist.js Update copyright headers 2011-03-14 17:37:05 -07:00
fs.js Allow omission of end option for range reads 2011-04-13 09:46:28 -07:00
http.js Fix bug where http response.readable was never set to false 2011-04-12 14:55:18 -07:00
https.js Closes GH-721 Set default host header properly 2011-04-01 17:40:41 -07:00
module.js Update copyright headers 2011-03-14 17:37:05 -07:00
net.js Don't emit error on ECONNRESET - just close 2011-04-14 10:42:57 -07:00
os.js Update copyright headers 2011-03-14 17:37:05 -07:00
path.js Update copyright headers 2011-03-14 17:37:05 -07:00
querystring.js Update copyright headers 2011-03-14 17:37:05 -07:00
readline.js Update copyright headers 2011-03-14 17:37:05 -07:00
repl.js Close #983 Better JSON.parse error detection 2011-04-26 09:48:28 -07:00
stream.js Better stream.pipe() tracking. 2011-04-27 22:08:21 -07:00
string_decoder.js Update copyright headers 2011-03-14 17:37:05 -07:00
sys.js Update copyright headers 2011-03-14 17:37:05 -07:00
timers.js Update copyright headers 2011-03-14 17:37:05 -07:00
tls.js CryptoStream.write returns false when queue > 128kb 2011-04-13 20:32:46 -07:00
tty_posix.js Fix setsid in tty.open 2011-03-22 12:02:35 -07:00
tty_win32.js Update copyright headers 2011-03-14 17:37:05 -07:00
tty.js Update copyright headers 2011-03-14 17:37:05 -07:00
url.js Close #954 URL parsing/formatting corrections 2011-04-20 15:44:34 -07:00
util.js Closes GH-310 Format slashes properly 2011-04-01 17:40:19 -07:00
vm.js Update copyright headers 2011-03-14 17:37:05 -07:00