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

10588 Commits

Author SHA1 Message Date
Evan Lucas
b1a208c83c util: _detailedException to _exceptionWithHostPort
The _detailedException() helper function used to be local to the 'net'
module, but now that it has been moved to 'util' a more descriptive name
is desirable.

PR-URL: https://github.com/iojs/io.js/pull/250
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-08 20:16:38 +01:00
Evan Lucas
3937e8566d util,net: move _detailedException into util
This allows _detailedException() to be used by both the 'net' and
'dgram' modules to provide more informative error messages.

PR-URL: https://github.com/iojs/io.js/pull/250
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-08 20:15:01 +01:00
Rod Vagg
8a0e7d6566 version: working on 1.0.0
PR-URL: https://github.com/iojs/io.js/pull/253
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 09:50:16 -05:00
Bert Belder
e1fe270fd7 src: prefix ARCH and PLATFORM with NODE_
The PLATFORM preprocessor symbol is defined in node.gyp, and on Windows
it's set to "win". This conflicts with a built-in preprocessor symbol
with a different value ("win32"), which makes the linker(!) complain.
Resolve this by renaming these symbols to NODE_ARCH and NODE_PLATFORM.

PR-URL: https://github.com/iojs/io.js/pull/261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 14:17:24 +01:00
Bert Belder
858b558345 win: fix NODE_NET_SOCKET_READ/WRITE signature
The NODE_NET_SOCKET_READ and NODE_NET_SOCKET_WRITE macros are just
no-ops on Windows, but they used to be defined as taking four parameters
while being called with five arguments. Turn them into variadic macros
to squelch a compiler warning.

PR-URL: https://github.com/iojs/io.js/pull/261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 14:17:24 +01:00
Bert Belder
09fe6fe153 win: suppress GetVersionEx deprecation warning
There is no other way to retrieve the Windows version. The stated reason
this API is deprecated is that applications are not supposed to check
whether the Windows it's running on is recent enough. But that's not
what we use it for.

PR-URL: https://github.com/iojs/io.js/pull/261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 14:17:23 +01:00
Bert Belder
0ce7b912c4 win: use GetVersionExW instead of GetVersionExA
For consistency with the rest of the source code, use the wide-char
version of this API.

PR-URL: https://github.com/iojs/io.js/pull/261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 14:17:23 +01:00
Bert Belder
e70562704c win,openssl: disable some warnings
This patch disables two (categories of) warnings:

  * deprecation of GetVersionExA
  * possible loss of data in implicit conversion of scalar types

These warnings don't seem to point out serious problems, and avoiding
them in openssl is somebody else's business.

PR-URL: https://github.com/iojs/io.js/pull/261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 14:17:22 +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
Bert Belder
4519db0407 win: disable stl exception usage
Tell the stl that exception handling is unavailable. This avoids warnings
like:

  C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\
  xlocale(337): warning C4530: C++ exception handler used, but unwind
  semantics are not enabled. Specify /EHsc

PR-URL: https://github.com/iojs/io.js/pull/258
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 11:42:10 +01:00
Bert Belder
da9eff80a3 win: disable exception handling for all builds
Previously exception handling was disabled in release builds, but
enabled in debug builds. That makes no sense.

PR-URL: https://github.com/iojs/io.js/pull/258
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 11:42:10 +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
Cheng Zhao
604b876147 src,deps: replace LoadLibrary by LoadLibraryW
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes
`LoadLibraryW`. When an ASCII string is passed to that function it
crashes.

PR-URL: https://github.com/iojs/io.js/pull/226
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-07 23:38:28 +01:00
Trevor Norris
cbf76c1f2f src: pass Isolate to node::Utf8Value constructor
Initial attempt to remove all uses of Isolate::GetCurrent(). Still
exists a few locations, but this works out a heavy usage.

PR-URL: https://github.com/iojs/io.js/pull/244
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-07 14:21:02 -08:00
Trevor Norris
d553386623 src: pass Isolate to additional locations
Due to a recent V8 upgrade, more methods require Isolate as an argument.

PR-URL: https://github.com/iojs/io.js/pull/244
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-07 14:19:40 -08: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
8a83ebaede build: fix up build after v8 upgrade
* Define and disable new flag `v8_use_external_startup_data`.

* Disable v8_postmortem_support, it's broken again.  Fedor (@indutny)
  has volunteered to fix it up in the near future.

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:17 +01:00
Ben Noordhuis
dad73f645c deps: upgrade v8 to 3.31.74.1
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:11:18 +01:00
Rod Vagg
53ba494537 doc: update AUTHORS, .mailmap, add authors tool
PR-URL: https://github.com/iojs/io.js/pull/232
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-07 12:40:29 +11: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
eaed2a11ec deps: update libuv to 1.2.0
PR-URL: https://github.com/iojs/io.js/pull/237
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-05 22:25:20 +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
Trevor Norris
372a2f56be smalloc: fix bad assert for zero length data
If the data length passed to smalloc.alloc() the array_length will be
zero, causing an overflow check to fail. This prevents that from
happening.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2015-01-05 02:24:40 -08: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
8cfbeed27a docs: update to authors file
PR-URL: https://github.com/joyent/node/pull/8964
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2015-01-02 17:31:20 -08:00
Rod Vagg
261706e2ef doc: added TC meeting minutes 2014-12-30
closes #211

PR-URL: https://github.com/iojs/io.js/pull/229
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-01-03 12:26:09 +11: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
Rod Vagg
d5c7a9737a doc: added TC meeting minutes 2014-12-17
Closes #163

PR-URL: https://github.com/iojs/io.js/pull/178
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2014-12-31 00:35:09 +01:00
Ben Noordhuis
8b04161342 doc: util: document --trace-deprecation
Document the --trace-deprecation flag and the `process` properties that
affect util.deprecate().

Fixes: https://github.com/iojs/io.js/issues/190
PR-URL: https://github.com/iojs/io.js/pull/191
Reviewed-By: Jonathan Ong <me@jongleberry.com>
2014-12-30 23:46:47 +01: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
CGavrila
6a03fce16e url: improve parsing speed
The url.parse() function now checks whether an escapable character is in
the URL before trying to escape it.

PR-URL: https://github.com/joyent/node/pull/8638
[trev.norris@gmail.com: Switch to use continue instead of if]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-12-30 14:00:19 -08: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
Tim Ruffles
6f49c244d1 doc: be specific about the unit of maxBuffer
The maxBuffer option was not self-documenting, so document the unit and
its effect.

PR-URL: https://github.com/iojs/io.js/pull/209
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-29 17:26:41 +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
Nikolai Vavilov
0f3d7e6032 configure: remove compiler detection
The GCC version is no longer relevant since only 4.8 and newer are
supported. It's probably safe to assume clang on mac since V8 does
so too.

PR-URL: https://github.com/iojs/io.js/pull/205
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-23 19:27:24 +01:00
Rudi Cilibrasi
c77a494e4a src: remove cpplint error using NOLINT directive
PR-URL: https://github.com/iojs/io.js/pull/202
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-23 15:43:19 +01:00
Mark Stosberg
6af94831a8 doc: document time() and timeEnd() relationship
`console.time()` and `console.timeEnd()` are very closely related. It's
useful to reference them both from each other.

Previously, console.time() did not mention that it needed to be paired
with a call to console.timeEnd() to be useful, and timeEnd() also failed
to mention that console.time() needed to be called first.

References in both directions have been added.

PR-URL: https://github.com/iojs/io.js/pull/198
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-23 15:33:11 +01:00
Mark Stosberg
0a8e987708 doc: fix v8 doc headings so 'make doc' passes
Previously the code that builds the Table of Contents threw
an exception because of jump from an H1 heading directly to an H3
heading.

By changing the H3 heading to an H2, 'make doc' works again. This is
also consistent with other docs like console.markdown which use
H2 for method call documentation.

PR-URL: https://github.com/iojs/io.js/pull/203
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-23 15:29:18 +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
Nikolai Vavilov
ef10827c9f configure: remove workarounds for GCC < 4.8
They can't compile io.js anyway.

PR-URL: https://github.com/iojs/io.js/pull/187
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-20 22:08:47 +01:00
Ben Noordhuis
aff56cd2b4 lib: micro-optimize url.resolve()
Replace the call to Array#splice() with a faster open-coded version
that creates less garbage.

Add a new benchmark to prove it.  With the change applied, it scores
about 5% higher and that is nothing to sneeze at.

PR-URL: https://github.com/iojs/io.js/pull/184
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 21:33:52 +01:00
Ben Noordhuis
6b2af5f0c7 benchmark: rename url.parse() benchmark
Rename the url.parse() benchmark from url.js to url-parse.js.
A follow-up commit is going to add another one for url.resolve().

PR-URL: https://github.com/iojs/io.js/pull/184
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 21:33:21 +01:00
Ben Noordhuis
d3f8db1244 lib: micro-optimize EventEmitter#removeListener()
Replace the call to Array#splice() with a faster open-coded version
that creates less garbage.

Add a new benchmark to prove it.  With the change applied, it scores
a whopping 40% higher.

PR-URL: https://github.com/iojs/io.js/pull/185
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 02:39:42 +01:00
Ben Noordhuis
d0c238cc81 benchmark: fix printing of large numbers
Don't use Number#toPrecision(), it switches to scientific notation for
numbers with more digits than the precision; use Number#toFixed().

PR-URL: https://github.com/iojs/io.js/pull/185
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 02:38:47 +01:00
Ben Noordhuis
1a63b45a2a benchmark: pre-optimize url.parse() before start
Force V8 to optimize url.parse() before starting the actual benchmark.
Tries to minimize variance between successive runs caused by the
optimizer kicking in at different points.

It does not seem to have much impact, CPU times are roughly the same
before and afterwards; url.parse() quickly plateaus at a local optimum
where most time is spent in V8 builtins, notably Runtime_StringSplit()
and Object::GetElementWithReceiver() calls originating from
deps/v8/src/uri.js, with no recurring optimize/deoptimize cycles that
I could spot.

Still, I don't see any downsides to pre-optimizing the function being
benchmarked so in it goes.

PR-URL: https://github.com/iojs/io.js/pull/132
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-12-19 23:10:31 +01:00