platform/upstream/nodejs.git
11 years agocpplint: make lint rules closer to node's source
Fedor Indutny [Wed, 31 Jul 2013 18:05:31 +0000 (22:05 +0400)]
cpplint: make lint rules closer to node's source

* Support C-style header guards (/* comments */)
* Support `class NODE_EXTERN something`
* Support `}  // extern "C"` closures
* Ignore header order
* Ignore `long/short` usage (because of OpenSSL's API)

11 years agonode: add inTick and lastThrew to infoBox
Trevor Norris [Tue, 30 Jul 2013 22:06:45 +0000 (15:06 -0700)]
node: add inTick and lastThrew to infoBox

To prevent all unnecessary calls to JS from MakeCallback, the remaining
two immediate return variables inTick and lastThrew have been added to
infoBox. Now MakeCallback should never need to call into JS unless it
absolutely has to.

Also removed Tock. Performance tests showed it was at least as fast or
faster than using a normal object, and this is more readable.

11 years agoutil: don't throw on circular %j input to format()
Ben Noordhuis [Mon, 29 Jul 2013 19:00:33 +0000 (21:00 +0200)]
util: don't throw on circular %j input to format()

Don't throw an exception when the argument to %j is an object that
contains circular references, it's not helpful. Catch the exception
and return the string '[Circular]'.

11 years agofs: write strings directly to disk
Trevor Norris [Tue, 2 Jul 2013 07:27:26 +0000 (00:27 -0700)]
fs: write strings directly to disk

Prior, strings would first be converted to a Buffer before being written
to disk. Now the intermediary step has been removed.

Other changes of note:

* Class member "must_free" was added to req_wrap so to track if the
  memory needs to be manually cleaned up after use.
* External String Resource support, so the memory will be used directly
  instead of copying out the data.
* Docs have been updated to reflect that if position is not a number
  then it will assume null. Previously it specified the argument must be
  null, but that was not how the code worked. An attempt was made to
  only support == null, but there were too many tests that assumed !=
  number would be enough.
* Docs update show some of the write/writeSync arguments are optional.

11 years agostring_bytes: export GetExternalParts
Trevor Norris [Tue, 2 Jul 2013 07:07:47 +0000 (00:07 -0700)]
string_bytes: export GetExternalParts

The method is useful elsewhere when needing to check if external and
grab data.

11 years agodeps: upgrade libuv to joyent/libuv@4bdb7d8
Ben Noordhuis [Tue, 30 Jul 2013 21:32:53 +0000 (23:32 +0200)]
deps: upgrade libuv to joyent/libuv@4bdb7d8

Non-release upgrade so pending patches can land.

11 years agocrypto: simplify DH modp group name matcher
Ben Noordhuis [Mon, 29 Jul 2013 18:36:11 +0000 (20:36 +0200)]
crypto: simplify DH modp group name matcher

* Use ARRAY_SIZE() rather than scanning until we hit a NULL entry.
* Fix `-fsigned-char -Wnarrowing` compiler warnings. Harmless but
  numerous and annoying.
* Static-ify the modp_group and mod_groups arrays.
* Const-ify the modp_groups array.

11 years agosrc: const-ify variables in src/node_crypto*
Ben Noordhuis [Tue, 30 Jul 2013 19:42:47 +0000 (21:42 +0200)]
src: const-ify variables in src/node_crypto*

No functional changes, just some code tightening. Clean up some style
inconsistencies while we are here.

11 years agosrc: remove unused import in src/node_os.cc
Ben Noordhuis [Tue, 30 Jul 2013 19:32:43 +0000 (21:32 +0200)]
src: remove unused import in src/node_os.cc

11 years agostring_bytes: don't use named imports in header
Ben Noordhuis [Tue, 30 Jul 2013 19:28:43 +0000 (21:28 +0200)]
string_bytes: don't use named imports in header

It imports the definition into every source file that includes
string_bytes.h, as evidenced by the build suddenly breaking left
and right because of missing Handle/Local/String/Value imports.

11 years agov8: upgrade v8 to 3.20.11
Ben Noordhuis [Tue, 30 Jul 2013 15:14:55 +0000 (17:14 +0200)]
v8: upgrade v8 to 3.20.11

11 years agoMerge remote-tracking branch 'origin/v0.10'
Ben Noordhuis [Tue, 30 Jul 2013 13:19:48 +0000 (15:19 +0200)]
Merge remote-tracking branch 'origin/v0.10'

Conflicts:
AUTHORS
ChangeLog
deps/uv/ChangeLog
deps/uv/src/version.c
deps/uv/src/win/fs.c
src/node.cc
src/node_crypto.cc
src/node_os.cc
src/node_version.h

11 years agocrypto: fix assert() on malformed hex input
Ben Noordhuis [Tue, 30 Jul 2013 12:27:13 +0000 (14:27 +0200)]
crypto: fix assert() on malformed hex input

Use the StringBytes::IsValidString() function introduced in commit
dce26cc to ensure that the input string meets the expectations of the
other StringBytes functions before processing it further.

Fixes the following assertion:

    Assertion failed: (str->Length() % 2 == 0 && "invalid hex string
    length"), function StorageSize, file ../../src/string_bytes.cc,
    line 301.

Fixes #5725.

11 years agostring_bytes: add StringBytes::IsValidString()
Ben Noordhuis [Tue, 30 Jul 2013 12:26:11 +0000 (14:26 +0200)]
string_bytes: add StringBytes::IsValidString()

Performs a quick, non-exhaustive check on the input string to see if
it's compatible with the specified string encoding.

Curently it only checks that hex strings have a length that is a
multiple of two.

11 years agoassert: replace !!!value with just !value
Ben Noordhuis [Tue, 30 Jul 2013 11:28:48 +0000 (13:28 +0200)]
assert: replace !!!value with just !value

Not harmful, just code cleanup.

Fixes #5885.

11 years agodgram: report send errors to cb, don't pass bytes
Ben Noordhuis [Wed, 26 Jun 2013 22:43:23 +0000 (00:43 +0200)]
dgram: report send errors to cb, don't pass bytes

Passing the number of sent bytes to the callback is superfluous;
datagram sockets operate in atomic mode: either the sendmsg() system
call succeeds or it fails but it never does partial writes.

Instead, report send errors to the callback. UDP error reporting is
fairly haphazard on most platforms. You should not expect reliable
delivery of anything besides EMSGSIZE and (possibly) ENETDOWN and
ENETUNREACH.

Fixes #2608.

11 years agosrc: don't use NewExternal() with unaligned strings
Ben Noordhuis [Mon, 29 Jul 2013 03:07:07 +0000 (05:07 +0200)]
src: don't use NewExternal() with unaligned strings

V8 3.20.9 enforces that external pointers are aligned on a two-byte
boundary.

We cannot portably guarantee that for the source code strings that
tools/js2c.py generates so simply stop using String::NewExternal()
altogether (and by extension String::ExternalAsciiStringResource).

Fixes the following run-time assert:

  FATAL ERROR: v8::String::NewExternal() Pointer is not aligned

11 years agov8: upgrade to v8 3.20.9
Ben Noordhuis [Mon, 29 Jul 2013 19:21:03 +0000 (21:21 +0200)]
v8: upgrade to v8 3.20.9

11 years agodoc: vm: fix incorrect API documentation
Andrew Paprocki [Mon, 29 Jul 2013 15:34:12 +0000 (17:34 +0200)]
doc: vm: fix incorrect API documentation

On timeout, an Error object is thrown, not null.

11 years agochild_process: add 'shell' option to .exec()
Ben Noordhuis [Mon, 29 Jul 2013 14:20:24 +0000 (16:20 +0200)]
child_process: add 'shell' option to .exec()

No test, we can't rely on an alternate shell being available.

Fixes #5935.

11 years agotest: loosen timeout in https-no-reader
Fedor Indutny [Mon, 29 Jul 2013 09:33:01 +0000 (13:33 +0400)]
test: loosen timeout in https-no-reader

fix #5925

11 years agosrc: remove unused tick_spinner
Ben Noordhuis [Sun, 28 Jul 2013 17:07:59 +0000 (19:07 +0200)]
src: remove unused tick_spinner

11 years agotest: cluster: add 'bind to privileged port' tests
Ben Noordhuis [Sun, 28 Jul 2013 12:50:03 +0000 (14:50 +0200)]
test: cluster: add 'bind to privileged port' tests

11 years agocluster: fix shared handle bind error propagation
Ben Noordhuis [Sun, 28 Jul 2013 10:19:34 +0000 (12:19 +0200)]
cluster: fix shared handle bind error propagation

A failed bind() was already being correctly reported in round-robin
mode. This commit fixes bind() error reporting in shared handle mode.

Fixes #5774.

11 years agocluster: remove duplicate this.errno assignment
Ben Noordhuis [Sun, 28 Jul 2013 09:36:12 +0000 (11:36 +0200)]
cluster: remove duplicate this.errno assignment

11 years agodoc: clarify fs.read() offset argument
Ben Noordhuis [Sat, 27 Jul 2013 22:05:10 +0000 (00:05 +0200)]
doc: clarify fs.read() offset argument

11 years agodoc: add nodejs.geek.nz to the community page
Andrew Chilton [Sat, 27 Jul 2013 11:13:55 +0000 (23:13 +1200)]
doc: add nodejs.geek.nz to the community page

11 years agodoc: add nodejs.org.au to community listing
Rod Vagg [Sat, 27 Jul 2013 05:20:08 +0000 (15:20 +1000)]
doc: add nodejs.org.au to community listing

11 years agodoc: document possible return values of os.arch()
Maciej Małecki [Fri, 26 Jul 2013 21:48:57 +0000 (23:48 +0200)]
doc: document possible return values of os.arch()

11 years agodoc: Fix missing backtick in debugger doc
Dav Glass [Wed, 24 Jul 2013 18:17:28 +0000 (13:17 -0500)]
doc: Fix missing backtick in debugger doc

11 years agostreams: Don't emit 'end' until read() past EOF
isaacs [Wed, 24 Jul 2013 23:05:54 +0000 (16:05 -0700)]
streams: Don't emit 'end' until read() past EOF

This prevents the following sort of thing from being confusing:

```javascript
stream.on('data', function() { console.error('got data'); });
stream.pause(); // stop reading

// turns out no data is available
stream.push(null);

// Hand the stream to someone else, who does stuff...
setTimeout(function() {
  // too late! 'end' is already emitted!
  stream.on('end', function() { console.error('got end'); });
});
```

With this change, the `end` event is not emitted until you call `read()`
*past* the EOF null.  So, a paused stream will not swallow the `end`
event and emit it before you `resume()` the stream.

11 years agoopenssl: use asm for sha, md5, rmd
Fedor Indutny [Thu, 25 Jul 2013 14:27:26 +0000 (18:27 +0400)]
openssl: use asm for sha, md5, rmd

11 years agotest: fix simple/test-setproctitle
Ben Noordhuis [Thu, 25 Jul 2013 10:24:40 +0000 (12:24 +0200)]
test: fix simple/test-setproctitle

The title shouldn't be too long; libuv's uv_set_process_title() out of
security considerations no longer overwrites envp, only argv, so the
maximum title length is possibly quite short.

Fixes #5908.

11 years agoblog: Post for v0.10.15
Timothy J Fontaine [Fri, 26 Jul 2013 00:03:21 +0000 (17:03 -0700)]
blog: Post for v0.10.15

11 years agoNow working on 0.10.16
Timothy J Fontaine [Fri, 26 Jul 2013 00:03:03 +0000 (17:03 -0700)]
Now working on 0.10.16

11 years agoMerge branch 'v0.10.15-release' into v0.10
Timothy J Fontaine [Fri, 26 Jul 2013 00:02:38 +0000 (17:02 -0700)]
Merge branch 'v0.10.15-release' into v0.10

11 years ago2013.07.25, Version 0.10.15 (Stable) v0.10.15
Timothy J Fontaine [Thu, 25 Jul 2013 23:26:15 +0000 (16:26 -0700)]
2013.07.25, Version 0.10.15 (Stable)

* src: fix process.getuid() return value (Ben Noordhuis)

11 years agosrc: fix process.getuid() return value
Ben Noordhuis [Thu, 25 Jul 2013 22:24:27 +0000 (00:24 +0200)]
src: fix process.getuid() return value

And process.getgid() too.

Commit ed80638 changed fs.chown() and fs.fchown() to only accept
unsigned integers. Make process.getuid() and process.getgid() follow
suit.

This commit should unbreak npm on OS X - it's hitting the new 'uid must
be an unsigned int' check when installing as e.g. user 'nobody' (which
has an UID of -2 in /etc/passwd or 4294967294 when cast to an uid_t.)

Fixes #5904.

11 years agodoc: document tls.Server 'secureProtocol' option
Ben Noordhuis [Thu, 25 Jul 2013 21:21:52 +0000 (23:21 +0200)]
doc: document tls.Server 'secureProtocol' option

11 years agoblog: Post for v0.10.14
Timothy J Fontaine [Thu, 25 Jul 2013 20:54:55 +0000 (13:54 -0700)]
blog: Post for v0.10.14

11 years agoNow working on 0.10.15
Timothy J Fontaine [Thu, 25 Jul 2013 20:54:16 +0000 (13:54 -0700)]
Now working on 0.10.15

11 years agoMerge branch 'v0.10.14-release' into v0.10
Timothy J Fontaine [Thu, 25 Jul 2013 20:53:45 +0000 (13:53 -0700)]
Merge branch 'v0.10.14-release' into v0.10

11 years ago2013.07.25, Version 0.10.14 (Stable) v0.10.14
Timothy J Fontaine [Thu, 25 Jul 2013 18:49:01 +0000 (11:49 -0700)]
2013.07.25, Version 0.10.14 (Stable)

* uv: Upgrade to v0.10.13

* npm: Upgrade to v1.3.5

* os: Don't report negative times in cpu info (Ben Noordhuis)

* fs: Handle large UID and GID (Ben Noordhuis)

* url: Fix edge-case when protocol is non-lowercase (Shuan Wang)

* doc: Streams API Doc Rewrite (isaacs)

* node: call MakeDomainCallback in all domain cases (Trevor Norris)

* crypto: fix memory leak in LoadPKCS12 (Fedor Indutny)

11 years agouv: Upgrade to v0.10.13
Timothy J Fontaine [Thu, 25 Jul 2013 17:48:29 +0000 (10:48 -0700)]
uv: Upgrade to v0.10.13

11 years agotls: share tls tickets key between cluster workers
Fedor Indutny [Sun, 21 Jul 2013 03:11:02 +0000 (10:11 +0700)]
tls: share tls tickets key between cluster workers

fix #5871

11 years agocluster: support setting data on shared server
Fedor Indutny [Sun, 21 Jul 2013 03:09:47 +0000 (10:09 +0700)]
cluster: support setting data on shared server

If `obj` given to `cluster._getServer` has `_setServerData` or
`_getServerData` methods, the data will be synchronized across workers
and stored in master.

11 years agodoc: explicitly set industry logo height
isaacs [Wed, 24 Jul 2013 20:37:20 +0000 (13:37 -0700)]
doc: explicitly set industry logo height

11 years agonpm: Upgrade to v1.3.5
isaacs [Wed, 24 Jul 2013 20:23:44 +0000 (13:23 -0700)]
npm: Upgrade to v1.3.5

11 years agosrc: move NODE_MODULE_VERSION to node_version.h
Ben Noordhuis [Wed, 24 Jul 2013 20:13:43 +0000 (22:13 +0200)]
src: move NODE_MODULE_VERSION to node_version.h

11 years agolib: macro-ify type checks
Ben Noordhuis [Wed, 24 Jul 2013 16:03:53 +0000 (18:03 +0200)]
lib: macro-ify type checks

Increases the grep factor. Makes it easier to harmonize type checks
across the code base.

11 years agotools: fix js2c macro expansion bug
Ben Noordhuis [Wed, 24 Jul 2013 16:13:25 +0000 (18:13 +0200)]
tools: fix js2c macro expansion bug

If the same macro was used twice in close proximity, the second one
didn't get expanded.

11 years agosrc: rename macros.py to notrace_macros.py
Ben Noordhuis [Wed, 24 Jul 2013 10:53:28 +0000 (12:53 +0200)]
src: rename macros.py to notrace_macros.py

This incarnation of macros.py is only used to disable the (d)trace
macros. Rename it so it better reflects its purpose. A new macros.py
will be added in a follow-up commit.

11 years agosrc: cares_wrap: remove two unused variables
Ben Noordhuis [Wed, 24 Jul 2013 16:48:48 +0000 (18:48 +0200)]
src: cares_wrap: remove two unused variables

11 years agosmalloc: add external to alloc with callbacks
Trevor Norris [Tue, 23 Jul 2013 23:56:22 +0000 (16:56 -0700)]
smalloc: add external to alloc with callbacks

Forgot to actually assign cb_info to the External in smalloc::Alloc()
that accepts a callback to be run in the weak callback.

11 years agobuffer: misc logic simplification
Trevor Norris [Tue, 23 Jul 2013 18:02:47 +0000 (11:02 -0700)]
buffer: misc logic simplification

Includes:
* No need for `typeof` when checking undefined.
* length is coerced to uint so no need to check if < 0.
* Stay consistent and always throw `new` errors.
* Returning offset + magic number in every write is error prone. Instead
  return the central write function which returns the correct offset.

11 years agobuffer: revert length and parent check
Trevor Norris [Tue, 23 Jul 2013 17:43:48 +0000 (10:43 -0700)]
buffer: revert length and parent check

In a rush to implement the fix 35e0d60 I overlooked the logic that
causes 0-length buffer instantiation to automatically not assign the
parent regardless.

11 years agosrc: os: use Number::New() for CPU info
Ben Noordhuis [Tue, 23 Jul 2013 15:09:09 +0000 (17:09 +0200)]
src: os: use Number::New() for CPU info

The return values from uv_cpu_info() don't necessarily fit in a 32 bits
signed integer.

Fixes #5732.

11 years agofs: uids and gids must be unsigned ints
Ben Noordhuis [Tue, 23 Jul 2013 11:28:14 +0000 (13:28 +0200)]
fs: uids and gids must be unsigned ints

Before this commit, fs.chown() and fs.fchown() coerced the uid and gid
arguments to signed integers which is wrong because uid_t and gid_t are
unsigned on most all platforms and IDs that don't fit in a signed
integer do exist.

This commit changes the aforementioned functions to take unsigned ints
instead.  No test because we can't assume the system has [GU]IDs that
large.

This change depends on joyent/libuv@d779eb5.

Fixes #5890.

11 years agocrypto: Add test for sha.write(''); sha.end()
David Björklund [Thu, 4 Jul 2013 14:22:31 +0000 (16:22 +0200)]
crypto: Add test for sha.write(''); sha.end()

11 years agobuffer: slice on zero length buffer
Trevor Norris [Tue, 23 Jul 2013 00:04:17 +0000 (17:04 -0700)]
buffer: slice on zero length buffer

SlowBuffer(0) passes NULL instead of doing malloc(0). So when someone
attempted to SlowBuffer(0).slice(0, 1) an assert would fail in
smalloc::SliceOnto.

It's important that the check go where it is because the resulting
Buffer needs to have external array data allocated. In the case a user
tries to slice a zero length Buffer it will also have NULL passed as the
data argument.

Also fixed where the .parent attribute was set for zero length Buffers.
There is no need to track the source of slice if the slice isn't
actually occurring.

11 years agostream: Simplify flowing, passive data listening
isaacs [Thu, 18 Jul 2013 01:24:02 +0000 (18:24 -0700)]
stream: Simplify flowing, passive data listening

Closes #5860

In streams2, there is an "old mode" for compatibility.  Once switched
into this mode, there is no going back.

With this change, there is a "flowing mode" and a "paused mode".  If you
add a data listener, then this will start the flow of data.  However,
hitting the `pause()` method will switch *back* into a non-flowing mode,
where the `read()` method will pull data out.

Every time `read()` returns a data chunk, it also emits a `data` event.
In this way, a passive data listener can be added, and the stream passed
off to some other reader, for use with progress bars and the like.

There is no API change beyond this added flexibility.

11 years agoutil: removed duplicated isArray check
Wyatt Preul [Sat, 20 Jul 2013 05:56:31 +0000 (00:56 -0500)]
util: removed duplicated isArray check

11 years agov8: reapply floating patches
Ben Noordhuis [Wed, 3 Jul 2013 02:23:36 +0000 (04:23 +0200)]
v8: reapply floating patches

11 years agosrc: update v8 build requirements
Trevor Norris [Mon, 22 Jul 2013 22:53:43 +0000 (15:53 -0700)]
src: update v8 build requirements

In v8 3.20.4 build/common.gypi was moved to build/toolchain.gypi and
build/features.gypi.

11 years agov8: upgrade to v8 3.20.7
Trevor Norris [Mon, 22 Jul 2013 22:26:27 +0000 (15:26 -0700)]
v8: upgrade to v8 3.20.7

11 years agosrc: fix windows build error from 221c689e
Ben Noordhuis [Sat, 20 Jul 2013 19:42:20 +0000 (21:42 +0200)]
src: fix windows build error from 221c689e

Just forward declare struct sockaddr, the struct is never actually
dereferenced in src/node_internals.h.

Before this commit, it included sys/socket.h but that header doesn't
exist on Windows.

11 years agotest: move two tests from simple/ to internet/
Ben Noordhuis [Sat, 20 Jul 2013 10:34:53 +0000 (12:34 +0200)]
test: move two tests from simple/ to internet/

Fixes #5876.

11 years agobench: fix up benchmarks after internal api change
Ben Noordhuis [Fri, 19 Jul 2013 21:59:41 +0000 (23:59 +0200)]
bench: fix up benchmarks after internal api change

11 years agotest: fix up tests after internal api change
Ben Noordhuis [Fri, 19 Jul 2013 21:33:06 +0000 (23:33 +0200)]
test: fix up tests after internal api change

11 years agosrc, lib: update after internal api change
Ben Noordhuis [Thu, 18 Jul 2013 21:18:50 +0000 (23:18 +0200)]
src, lib: update after internal api change

Libuv now returns errors directly.  Make everything in src/ and lib/
follow suit.

The changes to lib/ are not strictly necessary but they remove the need
for the abominations that are process._errno and node::SetErrno().

11 years agosrc, lib: deduplicate errnoException
Ben Noordhuis [Tue, 16 Jul 2013 21:28:38 +0000 (23:28 +0200)]
src, lib: deduplicate errnoException

11 years agosrc: add libuv bindings module
Ben Noordhuis [Tue, 16 Jul 2013 21:08:25 +0000 (23:08 +0200)]
src: add libuv bindings module

Exports:

* all UV_E* error codes
* a uv_err_name() binding

11 years agodeps: upgrade libuv to 3ee4d3f
Ben Noordhuis [Tue, 16 Jul 2013 19:04:31 +0000 (21:04 +0200)]
deps: upgrade libuv to 3ee4d3f

11 years agoudp_wrap, tcp_wrap: add out arg to AddressToJS
Ben Noordhuis [Thu, 6 Jun 2013 02:31:12 +0000 (04:31 +0200)]
udp_wrap, tcp_wrap: add out arg to AddressToJS

Prep work for removing process._errno. The handle.getsockname() function
will return a status code in the future and set the address and port
properties on the object that's passed in from JS land.

11 years agosrc: ReqWrap now optionally accepts a wrap object
Ben Noordhuis [Tue, 4 Jun 2013 10:45:12 +0000 (12:45 +0200)]
src: ReqWrap now optionally accepts a wrap object

11 years agobuffer: return offset for end of last write
Trevor Norris [Fri, 12 Jul 2013 23:29:54 +0000 (16:29 -0700)]
buffer: return offset for end of last write

11 years agosrc: fix persistent handle lifecycle issue
Ben Noordhuis [Fri, 19 Jul 2013 20:35:23 +0000 (22:35 +0200)]
src: fix persistent handle lifecycle issue

Commit 636ca7c adds an optimization that casts strong Persistent<T>
handles directly to Local<T> handles to avoid the overhead of creating
new HandleScope-rooted Local<T> handles all the time.

One gotcha that I missed is that it's no longer legal to reference the
Local<T> after calling Persistent<T>::Dispose(). This commit addresses
that.

11 years agosrc: add IsFunction() assert to MakeCallback
Ben Noordhuis [Sun, 2 Jun 2013 13:11:46 +0000 (15:11 +0200)]
src: add IsFunction() assert to MakeCallback

Helps catch bugs early on. Without it, V8 throws the fairly
unhelpful exception "TypeError: undefined is not a function" -
unhelpful because there is no stack trace.

11 years agotools: make check-imports.sh work on bsd-likes
Ben Noordhuis [Fri, 19 Jul 2013 10:46:11 +0000 (12:46 +0200)]
tools: make check-imports.sh work on bsd-likes

11 years agosmalloc: create separate module
Trevor Norris [Fri, 12 Jul 2013 22:18:21 +0000 (15:18 -0700)]
smalloc: create separate module

It will be confusing if later on we add Buffer#dispose(), and smalloc is
its own cpp api anyways. So instead create a new require('smalloc') to
expose the previous Buffer.alloc/dispose methods, and expose copyOnto
and kMaxLength as well.

Other changes:
* Added documentation and additional tests.
* smalloc::CopyOnto has changed from using assert() to throwing errors
  on bad argument values because it is not exposed to the user.
* Minor style fixes.

11 years agonode: always set function name
Trevor Norris [Fri, 19 Jul 2013 19:47:06 +0000 (12:47 -0700)]
node: always set function name

For easier debugging it's helpful to always have the function name.
These were not set for methods coming from cc.

11 years agodoc: events: clarify 'newListener' emitter state
Ben Noordhuis [Thu, 18 Jul 2013 18:47:56 +0000 (20:47 +0200)]
doc: events: clarify 'newListener' emitter state

Ditto for the 'removeListener' event.

11 years agoMerge remote-tracking branch 'ry/v0.10'
isaacs [Thu, 18 Jul 2013 01:32:23 +0000 (18:32 -0700)]
Merge remote-tracking branch 'ry/v0.10'

Conflicts:
doc/api/stream.markdown
lib/tls.js

11 years agourl: Fix edge-case when protocol is non-lowercase
Shuan Wang [Wed, 17 Jul 2013 20:10:09 +0000 (13:10 -0700)]
url: Fix edge-case when protocol is non-lowercase

When using url.parse(), path and pathname usually return '/' when there
is no path available. However when you have a protocol that contains
non-lowercase letters and the input string does not have a trailing
slash, both path and pathname will be undefined.

11 years agodoc: Explain process.nextTick timing
isaacs [Sat, 13 Jul 2013 22:20:27 +0000 (15:20 -0700)]
doc: Explain process.nextTick timing

Provide more detailed explanation of the timing of `process.nextTick`
relative to I/O.

11 years agodoc: style the 'type' fields in API docs
isaacs [Tue, 16 Jul 2013 00:48:12 +0000 (17:48 -0700)]
doc: style the 'type' fields in API docs

11 years agodoc: Streams API Doc Rewrite
isaacs [Mon, 15 Jul 2013 23:56:02 +0000 (16:56 -0700)]
doc: Streams API Doc Rewrite

The Streams API doc is now broken up into 3 sections:

1. API for Consumers
2. API for Implementors
3. Details and Extras

This addresses one of the biggest points of confusion for new users who
start to consume streams, and get the impression that they have to do
lots of extra work and implement classes and such, just to get some data
out of a file.

11 years agosmalloc: remove NULL assert check
Trevor Norris [Mon, 15 Jul 2013 18:08:23 +0000 (11:08 -0700)]
smalloc: remove NULL assert check

In fa10b75 the assert to check if data == NULL was remove for
smalloc::Alloc with no callback. It should have also been removed where
a callback is accepted.

No sense in making sure that length == 0 if data == NULL because devs
already have to be responsible for checking that length is the same as
the char* they're passing in.

11 years agotls: Trivial use_strict fix
isaacs [Mon, 15 Jul 2013 03:08:07 +0000 (20:08 -0700)]
tls: Trivial use_strict fix

11 years agosrc: remove Buffer::Data(Persistent<T>&)
Ben Noordhuis [Sat, 13 Jul 2013 12:07:26 +0000 (14:07 +0200)]
src: remove Buffer::Data(Persistent<T>&)

It hits a compiler bug in gcc <= 4.4 similar to the issue that was
recently addressed in commit 157d2bc:

    ../deps/v8/include/v8.h: In function ‘char*
    node::Buffer::Data(v8::Persistent&) [with TypeName = v8::Object]’:
    ../src/node_crypto.cc:1123: instantiated from here
    ../deps/v8/include/v8.h:876: error: ‘class v8::Data’ is not a
    function,
    ../src/node_internals.h:356: error: conflict with ‘template char*
    node::Buffer::Data(v8::Persistent&)’
    ../src/node_internals.h:357: error: in call to ‘Data’

Remove the helper function, it was only used in a couple of places.
Should fix the build on Ubuntu 10.04.

Fixes #5844.

11 years agoblog: v0.11.4 is unstable not stable
Timothy J Fontaine [Sat, 13 Jul 2013 00:04:29 +0000 (17:04 -0700)]
blog: v0.11.4 is unstable not stable

11 years agolint: fix _http_client.js after v0.10 merge
Timothy J Fontaine [Fri, 12 Jul 2013 22:18:53 +0000 (15:18 -0700)]
lint: fix _http_client.js after v0.10 merge

11 years agoNow working on 0.11.5
Timothy J Fontaine [Fri, 12 Jul 2013 22:17:16 +0000 (15:17 -0700)]
Now working on 0.11.5

11 years agoMerge branch 'v0.11.4-release'
Timothy J Fontaine [Fri, 12 Jul 2013 22:16:33 +0000 (15:16 -0700)]
Merge branch 'v0.11.4-release'

11 years agoblog: v0.11.4 release
Timothy J Fontaine [Fri, 12 Jul 2013 22:12:49 +0000 (15:12 -0700)]
blog: v0.11.4 release

11 years ago2013.07.12, Version 0.11.4 (Unstable) v0.11.4
Timothy J Fontaine [Fri, 12 Jul 2013 20:51:04 +0000 (13:51 -0700)]
2013.07.12, Version 0.11.4 (Unstable)

* npm: Upgrade to 1.3.4

* v8: Upgrade to v3.20.2

* c-ares: Upgrade to piscisaureus/cares@805d153

* timers: setImmediate process full queue each turn (Ben Noordhuis)

* http: Add agent.get/request methods (isaacs)

* http: Proper KeepAlive behavior (isaacs)

* configure: fix the --without-ssl option (Nathan Rajlich)

* buffer: propagate originating parent (Trevor Norris)

* tls_wrap: return Error not throw for missing cert (Timothy J Fontaine)

* src: enable native v8 typed arrays (Ben Noordhuis)

* stream: objectMode transform should allow falsey values (Jeff Barczewski)

* slab_allocator: remove SlabAllocator (Trevor Norris)

* crypto: fix memory leak in LoadPKCS12 (Fedor Indutny)

* tls: export TLSSocket (Fedor Indutny)

* zlib: allow changing of level and strategy (Brian White)

* zlib: allow custom flush type for flush() (Brian White)

11 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Fri, 12 Jul 2013 20:26:56 +0000 (13:26 -0700)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
AUTHORS
ChangeLog
deps/npm/Makefile
deps/npm/doc/api/npm-commands.md
deps/npm/doc/api/npm-deprecate.md
deps/npm/doc/api/npm-init.md
deps/npm/doc/api/npm-owner.md
deps/npm/doc/api/npm-publish.md
deps/npm/doc/api/npm-run-script.md
deps/npm/doc/cli/npm-adduser.md
deps/npm/doc/cli/npm-bin.md
deps/npm/doc/cli/npm-bugs.md
deps/npm/doc/cli/npm-build.md
deps/npm/doc/cli/npm-cache.md
deps/npm/doc/cli/npm-completion.md
deps/npm/doc/cli/npm-deprecate.md
deps/npm/doc/cli/npm-docs.md
deps/npm/doc/cli/npm-edit.md
deps/npm/doc/cli/npm-explore.md
deps/npm/doc/cli/npm-help-search.md
deps/npm/doc/cli/npm-help.md
deps/npm/doc/cli/npm-init.md
deps/npm/doc/cli/npm-install.md
deps/npm/doc/cli/npm-link.md
deps/npm/doc/cli/npm-ls.md
deps/npm/doc/cli/npm-outdated.md
deps/npm/doc/cli/npm-owner.md
deps/npm/doc/cli/npm-pack.md
deps/npm/doc/cli/npm-prefix.md
deps/npm/doc/cli/npm-prune.md
deps/npm/doc/cli/npm-publish.md
deps/npm/doc/cli/npm-restart.md
deps/npm/doc/cli/npm-rm.md
deps/npm/doc/cli/npm-root.md
deps/npm/doc/cli/npm-run-script.md
deps/npm/doc/cli/npm-search.md
deps/npm/doc/cli/npm-shrinkwrap.md
deps/npm/doc/cli/npm-start.md
deps/npm/doc/cli/npm-stop.md
deps/npm/doc/cli/npm-submodule.md
deps/npm/doc/cli/npm-tag.md
deps/npm/doc/cli/npm-test.md
deps/npm/doc/cli/npm-uninstall.md
deps/npm/doc/cli/npm-unpublish.md
deps/npm/doc/cli/npm-update.md
deps/npm/doc/cli/npm-version.md
deps/npm/doc/cli/npm-view.md
deps/npm/doc/cli/npm-whoami.md
deps/npm/doc/files/npm-folders.md
deps/npm/doc/files/package.json.md
deps/npm/doc/misc/npm-coding-style.md
deps/npm/doc/misc/npm-config.md
deps/npm/doc/misc/npm-developers.md
deps/npm/doc/misc/npm-disputes.md
deps/npm/doc/misc/npm-faq.md
deps/npm/doc/misc/npm-registry.md
deps/npm/doc/misc/npm-scripts.md
deps/npm/doc/misc/semver.md
deps/npm/html/doc/README.html
deps/npm/html/doc/api/npm-bin.html
deps/npm/html/doc/api/npm-bugs.html
deps/npm/html/doc/api/npm-commands.html
deps/npm/html/doc/api/npm-config.html
deps/npm/html/doc/api/npm-deprecate.html
deps/npm/html/doc/api/npm-docs.html
deps/npm/html/doc/api/npm-edit.html
deps/npm/html/doc/api/npm-explore.html
deps/npm/html/doc/api/npm-help-search.html
deps/npm/html/doc/api/npm-init.html
deps/npm/html/doc/api/npm-install.html
deps/npm/html/doc/api/npm-link.html
deps/npm/html/doc/api/npm-load.html
deps/npm/html/doc/api/npm-ls.html
deps/npm/html/doc/api/npm-outdated.html
deps/npm/html/doc/api/npm-owner.html
deps/npm/html/doc/api/npm-pack.html
deps/npm/html/doc/api/npm-prefix.html
deps/npm/html/doc/api/npm-prune.html
deps/npm/html/doc/api/npm-publish.html
deps/npm/html/doc/api/npm-rebuild.html
deps/npm/html/doc/api/npm-restart.html
deps/npm/html/doc/api/npm-root.html
deps/npm/html/doc/api/npm-run-script.html
deps/npm/html/doc/api/npm-search.html
deps/npm/html/doc/api/npm-shrinkwrap.html
deps/npm/html/doc/api/npm-start.html
deps/npm/html/doc/api/npm-stop.html
deps/npm/html/doc/api/npm-submodule.html
deps/npm/html/doc/api/npm-tag.html
deps/npm/html/doc/api/npm-test.html
deps/npm/html/doc/api/npm-uninstall.html
deps/npm/html/doc/api/npm-unpublish.html
deps/npm/html/doc/api/npm-update.html
deps/npm/html/doc/api/npm-version.html
deps/npm/html/doc/api/npm-view.html
deps/npm/html/doc/api/npm-whoami.html
deps/npm/html/doc/api/npm.html
deps/npm/html/doc/cli/npm-adduser.html
deps/npm/html/doc/cli/npm-bin.html
deps/npm/html/doc/cli/npm-bugs.html
deps/npm/html/doc/cli/npm-build.html
deps/npm/html/doc/cli/npm-bundle.html
deps/npm/html/doc/cli/npm-cache.html
deps/npm/html/doc/cli/npm-completion.html
deps/npm/html/doc/cli/npm-config.html
deps/npm/html/doc/cli/npm-dedupe.html
deps/npm/html/doc/cli/npm-deprecate.html
deps/npm/html/doc/cli/npm-docs.html
deps/npm/html/doc/cli/npm-edit.html
deps/npm/html/doc/cli/npm-explore.html
deps/npm/html/doc/cli/npm-help-search.html
deps/npm/html/doc/cli/npm-help.html
deps/npm/html/doc/cli/npm-init.html
deps/npm/html/doc/cli/npm-install.html
deps/npm/html/doc/cli/npm-link.html
deps/npm/html/doc/cli/npm-ls.html
deps/npm/html/doc/cli/npm-outdated.html
deps/npm/html/doc/cli/npm-owner.html
deps/npm/html/doc/cli/npm-pack.html
deps/npm/html/doc/cli/npm-prefix.html
deps/npm/html/doc/cli/npm-prune.html
deps/npm/html/doc/cli/npm-publish.html
deps/npm/html/doc/cli/npm-rebuild.html
deps/npm/html/doc/cli/npm-restart.html
deps/npm/html/doc/cli/npm-rm.html
deps/npm/html/doc/cli/npm-root.html
deps/npm/html/doc/cli/npm-run-script.html
deps/npm/html/doc/cli/npm-search.html
deps/npm/html/doc/cli/npm-shrinkwrap.html
deps/npm/html/doc/cli/npm-star.html
deps/npm/html/doc/cli/npm-stars.html
deps/npm/html/doc/cli/npm-start.html
deps/npm/html/doc/cli/npm-stop.html
deps/npm/html/doc/cli/npm-submodule.html
deps/npm/html/doc/cli/npm-tag.html
deps/npm/html/doc/cli/npm-test.html
deps/npm/html/doc/cli/npm-uninstall.html
deps/npm/html/doc/cli/npm-unpublish.html
deps/npm/html/doc/cli/npm-update.html
deps/npm/html/doc/cli/npm-version.html
deps/npm/html/doc/cli/npm-view.html
deps/npm/html/doc/cli/npm-whoami.html
deps/npm/html/doc/cli/npm.html
deps/npm/html/doc/files/npm-folders.html
deps/npm/html/doc/files/npm-global.html
deps/npm/html/doc/files/npm-json.html
deps/npm/html/doc/files/npmrc.html
deps/npm/html/doc/files/package.json.html
deps/npm/html/doc/index.html
deps/npm/html/doc/misc/npm-coding-style.html
deps/npm/html/doc/misc/npm-config.html
deps/npm/html/doc/misc/npm-developers.html
deps/npm/html/doc/misc/npm-disputes.html
deps/npm/html/doc/misc/npm-faq.html
deps/npm/html/doc/misc/npm-index.html
deps/npm/html/doc/misc/npm-registry.html
deps/npm/html/doc/misc/npm-scripts.html
deps/npm/html/doc/misc/removing-npm.html
deps/npm/html/doc/misc/semver.html
deps/npm/man/man1/npm-README.1
deps/npm/man/man1/npm-adduser.1
deps/npm/man/man1/npm-bin.1
deps/npm/man/man1/npm-bugs.1
deps/npm/man/man1/npm-build.1
deps/npm/man/man1/npm-bundle.1
deps/npm/man/man1/npm-cache.1
deps/npm/man/man1/npm-completion.1
deps/npm/man/man1/npm-dedupe.1
deps/npm/man/man1/npm-deprecate.1
deps/npm/man/man1/npm-docs.1
deps/npm/man/man1/npm-edit.1
deps/npm/man/man1/npm-explore.1
deps/npm/man/man1/npm-help-search.1
deps/npm/man/man1/npm-help.1
deps/npm/man/man1/npm-init.1
deps/npm/man/man1/npm-install.1
deps/npm/man/man1/npm-link.1
deps/npm/man/man1/npm-ls.1
deps/npm/man/man1/npm-outdated.1
deps/npm/man/man1/npm-owner.1
deps/npm/man/man1/npm-pack.1
deps/npm/man/man1/npm-prefix.1
deps/npm/man/man1/npm-prune.1
deps/npm/man/man1/npm-publish.1
deps/npm/man/man1/npm-rebuild.1
deps/npm/man/man1/npm-restart.1
deps/npm/man/man1/npm-rm.1
deps/npm/man/man1/npm-root.1
deps/npm/man/man1/npm-run-script.1
deps/npm/man/man1/npm-search.1
deps/npm/man/man1/npm-shrinkwrap.1
deps/npm/man/man1/npm-star.1
deps/npm/man/man1/npm-stars.1
deps/npm/man/man1/npm-start.1
deps/npm/man/man1/npm-stop.1
deps/npm/man/man1/npm-submodule.1
deps/npm/man/man1/npm-tag.1
deps/npm/man/man1/npm-test.1
deps/npm/man/man1/npm-uninstall.1
deps/npm/man/man1/npm-unpublish.1
deps/npm/man/man1/npm-update.1
deps/npm/man/man1/npm-version.1
deps/npm/man/man1/npm-view.1
deps/npm/man/man1/npm-whoami.1
deps/npm/man/man1/npm.1
deps/npm/man/man3/npm-bin.3
deps/npm/man/man3/npm-bugs.3
deps/npm/man/man3/npm-commands.3
deps/npm/man/man3/npm-config.3
deps/npm/man/man3/npm-deprecate.3
deps/npm/man/man3/npm-docs.3
deps/npm/man/man3/npm-edit.3
deps/npm/man/man3/npm-explore.3
deps/npm/man/man3/npm-help-search.3
deps/npm/man/man3/npm-init.3
deps/npm/man/man3/npm-install.3
deps/npm/man/man3/npm-link.3
deps/npm/man/man3/npm-load.3
deps/npm/man/man3/npm-ls.3
deps/npm/man/man3/npm-outdated.3
deps/npm/man/man3/npm-owner.3
deps/npm/man/man3/npm-pack.3
deps/npm/man/man3/npm-prefix.3
deps/npm/man/man3/npm-prune.3
deps/npm/man/man3/npm-publish.3
deps/npm/man/man3/npm-rebuild.3
deps/npm/man/man3/npm-restart.3
deps/npm/man/man3/npm-root.3
deps/npm/man/man3/npm-run-script.3
deps/npm/man/man3/npm-search.3
deps/npm/man/man3/npm-shrinkwrap.3
deps/npm/man/man3/npm-start.3
deps/npm/man/man3/npm-stop.3
deps/npm/man/man3/npm-submodule.3
deps/npm/man/man3/npm-tag.3
deps/npm/man/man3/npm-test.3
deps/npm/man/man3/npm-uninstall.3
deps/npm/man/man3/npm-unpublish.3
deps/npm/man/man3/npm-update.3
deps/npm/man/man3/npm-version.3
deps/npm/man/man3/npm-view.3
deps/npm/man/man3/npm-whoami.3
deps/npm/man/man3/npm.3
deps/npm/man/man5/npm-folders.5
deps/npm/man/man5/npm-global.5
deps/npm/man/man5/npm-json.5
deps/npm/man/man7/npm-coding-style.7
deps/npm/man/man7/npm-config.7
deps/npm/man/man7/npm-developers.7
deps/npm/man/man7/npm-disputes.7
deps/npm/man/man7/npm-faq.7
deps/npm/man/man7/npm-registry.7
deps/npm/man/man7/npm-scripts.7
deps/npm/man/man7/removing-npm.7
deps/npm/man/man7/semver.7
deps/npm/package.json
deps/uv/AUTHORS
deps/uv/ChangeLog
deps/uv/src/version.c
deps/uv/test/test-fs.c
deps/uv/test/test-list.h
lib/http.js
lib/tls.js
src/node_version.h

11 years agonpm: Upgrade to 1.3.4
isaacs [Fri, 12 Jul 2013 20:14:50 +0000 (13:14 -0700)]
npm: Upgrade to 1.3.4

11 years agonpm: Upgrade to 1.3.3
isaacs [Fri, 12 Jul 2013 15:56:59 +0000 (08:56 -0700)]
npm: Upgrade to 1.3.3

11 years agonpm: Upgrade to 1.3.3
isaacs [Fri, 12 Jul 2013 15:55:57 +0000 (08:55 -0700)]
npm: Upgrade to 1.3.3