- Mar 02, 2013
-
-
Trevor Norris authored
Check both passed args to addListener. Place var at beginning.
-
Trevor Norris authored
By making sure the _events is always an object there is one less check that needs to be performed by emit. Use undefined instead of null. typeof checks are a lot faster than isArray. There are a few places where the this._events check cannot be removed because it is possible for the user to call those methods after using utils.extend to create their own EventEmitter, but before it has actually been instantiated.
-
Trevor Norris authored
Remove unecessary splice for single listener events. Add type check for "type" argument.
-
Trevor Norris authored
Make sure the argument passed is a string. Also use typeof === function check instead of isArray().
-
Trevor Norris authored
Unnecessary checks were being performed on if the event existed before being removed. _events starts out as null, so reset to null when emptied. Checking typeof is a lot cheaper than isArray().
-
Trevor Norris authored
setMaxListeners will now make sure a positive number is passed. Also throwing more definitive Error types.
-
Trevor Norris authored
Small addition to ensure that exports.usingDomains is always a bool.
-
Trevor Norris authored
Ability to return just the length of listeners for a given type, using EventEmitter.listenerCount(emitter, event). This will be a lot cheaper than creating a copy of the listeners array just to check its length.
-
Ben Noordhuis authored
-
Lars-Magnus Skog authored
-
isaacs authored
-
Gil Pedersen authored
-
Evan Oxfeld authored
Slice the portion of the buffer to unshift back into the read queue
-
Scott Blomquist authored
We were using a global temp file while setting the NODE_VERSION environment variable. This resulted in simultaneous builds swapping version numbers on occasion. This patch removes the use of a temp file for this.
-
isaacs authored
-
isaacs authored
-
isaacs authored
-
isaacs authored
* V8: downgrade 3.14.5 * openssl: update to 1.0.1e * darwin: Make process.title work properly (Ben Noordhuis) * fs: Support mode/flag options to read/append/writeFile (isaacs) * stream: _read() no longer takes a callback (isaacs) * stream: Add stream.unshift(chunk) (isaacs) * stream: remove lowWaterMark feature (isaacs) * net: omit superfluous 'connect' event (Ben Noordhuis) * build, windows: disable SEH (Ben Noordhuis) * core: remove errno global (Ben Noordhuis) * core: Remove the nextTick for running the main file (isaacs) * core: Mark exit() calls with status codes (isaacs) * core: Fix debug signal handler race condition lock (isaacs) * crypto: clear error stack (Ben Noordhuis) * test: optionally set common.PORT via env variable (Timothy J Fontaine) * path: Throw TypeError on non-string args to path.resolve/join (isaacs, Arianit Uka) * crypto: fix uninitialized memory access in openssl (Ben Noordhuis)
-
isaacs authored
-
isaacs authored
Fix #4841
-
isaacs authored
This prevents fixture litter when these tests fail.
-
- Mar 01, 2013
-
-
Timothy J Fontaine authored
-
isaacs authored
The first example uses Readable, and shows the use of readable.unshift(). The second uses the Transform class, showing that it's much simpler in this case.
-
isaacs authored
This makes it so that `stream.push(chunk)` is the only way to signal the end of reading, removing the confusing disparity between the callback-style _read method, and the fact that most real-world streams do not have a 1:1 corollation between the "please give me data" event, and the actual arrival of a chunk of data. It is still possible, of course, to implement a `CallbackReadable` on top of this. Simply provide a method like this as the callback: function readCallback(er, chunk) { if (er) stream.emit('error', er); else stream.push(chunk); } However, *only* fs streams actually would behave in this way, so it makes not a lot of sense to make TCP, TLS, HTTP, and all the rest have to bend into this uncomfortable paradigm. -
isaacs authored
-
isaacs authored
A primary motivation of this is to make the onread function more inline-friendly, but also to make it more easy to explore not having onread at all, in favor of always using push() to signal the end of reading.
-
Ben Noordhuis authored
Don't emit a 'connect' event on sockets that are handed off to net.Server 'connection' event listeners. 1. It's superfluous because the connection has already been established at that point. 2. The implementation is arguably wrong because the event is emitted on the same tick of the event loop while the rule of thumb is to always emit it on the next one. This has been tried before in commit f0a440d8 but was reverted again in ede1acc1 because the change was incomplete (at least one test hadn't been updated). Fixes #1047 (again).
-
Ben Noordhuis authored
-
Ben Noordhuis authored
The output of `id -G` is unreliable on OS X. It uses an undocumented Libsystem function called getgrouplist_2() that includes some auxiliary groups that the POSIX getgroups() function does not return. Or rather, not always. It leads to fun bug chases where the test fails in one terminal but not in another.
-
Ben Noordhuis authored
-
Timothy J Fontaine authored
Test output is always \n and not platform dependent
-
Ben Noordhuis authored
Remove the errno global. It's a property on the process object now. Fixes #3095.
-
Scott Blomquist authored
-
- Feb 28, 2013
-
-
Ben Noordhuis authored
Conflicts: AUTHORS ChangeLog deps/uv/src/unix/pipe.c lib/http.js src/node_version.h
-
Ben Noordhuis authored
Turn off safe exception handlers, they're incompatible with how openssl is compiled / linked under MSVS 2012. Addresses the following build error: openssl.lib(x86cpuid.obj) : error LNK2026: module unsafe for SAFESEH image. [g:\jenkins\workspace\nodejs-oneoff\node.vcxproj] openssl.lib(x86.obj) : error LNK2026: module unsafe for SAFESEH image. [g:\jenkins\workspace\nodejs-oneoff\node.vcxproj] # etc. etc. g:\jenkins\workspace\nodejs-oneoff\Release\node.exe : fatal error LNK1281: Unable to generate SAFESEH image. [g:\jenkins\workspace\nodejs-oneoff\node.vcxproj] Fixes #4242.
-
Ben Noordhuis authored
Document how to run the example on the home page in more detail. Apparently our Windows brethren are prone to double-clicking on the binary instead of running it from the command line. Fixes #4854.
-
Trevor Norris authored
It's cleaner to only load domain ticker logic when the domains are being used. This makes execution slightly quicker in both cases, and simpler from the spinner since there is no need to check if the latest callback requires use of domains.
-
isaacs authored
Not necessary, since we can handle the error properly on the first tick now, even if there are event listeners, etc. Additionally, this removes the unnecessary "_needTickCallback" from startup, since Module.loadMain() will kick off a nextTick callback right after it runs the main module. Fix #4856
-
isaacs authored
Also, exit with 128+n for signal exit n, as is The Unix Way.
-
Ben Noordhuis authored
Clear OpenSSL's error stack on return from Connection::HandleSSLError(). This stops stale errors from popping up later in the lifecycle of the SSL connection where they would cause spurious failures. This commit causes a 1-2% performance regression on `make bench-tls`. We'll address that in follow-up commits if possible but let's ensure correctness first. Fixes #4771.
-