0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

2951 Commits

Author SHA1 Message Date
Caitlin Potter
be2404e0d3 core: throw TypeError if chdir() args are wrong
PR-URL: https://github.com/iojs/io.js/pull/274
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-09 18:36:15 +01:00
Ben Noordhuis
f17f473af5 build: rename binary from node to iojs
* rename the build targets

* update the test runner to use `out/{Debug,Release}/iojs`

* update the installer to install the iojs binary

* update one test that explicitly checks for the binary name

PR-URL: https://github.com/iojs/io.js/pull/262
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-08 23:21:20 +01:00
Colin Ihrig
b5c9dcb6d7 win,test: fix test-process-active-wraps.js
b636ba8 broke this test, because it now takes a loop iteration or two
to resolve the loopback address. That consequence is that the TCPWrap
handle that we *don't* want to see is created a bit later, and also
destroyed later, so when we assert that the active handle list is empty
the TCPWrap object is still "busy" being closed.

Wait one extra loop iteration before checking there are no more active
handles. This allows name resolution and clean-up to finish before the
assertion.

BUG: https://github.com/iojs/io.js/issues/246
PR-URL: https://github.com/joyent/node/pull/8998
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-08 20:48:57 +01:00
Evan Lucas
c9fd9e2162 dgram: make error messages more informative
PR-URL: https://github.com/iojs/io.js/pull/250
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-08 20:16:39 +01:00
Ben Noordhuis
7266b75779 test: move broadcast/multicast test to internet/
Move parallel/test-dgram-broadcast-multi-process to test/internet.

The test does not play nice with firewalls that restrict broadcast
or multicast traffic, nor can it be rewritten to use only loopback
traffic without running into platform-specific limitations, see also
commits 52e600a and 236533c (TODO: update second one before landing.)

PR-URL: https://github.com/iojs/io.js/pull/259
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-01-08 13:17:32 +01:00
Ben Noordhuis
df3c4ca16e Revert "test: don't assume broadcast traffic is unfiltered"
This reverts commit 52e600a9c8.

Reverted for:

* making the test fail with ENETUNREACH on OS X 10.8, and

* making the test fail with EHOSTDOWN on OS X 10.9 and 10.10 when there
  is no network connectivity, and

* leaving behind orphan processes that make subsequent tests fail with
  EADDRINUSE errors

PR-URL: https://github.com/iojs/io.js/pull/259
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-01-08 13:17:17 +01:00
Vladimir Kurchatkin
c70d192ab3 util: show symbol properties
Properties with symbol names are shown if option `showHidden` of `util.inspect`
or `console.dir` is `true`.

PR-URL: https://github.com/iojs/io.js/pull/247
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-01-08 11:20:15 +01:00
Ben Noordhuis
6e9d1c8684 test: fix parallel/test-repl with new v8
Per the ES6 spec, V8 3.31 no longer throws a SyntaxError for scoped
function declarations.

PR-URL: https://github.com/iojs/io.js/pull/243
Reviewed-By: Domenic Denicola <domenic@domenicdenicola.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-01-07 22:12:23 +01:00
Ben Noordhuis
58f3a0382b test: fix parallel/test-repl-harmony with new v8
Assignment to a const var in strict mode is a lazy TypeError now.
Update the test accordingly.

PR-URL: https://github.com/iojs/io.js/pull/243
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-01-07 22:12:20 +01:00
Ben Noordhuis
52e600a9c8 test: don't assume broadcast traffic is unfiltered
parallel/test-dgram-broadcast-multi-process assumes non-local broadcast
traffic is unfiltered, an assumption that fails with, for example, the
default Fedora firewall rules.  Use a loopback interface instead.

Fixes: https://github.com/iojs/io.js/issues/219
PR-URL: https://github.com/iojs/io.js/pull/220
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-01-06 17:11:29 +01:00
Ben Noordhuis
94e147500c Merge remote-tracking branch 'joyent/v0.12' into v1.x
I was originally going to do this after the v0.11.15 release, but as
that release is three weeks overdue now, I decided not to wait any
longer; we don't want the delta to get too big.

Conflicts:
	lib/net.js
	test/simple/simple.status

PR-URL: https://github.com/iojs/io.js/pull/236
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-01-05 17:26:47 +01:00
cjihrig
b636ba8186 net: make connect() input validation synchronous
Socket.prototype.connect() sometimes throws on bad inputs
after an asynchronous operation. This commit makes the input
validation synchronous. This commit also removes some hard
coded IP addresses.

PR-URL: https://github.com/joyent/node/pull/8180
Fixes: https://github.com/joyent/node/issues/8140
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2015-01-03 20:02:27 -05:00
Steven R. Loomis
a30839576c build: i18n: add icu config options
Make "--with-intl=none" the default and add "intl-none" option to
vcbuild.bat.

If icu data is missing print a warning unless either --download=all or
--download=icu is set. If set then automatically download, verify (MD5)
and unpack the ICU data if not already available.

There's a "list" of URLs being used, but right now only the first is
picked up. The logic works something like this:

* If there is no directory deps/icu,
  * If no zip file (currently icu4c-54_1-src.zip),
    * Download zip file (icu-project.org -> sf.net)
  * Verify the MD5 sum of the zipfile
    * If bad, print error and exit
  * Unpack the zipfile into deps/icu
* If deps/icu now exists, use it, else fail with help text

Add the configuration option "--with-icu-source=..."

Usage:
  * --with-icu-source=/path/to/my/other/icu
  * --with-icu-source=/path/to/icu54.zip
  * --with-icu-source=/path/to/icu54.tgz
  * --with-icu-source=http://example.com/icu54.tar.bz2

Add the configuration option "--with-icu-locals=...".  Allows choosing
which locales are used in the "small-icu" case.

Example:
    configure --with-intl=small-icu --with-icu-locales=tlh,grc,nl

(Also note that as of this writing, neither Klingon nor Ancient Greek
are in upstream CLDR data. Serving suggestion only.)

Don't use hard coded ../../out paths on windows. This was suggested by
@misterdjules as it causes test failures.  With this fix, "out" is no
longer created on windows and the following can run properly:

    python tools/test.py simple

Reduce space by about 1MB with ICU 54 (over without this patch). Also
trims a few other source files, but only conditional on the exact ICU
version used. This is to future-proof - a file that is unneeded now may
be needed in future ICUs.

Also:
  * Update distclean to remove icu related files
  * Refactor some code into tools/configure.d/nodedownload.py
  * Update docs
  * Add test

PR-URL: https://github.com/joyent/node/pull/8719
Fixes: https://github.com/joyent/node/issues/7676#issuecomment-64704230
[trev.norris@gmail.com small change to test's whitespace and logic]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2015-01-02 16:51:53 -08:00
Aleksey Smolenchuk
d8586eab7e lib: introduce process module
This makes require('process') always return a reference to the global
process object.

PR-URL: https://github.com/iojs/io.js/pull/206
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-30 23:29:32 +01:00
Sam Roberts
b42c0853ae doc: add tls server.close() callback docs
Also, tests to confirm its existence.

PR-URL: https://github.com/iojs/io.js/pull/217
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-30 21:40:46 +01:00
Sam Roberts
63005ee10b dgram: close() should accept a callback
Like net, http, and https server.close, and socket.end(), etc.

PR-URL: https://github.com/iojs/io.js/pull/217
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-30 21:40:43 +01:00
Sam Roberts
7349d7fd99 dgram: make 'close' event async
Emit the close event asynchronously, after the close, as it is with the
net/http close events.

PR-URL: https://github.com/iojs/io.js/pull/217
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-30 21:40:28 +01:00
Brendan Ashworth
4444b7b52c dgram: changes Socket.close() to return itself
This commit adds a return statement to the dgram.Socket.close()
function that returns itself after it finishes. This follows along
the functionality of the more popular and, dare I say, father-library
`lib/net.js`.

PR-URL: https://github.com/iojs/io.js/pull/214
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-29 17:25:45 +01:00
Brendan Ashworth
3e0057dd61 dgram: change Socket.bind() to return itself
This commit changes `lib/dgram.js` Sockets to, when
they are bound to a port / IP, return themselves. This
is done in order to allow chaining of methods and be
in accordance with the `lib/net.js` library.

PR-URL: https://github.com/iojs/io.js/pull/214
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-29 17:25:27 +01:00
teppeis
00a7456c19 assert: fix deepEqual regression
Change of Object.keys in ES6 breaks assert.deepEqual about primitive
values.

V8: https://code.google.com/p/v8/issues/detail?id=3443

Previously deepEqual depends on Object.key that throws an error for
a primitive value, but now Object.key does not throw.

PR-URL: https://github.com/iojs/io.js/pull/193
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-22 12:46:59 +01:00
cjihrig
5678595856 fs: deprecate exists() and existsSync()
These methods don't follow standard conventions, and shouldn't
be used anyway.

Fixes: https://github.com/iojs/io.js/issues/103
PR-URL: https://github.com/iojs/io.js/pull/166
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-19 10:27:48 -05:00
Ben Noordhuis
dab6f681cd lib,src: remove post-gc event infrastructure
Remove the 'gc' event from the v8 module and remove the supporting
infrastructure from src/.  It gets the axe because:

1. There are currently no users.  It was originally conceived as
   an upstreamed subset of StrongLoop's strong-agent GC metrics,
   but the strong-agent code base has evolved considerably since
   that time and has no use anymore for what is in core.

2. The implementation is not quite sound.  It calls into JS land
   from inside the GC epilog and that is unsafe.  We could fix
   that by delaying the callback until a safe time but because
   there are no users anyway, removing it is all around easier.

PR-URL: https://github.com/iojs/io.js/pull/174
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2014-12-18 19:39:30 +01:00
Chris Dickinson
91586661c9 stream: switch _writableState.buffer to queue
In cases where many small writes are made to a stream
lacking _writev, the array data structure backing the
WriteReq buffer would greatly increase GC pressure.

Specifically, in the fs.WriteStream case, the
clearBuffer routine would only clear a single WriteReq
from the buffer before exiting, but would cause the
entire backing array to be GC'd. Switching to [].shift
lessened pressure, but still the bulk of the time was
spent in memcpy.

This replaces that structure with a linked list-backed
queue so that adding and removing from the queue is O(1).
In the _writev case, collecting the buffer requires an
O(N) loop over the buffer, but that was already being
performed to collect callbacks, so slowdown should be
neglible.

PR-URL: https://github.com/joyent/node/pull/8826
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-12-18 09:39:05 -08:00
Ben Noordhuis
ebf9f297b3 lib: fix guard expression in timer.unref()
Fixes the following assertion on slow systems, like our ARM buildbot:

    $ out/Debug/node test/simple/test-timers-unref.js
    node: ../src/async-wrap-inl.h:101: v8::Handle<v8::Value>
    node::AsyncWrap::MakeCallback(uint32_t, int,
    v8::Handle<v8::Value>*): Assertion `cb_v->IsFunction()' failed.
    Aborted

The reason it only manifests on slow systems is that the test starts
a 1 ms interval timer, then defers timer.unref.bind({}) to the next
tick.  On fast systems, the test completes in under a millisecond,
before the callback is called.

This commit makes timer.unref() check that the receiver actually has
a timeout callback property.

Fixes #13.

PR-URL: https://github.com/iojs/io.js/pull/165
Reviewed-By: Rod Vagg <rod@vagg.org>
2014-12-18 18:24:29 +01:00
Fedor Indutny
b7d247856e test: run tests in parallel, common improvements
* Allow running tests in mixed parallel/sequential modes
* Add -J flag for running tests on all available CPUs
* Support TEST_THREAD_ID in test/common.js and use it for tmpDir and PORT
* make: use -J flag

Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/172
Fix: iojs/io.js#139
2014-12-17 20:45:37 +07:00
Fedor Indutny
0e19476595 test: split test in parallel/sequential
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/172
Fix: iojs/io.js#139
2014-12-17 20:45:02 +07:00
Luis Reis
6f6a97958e zlib: support concatenated gzip files
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/6442
2014-12-16 15:11:50 -08:00
cjihrig
165b70f146 fs: add access() and accessSync()
fs.exists() and fs.existsSync() do not follow the typical
error first callback convention. access() and accessSync()
are added as alternatives in this commit.

Fixes: https://github.com/joyent/node/pull/8714
PR-URL: https://github.com/iojs/io.js/pull/114
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Domenic Denicola <domenic@domenicdenicola.com>
2014-12-15 12:05:49 -05:00
Ben Noordhuis
db595b2de6 lib: reintroduce v8 module
I introduced this module over a year ago in a pull request as the v8
module but it was quickly subsumed by the tracing module.

The tracing module was recently removed again and that is why this
commit introduces the v8 module again, including the new features it
picked up commits d23ac0e and f8076c4.

PR-URL: https://github.com/iojs/io.js/pull/131
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Christian Tellnes <christian@tellnes.no>
Reviewed-By: Thorsten Lorenz <thlorenz@gmx.de>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2014-12-14 18:52:57 +01:00
cjihrig
4bba87050c test: add test for spawnSync() env option
PR-URL: https://github.com/joyent/node/pull/8845
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-12-11 10:32:56 -08:00
micnic
8c69d7bed4 domain: forward args to .run(fn)
Adds the feature to define arguments for the function called in
domain.run(), this is supposed to be useful when a function is called from
another context and some values from the current context are needed as
arguments, it's similar to the callback from setTimeout or setInterval.

PR-URL: https://github.com/iojs/io.js/pull/15
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-12 12:14:11 +11:00
Evan Lucas
78a7dc2b8f module: fix regression in require ../
Fixes regression in require system that prevented loading relative
packages via main property in package.json where the file is not
index.{ext}. The regression was introduced in commit 36777d2.

PR-URL: https://github.com/iojs/io.js/pull/145
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-11 10:18:00 +01:00
Fedor Indutny
687dfc9875 crypto: separate altname extensions with ", "
In newly introduced `SafeX509ExtPrint` I forgot to insert separators
between extensions, which lead to the "DNS:...DNS:..." thing for npm.

Fix: iojs/io.js#105
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/113.patch
2014-12-11 00:07:58 +07:00
Alexis Campailla
8708c7abe5 test: mark more tests as flaky
Marking these two tests as flaky, since they have been failing
intermittenly in recent builds:
test-debug-signal-cluster
test-cluster-basic
2014-12-10 12:58:32 +01:00
Bert Belder
4efc02a582 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>
2014-12-09 21:16:29 +01:00
cjihrig
8e272dffa2 test: add test for spawnSync() env option
PR-URL: https://github.com/joyent/node/pull/8845
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-09 18:41:36 +01:00
Bert Belder
2b6a0f85f3 src: remove the tracing module entirely
PR-URL: https://github.com/iojs/io.js/pull/124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-09 17:57:19 +01:00
Trevor Norris
819690fd98 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>
2014-12-09 17:57:15 +01:00
Trevor Norris
0d60ab3efe 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>
2014-12-09 17:57:12 +01:00
Bert Belder
4d94658918 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>
2014-12-09 17:57:12 +01:00
Jonathan Johnson
c90eac7e0e 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.
2014-12-09 17:57:10 +01:00
Vladimir Kurchatkin
f1f511fd22 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>
2014-12-09 17:57:09 +01:00
Bert Belder
dd7ce69097 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>
2014-12-09 15:36:31 +01:00
Bert Belder
7014b7c069 test: make fs-symlink-dir-junction-relative pass on unix 2014-12-09 08:08:51 +01:00
Vincent Weevers
764c5c7fd1 fs: resolve junction targets relative to their parent
PR-URL: https://github.com/joyent/node/pull/8813
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2014-12-09 03:00:50 +01:00
Nikolai Vavilov
e24fa83e69 Revert "path: resolve normalize drive letter to lower case"
This reverts commit f6e5740180.

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>
2014-12-08 17:35:52 +01:00
Robert Kowalski
36777d2a5f 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>
2014-12-06 22:14:05 +01:00
Evan Lucas
3ac4941953 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
2014-12-07 01:45:16 +03:00
cjihrig
616343bc61 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>
2014-12-06 15:24:54 -05:00
Ben Noordhuis
b928303d83 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>
2014-12-06 02:37:30 +01:00