platform/upstream/nodejs.git
9 years agobenchmark: add url benchmarks
Ben Noordhuis [Sat, 6 Dec 2014 19:38:58 +0000 (20:38 +0100)]
benchmark: add url benchmarks

Based on the ad-hoc benchmark from joyent/node#8638 plus an additional
benchmark for user:pass auth URLs.

PR-URL: https://github.com/iojs/io.js/pull/102
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
9 years agolib: optimize require() path walking
Ben Noordhuis [Tue, 9 Dec 2014 17:57:43 +0000 (18:57 +0100)]
lib: optimize require() path walking

Remove a speed bump from commit 36777d2 by reusing the result of the
previous stat() system call.  It's a code path that gets called many
thousands of times at startup in most applications so shaving off an
extra system call can have an appreciable impact on startup times.

PR-URL: https://github.com/iojs/io.js/pull/130
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
9 years agosrc: fix unaligned access in ucs2 string encoder
Ben Noordhuis [Tue, 9 Dec 2014 14:41:35 +0000 (15:41 +0100)]
src: fix unaligned access in ucs2 string encoder

Seen with g++ 4.9.2 on x86_64 Linux: a SIGSEGV is generated when the
input to v8::String::NewFromTwoByte() is not suitably aligned.

g++ 4.9.2 emits SSE instructions for copy loops.  That requires aligned
input but that was something StringBytes::Encode() did not enforce until
now.  Make a properly aligned copy before handing off the input to V8.

We could, as an optimization, check that the pointer is aligned on a
two-byte boundary but that is technically still UB; pointers-to-char
are allowed to alias other pointers but the reverse is not true:
a pointer-to-uint16_t that aliases a pointer-to-char is in violation
of the pointer aliasing rules.

See https://code.google.com/p/v8/issues/detail?id=3694

Fixes segfaulting test simple/test-stream2-writable.

PR-URL: https://github.com/iojs/io.js/pull/127
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agotest: fix test-fs-symlink-dir-junction-relative
Bert Belder [Tue, 9 Dec 2014 20:15:32 +0000 (21:15 +0100)]
test: fix test-fs-symlink-dir-junction-relative

  * The test no longer relies on being invoked from a particular
    working directory to function properly.
  * fs.symlink() and fs.symlinkSync() are both tested.
  * The test now cleans up after itself.

This commit fixes https://github.com/iojs/io.js/issues/126

PR-URL: https://github.com/iojs/io.js/pull/129
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agotest: add test for spawnSync() env option
cjihrig [Tue, 9 Dec 2014 18:47:49 +0000 (13:47 -0500)]
test: add test for spawnSync() env option

PR-URL: https://github.com/joyent/node/pull/8845
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agolib,src: fix spawnSync ignoring its 'env' option
Juanjo [Tue, 14 Oct 2014 10:07:19 +0000 (12:07 +0200)]
lib,src: fix spawnSync ignoring its 'env' option

PR-URL: https://github.com/joyent/node/pull/8546
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
9 years agobuild: fix build with systemtap providers enabled
Evan Torrie [Tue, 9 Dec 2014 19:02:39 +0000 (11:02 -0800)]
build: fix build with systemtap providers enabled

The "dtrace" script version include in systemtap-sdt-devel-2.6-3
(part of Fedora 21) no longer ignores unknown command line
arguments, but will instead error out and refuse to run.
This patch adds a separate condition to node's gyp input so
that on Linux it will run dtrace without the -xnolibs
argument that trips it up on systemtap-std-devel-2.6-3.

PR-URL: https://github.com/joyent/node/pull/8846
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agoMerge 'node/v0.12'
Bert Belder [Tue, 9 Dec 2014 17:06:35 +0000 (18:06 +0100)]
Merge 'node/v0.12'

This merge is effectively a no-op because io.js has already
cherry-picked all the patches from node it needs.

The merge commit serves to establish a new merge base for future merges.

9 years agosrc: remove the tracing module entirely
Bert Belder [Tue, 9 Dec 2014 15:03:24 +0000 (16:03 +0100)]
src: remove the tracing module entirely

PR-URL: https://github.com/iojs/io.js/pull/124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agodoc: mention callback for http res/req write & end
Jackson Tian [Tue, 2 Dec 2014 03:14:57 +0000 (11:14 +0800)]
doc: mention callback for http res/req write & end

Add documentation for the callback parameter of http.ClientRequest's and
http.ServerResponse's write and end methods.

9 years agoasync-wrap: add event hooks
Trevor Norris [Tue, 9 Dec 2014 04:10:44 +0000 (05:10 +0100)]
async-wrap: add event hooks

Call a user-defined callback at specific points in the lifetime of an
asynchronous event. Which are on instantiation, just before/after the
callback has been run.

**If any of these callbacks throws an exception, there is no forgiveness
or recovery. A message will be displayed and a core file dumped.**

Currently these only tie into AsyncWrap, meaning no call to a hook
callback will be made for timers or process.nextTick() events. Though
those will be added in a future commit.

Here are a few notes on how to make the hooks work:

- The "this" of all event hook callbacks is the request object.

- The zero field (kCallInitHook) of the flags object passed to
  setupHooks() must be set != 0 before the init callback will be called.

- kCallInitHook only affects the calling of the init callback. If the
  request object has been run through the create callback it will always
  run the before/after callbacks. Regardless of kCallInitHook.

- In the init callback the property "_asyncQueue" must be attached to
  the request object. e.g.

  function initHook() {
    this._asyncQueue = {};
  }

- DO NOT inspect the properties of the object in the init callback.
  Since the object is in the middle of being instantiated there are some
  cases when a getter is not complete, and doing so will cause Node to
  crash.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agoasync-wrap: explicitly pass parent
Trevor Norris [Tue, 9 Dec 2014 04:02:09 +0000 (05:02 +0100)]
async-wrap: explicitly pass parent

When instantiating a new AsyncWrap allow the parent AsyncWrap to be
passed. This is useful for cases like TCP incoming connections, so the
connection can be tied to the server receiving the connection.

Because the current architecture instantiates the *Wrap inside a
v8::FunctionCallback, the parent pointer is currently wrapped inside a
new v8::External every time and passed as an argument. This adds ~80ns
to instantiation time.

A future optimization would be to add the v8::External as the data field
when creating the v8::FunctionTemplate, change the pointer just before
making the call then NULL'ing it out afterwards. This adds enough code
complexity that it will not be attempted until the current approach
demonstrates it is a bottle neck.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agoasync-wrap: expose async-wrap as binding
Trevor Norris [Sat, 15 Nov 2014 00:15:06 +0000 (16:15 -0800)]
async-wrap: expose async-wrap as binding

Expose basic hooks for AsyncWrap via the async_wrap binding. Right now
only the PROVIDER types are exposed. This is a preliminary step before
more functionality is added.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agosrc: remove unnecessary template parameter
Trevor Norris [Fri, 14 Nov 2014 23:47:34 +0000 (15:47 -0800)]
src: remove unnecessary template parameter

The template class information is received via the type of the first
argument. So there is no need to use Wrap<T>(handle).

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agosrc: all wraps now use actual FunctionTemplate
Trevor Norris [Tue, 9 Dec 2014 04:29:47 +0000 (05:29 +0100)]
src: all wraps now use actual FunctionTemplate

Instead of simply creating a new v8::Object to contain the connection
information, instantiate a new instance of a FunctionTemplate. This will
allow future improvements for debugging and performance probes.

Additionally, the "provider" argument in the ReqWrap constructor is no
longer optional.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agonode: fix throws before timer module is loaded
Trevor Norris [Thu, 13 Nov 2014 00:35:48 +0000 (16:35 -0800)]
node: fix throws before timer module is loaded

An edge case could occur when the setImmediate() in _fatalException()
would fire before the timers module had been loaded globally, causing
Node to crash.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agonode, async-wrap: remove MakeDomainCallback
Trevor Norris [Tue, 9 Dec 2014 04:24:59 +0000 (05:24 +0100)]
node, async-wrap: remove MakeDomainCallback

C++ won't deoptimize like JS if specific conditional branches are
sporadically met in the future. Combined with the amount of code
duplication removal and simplified maintenance complexity, it makes more
sense to merge MakeCallback and MakeDomainCallback.

Additionally, type casting in V8 before verifying what that type is will
cause V8 to abort in debug mode if that type isn't what was expected.
Fix this by first checking the v8::Value before casting.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agoasync-wrap: move MakeCallback to .cc
Trevor Norris [Tue, 9 Dec 2014 03:55:48 +0000 (04:55 +0100)]
async-wrap: move MakeCallback to .cc

MakeCallback is too large a function to be inlined. Likewise, only
having header files will not allow for any part of AsyncWrap to be
exposed cleanly via NODE_MODULE_CONTEXT_AWARE_BUILTIN().

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agosrc: remove Async Listener
Trevor Norris [Tue, 9 Dec 2014 15:01:05 +0000 (16:01 +0100)]
src: remove Async Listener

Async Listener was the name of the user-facing JS API, and is being
completely removed. Instead low level hooks directly into the mechanism
that AL used will be introduced in a future commit.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agotest: mark test-net-GH-5504 as flaky on linux
Bert Belder [Tue, 9 Dec 2014 15:08:48 +0000 (16:08 +0100)]
test: mark test-net-GH-5504 as flaky on linux

That test can trigger a bug on some older Linux kernels.

PR-URL: https://github.com/iojs/io.js/pull/124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agotest: runner support for flaky tests
Alexis Campailla [Fri, 7 Nov 2014 13:15:24 +0000 (14:15 +0100)]
test: runner support for flaky tests

Adding --flaky-tests option, to allow regarding flaky tests failures
as non-fatal.

Currently only observed by the TapProgressIndicator, which will
add a # TODO directive to tests classified as flaky. According to the
TAP specification, the test harness is supposed to treat failures
that have a # TODO directive as non-fatal.

9 years agodoc: set logical umask in process.umask example
Carlos Campderrós [Thu, 31 Jul 2014 08:34:51 +0000 (10:34 +0200)]
doc: set logical umask in process.umask example

0644 seems to be the desired mode for new files (as it is a very weird
umask), and to achieve that the correct umask would be 0022.

PR-URL: https://github.com/joyent/node/pull/8039
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agourl: change hostname regex to negate invalid chars
Jonathan Johnson [Thu, 27 Nov 2014 02:02:25 +0000 (20:02 -0600)]
url: change hostname regex to negate invalid chars

Regarding joyent/node#8520

This changes hostname validation from a whitelist regex approach
to a blacklist regex approach as described in https://url.spec.whatwg.org/#host-parsing.

url.parse misinterpreted `https://good.com+.evil.org/`
as `https://good.com/+.evil.org/`.  If we use url.parse to check the
validity of the hostname, the test passes, but in the browser the
user is redirected to the evil.org website.

9 years agosmalloc: don't allow to dispose typed arrays
Vladimir Kurchatkin [Tue, 18 Nov 2014 09:30:27 +0000 (12:30 +0300)]
smalloc: don't allow to dispose typed arrays

PR-URL: https://github.com/joyent/node/pull/8743
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agopath: refactor normalizeArray()
Nathan Woltman [Fri, 21 Nov 2014 08:22:07 +0000 (03:22 -0500)]
path: refactor normalizeArray()

The normalizeArray() function now avoids using the slow Array#splice()
method to improve performance and now also filters out empty path parts.

Code that pre-filtered empty parts has been removed.

PR-URL: https://github.com/joyent/node/pull/8724
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agonode.cc: use nullptr instead of NULL
Bert Belder [Tue, 9 Dec 2014 04:57:17 +0000 (05:57 +0100)]
node.cc: use nullptr instead of NULL

PR-URL: https://github.com/iojs/io.js/pull/124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agonode.cc: fix bad assert
Trevor Norris [Tue, 9 Dec 2014 04:22:49 +0000 (05:22 +0100)]
node.cc: fix bad assert

It was my mistake to change an assert check. This changes it back to how
the assert was originally done.

Fixes: c131c1f "modules: adding load linked modules feature"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
9 years agouv: float patch to revert tty breakage
Trevor Norris [Fri, 5 Dec 2014 13:34:03 +0000 (05:34 -0800)]
uv: float patch to revert tty breakage

Float https://github.com/libuv/libuv/commit/484a3a9 to fix incorrect
indentation in REPL.

9 years agocrypto: store thread id as pointer-sized value
Bert Belder [Tue, 9 Dec 2014 16:44:37 +0000 (17:44 +0100)]
crypto: store thread id as pointer-sized value

uv_thread_t is a HANDLE (void pointer) on Windows, which means that
on 64-bit windows it cannot be stored with CRYPTO_THREADID_set_numeric
without potential data loss.

PR-URL: https://github.com/iojs/io.js/pull/124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agodeps: update libuv to 1.0.1
Saúl Ibarra Corretgé [Fri, 21 Nov 2014 14:43:12 +0000 (15:43 +0100)]
deps: update libuv to 1.0.1

PR-URL: https://github.com/joyent/node/pull/8785
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agoopenssl: don't define SIXTY_FOUR_BIT_LONG on Windows
Bert Belder [Tue, 9 Dec 2014 16:49:42 +0000 (17:49 +0100)]
openssl: don't define SIXTY_FOUR_BIT_LONG on Windows

On Windows a long integer is always 32-bits, even when the target
architecture uses 64-bit pointers.

PR-URL: https://github.com/iojs/io.js/pull/124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agodocs: fix project name
Tyler Kellen [Wed, 3 Dec 2014 16:45:44 +0000 (11:45 -0500)]
docs: fix project name

Renamed node.js to io.js and updated links to external resources.

PR-URL: https://github.com/iojs/io.js/pull/42
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agoRevert "openssl: don't define SIXTY_FOUR_BIT_LONG on Windows"
Ben Noordhuis [Tue, 9 Dec 2014 14:16:55 +0000 (15:16 +0100)]
Revert "openssl: don't define SIXTY_FOUR_BIT_LONG on Windows"

This reverts commit 878cc3e532ec5feb7145ba0523db2c6383df748b.

Reverted for breaking the x86_64 Linux build:

    In file included from ../deps/openssl/openssl/include/openssl/bn.h:1:0,
                     from ../deps/openssl/openssl/crypto/bn/asm/../bn_lcl.h:115,
                     from ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:1:
    ../deps/openssl/openssl/include/openssl/../../crypto/bn/bn.h:813:20: note: previous declaration of 'bn_add_words' was here
     BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num);
                        ^
    ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:210:15: error: conflicting types for 'bn_sub_words'
     BN_ULONG bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int n)

9 years agoopenssl: don't define SIXTY_FOUR_BIT_LONG on Windows
Bert Belder [Tue, 9 Dec 2014 14:46:59 +0000 (15:46 +0100)]
openssl: don't define SIXTY_FOUR_BIT_LONG on Windows

On Windows (and potentially other LP64 platforms), a long integer is
always 32-bits, even when the target architecture uses 64-bit pointers.

Signed-off-by: Bert Belder <bertbelder@gmail.com>
9 years agotest-require-resolve: use case insensitive compare
Bert Belder [Mon, 8 Dec 2014 16:49:24 +0000 (17:49 +0100)]
test-require-resolve: use case insensitive compare

The test fixtures directory is derived from the path to the currently
running script, which is itself specified on the command line. That
means that the case of the fixtures dir may not match what the test
expects (when executed on a case-insensitive file system).

PR-URL: https://github.com/iojs/io.js/pull/116
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agotest: make fs-symlink-dir-junction-relative pass on unix
Bert Belder [Tue, 9 Dec 2014 07:08:51 +0000 (08:08 +0100)]
test: make fs-symlink-dir-junction-relative pass on unix

9 years agofs: resolve junction targets relative to their parent
Vincent Weevers [Wed, 3 Dec 2014 14:38:53 +0000 (15:38 +0100)]
fs: resolve junction targets relative to their parent

PR-URL: https://github.com/joyent/node/pull/8813
Reviewed-By: Bert Belder <bertbelder@gmail.com>
9 years agopath: path.normalize no longer lower-cases drive letters
Bert Belder [Mon, 8 Dec 2014 20:12:12 +0000 (21:12 +0100)]
path: path.normalize no longer lower-cases drive letters

Fixes an omission in e24fa83.

9 years agoRevert "path: resolve normalize drive letter to lower case"
Nikolai Vavilov [Sat, 6 Dec 2014 14:42:24 +0000 (16:42 +0200)]
Revert "path: resolve normalize drive letter to lower case"

This reverts commit f6e574018090ed4d63596b8a3bb614f8f48b6267.

Changing drive letters to lowercase violates the principle of
least surprise. Other functions that do this should get fixed too.

Conflicts:
lib/path.js

PR-URL: https://github.com/iojs/io.js/pull/100
Reviewed-By: Bert Belder <bertbelder@gmail.com>
9 years agocontributing: add all core modules to Caine's spec
Fedor Indutny [Mon, 8 Dec 2014 15:02:30 +0000 (18:02 +0300)]
contributing: add all core modules to Caine's spec

Reviewed-By: Fedor Indutny <fedor@indutny.com>
9 years agocontributing: add information for caine bot
Fedor Indutny [Mon, 8 Dec 2014 02:36:03 +0000 (05:36 +0300)]
contributing: add information for caine bot

Reviewed-By: Rod Vagg <r@va.gg>
PR-URL: https://github.com/iojs/io.js/pull/107

9 years agodoc: fixes grammar in timers/tls
Brendan Ashworth [Fri, 5 Dec 2014 07:01:55 +0000 (23:01 -0800)]
doc: fixes grammar in timers/tls

This commit fixes a few grammar issues located
within the doc files for timers and tls.

They primarily include incorrect use of a / an
and a single insertion of a comma.

same as [this PR](https://github.com/joyent/node/pull/8581)

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/iojs/io.js/pull/76

9 years agomodule: test for directories, fix require with ..
Robert Kowalski [Mon, 10 Feb 2014 20:14:53 +0000 (21:14 +0100)]
module: test for directories, fix require with ..

Given my home-directory is `/Users/rocko` - and I have a file named
`npm.json` in it and also a repository with name `npm`, which is a
folder for the node-module.

When try to require the `/Users/rocko/npm/index.js` two direcotry
levels down in the npm folder (e.g. `/Users/rocko/npm/test/tap`)
with require("../../") node will load `/Users/rocko/npm/index.json`.

When I use require("../..") node will load `/Users/rocko/npm.json`
which is fixed by this commit.

PR-URL: https://github.com/iojs/io.js/pull/58
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
9 years agonet: give better error messages
Evan Lucas [Wed, 3 Dec 2014 03:16:32 +0000 (21:16 -0600)]
net: give better error messages

Add address and/or port to errors where applicable for better reporting.
In the event the local address and port are accessible, it will also add
those to the error message.

See joyent/node#7005
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/35

9 years agodebugger: use requireRepl() to load debugger repl
cjihrig [Wed, 26 Nov 2014 15:46:59 +0000 (10:46 -0500)]
debugger: use requireRepl() to load debugger repl

Currently, the debugger uses require('repl') to setup the repl.
However, require.extensions is not available yet, causing a
crash on tab completion of require('. This commit uses the
module.requireRepl() method to bootstrap the repl.

Fixes: https://github.com/joyent/node/issues/8359
PR-URL: https://github.com/iojs/io.js/pull/49
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agobuild: don't run find in non-existent directory
Jose Luis Rivas [Sat, 6 Dec 2014 17:46:53 +0000 (12:46 -0500)]
build: don't run find in non-existent directory

PR-URL: https://github.com/iojs/io.js/pull/97
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agotest: move simple/test-abort-fatal-error to pummel
Ben Noordhuis [Fri, 5 Dec 2014 22:55:17 +0000 (23:55 +0100)]
test: move simple/test-abort-fatal-error to pummel

Move it from simple/ to pummel/ because it can take an awful long to
run to completion:

    $ time out/x64.release/node test/simple/test-abort-fatal-error.js

    real    0m8.150s
    user    0m0.328s
    sys     0m0.054s

PR-URL: https://github.com/node-forward/node/pull/91
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
9 years agoevents: implement EventEmitter#getMaxListeners()
Christian Tellnes [Fri, 5 Dec 2014 13:50:05 +0000 (14:50 +0100)]
events: implement EventEmitter#getMaxListeners()

Fixes https://github.com/joyent/node/issues/8237.

PR-URL: https://github.com/iojs/io.js/pull/82
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agobuild: rename rpmbuild .spec file
Ben Noordhuis [Thu, 4 Dec 2014 21:02:51 +0000 (22:02 +0100)]
build: rename rpmbuild .spec file

Rename the .spec file from node.spec to iojs.spec and update the build
script.  Done as a separate commit to not obscure the changes from the
previous commit.

PR-URL: https://github.com/iojs/io.js/pull/71
Reviewed-By: Rod Vagg <rod@vagg.org>
9 years agobuild: update rpmbuild .spec file
Ben Noordhuis [Thu, 4 Dec 2014 21:00:55 +0000 (22:00 +0100)]
build: update rpmbuild .spec file

Rename the package to iojs.  No Conflicts: header is necessary because
the package was already marked as conflicting with the Fedora nodejs
package.

PR-URL: https://github.com/iojs/io.js/pull/71
Reviewed-By: Rod Vagg <rod@vagg.org>
9 years agodoc: fix grammar and wording in tls and timers
Brendan Ashworth [Sun, 19 Oct 2014 18:54:48 +0000 (11:54 -0700)]
doc: fix grammar and wording in tls and timers

In `tls.markdown`, there was a misuse of 'a' which has been replaced
with 'an'.

In `timers.markdown`...
  line 31: misuse of 'a', replaced with 'an'
  line 59: unclear wording, haywire 'a', added new comma

9 years agodoc: mention callback for http res/req write & end
Jackson Tian [Tue, 2 Dec 2014 03:14:57 +0000 (11:14 +0800)]
doc: mention callback for http res/req write & end

Add documentation for the callback parameter of http.ClientRequest's and
http.ServerResponse's write and end methods.

9 years agouv: float patch to revert tty breakage
Trevor Norris [Fri, 5 Dec 2014 13:34:03 +0000 (05:34 -0800)]
uv: float patch to revert tty breakage

Float https://github.com/libuv/libuv/commit/484a3a9 to fix incorrect
indentation in REPL.

9 years agoasync-wrap: add event hooks
Trevor Norris [Thu, 20 Nov 2014 19:27:06 +0000 (11:27 -0800)]
async-wrap: add event hooks

Call a user-defined callback at specific points in the lifetime of an
asynchronous event. Which are on instantiation, just before/after the
callback has been run.

**If any of these callbacks throws an exception, there is no forgiveness
or recovery. A message will be displayed and a core file dumped.**

Currently these only tie into AsyncWrap, meaning no call to a hook
callback will be made for timers or process.nextTick() events. Though
those will be added in a future commit.

Here are a few notes on how to make the hooks work:

- The "this" of all event hook callbacks is the request object.

- The zero field (kCallInitHook) of the flags object passed to
  setupHooks() must be set != 0 before the init callback will be called.

- kCallInitHook only affects the calling of the init callback. If the
  request object has been run through the create callback it will always
  run the before/after callbacks. Regardless of kCallInitHook.

- In the init callback the property "_asyncQueue" must be attached to
  the request object. e.g.

  function initHook() {
    this._asyncQueue = {};
  }

- DO NOT inspect the properties of the object in the init callback.
  Since the object is in the middle of being instantiated there are some
  cases when a getter is not complete, and doing so will cause Node to
  crash.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agoasync-wrap: explicitly pass parent
Trevor Norris [Mon, 17 Nov 2014 20:54:03 +0000 (12:54 -0800)]
async-wrap: explicitly pass parent

When instantiating a new AsyncWrap allow the parent AsyncWrap to be
passed. This is useful for cases like TCP incoming connections, so the
connection can be tied to the server receiving the connection.

Because the current architecture instantiates the *Wrap inside a
v8::FunctionCallback, the parent pointer is currently wrapped inside a
new v8::External every time and passed as an argument. This adds ~80ns
to instantiation time.

A future optimization would be to add the v8::External as the data field
when creating the v8::FunctionTemplate, change the pointer just before
making the call then NULL'ing it out afterwards. This adds enough code
complexity that it will not be attempted until the current approach
demonstrates it is a bottle neck.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agoasync-wrap: expose async-wrap as binding
Trevor Norris [Sat, 15 Nov 2014 00:15:06 +0000 (16:15 -0800)]
async-wrap: expose async-wrap as binding

Expose basic hooks for AsyncWrap via the async_wrap binding. Right now
only the PROVIDER types are exposed. This is a preliminary step before
more functionality is added.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agosrc: remove unnecessary template parameter
Trevor Norris [Fri, 14 Nov 2014 23:47:34 +0000 (15:47 -0800)]
src: remove unnecessary template parameter

The template class information is received via the type of the first
argument. So there is no need to use Wrap<T>(handle).

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agosrc: all wrap's now use actual FunctionTemplate
Trevor Norris [Tue, 26 Aug 2014 19:21:39 +0000 (12:21 -0700)]
src: all wrap's now use actual FunctionTemplate

Instead of simply creating a new v8::Object to contain the connection
information, instantiate a new instance of a FunctionTemplate. This will
allow future improvements for debugging and performance probes.

Additionally, the "provider" argument in the ReqWrap constructor is no
longer optional.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agonode: fix throws before timer module is loaded
Trevor Norris [Thu, 13 Nov 2014 00:35:48 +0000 (16:35 -0800)]
node: fix throws before timer module is loaded

An edge case could occur when the setImmediate() in _fatalException()
would fire before the timers module had been loaded globally, causing
Node to crash.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agonode, async-wrap: remove MakeDomainCallback
Trevor Norris [Thu, 13 Nov 2014 00:08:12 +0000 (16:08 -0800)]
node, async-wrap: remove MakeDomainCallback

C++ won't deoptimize like JS if specific conditional branches are
sporadically met in the future. Combined with the amount of code
duplication removal and simplified maintenance complexity, it makes more
sense to merge MakeCallback and MakeDomainCallback.

Additionally, type casting in V8 before verifying what that type is will
cause V8 to abort in debug mode if that type isn't what was expected.
Fix this by first checking the v8::Value before casting.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agoasync-wrap: move MakeCallback to .cc
Trevor Norris [Wed, 12 Nov 2014 23:58:23 +0000 (15:58 -0800)]
async-wrap: move MakeCallback to .cc

MakeCallback is too large a function to be inlined. Likewise, only
having header files will not allow for any part of AsyncWrap to be
exposed cleanly via NODE_MODULE_CONTEXT_AWARE_BUILTIN().

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agosrc: remove Async Listener
Trevor Norris [Wed, 12 Nov 2014 00:48:34 +0000 (16:48 -0800)]
src: remove Async Listener

Async Listener was the name of the user-facing JS API, and is being
completely removed. Instead low level hooks directly into the mechanism
that AL used will be introduced in a future commit.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
9 years agotest: mark current flaky tests as flaky
Alexis Campailla [Fri, 7 Nov 2014 13:31:39 +0000 (14:31 +0100)]
test: mark current flaky tests as flaky

9 years agotest: runner support for flaky tests
Alexis Campailla [Fri, 7 Nov 2014 13:15:24 +0000 (14:15 +0100)]
test: runner support for flaky tests

Adding --flaky-tests option, to allow regarding flaky tests failures
as non-fatal.

Currently only observed by the TapProgressIndicator, which will
add a # TODO directive to tests classified as flaky. According to the
TAP specification, the test harness is supposed to treat failures
that have a # TODO directive as non-fatal.

9 years agocontributing: commiter git FAQ
Fedor Indutny [Thu, 4 Dec 2014 14:08:19 +0000 (17:08 +0300)]
contributing: commiter git FAQ

Describe in details how our current git flow works and could be used.

Fix iojs/io.js#67
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/68

9 years agoconfigure: remove shared cares build option
Johan Bergström [Wed, 3 Dec 2014 07:28:40 +0000 (18:28 +1100)]
configure: remove shared cares build option

Bundled cares differs from upstream which will result
in a compilation error when trying to used a shared cares.

Fixes: https://github.com/joyent/node/pull/8786
PR-URL: https://github.com/iojs/io.js/pull/38
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agopolicy: added contribution policy
Rod Vagg [Thu, 4 Dec 2014 09:48:43 +0000 (20:48 +1100)]
policy: added contribution policy

Policy originally by @isaacs and @othiym23, submitted by @mikeal,
committed fresh by @rvagg because .. #22 is kind of a mess

PR-URL: https://github.com/iojs/io.js/pull/22
Reviewed-By: Mikeal Rogers <mikeal.rogers@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
9 years agomodules: adding load linked modules feature
Thorsten Lorenz [Mon, 15 Sep 2014 17:00:22 +0000 (12:00 -0500)]
modules: adding load linked modules feature

- introduced NM_F_LINKED flag to identify linked modules
- setting node_is_initialized after calling V8::Initialize in order to
  make the right decision during initial module registration
- introduced modlist_linked in order to track modules that were
  pre-registered in order to complete it once node is initialized
- completing registration of linked module similarly to the way it's
  done inside DLOpen

PR-URL: https://github.com/iojs/io.js/pull/8
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agoconfigure: remove shared cares build option
Johan Bergström [Wed, 3 Dec 2014 07:28:40 +0000 (18:28 +1100)]
configure: remove shared cares build option

Bundled cares differs from upstream which will result
in a compilation error when trying to used a shared cares.

Fixes: https://github.com/joyent/node/pull/8786
PR-URL: https://github.com/iojs/io.js/pull/38
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9 years agoAdded Gitter badge
The Gitter Badger [Wed, 3 Dec 2014 14:55:54 +0000 (14:55 +0000)]
Added Gitter badge

Reviewed-By: Mikeal Rogers <mikeal.rogers@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
PR-URL: https://github.com/iojs/io.js/pull/41

9 years agodocs: fix prerequisite list formatting
Bryce Kahle [Wed, 3 Dec 2014 17:11:18 +0000 (12:11 -0500)]
docs: fix prerequisite list formatting

PR-URL: https://github.com/iojs/io.js/pull/44
Reviewed-By: Rod Vagg <rod@vagg.org>
9 years agodocs: improve repo description
Leonardo Balter [Wed, 3 Dec 2014 20:07:44 +0000 (15:07 -0500)]
docs: improve repo description

PR-URL: https://github.com/iojs/io.js/pull/48
Reviewed-By: Mikeal Rogers <mikeal.rogers@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
9 years agonode: fix bad assert
Trevor Norris [Thu, 4 Dec 2014 01:16:31 +0000 (17:16 -0800)]
node: fix bad assert

It was my mistake to change an assert check. This changes it back to how
the assert was originally done.

Fixes: c131c1f "modules: adding load linked modules feature"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
9 years agodoc: set logical umask in process.umask example
Carlos Campderrós [Thu, 31 Jul 2014 08:34:51 +0000 (10:34 +0200)]
doc: set logical umask in process.umask example

0644 seems to be the desired mode for new files (as it is a very weird
umask), and to achieve that the correct umask would be 0022.

PR-URL: https://github.com/joyent/node/pull/8039
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agodoc: update README with irc channel
Martin Cozzi [Wed, 3 Dec 2014 01:10:55 +0000 (17:10 -0800)]
doc: update README with irc channel

Fixes: https://github.com/iojs/io.js/issues/30
PR-URL: https://github.com/iojs/io.js/pull/31
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
9 years agourl: change hostname regex to negate invalid chars
Jonathan Johnson [Thu, 27 Nov 2014 02:02:25 +0000 (20:02 -0600)]
url: change hostname regex to negate invalid chars

Regarding joyent/node#8520

This changes hostname validation from a whitelist regex approach
to a blacklist regex approach as described in https://url.spec.whatwg.org/#host-parsing.

url.parse misinterpreted `https://good.com+.evil.org/`
as `https://good.com/+.evil.org/`.  If we use url.parse to check the
validity of the hostname, the test passes, but in the browser the
user is redirected to the evil.org website.

9 years agolint: fix code style
Trevor Norris [Wed, 3 Dec 2014 01:10:40 +0000 (17:10 -0800)]
lint: fix code style

Couple code style fixes to pass cpplint

Fixes: 304c0b4 "crypto: store thread id as pointer-sized"

9 years agodoc: fixed article usage in README.
Jamund Ferguson [Tue, 2 Dec 2014 23:08:25 +0000 (15:08 -0800)]
doc: fixed article usage in README.

added a the because it sounded weird.

PR-URL: https://github.com/iojs/io.js/pull/29
Reviewed-by: Mikeal Rogers <mikeal.rogers@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
9 years agourl: support `path` for url.format
Yazhong Liu [Thu, 20 Nov 2014 15:46:38 +0000 (23:46 +0800)]
url: support `path` for url.format

this adds support for a "path" field that overrides
"query", "search", and "pathname" if given.

Fixes: https://github.com/joyent/node/issues/8722
PR-URL: https://github.com/joyent/node/pull/8755
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
9 years agourl: support `path` for url.format
Yazhong Liu [Thu, 20 Nov 2014 15:46:38 +0000 (23:46 +0800)]
url: support `path` for url.format

this adds support for a "path" field that overrides
"query", "search", and "pathname" if given.

Fixes: https://github.com/joyent/node/issues/8722
PR-URL: https://github.com/joyent/node/pull/8755
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
9 years agodocs: Change contributing documentation to io.js
Tom Gallacher [Tue, 2 Dec 2014 17:39:39 +0000 (17:39 +0000)]
docs: Change contributing documentation to io.js

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/iojs/io.js/pull/25

9 years agodocs: simple project messaging.
Mikeal Rogers [Tue, 2 Dec 2014 02:06:21 +0000 (18:06 -0800)]
docs: simple project messaging.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/iojs/io.js/pull/24

9 years agodocs: add issue contributing section
Max Ogden [Tue, 2 Dec 2014 01:31:19 +0000 (17:31 -0800)]
docs: add issue contributing section

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/iojs/io.js/pull/21

9 years agomodules: adding load linked modules feature
Thorsten Lorenz [Mon, 15 Sep 2014 17:00:22 +0000 (12:00 -0500)]
modules: adding load linked modules feature

- introduced NM_F_LINKED flag to identify linked modules
- setting node_is_initialized after calling V8::Initialize in order to
  make the right decision during initial module registration
- introduced modlist_linked in order to track modules that were
  pre-registered in order to complete it once node is initialized
- completing registration of linked module similarly to the way it's
  done inside DLOpen

PR-URL: https://github.com/joyent/node/pull/8386
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agotest: extend timeouts in child/exec tests
Rod Vagg [Sat, 29 Nov 2014 02:36:14 +0000 (13:36 +1100)]
test: extend timeouts in child/exec tests

increased resillence on slower computers

Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/10

9 years agotest: bump --stack-size to stop child fails on ARM
Rod Vagg [Sat, 29 Nov 2014 10:52:51 +0000 (21:52 +1100)]
test: bump --stack-size to stop child fails on ARM

On ARM, we get a "Maximum call stack size exceeded" when using
require() in the child process, bump it up a bit to avoid the
failures so we can test what we are actually after

Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/14

9 years agodeps: openssl - add x32 support
Ben Noordhuis [Tue, 14 Oct 2014 20:52:16 +0000 (22:52 +0200)]
deps: openssl - add x32 support

This commit adds preliminary x32 support.  Configure with:

    $ ./configure --dest-cpu=x32

PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
9 years agoopenssl: fix keypress requirement in apps on win32
Fedor Indutny [Wed, 11 Dec 2013 17:19:04 +0000 (21:19 +0400)]
openssl: fix keypress requirement in apps on win32

Original source:

http://openssl.6102.n7.nabble.com/PATCH-s-client-Fix-keypress-requirement-with-redirected-input-on-Windows-td46787.html

Reviewed-By: Fedor Indutny <fedor@indutny.com>
9 years agotest: don't remove empty.txt on win32
Rod Vagg [Thu, 27 Nov 2014 22:43:15 +0000 (09:43 +1100)]
test: don't remove empty.txt on win32

on win32 we use empty.txt in the fixtures directory, otherwise we
use a file constructed specifically for this test due to POSIX
socket path length limitations, in which case we need to do
appropriate cleanup

Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/2

9 years agotest: another fix for test-crypto-stream
Fedor Indutny [Fri, 28 Nov 2014 14:13:12 +0000 (17:13 +0300)]
test: another fix for test-crypto-stream

Reviewed-By: Fedor Indutny <fedor@indutny.com>
9 years agocrypto: store thread id as pointer-sized
Alexis Campailla [Mon, 17 Nov 2014 15:44:19 +0000 (16:44 +0100)]
crypto: store thread id as pointer-sized

In https://github.com/MSOpenTech/libuv/commit/59658a8de7cc05a58327a164fd2ed4b050f8b4f4
the return of uv_thread_self() was changed from unsigned long to
uv_thread_t.

uv_thread_t is a HANDLE (pointer-sized) on Windows, which means that
on Win64 it cannot be stored with CRYPTO_THREADID_set_numeric without
data loss.

Furthermore, without this change there will be a build break on Windows
when the libuv change is integrated into Node, because of the
conversion from HANDLE to unsigned long.

Other related commits:
https://github.com/joyent/node/commit/5845a6bcd5b36168bdddeb85da8d8d9d36de7642
https://github.com/MSOpenTech/libuv/commit/919d8ec63ac53566ad1f090058ec15966bd0e960

9 years agoRevert "crypto: cast uv_thread_t to unsigned long"
Alexis Campailla [Fri, 28 Nov 2014 12:11:36 +0000 (13:11 +0100)]
Revert "crypto: cast uv_thread_t to unsigned long"

This reverts commit 0308ad2ce53f73368f265d5e7ee4c0e9f07600a6.

9 years agotest: fix test-crypto-stream
Fedor Indutny [Wed, 15 Oct 2014 16:50:15 +0000 (20:50 +0400)]
test: fix test-crypto-stream

Because of constant-timeness change made in openssl-1.0.1j the error is
no longer returned from EVP_DecryptFinal_ex. Now it just return 0, and
thus the error message does not contain proper error code. Adapt to this
change, there is not much that we could do about it.

9 years agopunycode: update to v1.3.2
Mathias Bynens [Fri, 28 Nov 2014 09:50:12 +0000 (10:50 +0100)]
punycode: update to v1.3.2

Changes since v1.2.3:

* Email address support in `toASCII` and `toUnicode`
* `punycode.ucs2.encode` now no longer mutates the `codePoints`
  argument
* Ensure trailing `.` in domain names are preserved
* Some minor code cleanup + bug fixes

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/iojs/io.js/pull/6

9 years agodeps: update openssl to 1.0.1j
Fedor Indutny [Thu, 27 Nov 2014 15:37:49 +0000 (18:37 +0300)]
deps: update openssl to 1.0.1j

Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/1

9 years agotest: fix floating point NaN tests on mips
James Cowgill [Wed, 26 Nov 2014 17:06:19 +0000 (17:06 +0000)]
test: fix floating point NaN tests on mips

MIPS machines use a slightly different format for NaNs (still perfectly
valid though). This patch adjusts the buffer testcases to allow for
this.

See https://en.wikipedia.org/wiki/NaN#Encoding for some more info.

Based on patch applied to debian by Jérémy Lal <kapouer@melix.org>

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8793

9 years agocrypto: cast uv_thread_t to unsigned long
Saúl Ibarra Corretgé [Wed, 26 Nov 2014 21:50:19 +0000 (22:50 +0100)]
crypto: cast uv_thread_t to unsigned long

Should work in all platforms and it fixes this compilation problem
on OSX:

../src/node_crypto.cc:154:3: error: no matching function for call to
'CRYPTO_THREADID_set_numeric'
  CRYPTO_THREADID_set_numeric(tid, uv_thread_self());
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../deps/openssl/openssl/include/openssl/../../crypto/crypto.h:435:6:
    note: candidate function not viable: no known conversion from
          'uv_thread_t' (aka '_opaque_pthread_t *') to 'unsigned long'
          for 2nd argument
          void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned
          long val);
               ^
               1 error generated.

PR-URL: https://github.com/joyent/node/pull/8785
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agodeps: update libuv to 1.0.1
Saúl Ibarra Corretgé [Wed, 26 Nov 2014 21:37:41 +0000 (22:37 +0100)]
deps: update libuv to 1.0.1

PR-URL: https://github.com/joyent/node/pull/8785
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agosmalloc: don't allow to dispose typed arrays
Vladimir Kurchatkin [Tue, 18 Nov 2014 09:30:27 +0000 (12:30 +0300)]
smalloc: don't allow to dispose typed arrays

PR-URL: https://github.com/joyent/node/pull/8743
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
9 years agopath: refactor normalizeArray()
Nathan Woltman [Fri, 21 Nov 2014 08:22:07 +0000 (03:22 -0500)]
path: refactor normalizeArray()

The normalizeArray() function now avoids using the slow Array#splice()
method to improve performance and now also filters out empty path parts.

Code that pre-filtered empty parts has been removed.

PR-URL: https://github.com/joyent/node/pull/8724
Reviewed-by: Trevor Norris <trev.norris@gmail.com>