Commit Graph

9519 Commits (82c2084b4ebb431153b54e598c70ced74217af79)

Author SHA1 Message Date
isaacs c1452f4c6f npm: Upgrade to v1.3.15 2013-11-20 11:08:52 -08:00
Timothy J Fontaine 40d5e9074a child_process: deliver ENOENT on nextTick
After the uv upgrade, uv_spawn will now fail faster for certain
failures like ENOENT. However, our tests and other people may be
depending on that error being passed to the callback instead of a
throw.
2013-11-20 09:35:08 -08:00
Timothy J Fontaine 1fef66ffd4 uv: upgrade to v0.11.15 2013-11-20 09:35:08 -08:00
Trevor Norris aef652dc11 asyncwrap: add missing TryCatch
The TryCatch was not being checked after calling the unload asyncQueue
callback in AsyncWrap::MakeCallback.
2013-11-19 16:03:11 -08:00
Ben Noordhuis 3ac6946999 src: add ASSERT/CHECK/UNREACHABLE macros 2013-11-20 00:26:30 +01:00
Ben Noordhuis d29fe0f2c6 src: make queue.h c++ compatible
This is a cherry-pick of commit joyent/libuv@0520464.
2013-11-20 00:26:30 +01:00
Fedor Indutny 88dc1fcb62 crypto: `randomBytes` is non-blocking
Add NOTE section in documentation, mentioning that `randomBytes` won't
block when entropy sources are drained.

fix #6372
2013-11-19 13:15:50 +04:00
Fedor Indutny fce0eb416b events: do not accept NaN in setMaxListeners 2013-11-19 13:14:01 +04:00
Fedor Indutny 5885f464f0 net: fix `new net.Socket` documentation
`Socket` no longer accepts `type` option, and also accepts `readable`,
`writable` options.

fix #6541
2013-11-19 12:50:16 +04:00
Fedor Indutny 5ce50ece16 dgram: fix abort when getting `fd` of closed dgram
v8's `messages.js` file's `CallSiteGetMethodName` is running through all
object properties and getter to figure out method name of function that
appears in stack trace. This run-through will also read `fd` property of
`UDPWrap` instance's javascript object, making `UNWRAP()` fail.

As a simple alternative to the test case above, one could just keep
reference to the dgram handle and try accessing `handle.fd` after it has
been fully closed.

fix #6536
2013-11-19 12:44:06 +04:00
Timothy J Fontaine b73967e9a0 v8: upgrade to 3.22.24.5 2013-11-18 15:01:38 -08:00
Timothy J Fontaine 2329a254b4 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/AUTHORS
	deps/uv/ChangeLog
	deps/uv/README.md
	deps/uv/build.mk
	deps/uv/src/unix/core.c
	deps/uv/src/unix/darwin-proctitle.c
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/fsevents.c
	deps/uv/src/unix/udp.c
	deps/uv/src/version.c
	deps/v8/src/platform-solaris.cc
	deps/v8/test/cctest/test-api.cc
	lib/tls.js
	src/node.h
	src/node_version.h
2013-11-18 13:41:17 -08:00
Ben Noordhuis bd9c66668c debugger: pass on v8 debug switches
Before this commit, passing --debugger and other V8 debug switches to
node.js made node print a usage message and exit.

Rewrite the debug argument parser so it only consumes switches that we
understand and pass everything else as-is to V8.

A side effect of this change is that switches like --debugger_agent and
--debugger_port now work.  That kind of obsoletes our debugger switches
because they implement pretty much the same functionality but let's
leave them in for now for the sake of convenience and backwards
compatibility.

Fixes #6526.
2013-11-16 14:53:56 +01:00
Trevor Norris d6df1b9157 buffer: convert values to uint, not int
In many cases values expected to be unsigned were converted to a signed
integer.

Also include some small code cleanup.
2013-11-15 11:48:09 -08:00
Trevor Norris e5346932bc src: make buffer size errors more explicit
Fixes #6490
2013-11-15 11:48:08 -08:00
Trevor Norris a263abaa81 buffer: no warning when encoding isn't passed
Buffer#write() was showing the deprecation warning when only
buf.write('string') was passed. This is incorrect since the encoding is
always optional.

Argument order should follow:
  Buffer#write(string[, offset[, length]][, encoding])

(yeah, not confusing at all)
2013-11-15 11:48:03 -08:00
Ben Noordhuis 1394d5856b doc: add nodejs.vn to community page
Node.js.  It's not just for SF hipsters anymore.
2013-11-15 16:29:30 +01:00
Ben Noordhuis a763db8fc0 doc: sort community page links alphabetically
This commit introduces some long lines but it's HTML so it's okay.
2013-11-15 16:24:47 +01:00
Ben Noordhuis 85c8eeb838 src: remove unused import in cares_wrap.cc 2013-11-14 01:59:07 +01:00
Trevor Norris 26a795baa1 doc: fix few smalloc entries for proper formatting 2013-11-13 15:31:22 -08:00
Trevor Norris c414ec1c2c smalloc: check if object has external memory
Add HasExternalData API to check if Object has externally allocated
memory, and accompanying tests.
2013-11-13 15:29:50 -08:00
Fedor Indutny 65b127572f tls: handle `ssl.start()` errors 2013-11-13 17:09:25 +04:00
Tim Wood c9d93f3431 events: don't call once twice
Emitting an event within a `EventEmitter#once` callback of the same
event name will cause subsequent `EventEmitter#once` listeners of the
same name to be called multiple times.

    var emitter = new EventEmitter();

    emitter.once('e', function() {
      emitter.emit('e');
      console.log(1);
    });

    emitter.once('e', function() {
      console.log(2);
    });

    emitter.emit('e');

    // Output
    // 2
    // 1
    // 2

Fix the issue, by calling the listener method only if it was not
already called.
2013-11-13 03:21:04 +04:00
Trevor Norris 9b4aa355e3 src: add comments about implicit dependencies 2013-11-12 13:38:31 -08:00
Trevor Norris d120d92bfe base-object: add BaseObject
BaseObject is a class that just handles the Persistent handle attached
to the class instance.

This also removed WeakObject. Reordering the inheritance chain helps
prevent unneeded calls on instances that don't call MakeCallback.
2013-11-12 13:38:31 -08:00
Trevor Norris 6cea16f2c9 async-wrap: make typenames consistent 2013-11-12 13:38:30 -08:00
Trevor Norris 4326c6d1b3 tls_wrap: move members to initialization list
They didn't need to be defined in the body of the constructor.
2013-11-12 13:38:30 -08:00
Ben Noordhuis 5235d71f89 src: use Context::Scope objects in cares_wrap.cc
Enter the context explicitly, don't rely on the fact that there is a
Context::Scope a few stack frames below because it may be gone someday
2013-11-12 22:10:57 +01:00
Ben Noordhuis 27f115d715 src: fix Context::Scope usage
env->context() may or may not create a new Local.  It currently does
not but don't depend on that behavior, create a HandleScope first.
2013-11-12 22:06:48 +01:00
Ben Noordhuis c0d62c207e crypto: fix up implicit HandleScope abuse
Don't depend on any HandleScope objects that may or may not have been
created in src/stream_wrap.cc, create them explicitly.
2013-11-12 22:06:48 +01:00
Ben Noordhuis fd819efbdf src: remove global HandleScope
Make it more difficult to accidentally leak handles by removing the
top-level HandleScope.  Now if there's no valid HandleScope now, V8
will complain and, in debug builds, abort.
2013-11-12 22:01:21 +01:00
Timothy J Fontaine ac9cf00252 blog: Post for v0.10.22 2013-11-12 12:53:45 -08:00
Timothy J Fontaine 9142dc676f Now working on 0.10.23 2013-11-12 12:53:45 -08:00
Timothy J Fontaine 36f2bf22b5 Merge branch 'v0.10.22-release' into v0.10 2013-11-12 12:53:28 -08:00
Timothy J Fontaine cbff8f091c 2013.11.12, Version 0.10.22 (Stable)
* npm: Upgrade to 1.3.14

* uv: Upgrade to v0.10.19

* child_process: don't assert on stale file descriptor events (Fedor Indutny)

* darwin: Fix "Not Responding" in Mavericks activity monitor (Fedor Indutny)

* debugger: Fix bug in sb() with unnamed script (Maxim Bogushevich)

* repl: do not insert duplicates into completions (Maciej Małecki)

* src: Fix memory leak on closed handles (Timothy J Fontaine)

* tls: prevent stalls by using read(0) (Fedor Indutny)

* v8: use correct timezone information on Solaris (Maciej Małecki)
2013-11-12 12:22:12 -08:00
Timothy J Fontaine 16934d9210 src: add HandleScope in HandleWrap::OnClose
Fixes a 4 byte leak on handles closing. AKA The Walmart leak.

MakeCallback doesn't have a HandleScope. That means the callers scope
will retain ownership of created handles from MakeCallback and related.
There is by default a wrapping HandleScope before uv_run, if the caller
doesn't have a HandleScope on the stack the global will take ownership
which won't be reaped until the uv loop exits.

If a uv callback is fired, and there is no enclosing HandleScope in the
cb, you will appear to leak 4-bytes for every invocation. Take heed.

cc @hueniverse
2013-11-12 11:23:19 -08:00
Timothy J Fontaine ac799ba0af uv: Upgrade to v0.10.19 2013-11-12 10:57:57 -08:00
yangguo@chromium.org 007393a09d v8: use correct timezone information on Solaris
`timezone` variable contains the difference, in seconds, between UTC and
local standard time (see `man 3 localtime` on Solaris).

Call to `tzset` is required to apply contents of `TZ` variable to
`timezone` variable.

BUG=v8:2064

Review URL: https://chromiumcodereview.appspot.com/10967066
Patch from Maciej Małecki <me@mmalecki.com>.

This is a back-port of upstream commit r12802 and a forward port of
commit 9fa953d from the v0.8 branch.  V8 3.22 in the master branch
contains the patch so no further forward-porting is necessary.
2013-11-12 15:15:32 +01:00
Maciej Małecki 568072ceae repl: do not insert duplicates into completions
Fix invalid `hasOwnProperty` function usage.

For example, before in the REPL:

```
> Ar<Tab>
Array

Array        ArrayBuffer
```

Now:

```
> Ar<Tab>
Array

ArrayBuffer
```

Fixes #6255.
Closes #6498.
2013-11-11 15:45:09 -08:00
Ben Noordhuis 09724b311e src: fix Environment::GetCurrent() usage
Create a HandleScope before calling the Environment::GetCurrent() that
takes a v8::Isolate* as an argument because it creates a handle with
the call to v8::Isolate::CurrentContext().
2013-11-11 10:40:28 +01:00
Trevor Norris 7f09a13bba node: add HandleScope to prevent memory leak
MakeCallback can only be called from a valid v8::HandleScope.

Fixed #6487
2013-11-11 11:24:31 -08:00
Ben Noordhuis f230a1cf74 v8: upgrade to 3.22.24
This commit removes the simple/test-event-emitter-memory-leak test for
being unreliable with the new garbage collector: the memory pressure
exerted by the test case is too low for the garbage collector to kick
in.  It can be made to work again by limiting the heap size with the
--max_old_space_size=x flag but that won't be very reliable across
platforms and architectures.
2013-11-11 02:40:36 +01:00
Timothy J Fontaine 2010985354 gyp: update to bebdcea 2013-11-10 15:15:34 -08:00
Ben Noordhuis a12870c823 crypto: update root certificates
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl and update src/node_crypto.cc to make use of
the new format.

Fixes #6013.
2013-11-09 23:46:07 +01:00
Ben Noordhuis d4c09f20c8 tools: check in certdata.txt from mozilla NSS
This is a file from the NSS project containing root certificate data.
It can be downloaded from:

  https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1

Once downloaded, running `perl tools/mk-ca-bundle.pl` will update
src/node_root_certs.h.  Commit, rebuild and go.
2013-11-09 23:37:55 +01:00
Ben Noordhuis e159073da5 tools: customize mk-ca-bundle.pl
Remove unneeded functionality and tweak the generated output so we
can #include it in C++ source code.
2013-11-09 23:37:16 +01:00
Ben Noordhuis 5ab863de22 tools: bundle mk-ca-bundle.pl from upstream curl 2013-11-09 23:01:27 +01:00
Ben Noordhuis 3dcc9b93e1 v8: unbreak `make native` build
The security fix from commit 6b92a713 also back-ported the test case.
Said test case relies on API that is only available in newer versions
of V8 and, as a result, broke the `make native` and `make <arch.mode>`
builds.  This commit reverts that part of the back-port.  Fixes the
following build error:

  ../test/cctest/test-api.cc: In function ‘void TestRegress260106()’:
  ../test/cctest/test-api.cc:17712:34: error: ‘class v8::Context’ has
  no member named ‘GetIsolate’
2013-11-09 22:27:22 +01:00
Fedor Indutny ac2263b77f tls: prevent stalls by using read(0)
Do not `.push()` the same data as just passed to `.ondata()`, it
may be read by 'data' event listeners.

fix #6277
2013-11-09 02:07:36 +04:00
isaacs a48b647162 Merge remote-tracking branch 'ry/v0.10' 2013-11-08 13:41:44 -08:00