Commit Graph

8171 Commits (40b1c9a66d2d32673dec4ac5ec03f927dd33b32b)

Author SHA1 Message Date
Trevor Norris 04688614f7 events: remove type check for event type
Strict checking for typeof types broke backwards compatibility for other
libraries. This reverts those checks.

The subclass test has been changed to ensure all operations can be
performed on the inherited EE before instantiation. Including the
ability to set event names with numbers.
2013-03-04 11:57:35 -08:00
Ben Noordhuis ecf9f606c9 doc: add url.resolve() usage examples
Fixes #4913.
2013-03-04 20:54:36 +01:00
Bert Belder 890dc2eeb1 win/msi: make msi build work when spaces are present in the path 2013-03-04 19:47:05 +01:00
isaacs 119cbf4854 stream: Don't require read(0) to emit 'readable' event
When a readable listener is added, call read(0) so that data will flow in, up to
the high water mark.

Otherwise, it's somewhat confusing that you have to listen for readable,
and ALSO call read() (when it will certainly return null) just to get some
data out of the stream.

See: #4720
2013-03-04 07:38:32 -08:00
Xidorn Quan 009ba02e18 dns: fix ReferenceError in resolve() error path
A typo in the variable name makes it throw a ReferenceError instead of
the expected "Unknown type" error when dns.resolve() is passed a bad
record type argument.

Fixes the following exception:

  ReferenceError: type is not defined
    at Object.exports.resolve (dns.js:189:40)
    at /Users/bnoordhuis/src/master/test/simple/test-c-ares.js:48:9
    <snip>
2013-03-04 16:20:40 +01:00
Rod Vagg a6a1659d85 link to LevelUP modules wiki page, not level-hooks 2013-03-03 22:12:53 -08:00
Rod Vagg 906f824bab link to LevelUP modules wiki page, not level-hooks 2013-03-03 22:12:09 -08:00
isaacs e428bb7eae cluster: Rename destroy() to kill(signal=SIGTERM)
Fix #4133, bringing the cluster worker API more in line with the
child process API.
2013-03-03 17:26:38 -08:00
isaacs 384f1be739 stream: Writable.end(chunk) after end is an error
Calling end(data) calls write(data).  Doing this after end should
raise a 'write after end' error.

However, because end() calls were previously ignored on already
ended streams, this error was confusingly suppressed, even though the
data never is written, and cannot get to the other side.

This is a re-hash of 5222d19a11, but
without assuming that the data passed to end() is valid, and thus
breaking a bunch of tests.
2013-03-03 17:26:38 -08:00
Aaron Cannon 0c57b31190 doc: Add crypto.pseudoRandomBytes, fix typo 2013-03-03 15:30:49 -08:00
Dave Olszewski 22aa767421 make repl compatible with domains
The try/catch in repl.js keeps any active domain from catching the
error.  Since the domain may not even be enterd until the code is run,
it's not possible to avoid the try/catch, so emit on the domain when an
error is thrown.
2013-03-03 15:28:45 -08:00
Ben Noordhuis 80ea63b958 Revert "stream: Writable.end(chunk) after end is an error"
It's breaking ~22 tests, Needs further investigation.

This reverts commit 5222d19a11.
2013-03-03 02:21:28 +01:00
isaacs f5d84965d7 doc: Typo in ChangeLog
downgrade TO 3.14
2013-03-02 16:10:21 -08:00
isaacs 5222d19a11 stream: Writable.end(chunk) after end is an error
Calling end(data) calls write(data).  Doing this after end should
raise a 'write after end' error.

However, because end() calls were previously ignored on already
ended streams, this error was confusingly suppressed, even though the
data never is written, and cannot get to the other side.
2013-03-02 16:09:16 -08:00
isaacs 63edde0e01 events: Handle emit('error') before ctor
The previous commit did not handle the case when the event type
is 'error', since that is checked before reading the handler.
2013-03-02 15:11:23 -08:00
isaacs d345c1173a events: Handle emit before constructor call 2013-03-02 15:01:20 -08:00
Ben Noordhuis 2d51036fb9 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	doc/api/http.markdown
	test/simple/test-crypto.js
2013-03-02 23:13:35 +01:00
Ben Noordhuis 426cbedb44 test: make simple/test-dgram-pingpong respect PORT
Don't use hard-coded port numbers, use common.PORT instead.

Should fix the occasional Jenkins failure; the builds run in parallel.
2013-03-02 23:04:06 +01:00
isaacs 4ac73d2c99 net: s/closed/ended/ in write-after-fin message 2013-03-02 11:50:33 -08:00
isaacs 2106ef000c net: Provide better error when writing after FIN
The stock writable stream "write after end" message is overly vague, if
you have clearly not called end() yourself yet.

When we receive a FIN from the other side, and call destroySoon() as a
result, then generate an EPIPE error (which is what would happen if you
did actually write to the socket), with a message explaining what
actually happened.
2013-03-02 11:26:39 -08:00
Raymond Feng 47e115063b windows/msi: fix msi build issue with WiX 3.7/3.8
The `heat` tool that gathers NPM source files wasn't getting called.
Closes #4896
2013-03-02 20:06:45 +01:00
Timothy J Fontaine 0b70a14abf test: optionally set common.PORT via env variable
This is a back-port of commit 17a8126 from the master branch.
2013-03-02 19:09:39 +01:00
Ben Noordhuis 93156a6057 test: unlink temp file at test start
The file has a long name that's apparently impossible to remove with
`git clean` on Windows.
2013-03-02 02:43:02 +01:00
Trevor Norris d1b4dcd6ac events: add type checks to once
Also cleanup unnecessary use of "self" since it will always be called
using .apply() from emit.
2013-03-01 17:36:48 -08:00
Trevor Norris e1ac2ef7cf events: emit cleanup
Cleanup check logic. Place vars at top. Remove PROCESS.
2013-03-01 17:36:48 -08:00
Trevor Norris 1ccc6fbe05 events: additional type check for addListener
Check both passed args to addListener.

Place var at beginning.
2013-03-01 17:36:48 -08:00
Trevor Norris 4f7f8bbdf8 events: _events to object and undefined not null
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.
2013-03-01 17:36:47 -08:00
Trevor Norris b3ea8443bd events: removeListener add checks and cleanup
Remove unecessary splice for single listener events. Add type check for
"type" argument.
2013-03-01 17:36:47 -08:00
Trevor Norris aba03ebb5a events: type check listeners
Make sure the argument passed is a string. Also use typeof === function
check instead of isArray().
2013-03-01 17:36:47 -08:00
Trevor Norris 8ab346c98f events: simplify removeAllListeners logic
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().
2013-03-01 17:36:47 -08:00
Trevor Norris dd171d24df events: type check setMaxListeners, cleanup throws
setMaxListeners will now make sure a positive number is passed. Also
throwing more definitive Error types.
2013-03-01 17:36:47 -08:00
Trevor Norris 8ca43a7f40 events: ensure usingDomain is always boolean
Small addition to ensure that exports.usingDomains is always a bool.
2013-03-01 17:36:47 -08:00
Trevor Norris 75305f3bab events: add check for listeners length
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.
2013-03-01 17:36:47 -08:00
Ben Noordhuis 7189b3ed33 crypto: don't assert when calling Cipher#final() twice
Remove the assert() that triggered when Cipher#final() or
Decipher#final() was called twice.

Fixes #4886.
2013-03-02 02:13:18 +01:00
Ben Noordhuis 7707acd6ef deps: upgrade libuv to 7e59f9b 2013-03-02 01:49:19 +01:00
Lars-Magnus Skog 4b20f3440d doc change for Readable._read() 2013-03-01 16:33:48 -08:00
isaacs fc22986023 doc: Clarify advisory-ness of stream._read() argument 2013-03-01 14:26:35 -08:00
Gil Pedersen 13c8bc8917 doc: Update to reflect new _read() interface 2013-03-01 14:23:51 -08:00
Evan Oxfeld 16ddc545bd doc: Fix readable.unshift() example
Slice the portion of the buffer to unshift back into the read queue
2013-03-01 14:21:34 -08:00
Scott Blomquist 6366a3057c build/windows: don't use wrong version number
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.
2013-03-01 13:30:25 -08:00
isaacs be770a3839 blog: Post about v0.9.11 2013-03-01 11:24:46 -08:00
isaacs 33aafbd882 doc: Correct version in changelog 2013-03-01 11:23:55 -08:00
isaacs 4cda016c26 Now working on 0.9.12 2013-03-01 11:19:38 -08:00
isaacs 300802d513 Merge branch 'v0.9.11-release' 2013-03-01 11:19:20 -08:00
isaacs 83392403b7 2013.03.01, Version 0.9.10 (Unstable)
* 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)
2013-03-01 10:59:24 -08:00
isaacs 687522c5a5 blog: Do not pass undefined to path.join 2013-03-01 10:58:17 -08:00
isaacs 0928a526dd fs: Support mode/flag options to read/append/writeFile
Fix #4841
2013-03-01 09:48:57 -08:00
isaacs 55aa973bee test: Put fs write test files in tmp
This prevents fixture litter when these tests fail.
2013-03-01 08:55:05 -08:00
Ben Noordhuis f26362e938 http: use socket.once, not socket.on
Register the 'close' event listener with .once(), not .on().

It doesn't matter in the grand scheme of things because the listener
doesn't keep references to any heavy-weight objects but using .once()
for a oneshot listener is something of a best practice.
2013-03-01 13:11:40 +01:00
Timothy J Fontaine f0f87d8afb build: windows should append date if nightly 2013-03-01 02:44:31 +01:00