platform/upstream/nodejs.git
10 years agomdb_v8: remove useless check
Dave Pacheco [Mon, 7 Oct 2013 21:20:00 +0000 (14:20 -0700)]
mdb_v8: remove useless check

10 years agodtrace, mdb_v8: support more string, frame types
Dave Pacheco [Mon, 7 Oct 2013 20:17:49 +0000 (13:17 -0700)]
dtrace, mdb_v8: support more string, frame types

This change makes several improvements to the ustack helper and MDB
support:

- ustack helper and MDB: add support for two-byte strings
  (necessary to print many filenames in stacktraces in 0.10 and later).
- ustack helper: fix position numbers, which were off by a factor of two
- ustack helper: fix frames with undefined Scripts (e.g., "RegExp")
- ustack helper: add stub frames
- MDB: add support for sliced strings
- MDB: sync up with changes from the illumos version of the module

Fixes #6309
Closes #6318

10 years agozlib: fix write request reference counting
Ben Noordhuis [Sat, 5 Oct 2013 17:48:33 +0000 (19:48 +0200)]
zlib: fix write request reference counting

Keep track of the reference count, don't make the wrapper object weak
when there are pending write requests.  Fixes a regression from c79d516.

10 years agov8: ugprade to 3.20.17.14
Timothy J Fontaine [Mon, 7 Oct 2013 17:17:04 +0000 (10:17 -0700)]
v8: ugprade to 3.20.17.14

10 years agodebugger: count space for line numbers correctly
Alex Kocharin [Sun, 6 Oct 2013 05:22:41 +0000 (09:22 +0400)]
debugger: count space for line numbers correctly

10 years agosrc: fix up after botched merge conflict
Ben Noordhuis [Thu, 3 Oct 2013 17:27:51 +0000 (19:27 +0200)]
src: fix up after botched merge conflict

Mea culpa, I didn't properly resolve a merge conflict in the last two
commits.  The resulting segmentation fault only happened on Linux and
only sometimes.

Fixes #6306.

10 years agosrc: add JS start/stop methods for idle notifier
Ben Noordhuis [Thu, 3 Oct 2013 09:03:46 +0000 (11:03 +0200)]
src: add JS start/stop methods for idle notifier

The previous commit changes the profiler idle notifier so that it only
gets started when a --prof or --prof_lazy argument is specified on the
command line.

This commit adds two internal methods to the process object that allows
one to start and stop the idle notifier programmatically.

10 years agosrc: only start idle notifier when profiling
Ben Noordhuis [Thu, 3 Oct 2013 08:45:32 +0000 (10:45 +0200)]
src: only start idle notifier when profiling

The previous commit adds a notifier that tells the V8 profiler when
node.js is idle, i.e. when it's about to start sleeping in the
platform's equivalent of epoll_wait().

This commit adds a heuristic that only starts the notifier when the
V8 profiler is started from the command line.

10 years agosrc: notify V8 profiler when we're idle
Ben Noordhuis [Wed, 2 Oct 2013 04:37:44 +0000 (06:37 +0200)]
src: notify V8 profiler when we're idle

Inform V8's CPU profiler when we're idle.  The profiler is
sampling-based but not all samples are created equal; mark the wall
clock time spent in epoll_wait() and friends so profiling tools can
filter it out.  The samples still end up in v8.log but with state=IDLE
rather than state=EXTERNAL.

10 years agosrc: raise maximum file descriptor limit
Ben Noordhuis [Wed, 2 Oct 2013 10:17:57 +0000 (12:17 +0200)]
src: raise maximum file descriptor limit

Do a binary search for the maximum RLIMIT_NOFILE.  Works around the
low, low limits on certain high, high-priced devices from Cupertino, CA.

10 years agotest: update require path after file move
Ben Noordhuis [Tue, 1 Oct 2013 00:55:30 +0000 (02:55 +0200)]
test: update require path after file move

Commit 204228b moved a few slow tests to pummel but I forgot to update
the require() path in pummel/test-debugger-repl-break-in-module.  Mea
culpa.

10 years agodebugger: show current line, fix for #6150
Alex Kocharin [Sat, 28 Sep 2013 20:26:15 +0000 (00:26 +0400)]
debugger: show current line, fix for #6150

10 years agodebugger: repeat last command
Alex Kocharin [Sat, 28 Sep 2013 22:57:33 +0000 (02:57 +0400)]
debugger: repeat last command

Regression introduced by commit 9ef9a9d.

10 years agofs: remove duplicate !options case
Jeff Switzer [Fri, 27 Sep 2013 03:03:59 +0000 (23:03 -0400)]
fs: remove duplicate !options case

I haven't actually tested this code, but was reading it due to a
post that linked to the code here:

    http://dailyjs.com/2013/09/26/libuv/

As I was reading through the code, I noticed a path that can't
be reached.

I didn't strictly follow the contributing guide:

    https://github.com/joyent/node/wiki/Contributing

but the change seems safe.

Feel free to close this out. I'm not sure if it was just an oversight
or what.

10 years agotest: add regression test for #6235
Timothy J Fontaine [Thu, 26 Sep 2013 17:07:18 +0000 (10:07 -0700)]
test: add regression test for #6235

10 years agov8: upgrade to 3.20.17.13
Timothy J Fontaine [Thu, 26 Sep 2013 16:18:06 +0000 (09:18 -0700)]
v8: upgrade to 3.20.17.13

fixes #6235

10 years agosrc: remove ObjectWrap dependency from core
Ben Noordhuis [Wed, 25 Sep 2013 10:57:03 +0000 (12:57 +0200)]
src: remove ObjectWrap dependency from core

Drop the ObjectWrap dependency in favor of an internal WeakObject class.

Let's us stop worrying about API and ABI compatibility when making
changes to the way node.js deals with weakly persistent handles
internally.

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Tue, 24 Sep 2013 23:49:01 +0000 (16:49 -0700)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
AUTHORS
ChangeLog
configure
deps/uv/ChangeLog
deps/uv/src/version.c
lib/tls.js
src/node_version.h

10 years agoblog: add missing shasums for v0.10.19 release
Timothy J Fontaine [Tue, 24 Sep 2013 22:16:44 +0000 (15:16 -0700)]
blog: add missing shasums for v0.10.19 release

10 years agoblog: Post for v0.10.19
Timothy J Fontaine [Tue, 24 Sep 2013 22:10:22 +0000 (15:10 -0700)]
blog: Post for v0.10.19

10 years agoNow working on 0.10.20
Timothy J Fontaine [Tue, 24 Sep 2013 22:10:22 +0000 (15:10 -0700)]
Now working on 0.10.20

10 years agoMerge branch 'v0.10.19-release' into v0.10
Timothy J Fontaine [Tue, 24 Sep 2013 22:10:10 +0000 (15:10 -0700)]
Merge branch 'v0.10.19-release' into v0.10

10 years agolint: fix a few semicolons
Trevor Norris [Tue, 24 Sep 2013 21:35:30 +0000 (14:35 -0700)]
lint: fix a few semicolons

10 years ago2013.09.24, Version 0.10.19 (Stable) v0.10.19
Timothy J Fontaine [Tue, 24 Sep 2013 21:10:33 +0000 (14:10 -0700)]
2013.09.24, Version 0.10.19 (Stable)

* uv: Upgrade to v0.10.17

* npm: upgrade to 1.3.11

* readline: handle input starting with control chars (Eric Schrock)

* configure: add mips-float-abi (soft, hard) option (Andrei Sedoi)

* stream: objectMode transforms allow falsey values (isaacs)

* tls: prevent duplicate values returned from read (Nathan Rajlich)

* tls: NPN protocols are now local to connections (Fedor Indutny)

10 years agouv: Upgrade to v0.10.17
Timothy J Fontaine [Tue, 24 Sep 2013 20:45:57 +0000 (13:45 -0700)]
uv: Upgrade to v0.10.17

10 years agoRevert "deps: update v8 to 3.20.17.11"
Ben Noordhuis [Tue, 24 Sep 2013 14:13:05 +0000 (16:13 +0200)]
Revert "deps: update v8 to 3.20.17.11"

After the upgrade from 3.20.17.7 to 3.20.17.11, we've begun hitting
random assertions in V8 in memory-constrained / GC-heavy situations.

The assertions all seem to be related to heap allocations and garbage
collection but apart from that, they're all over the place.

This reverts commit 970bdccc38fee27e10ff1a3b68f3fea3417788a1.

10 years agotls: wrap tls inside tls using legacy API
Fedor Indutny [Tue, 24 Sep 2013 12:53:49 +0000 (16:53 +0400)]
tls: wrap tls inside tls using legacy API

Allow wrapping TLSSocket inside another TLSSocket, emulate it using
SecurePair in legacy APIs.

fix #6204

10 years agoreadline: handle input starting with control chars
Eric Schrock [Mon, 20 May 2013 18:44:26 +0000 (14:44 -0400)]
readline: handle input starting with control chars

Handle control characters only when there is a single byte in the
stream, otherwise fall through to the standard multibyte handling.

10 years agodeps: update v8 to 3.20.17.11
Fedor Indutny [Mon, 23 Sep 2013 16:25:11 +0000 (20:25 +0400)]
deps: update v8 to 3.20.17.11

fix #6235

10 years agosrc: fix v8 PRNG entropy seeding
Ben Noordhuis [Mon, 23 Sep 2013 12:27:26 +0000 (14:27 +0200)]
src: fix v8 PRNG entropy seeding

It was pointed out by a member of the V8 team that the call to
V8::SetEntropySource() should come before V8::Initialize().

See also commit 7ac2391.

10 years agosrc: seed V8's random number generator at startup
Ben Noordhuis [Fri, 20 Sep 2013 20:01:49 +0000 (22:01 +0200)]
src: seed V8's random number generator at startup

The default entropy source is /dev/urandom on UNIX platforms, which is
okay but we can do better by seeding it from OpenSSL's entropy pool.

On Windows we can certainly do better; on that platform, V8 seeds the
random number generator using only the current system time.

Fixes #6250.

10 years agodns: fix c-ares error reporting regression
Ben Noordhuis [Thu, 19 Sep 2013 04:38:37 +0000 (06:38 +0200)]
dns: fix c-ares error reporting regression

The test case from the previous commit exposed a regression in the way
that c-ares errors are reported to JS land.  Said regression was
introduced in commit 756b622 ("src: add multi-context support").

Fixes the following test failure:

    $ out/Release/node test/simple/test-dns-regress-6244
    util.js:675
      var errname = uv.errname(err);
                       ^
    Error: err >= 0
        at Object.exports._errnoException (util.js:675:20)
        at errnoException (dns.js:43:15)
        at Object.onresolve [as oncomplete] (dns.js:145:19)

lib/dns.js erroneously assumed that the error code was a libuv error
code when it's really a c-ares status code.  Libuv handles getaddrinfo()
style lookups (which is by far the most common type of lookup), that's
why this bug wasn't discovered earlier.

10 years agosrc: initialize c-ares task list on env init
Ben Noordhuis [Thu, 19 Sep 2013 03:59:54 +0000 (05:59 +0200)]
src: initialize c-ares task list on env init

Don't forget to initialize the c-ares task tree head when creating a
new Environment.  Oversight from the multi-context work that landed
in commit 756b622.

Fixes #6244.

10 years agonet: add a port validation to `connect`
Maciej Małecki [Wed, 4 Sep 2013 22:57:43 +0000 (18:57 -0400)]
net: add a port validation to `connect`

Fix "Assertion failed" when trying to connect to non-int ports:

    Assertion failed: (args[2]->Uint32Value()), function Connect,
    file ../src/tcp_wrap.cc, line 379.
    Abort trap: 6

10 years agodoc: document reserved status of SIGUSR1
Ben Noordhuis [Thu, 19 Sep 2013 10:27:06 +0000 (12:27 +0200)]
doc: document reserved status of SIGUSR1

Fixes #1212.

10 years agodeps: update v8 to 3.20.17.7
Fedor Indutny [Wed, 18 Sep 2013 16:33:28 +0000 (20:33 +0400)]
deps: update v8 to 3.20.17.7

10 years agodoc: fix typos in the tls `NPNProtocols` option
Nathan Rajlich [Mon, 16 Sep 2013 20:57:34 +0000 (13:57 -0700)]
doc: fix typos in the tls `NPNProtocols` option

10 years agodoc: specify the format of the `ca` tls option
Nathan Rajlich [Mon, 16 Sep 2013 20:57:00 +0000 (13:57 -0700)]
doc: specify the format of the `ca` tls option

10 years agocontextify: fix ContextifyContext leak
Fedor Indutny [Sat, 14 Sep 2013 14:29:24 +0000 (18:29 +0400)]
contextify: fix ContextifyContext leak

Apparently, context->Global() won't be destroyed if the context itself
isn't marked as weak and independent.

Also, the weakness flag should be cleared once the weak callback is
executed, otherwise we'll get crashes in Debug builds.

fix #6115 and #6201

10 years agohttp: don't pass the request options to Agent
Nathan Rajlich [Fri, 13 Sep 2013 23:54:05 +0000 (16:54 -0700)]
http: don't pass the request options to Agent

The `options` that were being passed in before here are specific to a
single request, which kinda defeats the purpose of using an Agent in the
first place.

On a worse note, these `options` have not yet been "processed" by the
`http.ClientRequest` class, so if `port: null` is set (like it is as the
result of a `url.parse()` call), then they take preference over the
processed values since the agent's "options" get mixed in last in the
`createSocket()` function.

Fixes #6197.
Fixes #6199.
Closes #6231.

10 years agotls: don't push() incoming data when ondata is set
Nathan Rajlich [Thu, 12 Sep 2013 01:18:10 +0000 (18:18 -0700)]
tls: don't push() incoming data when ondata is set

Otherwise the data ends up "on the wire" twice, and
switching between consuming the stream using `ondata`
vs. `read()` would yield duplicate data, which was bad.

10 years agodoc: fix blog link in blog posts and README
Ben Noordhuis [Fri, 13 Sep 2013 12:46:06 +0000 (14:46 +0200)]
doc: fix blog link in blog posts and README

Apparently Joyent decommissioned joyeur.com but at least they saved the
contents of the blog.  Update the links in the README and the nodejs.org
blog posts.

Hat tip to Eugen Pirogoff (@eugenpirogoff) for pointing it out.

Fixes #6224.

10 years agocontextify: dealloc only after global and sandbox
Fedor Indutny [Thu, 12 Sep 2013 13:51:55 +0000 (17:51 +0400)]
contextify: dealloc only after global and sandbox

Functions created using: `vm.runInNewContext('(function() { })')` will
reference only `proxy_global_` object and not `sandbox_`. Thus in case,
where there're no references to sandbox (such as in example above),
`ContextifyContext` will be destroyed and use-after-free might happen.

10 years agobuffer: optimize common encoding cases
Trevor Norris [Tue, 10 Sep 2013 02:39:21 +0000 (19:39 -0700)]
buffer: optimize common encoding cases

String#toLowerCase() is incredibly slow and was costing a 15-30%
performance hit for Buffers less than 1KB. Now instead it'll attempt to
find the correct encoding directly from the passed encoding, only then
afterwards it'll lowercase.

The optimization for not passing any encoding at all is still at the top
of the method.

At most this may add 10% performance hit for passing a mixed case
encoding.

10 years agotls: fix setting NPN protocols
Fedor Indutny [Mon, 9 Sep 2013 14:18:05 +0000 (18:18 +0400)]
tls: fix setting NPN protocols

The NPN protocols was set on `require('tls')` or `global` object instead
of being a local property. This fact lead to strange persistence of NPN
protocols, and sometimes incorrect protocol selection (when no NPN
protocols were passed in client options).

fix #6168

10 years agotest: move slow tests to test/pummel/
Ben Noordhuis [Mon, 9 Sep 2013 08:57:09 +0000 (10:57 +0200)]
test: move slow tests to test/pummel/

Slowness being somewhat subjective but determined by running the
test suite a few times and picking off everything that consistently
clocks in at 2 seconds or more.

Honorable mention for simple/test-tls-server-large-request, it often
runs for 10 (!) seconds or more.

10 years agoconfigure: add mips-float-abi (soft, hard) option
Andrei Sedoi [Wed, 19 Jun 2013 11:48:36 +0000 (14:48 +0300)]
configure: add mips-float-abi (soft, hard) option

10 years agoMerge remote-tracking branch 'ry/v0.10'
isaacs [Sat, 7 Sep 2013 19:31:27 +0000 (14:31 -0500)]
Merge remote-tracking branch 'ry/v0.10'

10 years agonpm: upgrade to 1.3.11
isaacs [Sat, 7 Sep 2013 19:31:04 +0000 (14:31 -0500)]
npm: upgrade to 1.3.11

10 years agoprocess: use exit 1 for uncaughtException
isaacs [Sat, 7 Sep 2013 00:47:56 +0000 (17:47 -0700)]
process: use exit 1 for uncaughtException

Since it is Unix tradition to use exit code 1 for general-purpose script
bail-out, and the way of doing that in Node is to throw an exception and
not catch it, it makes the most sense to exit with 1 when an exception
goes uncaught.

Move the `Invalid Argument` exit to 9, so that it's something specific,
and clear that it's a node internal error.

Also, document the exit codes that we use.

10 years agoprocess: Fix regression from a5dba82
isaacs [Sat, 7 Sep 2013 01:23:02 +0000 (18:23 -0700)]
process: Fix regression from a5dba82

Respect numeric string args to process.exit(code)

10 years agoprocess: Use exit code 8 consistently
isaacs [Sat, 7 Sep 2013 00:08:56 +0000 (17:08 -0700)]
process: Use exit code 8 consistently

This should always be used in the case of an uncaughtException

10 years agoprocess: Add exitCode property
isaacs [Fri, 6 Sep 2013 23:46:35 +0000 (16:46 -0700)]
process: Add exitCode property

This allows one to set a specific status code, while still letting the
process exit gracefully once all async operations are completed.

10 years agosrc: fix multi-base class ObjectWrap::Unwrap<T>()
Ben Noordhuis [Fri, 6 Sep 2013 18:59:27 +0000 (20:59 +0200)]
src: fix multi-base class ObjectWrap::Unwrap<T>()

Fix pointer unwrapping when T is a class with more than one base class.

Before this commit, the wrapped void* pointer was cast directly to T*
without going through ObjectWrap* first, possibly leading to a class
instance pointer that points to the wrong vtable.

This change required some cleanup in various files; some classes
used private rather than public inheritance, others didn't derive
from ObjectWrap at all...

Fixes #6188.

10 years agosrc: add multi-context support
Ben Noordhuis [Sat, 10 Aug 2013 22:26:11 +0000 (00:26 +0200)]
src: add multi-context support

This commit makes it possible to use multiple V8 execution contexts
within a single event loop.  Put another way, handle and request wrap
objects now "remember" the context they belong to and switch back to
that context when the time comes to call into JS land.

This could have been done in a quick and hacky way by calling
v8::Object::GetCreationContext() on the wrap object right before
making a callback but that leaves a fairly wide margin for bugs.

Instead, we make the context explicit through a new Environment class
that encapsulates everything (or almost everything) that belongs to
the context.  Variables that used to be a static or a global are now
members of the aforementioned class.  An additional benefit is that
this approach should make it relatively straightforward to add full
isolate support in due course.

There is no JavaScript API yet but that will be added in the near
future.

This work was graciously sponsored by GitHub, Inc.

10 years agotest: don't call process.exit() in debugger tests
Ben Noordhuis [Fri, 6 Sep 2013 00:44:16 +0000 (02:44 +0200)]
test: don't call process.exit() in debugger tests

process.exit() tends to hide bugs, both in tests and node.js.
Rewrite the tests so that the event loop exits naturally.

10 years agoMerge remote-tracking branch 'ry/v0.10'
isaacs [Fri, 6 Sep 2013 00:16:17 +0000 (17:16 -0700)]
Merge remote-tracking branch 'ry/v0.10'

Conflicts:
deps/uv/ChangeLog
deps/uv/src/version.c
deps/uv/src/win/fs.c
lib/_stream_transform.js

10 years agonpm: upgrade to v1.3.10
isaacs [Fri, 6 Sep 2013 00:13:50 +0000 (17:13 -0700)]
npm: upgrade to v1.3.10

10 years agohandle_wrap: properly don't abort on unwrap
Trevor Norris [Thu, 5 Sep 2013 22:50:51 +0000 (15:50 -0700)]
handle_wrap: properly don't abort on unwrap

From commit 756ae2c all the WRAP/UNWRAP were moved to a single location
for ease of use. In a single location NO_ABORT should have been used but
wasn't. This caused HandleWrap::Close to abort. Below is the applicable
code change as demonstration there was no abort specified when
unwrapping the object.

 void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
    HandleScope scope(node_isolate);

     -  HandleWrap *wrap = static_cast<HandleWrap*>(
     -      args.This()->GetAlignedPointerFromInternalField(0));
     +  HandleWrap* wrap;
     +  UNWRAP(args.This(), HandleWrap, wrap);

Also included a test that will reproduce the abort.

10 years agostream: objectMode transforms allow falsey values
isaacs [Thu, 5 Sep 2013 20:11:51 +0000 (13:11 -0700)]
stream: objectMode transforms allow falsey values

Closes #6183

10 years agosrc: fix solaris 10 build error
Ben Noordhuis [Thu, 5 Sep 2013 19:47:08 +0000 (21:47 +0200)]
src: fix solaris 10 build error

Stop gcc from getting confused, explicitly cast the return value from
getuid() and getgid() to uint32_t.  Fixes the following build error:

    ../src/node.cc: In function 'void node::GetUid(const
    v8::FunctionCallbackInfo<v8::Value>&)':
    ../src/node.cc:1552:37: error: call of overloaded 'Set(uid_t)' is
    ambiguous
    ../src/node.cc:1552:37: note: candidates are:
    ../deps/v8/include/v8.h:5939:6: note: void
    v8::ReturnValue<T>::Set(bool) [with T = v8::Value]
    ../deps/v8/include/v8.h:5909:6: note: void
    v8::ReturnValue<T>::Set(double) [with T = v8::Value]
    ../deps/v8/include/v8.h:5915:6: note: void
    v8::ReturnValue<T>::Set(int32_t) [with T = v8::Value, int32_t = int]
    ../deps/v8/include/v8.h:5926:6: note: void
    v8::ReturnValue<T>::Set(uint32_t) [with T = v8::Value, uint32_t =
    unsigned int]

Fixes #6182.

10 years agotest: move slow test from simple/ to pummel/
Ben Noordhuis [Wed, 4 Sep 2013 18:42:08 +0000 (20:42 +0200)]
test: move slow test from simple/ to pummel/

Move simple/test-http-many-keep-alive-connections to the pummel/
directory, it takes about 2.5 seconds to complete.

10 years agouv: upgrade to v0.10.16
Bert Belder [Thu, 5 Sep 2013 14:49:47 +0000 (16:49 +0200)]
uv: upgrade to v0.10.16

10 years agotls: socket.renegotiate(options, callback)
Fedor Indutny [Fri, 23 Aug 2013 13:53:16 +0000 (17:53 +0400)]
tls: socket.renegotiate(options, callback)

This utility function allows renegotiaion of secure connection after
establishing it.

fix #2496

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Wed, 4 Sep 2013 22:34:32 +0000 (15:34 -0700)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
ChangeLog
src/node_version.h

10 years agoblog: Post for v0.11.7
Timothy J Fontaine [Wed, 4 Sep 2013 22:27:06 +0000 (15:27 -0700)]
blog: Post for v0.11.7

10 years agoNow working on 0.11.8
Timothy J Fontaine [Wed, 4 Sep 2013 22:18:20 +0000 (15:18 -0700)]
Now working on 0.11.8

10 years agoMerge branch 'v0.11.7-release'
Timothy J Fontaine [Wed, 4 Sep 2013 22:18:09 +0000 (15:18 -0700)]
Merge branch 'v0.11.7-release'

10 years ago2013.08.21, Version 0.11.7 (Unstable) v0.11.7
Timothy J Fontaine [Wed, 4 Sep 2013 21:01:26 +0000 (14:01 -0700)]
2013.08.21, Version 0.11.7 (Unstable)

* uv: upgrade to v0.11.13

* v8: upgrade to 3.20.17

* buffer: adhere to INSPECT_MAX_BYTES (Timothy J Fontaine)

* buffer: fix regression for large buffer creation (Trevor Norris)

* buffer: don't throw if slice length too long (Trevor Norris)

* buffer: Buffer(buf) constructor copies into the proper buffer (Ben Noordhuis)

* cli: remove --max-stack-size (Ben Noordhuis)

* cli: unknown command line options are errors (Ben Noordhuis)

* child_process: exec accept buffer as an encoding (Seth Fitzsimmons)

* crypto: make randomBytes/pbkdf2 callbacks domain aware (Ben Noordhuis)

* domain: deprecate domain.dispose(). (Forrest L Norvell)

* fs: Expose birthtime on stat objects (isaacs)

* http: Only send connection:keep-alive if necessary (isaacs)

* repl: Catch syntax errors better (isaacs, Nathan Rajlich)

* stream: change default highWaterMark for objectMode to 16 (Mathias Buus)

* stream: make setEncoding/pause/resume chainable (Julian Gruber, isaacs)

* util: pass opts to custom inspect functions (Timothy J Fontaine)

* vm: rewritten to behave like Contextify (Domenic Denicola)

10 years agoblog: Post for v0.10.18
Timothy J Fontaine [Wed, 4 Sep 2013 18:25:19 +0000 (11:25 -0700)]
blog: Post for v0.10.18

10 years agoNow working on 0.10.19
Timothy J Fontaine [Wed, 4 Sep 2013 18:25:19 +0000 (11:25 -0700)]
Now working on 0.10.19

10 years agoMerge branch 'v0.10.18-release' into v0.10
Timothy J Fontaine [Wed, 4 Sep 2013 18:25:04 +0000 (11:25 -0700)]
Merge branch 'v0.10.18-release' into v0.10

10 years agohttp: Only send connection:keep-alive if necessary
isaacs [Sun, 18 Aug 2013 01:50:59 +0000 (18:50 -0700)]
http: Only send connection:keep-alive if necessary

In cases where the Agent has maxSockets=Infinity, and
keepAlive=false, there's no case where we won't immediately close the
connection after the response is completed.

Since we're going to close it anyway, send a `connection:close` header
rather than a `connection:keep-alive` header.  Still send the
`connection:keep-alive` if the agent will actually reuse the socket,
however.

Closes #5838

10 years agostream: return this from pause()/resume()
isaacs [Wed, 28 Aug 2013 01:59:58 +0000 (18:59 -0700)]
stream: return this from pause()/resume()

10 years agostream: make setEncoding chainable
Julian Gruber [Mon, 19 Aug 2013 17:14:42 +0000 (13:14 -0400)]
stream: make setEncoding chainable

10 years agorepl: Simplify paren wrap, continuation-detection
isaacs [Thu, 29 Aug 2013 21:48:24 +0000 (14:48 -0700)]
repl: Simplify paren wrap, continuation-detection

This simplifies the logic that was in isSyntaxError, as well as the
choice to wrap command input in parens to coerce to an expression
statement.

1. Rather than a growing blacklist of allowed-to-throw syntax errors,
just sniff for the one we really care about ("Unexpected end of input")
and let all the others pass through.

2. Wrapping {a:1} in parens makes sense, because blocks and line labels
are silly and confusing and should not be in JavaScript at all.
However, wrapping functions and other types of programs in parens is
weird and required yet *more* hacking to work around.  By only wrapping
statements that start with { and end with }, we can handle the confusing
use-case, without having to then do extra work for functions and other
cases.

This also fixes the repl wart where `console.log)(` works in the repl,
but only by virtue of the fact that it's wrapped in parens first, as
well as potential side effects of double-running the commands, such as:

    > x = 1
    1
    > eval('x++; throw new SyntaxError("e")')
    ... ^C
    > x
    3

10 years agorepl: treat "Assignment to const" as syntax error
Nathan Rajlich [Tue, 27 Aug 2013 15:57:16 +0000 (08:57 -0700)]
repl: treat "Assignment to const" as syntax error

Adding a new `repl-harmony` test file here because adding the
`--use_strict --harmony` flags on the main repl test file was causing
lots of unrelated failures, due to global variable assignments and
things like that. This new test file is based off of the original
repl.js test file, but has a lot of the tests stripped out. A test case
for this commit is included though.

Fixes #6132.

10 years agorepl: Catch syntax errors better
isaacs [Wed, 28 Aug 2013 01:53:39 +0000 (18:53 -0700)]
repl: Catch syntax errors better

Replace the growing list of 'isSyntaxError' whackamole conditions with a
smarter approach.  This creates a vm Script object *first*, which will
parse the code and raise a SyntaxError right away.

We still do need the test function, but only because strict mode syntax
errors are not recoverable, and should be raised right away.  Really, we
should probably *only* continue on "unexpected end of input" SyntaxErrors.

Also fixes a very difficult-to-test nit where the '...' indentation is
not properly cleared when you ^C out of a syntax error.

Closes #6093

10 years ago2013.09.04, Version 0.10.18 (Stable) v0.10.18
Timothy J Fontaine [Wed, 4 Sep 2013 17:51:53 +0000 (10:51 -0700)]
2013.09.04, Version 0.10.18 (Stable)

* uv: Upgrade to v0.10.15

* stream: Don't crash on unset _events property (isaacs)

* stream: Pass 'buffer' encoding with decoded writable chunks (isaacs)

10 years agouv: upgrade to v0.11.13
Ben Noordhuis [Wed, 4 Sep 2013 12:46:35 +0000 (14:46 +0200)]
uv: upgrade to v0.11.13

This commit changes src/tcp_wrap.cc and src/udp_wrap.cc just enough to
get by (i.e. to compile and function correctly.)

The new libuv API allows for more cleanup and deduplication but I'm
saving that for another day.

10 years agodoc: fix writable.write link
Kyle Robinson Young [Tue, 3 Sep 2013 22:00:45 +0000 (15:00 -0700)]
doc: fix writable.write link

10 years agobuild: remove unused Carbon dependency
Ben Noordhuis [Wed, 4 Sep 2013 07:55:57 +0000 (09:55 +0200)]
build: remove unused Carbon dependency

Libuv as of joyent/libuv@d48168a no longer has link-time dependencies
on the Carbon framework or any other frameworks.

10 years agostring_bytes: use extern for length and write utf8
Trevor Norris [Tue, 3 Sep 2013 11:04:26 +0000 (04:04 -0700)]
string_bytes: use extern for length and write utf8

If the string is external then the length can be quickly retrieved. This
is especially faster for large strings that are being treated as UTF8.
Also, if the string is external then there's no need for a full
String::WriteUtf8 operation. A simple memcpy will do.

10 years agoprocess: Add internal _rawDebug() method
isaacs [Wed, 21 Aug 2013 22:36:50 +0000 (15:36 -0700)]
process: Add internal _rawDebug() method

This is useful when we need to push some debugging messages out to
stderr, without going through the Writable class, or triggering any kind
of nextTick or callback behavior.

10 years agosrc: Remove outdated comment re assert()
isaacs [Wed, 21 Aug 2013 22:39:14 +0000 (15:39 -0700)]
src: Remove outdated comment re assert()

It's a normal function now, not a macro.

10 years agouv: upgrade to v0.11.12
Ben Noordhuis [Mon, 2 Sep 2013 22:42:59 +0000 (00:42 +0200)]
uv: upgrade to v0.11.12

* upgrade deps/uv/ to v0.11.12.
* update files in src/ after a libuv API change.

10 years agosrc: clean up CLI argument parser
Ben Noordhuis [Mon, 2 Sep 2013 14:42:01 +0000 (16:42 +0200)]
src: clean up CLI argument parser

* Exit with an error message when the option is not a node or V8 option.

* Remove the option_end_index global.  Needs to happen anyway for
  the multi-context work, might as well land it in master now.

* Add a smidgen of const-correctness.

* Pay off a few years of accrued technical debt.

10 years agotest: don't use --max-stack-size=0
Ben Noordhuis [Mon, 2 Sep 2013 17:10:36 +0000 (19:10 +0200)]
test: don't use --max-stack-size=0

--max-stack-size was removed in 3a87b31, use --stack-size instead.
What's more, a zero length stack will likely crash the process.

10 years agotest: speed up simple/test-fs-watch
Ben Noordhuis [Sun, 1 Sep 2013 12:47:25 +0000 (14:47 +0200)]
test: speed up simple/test-fs-watch

Don't wait a full second before starting the watcher, 10 ms ought to be
more than enough time.  Reduces running time from 1250 ms to 250 ms on
my system.

10 years agoMerge remote-tracking branch 'ry/v0.10'
isaacs [Sun, 1 Sep 2013 00:58:44 +0000 (17:58 -0700)]
Merge remote-tracking branch 'ry/v0.10'

10 years agobenchmark: Fix execArgv handling
isaacs [Sun, 1 Sep 2013 00:58:17 +0000 (17:58 -0700)]
benchmark: Fix execArgv handling

Bug in 01f3b46 causes the same benchmark to be run repeatedly.

Not so useful for the compare scripts.

10 years agoMerge remote-tracking branch 'ry/v0.10'
isaacs [Sat, 31 Aug 2013 18:29:51 +0000 (11:29 -0700)]
Merge remote-tracking branch 'ry/v0.10'

10 years agobenchmark: Support passing v8 flags to benchmarks
isaacs [Sat, 31 Aug 2013 05:39:06 +0000 (22:39 -0700)]
benchmark: Support passing v8 flags to benchmarks

The better to test --use-strict effects on performance.

(Spoiler: it has no measurable effect on performance.)

10 years agoRevert "src: call uv_loop_delete() on exit in debug mode"
Ben Noordhuis [Fri, 30 Aug 2013 21:28:22 +0000 (23:28 +0200)]
Revert "src: call uv_loop_delete() on exit in debug mode"

Don't call uv_loop_delete() until we've figured out a way to gracefully
close open handles.  See also commit 4915884 and its subsequent revert
in commit 980cbd5.

This reverts commit 556b890ad91780c52c77dccaddcf69beb8184e27.

10 years agoRevert "src: close libuv handles on exit"
Ben Noordhuis [Fri, 30 Aug 2013 21:21:05 +0000 (23:21 +0200)]
Revert "src: close libuv handles on exit"

This change is not entirely ready for prime time: it's making ~50 tests
fail on Windows, mostly due to timeouts.  It's up for debate who is
at fault here: node.js or libuv.

It does however expose a libuv bug on OS X, where the event loop
sometimes gets stuck in uv__io_poll() when there is a single
UV_SHUTDOWN request left in the queue.  Needs further investigation.

This reverts commit 4915884da69814bd4daab22393919a628c9ecf23.

10 years agotest: move smalloc segfault tests to pummel
Trevor Norris [Fri, 30 Aug 2013 20:55:53 +0000 (13:55 -0700)]
test: move smalloc segfault tests to pummel

These tests take a while to complete, and the issue only potentially
appears under heavy load.

10 years agosrc: close libuv handles on exit
Ben Noordhuis [Thu, 29 Aug 2013 09:39:37 +0000 (11:39 +0200)]
src: close libuv handles on exit

Commit 556b890 added a call to uv_loop_delete() with the intent of
catching handle lifecycle bugs.  It worked because it exposed one:

    process.on('exit', function() {
      console.log('bye');  // Asserts.
    });

When run, it asserts with the following message:

    Assertion failed: (!uv__has_active_reqs(loop)), function
    uv__loop_delete, file ../deps/uv/src/unix/loop.c, line 150.

That's because libuv as of joyent/libuv@3f2d4d5 checks that there are
no in-flight requests when the event loop is destroyed.  In the test
case above, the write request for the string hasn't completed yet by
the time node.js exits: the string itself has most likely been written
but libuv hasn't had the opportunity to return the write request to
node.js.

That's why this commit adds a cleanup step right before exit where it
explicitly closes all open handles, then waits until the event loop
exits naturally.

Named pipes (UNIX domain sockets) are shut down first in order to flush
pending write requests.  Should go some way towards fixing the Windows
issue where output on stdout/stderr sometimes gets truncated.

Fixes joyent/libuv#911.

10 years agouv: upgrade to v0.11.11
Bert Belder [Thu, 29 Aug 2013 13:04:27 +0000 (15:04 +0200)]
uv: upgrade to v0.11.11

10 years agosrc: remove unused Persistent<FunctionTemplate>
Ben Noordhuis [Thu, 29 Aug 2013 12:28:24 +0000 (14:28 +0200)]
src: remove unused Persistent<FunctionTemplate>

10 years agocrypto: remove NodeBIO::GetMethod()
Ben Noordhuis [Thu, 29 Aug 2013 12:19:27 +0000 (14:19 +0200)]
crypto: remove NodeBIO::GetMethod()

Remove NodeBIO::GetMethod() and replace calls to BIO_new() with calls
to the new NodeBIO::New() function.

This commit basically reshuffles some code in order to make it explicit
that the NodeBIO BIO_METHOD is const.