A number -> uint32 type coercion bug made buffer sizes
larger than kMaxLength (0x3fffffff) wrap around.
Instead of rejecting the requested size with an exception,
the constructor created a buffer with the wrong size.
PR-URL: https://github.com/iojs/io.js/pull/657
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
AsyncWrap should always properly propagate asynchronous calls to any
child that is created. Regardless whether kCallInitHook is currently
active. The previous logic would always return early if kCallInitHook
wasn't set.
PR-URL: https://github.com/joyent/node/pull/9146
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Replace tools/updateAuthors.awk with tools/update-authors.js. The new
tool generates an AUTHORS file that is stable-ordered alphanumerically.
Fixes#9077.
PR: #9088
PR-URL: https://github.com/joyent/node/pull/9088
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
V8_CONSTANT_REMOVED_SINCE(major, minor) can be used to mark a constant
has being removed from V8 since V8 version major.minor.
Reviewed-By: Dave Pacheco <dap@joyent.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Bugs fixed:
* v0.12 and later: in-object properties not printing correctly.
* 64-bit: not printing external strings correctly (offset was hardcoded
for 32-bit). This would happen with "::jsstack -vn0" because the
script "node.js" wasn't printed correctly, at least with 0.10 core
files.
* 64-bit: printing JS source (via "::jsstack -v") emits errors and shows
the wrong code.
* Several build warnings.
* Two-byte strings are unnecessarily truncated.
* Could print friendlier note when given obviously bogus function token
positions.
New features:
* ::jsstack prints much cleaner output by default.
* ::jsprint keys are now quoted.
* ::jsstack -v includes "this" value for each function on the stack.
* ::jsstack -v includes more details about each argument (constructor
names for each object).
* new commands: ::jsconstructor, ::jsfunctions, ::jssource, ::nodebuffer
and ::v8internal.
* ::findjsobjects and ::jsprint hidden flags for developers to measure
and improve test coverage.
* internal jsobj_properties() function is much better documented.
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Building node with GCC > 4.4 on CentOS makes the node binary depend on a
more recent version of the C/C++ runtime that is not installed by
default on these older CentOS platforms, and probably on other platforms
as well.
Building node with the default gcc and g++ compilers that come with
these older versions of CentOS allows to ship a node binary that runs
out of the box on these setups with older C/C++ runtimes.
This change works around a bug that was fixed in GCC 4.5. Versions of
GCC < 4.5 would not support using the injected-class-name of a
template base class as a type name.
This change also disables aliasing optimizations for toolchains using
GCC <= 4.4 as they're not able to deal with the aliasing in the queue
implementation used by libuv and node (see src/queue.h).
Fixes#9079.
PR: #9098
PR-URL: https://github.com/joyent/node/pull/9098
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Currently, JSON.stringify() is used to create error messages
on failed assertions. This causes an error when stringifying
objects with circular references. This commit switches out
JSON.stringify() for util.inspect(), which can handle
circular references.
PR: #8734
PR-URL: https://github.com/joyent/node/pull/8734
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
This reverts commit d312b6d15c.
d312b6d15c introduced some confusion in
the existing API of url.format and url.parse.
The way the 'path' property overrides other properties in url.format's
input is too confusing for existing users compared to the issues it
fixes.
Fixes such as https://github.com/joyent/node/pull/9081 have been
proposed, but they do not make the API less confusing.
Instead, this change just reverts the original breaking change so that
it gives us more time after v0.12.0 is released to come up with a better
API for url.format, url.parse and other related APIs in the v0.13
development branch.
Fixes#9070.
Conflicts:
doc/api/url.markdown
PR: #9109
PR-URL: https://github.com/joyent/node/pull/9109
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
On Windows, when building the "build-release" rule, enable both small-icu
and download-all.
This change also slightly refactors the build-release rule, mainly so that
it's easier to read.
The resulting MSI package was tested on Windows 7.
Fixes#9099.
PR: #9100
PR-URL: https://github.com/joyent/node/pull/9100
Reviewed-By: Steven R. Loomis <srloomis@us.ibm.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Fix regression introduced in 6120472036
that broke parsing of some ssh: urls.
An example url is ssh://git@github.com:npm/npm.git
Fixes#9072.
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit restricts socket timeouts non-negative, finite
numbers. Any other value throws a TypeError or RangeError.
This prevents subtle bugs that can happen due to type
coercion.
Fixes: https://github.com/joyent/node/issues/8618
PR-URL: https://github.com/joyent/node/pull/8884
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
The message argument is optional for both assert() and
assert.ok(). This commit makes message optional for assert().
PR-URL: https://github.com/joyent/node/pull/9003
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
The message argument is optional for both assert() and
assert.ok(). This commit makes message optional for assert().
PR-URL: https://github.com/joyent/node/pull/9003
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Make this test less prone to race conditions by using synchronous
interprocess communication instead of a timer to determine when the
child process is ready to receive messages from its parent.
Also, remove a superfluous timer since the tests suite already makes
tests time out after a while.
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
In order to preserve the potential for a flush method being added to the
streams API, rename flush to flushHeaders which is much more clear about
the behavior of this method.
PR: #9048
PR-URL: https://github.com/joyent/node/pull/9048
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Since the current environment is in scope use ThrowError on that,
instead of having to lookup the Environment again.
Added benefit, lint the source code.
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
On non-windows supported platforms, fs.access(readOnlyFile, W_OK, ...)
is expected to fail, but always succeeds if node runs as the super user,
which is often the case for tests running on our continuous integration
platform.
This change makes the test try to change its process user id to nobody
on non-windows platforms so that the above mentioned test can pass and
still perform the actual desired test. If changing the process user id
to a nobody is not possible, then the test checks that
fs.access(readOnlyFile, W_OK, ...) actually succeeds.
Fixes#9033.
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Added license info from:
http://source.icu-project.org/repos/icu/icu/trunk/license.html
All text pasted. Long lines wrapped. (original is HTML.)
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
unref one superfluous timer (as the test suite already has a global
timeout), and improve the state machine to iterate the messages more
reliably.
Ultimately make the test complete more quickly.
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
Previously if a worker's state machine had already transitioned into the
'listening' state when it received the message enabling the debugger,
the worker would never enable its debugger.
Change the logic to allow the 'listening' as a valid state for enabling
the debugger.
Fixes#6440
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
In general path functions don't change the case of a path. Making an
exception for windows drive letters violates the principle of least
surprise.
Changing the drive letter case has caused a lot of issues, including
joyent/node#7031, joyent/node#7806 and lots of bikeshedding about
whether uppercase is the right case or lowercase.
This effectively reverts joyent/node@a05f973
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Invokes the configure script used to build binary packages
(OSX pkg, binary tarballs, pkgsrc, MSI) with --download=all
--with-intl=small-icu.
Also makes PACKAGEMAKER customizable, because PackageMaker is not
necessarily installed in /Developer on OSX anymore.
Tested all binary packages on Windows, OSX, Linux and SmartOS.
Fixes#7676.
Reviewed-by: Steven R. Loomis <srl@icu-project.org>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
The tests suite available in test/external/ssl-options was originally
written for security fixes made in the v0.10 branch. In this branch, the
client's default ciphers list is compatible with SSLv2.
After merging this change from v0.10 to v0.12, this tests suite was
broken because commits 5d2aef17ee and
f4c8020d10 make SSL/TLS clients use a
default ciphers list that is not compatible with the SSLv2 protocol.
This change fixes two issues:
1) The cipher list that was setup for a given test was not passed
properly to the client.
2) When either or both of clients/servers were using SSLv2, tests were
expected to succeed when at least the server end was using SSLv2
compatible ciphers. Now, tests are expected to succeed only if
SSLv2 compatible ciphers are used on both ends.
Fixes#9020.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
A recent merge of v0.10 to v0.12
(0c7f6ca830) upgraded OpenSSL to version
1.0.1j. In v0.10, this required test-crypto-stream.js to be fixed with
commit 707cc25011. Basically, instead of
returning the proper error, Err_get_error() would return 0 and the test
for the error message needed to be updated in test-crypto-stream.js.
However, in the v0.12 branch, crypto error messages are handled a bit
differently since commit 26a1b712ec
landed. Instead of returning the default OpenSSL error message, it makes
the decipher stream return a default message specific to Node.js.
This commit updates test-crypto-stream.js to test the error object
against the proper default error message.
Fixes#9019.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Workers that are already disconnected but not yet exited should not be
disconnected, trying to do so raises exceptions.
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>