Fedor Indutny [Fri, 24 Oct 2014 12:52:29 +0000 (16:52 +0400)]
Merge remote-tracking branch 'origin/v0.12' into v0.12
Conflicts:
src/cares_wrap.cc
src/env-inl.h
src/env.h
src/node.cc
src/node.h
src/node_crypto.cc
Ben Noordhuis [Thu, 23 Oct 2014 20:45:58 +0000 (22:45 +0200)]
src: mark more destructors with override keyword
The previous commits fixed oversights in destructors that should have
been marked virtual but weren't. This commit marks destructors from
derived classes with the override keyword.
Ben Noordhuis [Thu, 23 Oct 2014 20:32:41 +0000 (22:32 +0200)]
src: mark SSLWrap destructor as virtual
Like the previous commit but this time for the SSLWrap destructor.
Ben Noordhuis [Thu, 23 Oct 2014 20:22:00 +0000 (22:22 +0200)]
src: mark BaseObject destructor as virtual
Like the previous commit but this time for the BaseObject destructor.
Ben Noordhuis [Thu, 23 Oct 2014 20:04:47 +0000 (22:04 +0200)]
src: mark AsyncWrap destructor as virtual
Make AsyncWrap::~AsyncWrap() virtual, otherwise it is unsafe to delete
a derived class through a pointer to AsyncWrap. Fortunately, we don't
do that anywhere right now; this commit is merely a preemptive bug fix.
Ben Noordhuis [Wed, 22 Oct 2014 02:53:26 +0000 (04:53 +0200)]
src: mark empty destructors as default
Mark empty destructors as having a default no-op implementation.
Remove a few unused constructors and destructors while we are here.
Ben Noordhuis [Wed, 22 Oct 2014 02:33:01 +0000 (04:33 +0200)]
src: update DISALLOW_COPY_AND_ASSIGN() to c++11
Mark the matrix of copy/move constructor/assignment operator as deleted.
Prevents the object from being copied around (the macro already did that
pre-C++11), but also from being moved out.
Ben Noordhuis [Wed, 22 Oct 2014 02:26:25 +0000 (04:26 +0200)]
src: mark virtual functions with override keyword
Add `override` keywords where appropriate. Makes maintenance easier
because the compiler will shout at you when a base class changes in
an incompatible way.
Ben Noordhuis [Wed, 22 Oct 2014 01:53:57 +0000 (03:53 +0200)]
src: remove STATIC_ASSERT() macro
This macro does not not rightfully belong in node.h, remove it.
Replace the one use site with a C++11 `static_assert` construct.
Ben Noordhuis [Wed, 22 Oct 2014 01:29:32 +0000 (03:29 +0200)]
src: replace NULL with nullptr
Now that we are building with C++11 features enabled, replace use
of NULL with nullptr.
The benefit of using nullptr is that it can never be confused for
an integral type because it does not support implicit conversions
to integral types except boolean - unlike NULL, which is defined
as a literal `0`.
dead-horse [Wed, 17 Sep 2014 10:59:59 +0000 (18:59 +0800)]
path: resolve normalize drive letter to lower case
make path.resolve work the same as path.normalize
Rod Vagg [Sat, 18 Oct 2014 12:25:10 +0000 (23:25 +1100)]
etw: use Isolate to SetJitCodeEventHandler
PR-URL: https://github.com/node-forward/node/pull/27
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Rod Vagg [Sat, 18 Oct 2014 04:06:43 +0000 (15:06 +1100)]
test: allow common.PIPE to be configured via env
Add optional env var $NODE_COMMON_PIPE for setting common.PIPE to
manually deal with maximum path lengths for unix sockets.
PR-URL: https://github.com/node-forward/node/pull/26
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Ben Noordhuis [Thu, 16 Oct 2014 17:35:16 +0000 (19:35 +0200)]
build: remove workarounds for gcc <= 4.4
Now that V8 requires a compiler with decent C++11 support, there is no
reason to keep supporting old versions of gcc. Remove workarounds for
bugs in gcc 4.4 and older.
This coincidentally makes it easier to build with clang 3.3 + address
sanitizer because clang no longer chokes on the `-fno-tree-vrp` switch.
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Thu, 16 Oct 2014 17:22:34 +0000 (19:22 +0200)]
build: add asan option to multi-arch/mode build
Make it possible to build node against Address Sanitizer. Enable with:
$ make -f Makefile.build asan=clang++ CC=clang CC_host=clang
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Thu, 16 Oct 2014 16:43:13 +0000 (18:43 +0200)]
test: make test runner multi-arch/mode compatible
Make `python tools/test.py --arch=ia32,x64 --mode=debug,release` work.
The test runner looks for the `node` binary in `out/${arch}.${mode}/`.
Running tools/test.py without --arch makes it use `out/Release/node` or
`out/Debug/node` like before.
This commit removes `test/simple/test-executable-path.js` because the
assumptions it makes about the locations of the debug and release
binaries are now outdated.
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Thu, 16 Oct 2014 15:10:33 +0000 (17:10 +0200)]
build: set up basic multi-arch/mode build
Make `make -f Makefile.build ia32.release x64.debug` work. It's not
perfect yet: it requires running `./configure` first and the generated
`config.gypi` is shared across builds.
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Thu, 16 Oct 2014 14:41:24 +0000 (16:41 +0200)]
build: copy V8 makefile to top-level directory
Will be used as the template for a multi-arch, multi-mode build system.
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Tue, 14 Oct 2014 20:52:16 +0000 (22:52 +0200)]
build: 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>
Ben Noordhuis [Tue, 14 Oct 2014 20:50:08 +0000 (22:50 +0200)]
deps: fix v8 x32 build
Fix double definition errors in the libv8_base.a library target by
compiling out stub functions when building for x32.
This fix is incomplete because, although V8 now builds, it makes a
number of bad assumptions about the size of stack slots, see
https://code.google.com/p/v8/issues/detail?id=3630.
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Thu, 16 Oct 2014 01:45:53 +0000 (03:45 +0200)]
test: fix non-determinism in test-crypto-domains
The test implicitly assumed that crypto operations complete in the same
order as they are started but, because they go round-trip through the
thread pool, there is no such guarantee. Enforce proper sequencing.
Fixes node-forward/node#22.
PR-URL: https://github.com/node-forward/node/pull/23
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Mon, 13 Oct 2014 13:19:55 +0000 (15:19 +0200)]
src: attach env directly to api functions
Attach the per-context execution environment directly to API functions.
Rationale:
* Gets node one step closer to multi-isolate readiness.
* Avoids multi-context confusion, e.g. when the caller and callee live
in different contexts.
* Avoids expensive calls to pthread_getspecific() on platforms where
V8 does not know how to use the thread-local storage directly.
(Linux, the BSDs.)
PR-URL: https://github.com/node-forward/node/pull/18
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Sun, 12 Oct 2014 15:48:05 +0000 (17:48 +0200)]
src: remove unused Environment::GetCurrent() calls
Remove a few Environment::GetCurrent() calls that g++ failed to detect
were not used for anything. The return value was assigned to a local
variable but not used meaningfully.
PR-URL: https://github.com/node-forward/node/pull/18
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Sat, 11 Oct 2014 19:54:59 +0000 (21:54 +0200)]
src: remove unused MIN macro
Defined in src/node.cc but not actually in use; remove it.
PR-URL: https://github.com/node-forward/node/pull/18
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Sat, 11 Oct 2014 19:48:25 +0000 (21:48 +0200)]
src: ignore risky env vars when setuid root
On POSIX platforms, check that the uid and gid match the euid and egid
respectively before looking up the environment variable.
Before this commit, an i18n-enabled suid node would cheerfully load
attacker-controlled ICU data through the NODE_ICU_DATA environment
variable.
This commit is not a complete fix. For example, it's up for debate
what to do with the NODE_CHANNEL_FD environment variable.
PR-URL: https://github.com/node-forward/node/pull/18
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Sat, 11 Oct 2014 14:52:07 +0000 (16:52 +0200)]
src: replace assert() with CHECK()
Mechanically replace assert() statements with UNREACHABLE(), CHECK(),
or CHECK_{EQ,NE,LT,GT,LE,GE}() statements.
The exceptions are src/node.h and src/node_object_wrap.h because they
are public headers.
PR-URL: https://github.com/node-forward/node/pull/16
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Sat, 11 Oct 2014 14:48:49 +0000 (16:48 +0200)]
src: fix up imports
Make tools/check-imports.sh stop complaining, remove or reorder 'using'
statements.
PR-URL: https://github.com/node-forward/node/pull/16
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Sat, 11 Oct 2014 14:24:12 +0000 (16:24 +0200)]
src: remove unnecessary HandleScopes
API callback functions don't need to create a v8::HandleScope instance
because V8 already creates one in the JS->C++ adapter frame.
PR-URL: https://github.com/node-forward/node/pull/16
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Refael Ackermann [Mon, 29 Sep 2014 09:20:50 +0000 (13:20 +0400)]
deps: fix postmortem-metadata generator in v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Fri, 10 Oct 2014 22:18:34 +0000 (02:18 +0400)]
test: fix error messages after v8 upgrade
Fedor Indutny [Fri, 10 Oct 2014 22:17:49 +0000 (02:17 +0400)]
gyp: build with gnu++0x for the sake of new v8
The new v8 doesn't build on non gnu++0x, set it to a proper value for
all systems.
Fedor Indutny [Fri, 10 Oct 2014 22:17:03 +0000 (02:17 +0400)]
v8_platform: provide default v8::Platform impl
Provide default Platform implementation for v8's purposes.
Alexis Campailla [Fri, 10 Oct 2014 13:14:47 +0000 (15:14 +0200)]
build: vcbuild fix "The input line is too long."
vcbuild.bat is calling vcvars.bat, which doesn't detect if the environment
has already been set. This causes repeated entries to be added to the PATH,
which after a few invocations will lead to an error:
The input line is too long.
Fedor Indutny [Fri, 10 Oct 2014 10:49:02 +0000 (14:49 +0400)]
deps: update v8 to 3.29.93.1
Brian White [Thu, 9 Oct 2014 20:07:50 +0000 (16:07 -0400)]
streams: make setDefaultEncoding() throw
PR-URL: https://github.com/joyent/node/pull/8529
Fixes: f04f3a0 "streams: set default encoding for writable streams"
[trev.norris@gmail.com: update tests to check if throws]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Sat, 3 May 2014 01:55:35 +0000 (03:55 +0200)]
freebsd,linux,sunos: make stack non-executable
Link with -z,noexecstack to make stack memory non-executable. Makes
shellcode injection through buffer overflows more difficult.
Fixes: https://github.com/joyent/node/issues/7542
PR-URL: https://github.com/node-forward/node/pull/8
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
Ben Noordhuis [Thu, 9 Oct 2014 21:10:55 +0000 (23:10 +0200)]
crypto: update root certificates
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl.
PR-URL: https://github.com/node-forward/node/pull/7
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
Ben Noordhuis [Thu, 9 Oct 2014 21:08:51 +0000 (23:08 +0200)]
tools: update certdata.txt
This is the latest certdata.txt from [0], last updated on 2014-10-08.
[0] https://hg.mozilla.org/mozilla-central/raw-file/
f0bb13ef0ee4/security/nss/lib/ckfw/builtins/certdata.txt
PR-URL: https://github.com/node-forward/node/pull/7
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
Ray Donnelly [Sat, 30 Aug 2014 22:59:05 +0000 (23:59 +0100)]
build: determine and use EXEEXT on windows
PR-URL: https://github.com/joyent/node/pull/8294
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ray Donnelly [Sat, 30 Aug 2014 22:51:20 +0000 (23:51 +0100)]
src: fixes for win32
Update following macros:
* NODE_NET_SOCKET_{READ,WRITE}() - they both take 4 arguments,
not 2
* NODE_COUNT_GC_PERCENTTIME() - it takes a single argument.
Use INT_PTR instead of INT32 in pointer casts in win32_etw provider.
PR-URL: https://github.com/joyent/node/pull/8294
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Julien Gilli [Thu, 9 Oct 2014 20:01:27 +0000 (13:01 -0700)]
build: fix build for SmartOS
This change in V8: https://code.google.com/p/v8/source/detail?r=22210
has introduced a method named OS::GetCurrentThreadId which fails to
compile on OSes where a "gettid" syscall does not exist.
This build issue has been fixed upstream by another change:
https://code.google.com/p/v8/source/detail?r=23459. This commit
integrates this fix. It's still not clear if this is good enough for the
long term, see https://code.google.com/p/v8/issues/detail?id=3620 for
more information.
The other build issue was due to the fact that alloca.h is not included
by other system includes on SmartOS, which is assumed by V8.
PR-URL: https://github.com/joyent/node/pull/8534
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Wang Xinyong [Thu, 9 Oct 2014 17:15:05 +0000 (01:15 +0800)]
doc: correct createSecureContext
Remove incorrect stablity indication of tls.createSecureContext, and
format stablity indication of crypto.createCredentials.
Fixes: e50749 "doc: document `tls.createSecureContext`"
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Alexis Campailla [Wed, 8 Oct 2014 18:30:01 +0000 (20:30 +0200)]
test: fix test-child-process-spawn-typeerror
You cannot spawn 'dir' on Windows because it's not an executable. Also,
some people might have 'ls' on their path on Windows, so I changed
invalidCmd to something that's highly unlikely to exist.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Stiliyan Lazarov [Sat, 4 Oct 2014 14:50:50 +0000 (10:50 -0400)]
doc: fix wording and punctuation in modules
[trev.norris@gmail.com: break lines at 80 characters]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 8 Oct 2014 22:38:46 +0000 (15:38 -0700)]
crypto: createDiffieHellman throw for bad args
Previously crypto.createDiffieHellman() would fail silently when a bad
argument was passed for prime/prime_length. Now throws TypeError.
Fixes: https://github.com/joyent/node/issues/8480
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Fedor Indutny [Wed, 8 Oct 2014 10:35:07 +0000 (14:35 +0400)]
test: fix debug-signal-cluster after da update
The cluster children are hitting breakpoint at `cluster.onread` and
hanging on a Semaphore wait now. This prevents them from disconnecting
gracefully. Considering that the test is checking different thing, the
cluster children needs to be force killed from the grand parent process.
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Wed, 8 Oct 2014 10:34:51 +0000 (14:34 +0400)]
src, test: fixup after v8 update
Because of behavior change of some V8 APIs (they mostly became more
strict), following modules needed to be fixed:
* crypto: duplicate prototype methods are not allowed anymore
* contextify: some TryCatch trickery, the binding was using it
incorrectly
* util: maximum call stack error is now crashing in a different place
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Sat, 4 Oct 2014 14:44:46 +0000 (18:44 +0400)]
cluster: do not signal children in debug mode
Do not send signal to children if they are already in debug mode.
Node.js on Windows does not register signal handler, and thus calling
`process._debugProcess()` will throw an error.
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Sat, 4 Oct 2014 14:44:39 +0000 (18:44 +0400)]
deps: re-implement debugger-agent
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Refael Ackermann [Mon, 29 Sep 2014 09:20:50 +0000 (13:20 +0400)]
deps: fix postmortem-metadata generator in v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Thu, 2 Oct 2014 04:16:24 +0000 (08:16 +0400)]
deps: apply floating irhydra patch to v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Refael Ackermann [Mon, 29 Sep 2014 09:20:04 +0000 (13:20 +0400)]
deps: update v8 to 3.28.73
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Wed, 8 Oct 2014 10:35:07 +0000 (14:35 +0400)]
test: fix debug-signal-cluster after da update
The cluster children are hitting breakpoint at `cluster.onread` and
hanging on a Semaphore wait now. This prevents them from disconnecting
gracefully. Considering that the test is checking different thing, the
cluster children needs to be force killed from the grand parent process.
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Wed, 8 Oct 2014 10:34:51 +0000 (14:34 +0400)]
src, test: fixup after v8 update
Because of behavior change of some V8 APIs (they mostly became more
strict), following modules needed to be fixed:
* crypto: duplicate prototype methods are not allowed anymore
* contextify: some TryCatch trickery, the binding was using it
incorrectly
* util: maximum call stack error is now crashing in a different place
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Sat, 4 Oct 2014 14:44:46 +0000 (18:44 +0400)]
cluster: do not signal children in debug mode
Do not send signal to children if they are already in debug mode.
Node.js on Windows does not register signal handler, and thus calling
`process._debugProcess()` will throw an error.
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Sat, 4 Oct 2014 14:44:39 +0000 (18:44 +0400)]
deps: re-implement debugger-agent
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Refael Ackermann [Mon, 29 Sep 2014 09:20:50 +0000 (13:20 +0400)]
deps: fix postmortem-metadata generator in v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Thu, 2 Oct 2014 04:16:24 +0000 (08:16 +0400)]
deps: apply floating irhydra patch to v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Refael Ackermann [Mon, 29 Sep 2014 09:20:04 +0000 (13:20 +0400)]
deps: update v8 to 3.28.73
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Mon, 6 Oct 2014 12:23:01 +0000 (16:23 +0400)]
tls_wrap: ignore ZERO_RETURN after close_notify
Do not call SSL_read() and ignore ZERO_RETURN if the connection was
shutdown and there could not be any reads.
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/joyent/node/pull/8519
Fedor Indutny [Wed, 8 Oct 2014 11:31:45 +0000 (15:31 +0400)]
Merge remote-tracking branch 'joyent/v0.12'
Trevor Norris [Wed, 8 Oct 2014 09:08:54 +0000 (02:08 -0700)]
buffer, doc: misc. fix and cleanup
* Add official documentation that a Buffer instance is a viable
argument when instantiating a new Buffer.
* Properly set the poolOffset when a buffer needs to be truncated.
* Add comments clarifying specific peculiar coding choices.
* Remove a level of unnecessary indentation.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 8 Oct 2014 08:34:46 +0000 (01:34 -0700)]
src: update use of ExternalArrayType constants
Continuation of 4809c7a to update the use of v8::ExternalArrayType.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Refael Ackermann [Thu, 2 Oct 2014 08:20:51 +0000 (11:20 +0300)]
tools: fix for testing openssl integrations
Windows doesn't resolve ".." the way we expect it for symlinks and
junctions.
PR-URL: https://github.com/joyent/node/pull/8489
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Trevor Norris [Wed, 8 Oct 2014 08:13:43 +0000 (01:13 -0700)]
src: fix jslint warning
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 8 Oct 2014 08:06:06 +0000 (01:06 -0700)]
smalloc: update use of ExternalArrayType constants
The constants in enum v8::ExternalArrayType have been changed. The old
values are there for legacy reasons, but it's best to update anyway.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Steve Mao [Fri, 3 Oct 2014 05:53:15 +0000 (15:53 +1000)]
doc: add missing semicolons
PR-URL: https://github.com/joyent/node/pull/8498
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Johnny Ray [Tue, 7 Oct 2014 23:32:05 +0000 (16:32 -0700)]
streams: set default encoding for writable streams
Add API Writable#setDefaultEncoding().
PR-URL: https://github.com/joyent/node/pull/8483
Fixes: https://github.com/joyent/node/issues/7159
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Sat, 4 Oct 2014 05:41:05 +0000 (22:41 -0700)]
build: i18n: py27 -> py26 dependency
Move from argparse to optparse for dependency management.
Fixes: https://github.com/joyent/node/pull/7719#issuecomment-
56868172
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Sat, 4 Oct 2014 00:42:37 +0000 (17:42 -0700)]
build: i18n: move noisy variables to separate gypi
Fixes: https://github.com/joyent/node/issues/7676#issuecomment-
57535890
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Evan Rutledge Borden [Fri, 26 Sep 2014 15:59:39 +0000 (11:59 -0400)]
url: fixed encoding for slash switching emulation.
Fixes: https://github.com/joyent/node/issues/8458
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Victor Widell [Sun, 30 Mar 2014 10:34:45 +0000 (12:34 +0200)]
doc: improve readLine.pause()
The docs for readLine.pause are misleading. I seriously spent hours on this. If
it isn't a bug, at least it should be well documented.
Someone else stumbled on this too:
http://stackoverflow.com/questions/
21341050/pausing-readline-in-node-js
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Steve Sharp [Sun, 28 Sep 2014 23:03:25 +0000 (16:03 -0700)]
doc: Update net.markdown
Associates link to dns.lookup() with proper URL.
Fixes: https://github.com/joyent/node/issues/8018
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Fedor Indutny [Mon, 6 Oct 2014 12:23:01 +0000 (16:23 +0400)]
tls_wrap: ignore ZERO_RETURN after close_notify
Do not call SSL_read() and ignore ZERO_RETURN if the connection was
shutdown and there could not be any reads.
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/joyent/node/pull/8519
gyson [Wed, 1 Oct 2014 02:44:39 +0000 (10:44 +0800)]
util: add es6 Symbol support for `util.inspect`
* `util.inspect` cannot accept es6 symbol primitive
* It will throw exception if do `util.inspect(Symbol())`
* This also affects repl, console.log, etc.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Yazhong Liu [Thu, 2 Oct 2014 23:24:58 +0000 (16:24 -0700)]
buffer: add generic functions for (u)int ops
Add generic functions for (U)Int read/write operations on Buffers. These
support up to and including 48 bit reads and writes.
Include documentation and tests.
Additional work done by Trevor Norris to include 40 and 48 bit write
support. Because bitwise operations cannot be used on values greater
than 32 bits, the operations have been replaced with mathematical
calculations. Regardless, they are still faster than floating point
operations.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 1 Oct 2014 22:42:02 +0000 (15:42 -0700)]
buffer: mv floating point read/write checks to JS
Performance improvement by moving checks for floating point operations
to JS and doing the operation on a protected internal function that
assumes all arguments are correct. Still abort if the operation
overflows memory. This can only be caused if the Buffer's length
property isn't the same as the actual internal length.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Julien Gilli [Mon, 22 Sep 2014 20:21:11 +0000 (13:21 -0700)]
readline: should not require an output stream.
Passing null as the output stream to readline.Interface()'s constructor
is now supported. Any output written by readline is just discarded. It
makes it easier to use readline just as a line parser.
Fixes: https://github.com/joyent/node/issues/4408
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Vladimir Kurchatkin [Mon, 22 Sep 2014 16:19:50 +0000 (20:19 +0400)]
node: avoid automatic microtask runs
Since we are taking control of the microtask queue it makes sense to
disable autorun and only run microtasks when necessary. Just setting
isolate->SetAutorunMicrotasks(false) would cause _tickCallback() not to
be called.
Automatically running the microtask queue will cause it to run:
* After callback invocation
* Inside _tickCallback()
* After _tickCallback() invocation
The third one is unnecessary as the microtask queue is guaranteed to be
empty at this point. The first only needs to be run manually when
_tickCallback() isn't going to be called by MakeCallback().
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Gabriel Wicke [Thu, 25 Sep 2014 16:59:18 +0000 (09:59 -0700)]
url: make query() consistent
Match the behavior of the slow path by setting url.query to an empty
object when the url contains no query, but query parsing is requested.
Also add a test for this case, and update the documents to clearly
reflect this behavior.
Fixes: https://github.com/joyent/node/issues/8332
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Fri, 5 Sep 2014 05:03:24 +0000 (22:03 -0700)]
build, i18n: improve Intl build, add "--with-intl"
The two main goals of this change are:
- To make it easier to build the Intl option using ICU (particularly,
using a newer ICU than v8/Chromium's version)
- To enable a much smaller ICU build with only English support The goal
here is to get node.js binaries built this way by default so that the
Intl API can be used. Additional data can be added at execution time
(see Readme and wiki)
More details are at https://github.com/joyent/node/pull/7719
In particular, this change adds the "--with-intl=" configure option to
provide more ways of building "Intl":
- "full-icu" picks up an ICU from deps/icu
- "small-icu" is similar, but builds only English
- "system-icu" uses pkg-config to find an installed ICU
- "none" does nothing (no Intl)
For Windows builds, the "full-icu" or "small-icu" options are added to
vcbuild.bat.
Note that the existing "--with-icu-path" option is not removed from
configure, but may not be used alongside the new option.
Wiki changes have already been made on
https://github.com/joyent/node/wiki/Installation
and a new page created at
https://github.com/joyent/node/wiki/Intl
(marked as provisional until this change lands.)
Summary of changes:
* README.md : doc updates
* .gitignore : added "deps/icu" as this is the location where ICU is
unpacked to.
* Makefile : added the tools/icu/* files to cpplint, but excluded a
problematic file.
* configure : added the "--with-intl" option mentioned above.
Calculate at config time the list of ICU source files to use and data
packaging options.
* node.gyp : add the new files src/node_i18n.cc/.h as well as ICU
linkage.
* src/node.cc : add call into
node::i18n::InitializeICUDirectory(icu_data_dir) as well as new
--icu-data-dir option and NODE_ICU_DATA env variable to configure ICU
data loading. This loading is only relevant in the "small"
configuration.
* src/node_i18n.cc : new source file for the above Initialize..
function, to setup ICU as needed.
* tools/icu : new directory with some tools needed for this build.
* tools/icu/icu-generic.gyp : new .gyp file that builds ICU in some new
ways, both on unix/mac and windows.
* tools/icu/icu-system.gyp : new .gyp file to build node against a
pkg-config detected ICU.
* tools/icu/icu_small.json : new config file for the "English-only" small
build.
* tools/icu/icutrim.py : new tool for trimming down ICU data. Reads the
above .json file.
* tools/icu/iculslocs.cc : new tool for repairing ICU data manifests
after trim operation.
* tools/icu/no-op.cc : dummy file to force .gyp into using a C++ linker.
* vcbuild.bat : added small-icu and full-icu options, to call into
configure.
* Fixed toolset dependencies, see
https://github.com/joyent/node/pull/7719#issuecomment-
54641687
Note that because of a bug in gyp {CC,CXX}_host must also be set.
Otherwise gcc/g++ will be used by default for part of the build.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Julien Fontanet [Tue, 23 Sep 2014 14:51:33 +0000 (16:51 +0200)]
doc: note stdout and stderr special behaviors.
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Jackson Tian [Wed, 24 Sep 2014 05:14:48 +0000 (13:14 +0800)]
http: Improve _addHeaderLines method
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Tue, 30 Sep 2014 00:29:59 +0000 (17:29 -0700)]
buffer: fix and cleanup fill()
Running fill() with an empty string would cause Node to hang
indefinitely. Now it will return without having operated on the buffer.
User facing function has been pulled into JS to perform all initial
value checks and coercions. The C++ method has been placed on the
"internal" object.
Coerced non-string values to numbers to match v0.10 support.
Simplified logic and changed a couple variable names.
Added tests for fill() and moved them all to the beginning of
buffer-test.js since many other tests depend on fill() working properly.
Fixes: https://github.com/joyent/node/issues/8469
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Mon, 29 Sep 2014 23:32:34 +0000 (16:32 -0700)]
doc: fix optional parameter parsing
The parameter parser specifically looked for the old bracket syntax.
This generated a lot of warnings when building the docs. Those warnings
have been fixed by changing the parsing logic.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Rasmus Christian Pedersen [Thu, 18 Sep 2014 12:10:53 +0000 (14:10 +0200)]
src: fix VC++ warning C4244
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
James Ferguson [Thu, 25 Sep 2014 03:19:22 +0000 (20:19 -0700)]
readme: grammer fix
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Mon, 29 Sep 2014 19:32:42 +0000 (12:32 -0700)]
http: cleanup setHeader()
Several fields on OutgoingMessage were set after instantiation. These
have been included in the constructor to prevent mutation of the object
map after instantiation.
"name" is now explicitly checked to be a string. Where before if a
non-string was passed the following cryptic error was thrown:
_http_outgoing.js:334
var key = name.toLowerCase();
^
TypeError: undefined is not a function
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Mon, 29 Sep 2014 17:13:35 +0000 (10:13 -0700)]
timer_wrap: remove HandleScopes, check return size
Calls from JS to C++ have an implicit HandleScope. So there is no need
to instantiate a new HandleScope in these basic cases.
Check if the returned int64_t is an SMI and cast the return value to
uint32_t instead of a double. Prevents needing to box the return value,
and saves a small amount of execution time.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Fedor Indutny [Wed, 24 Sep 2014 09:42:33 +0000 (13:42 +0400)]
crypto: lower RSS usage for TLSCallbacks
Don't allocate any BIO buffers initially, do this on a first read from
the TCP connection. Allocate different amount of data for initial read
and for consequent reads: small buffer for hello+certificate, big buffer
for better throughput.
see #8416
cjihrig [Sat, 20 Sep 2014 04:07:33 +0000 (00:07 -0400)]
child_process: improve spawn() argument handling
Add stricter argument type checking to normalizeSpawnArguments().
Removes a number of extraneous checks in spawn().
Fix regression in handling of the optional args argument.
Add more thorough testing of spawn() arguments.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Jicheng Li [Sun, 14 Sep 2014 15:40:49 +0000 (23:40 +0800)]
readline: fix performance issue when large line
Only run lineEnding.test() on the newly acquired chunk of string instead
of on the entire line buffer.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 24 Sep 2014 22:41:31 +0000 (15:41 -0700)]
doc: fix brackets for optional parameters
Documentation incorrectly used bracket notation for optional parameters.
This caused inconsistencies in usage because of examples like the
following:
fs.write(fd, data[, position[, encoding]], callback)
This simply fixes all uses of bracket notation in documentation.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Timothy J Fontaine [Thu, 25 Sep 2014 00:14:23 +0000 (17:14 -0700)]
Now working on 0.11.15
Timothy J Fontaine [Wed, 24 Sep 2014 21:46:41 +0000 (14:46 -0700)]
2014.09.24, Version 0.11.14 (Unstable)
* uv: Upgrade to v1.0.0-rc1
* http_parser: Upgrade to v2.3.0
* npm: Upgrade to v2.0.0
* openssl: Upgrade to v1.0.1i
* v8: Upgrade to 3.26.33
* Add fast path for simple URL parsing (Gabriel Wicke)
* Added support for options parameter in console.dir() (Xavi Magrinyà)
* Cluster: fix shared handles on Windows (Alexis Campailla)
* buffer: Fix incorrect Buffer.compare behavior (Feross Aboukhadijeh)
* buffer: construct new buffer from buffer toJSON() output (cjihrig)
* buffer: improve Buffer constructor (Kang-Hao Kenny)
* build: linking CoreFoundation framework for OSX (Thorsten Lorenz)
* child_process: accept uid/gid everywhere (Fedor Indutny)
* child_process: add path to spawn ENOENT Error (Ryan Cole)
* child_process: copy spawnSync() cwd option to proper buffer (cjihrig)
* child_process: do not access stderr when stdio set to 'ignore' (cjihrig)
* child_process: don't throw on EAGAIN (Charles)
* child_process: don't throw on EMFILE/ENFILE (Ben Noordhuis)
* child_process: use full path for cmd.exe on Win32 (Ed Morley)
* cluster: allow multiple calls to setupMaster() (Ryan Graham)
* cluster: centralize removal from workers list. (Julien Gilli)
* cluster: enable error/message events using .worker (cjihrig)
* cluster: include settings object in 'setup' event (Ryan Graham)
* cluster: restore v0.10.x setupMaster() behaviour (Ryan Graham)
* cluster: support options in Worker constructor (cjihrig)
* cluster: test events emit on cluster.worker (Sam Roberts)
* console: console.dir() accepts options object (Xavi Magrinyà)
* crypto: add `honorCipherOrder` argument (Fedor Indutny)
* crypto: allow padding in RSA methods (Fedor Indutny)
* crypto: clarify RandomBytes() error msg (Mickael van der Beek)
* crypto: never store pointer to conn in SSL_CTX (Fedor Indutny)
* crypto: unsigned value can't be negative (Brian White)
* dgram: remove new keyword from errnoException (Jackson Tian)
* dns: always set variable family in lookup() (cjihrig)
* dns: include host name in error message if available (Maciej Małecki)
* dns: introduce lookupService function (Saúl Ibarra Corretgé)
* dns: send lookup c-ares errors to callback (Chris Dickinson)
* dns: throw if hostname is not string or falsey (cjihrig)
* events: Output the event that is leaking (Arnout Kazemier)
* fs: close file if fstat() fails in readFile() (cjihrig)
* fs: fs.readFile should not throw uncaughtException (Jackson Tian)
* http: add 308 status_code, see RFC7238 (Yazhong Liu)
* http: don't default OPTIONS to chunked encoding (Nick Muerdter)
* http: fix bailout for writeHead (Alex Kocharin)
* http: remove unused code block (Fedor Indutny)
* http: write() after end() emits an error. (Julien Gilli)
* lib, src: add vm.runInDebugContext() (Ben Noordhuis)
* lib: noisy deprecation of child_process customFds (Ryan Graham)
* module: don't require fs several times (Robert Kowalski)
* net,dgram: workers can listen on exclusive ports (cjihrig)
* net,stream: add isPaused, don't read() when paused (Chris Dickinson)
* net: Ensure consistent binding to IPV6 if address is absent (Raymond Feng)
* net: add remoteFamily for socket (Jackson Tian)
* net: don't emit listening if handle is closed (Eli Skeggs)
* net: don't prefer IPv4 addresses during resolution (cjihrig)
* net: don't throw on net.Server.close() (cjihrig)
* net: reset `errorEmitted` on reconnect (Ed Umansky)
* node: set names for prototype methods (Trevor Norris)
* node: support v8 microtask queue (Vladimir Kurchatkin)
* path: fix slice OOB in trim (Lucio M. Tato)
* path: isAbsolute() should always return boolean (Herman Lee)
* process: throw TypeError if kill pid not a number (Sam Roberts)
* querystring: custom encode and decode (fengmk2)
* querystring: do not add sep for empty array (cjihrig)
* querystring: remove prepended ? from query field (Ezequiel Rabinovich)
* readline: fix close event of readline.Interface() (Yazhong Liu)
* readline: fixes scoping bug (Dan Kaplun)
* readline: implements keypress buffering (Dan Kaplun)
* repl: fix multi-line input (Fedor Indutny)
* repl: fix overwrite for this._prompt (Yazhong Liu)
* repl: proper `setPrompt()` and `multiline` support (Fedor Indutny)
* stream: don't try to finish if buffer is not empty (Vladimir Kurchatkin)
* stream: only end reading on null, not undefined (Jonathan Reem)
* streams: set default hwm properly for Duplex (Andrew Oppenlander)
* string_bytes: ucs2 support big endian (Andrew Low)
* tls, crypto: add DHE support (Shigeki Ohtsu)
* tls: `checkServerIdentity` option (Trevor Livingston)
* tls: add DHE-RSA-AES128-SHA256 to the def ciphers (Shigeki Ohtsu)
* tls: better error reporting at cert validation (Fedor Indutny)
* tls: support multiple keys/certs (Fedor Indutny)
* tls: throw an error, not string (Jackson Tian)
* udp: make it possible to receive empty udp packets (Andrius Bentkus)
* url: treat the same as / (isaacs)
Timothy J Fontaine [Wed, 24 Sep 2014 21:41:07 +0000 (14:41 -0700)]
deps: upgrade npm to 2.0.0
Patrick Mooney [Wed, 17 Sep 2014 18:54:24 +0000 (13:54 -0500)]
net: Make server.connections un-enumerable
The property server.connections should no longer be enumerable because
it has been deprecated. This will prevent deprecation warnings when
server objects are accessed by functions such as JSON.stringify.
Fixes: https://github.com/joyent/node/issues/8373
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Robert Kowalski [Sat, 13 Sep 2014 09:06:28 +0000 (11:06 +0200)]
benchmark: add test for module loader
Adds a test for benchmarking the module loader, needed for benchmarking
changes / refacortings in the module loader.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
Timothy J Fontaine [Wed, 24 Sep 2014 21:13:58 +0000 (14:13 -0700)]
test: disable dgram-bind-shared-ports on win32
Windows currently doesn't support clustered dgram sockets, when it does
re-enable this test
Julien Gilli [Wed, 24 Sep 2014 16:36:25 +0000 (09:36 -0700)]
tests: add test for buffer.slice.
4c9b30d introduced a regression in buffer.slice that 7c3c51b fixed, but
no test had been added to make sure that a similar regression is caught
by the tests suite in the future.