0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
Commit Graph

12468 Commits

Author SHA1 Message Date
Rich Trott
35f2f64edd tools: Use throw new Error() consistently
In preparation for a lint rule that will enforce `throw new Error()`
over `throw Error()`, fix the handful of instances in the code that
use `throw Error()`.

PR-URL: https://github.com/nodejs/node/pull/3714
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-10 21:00:35 -08:00
Rich Trott
0966ab9996 src: force line buffering for stderr
SmartOS does not line buffer stderr by default, or at least that is the
behavior on the Node project Jenkins server. Force line buffering. This
resolves the flakiness observed on SmartOS for
test-debug-signal-cluster.

PR-URL: https://github.com/nodejs/node/pull/3701
Fixes: https://github.com/nodejs/node/issues/2476
Refs: https://github.com/nodejs/node/pull/3615
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-10 17:52:44 -08:00
Tyler Henkel
eff8c3e024 doc: add note on tls connection meta data methods
PR-URL: https://github.com/nodejs/node/pull/3746
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-10 23:05:06 +01:00
Roman Klauke
52351430cf doc: add romankl to collaborators
PR-URL: https://github.com/nodejs/node/pull/3725
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Myles Borins <mborins@us.ibm.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-10 19:47:34 +01:00
Junliang Yan
19bf72ddc5 dns: prevent undefined values in results
When getaddrinfo linked-list results contain entries other than AF_INET
and AF_INET6, the resulting v8::Array will contain undefined values.
That's because initialization of v8::Array pre-allocates entries for all
linked-list nodes, but not all of them will be in the final results.
This commit ensures that the array only contains valid results.

PR-URL: https://github.com/nodejs/node/pull/3696
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-10 12:31:30 -05:00
Sakthipriyan Vairamani
a28b938895 test: enhance fs-watch-recursive test
This patch

  - issues a TAP plugin parsable message on non darwin/windows boxes
  - uses `const` wherever applicable
  - moves the test to parallel

PR-URL: https://github.com/nodejs/node/pull/2599
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-10 08:07:41 -08:00
Roman Reiss
9aee2c0e26 console: use 'label' argument for time and timeEnd
Turns out the argument is actually called label in the console spec,
while being wrongly named on MDN. This reverts commit
8c043c1245.

MDN has been updated in:

https://developer.mozilla.org/en-US/docs/Web/API/Console/timeEnd$compare?locale=en-US&to=947893&from=918571
https://developer.mozilla.org/en-US/docs/Web/API/Console/time$compare?locale=en-US&to=947891&from=896987

PR-URL: https://github.com/nodejs/node/pull/3590
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-10 15:37:06 +01:00
Hugues Malphettes
1bacf37ef8 test: fix test-module-loading-error for musl
When a compiled library file does not have the proper format,
musl returns the error message ENOEXEC as 'Exec format error' but
glibc returns 'file too short' if the file is under a certain size.

Reference:
http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46

This patch consists of tolerating musl's error.

PR-URL: https://github.com/nodejs/node/pull/3657
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-11-10 12:20:49 +01:00
cjihrig
2c33819370 test: fix tests that check error messages
20285ad177 changed the format
of error messages throughout lib. However, the tests were not
updated to reflect these changes. This commit makes those
changes.

PR-URL: https://github.com/nodejs/node/pull/3727
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-10 07:12:33 +01:00
Myles Borins
7b89a3de69 doc: add thealphanerd to collaborators
PR-URL: https://github.com/nodejs/node/pull/3723
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-11-09 15:01:59 -08:00
Saúl Ibarra Corretgé
64208efc9d doc: add saghul as a collaborator
PR_URL: https://github.com/nodejs/node/pull/3724
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Myles Borins <mborins@us.ibm.com>
2015-11-09 23:54:49 +01:00
Hemanth.HM
354f9ce458 repl: To exit, press ^C again or type .exit.
When the user hits `^C` in the REPL show more info about `.exit`.

The idea was to give more info to the user when they hit ^C.
Current version just displays `(^C again to quit)` and most
of the users are not aware of the `.exit` command that would
Exit the repl.

PR-URL: https://github.com/nodejs/node/pull/3368
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-09 11:52:13 -08:00
Sakthipriyan Vairamani
570725840c test: use really invalid hostname
On my slow Ubuntu 14.04 machine, this fails to resolve the host name
used (`no.way.you.will.resolve.this`) and it times out in local testing.
This patch uses an invalid name (`...`) and does stricter validation of
the error returned.

PR-URL: https://github.com/nodejs/node/pull/3711
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-09 11:30:02 -08:00
micnic
20285ad177 lib: Consistent error messages in all modules
This commit fixes some error messages that are not consistent with
some general rules which most of the error messages follow.

PR-URL: https://github.com/nodejs/node/pull/3374
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-11-09 20:08:36 +01:00
Roman Reiss
af46112828 src: Revert "nix stdin _readableState.reading"
This reverts 8cee8f5 which was causing stdin to behave strangely on
Windows 8 and 10. The suspected explanation for the issue is that there
might be a race condition occuring when stdin._readableState.reading is
set indirectly through `push('')`.

PR-URL: https://github.com/nodejs/node/pull/3490
Fixes: https://github.com/nodejs/node/issues/2996
Fixes: https://github.com/nodejs/node/issues/2504
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-11-08 23:14:37 +01:00
Trevor Norris
bb1bd76395 async_wrap: call callback in destructor
Call a user's callback to notify that the handle has been destroyed.
Only pass the id of the AsyncWrap instance since the object no longer
exists.

The object that's being destructed should never be inspected within the
callback or any time afterward.

This commit make a breaking change. The init callback will now be passed
arguments in the order of provider, id, parent.

PR-URL: https://github.com/nodejs/node/pull/3461
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-06 16:37:11 -07:00
Trevor Norris
80a66ba6ae async_wrap: new instances get uid
New instances of AsyncWrap are automatically assigned a unique id. The
value will be used in future commits to communicate additional
information via the async hooks.

While the largest value we can reliably communicate to JS is 2^53, even
if a new AsyncWrap is created every 100ns the uid won't reach its end
for 28.5 years.

PR-URL: https://github.com/nodejs/node/pull/3461
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-06 16:37:06 -07:00
Trevor Norris
a4e9487aae async_wrap: allow some hooks to be optional
Only enforce that the init callback is passed to setupHooks(). The
remaining hooks can be optionally passed.

Throw if async_wrap.enable() runs before setting the init callback or if
setupHooks() is called while async wrap is enabled.

Add test to verify calls throw appropriately.

PR-URL: https://github.com/nodejs/node/pull/3461
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-06 16:36:31 -07:00
Ben Noordhuis
33827e3f68 cluster: remove handles when disconnecting worker
Due to the race window between the master's "disconnect" message and the
worker's "handle received" message, connections sometimes got stuck in
the pending handles queue when calling `worker.disconnect()` in the
master process.

The observable effect from the client's perspective was a TCP or HTTP
connection that simply stalled.  This commit fixes that by closing open
handles in the master when the "disconnect" message is sent.

Fixes: https://github.com/nodejs/node/issues/3551
PR-URL: https://github.com/nodejs/node/pull/3677
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-06 23:02:11 +01:00
Rebecca Turner
df9c4a6a1f deps: upgrade npm to 3.3.12
PR-URL: https://github.com/nodejs/node/pull/3685
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-06 12:28:06 -05:00
qinjia
02a44e0bfd util: use regexp instead of str.replace().join()
PR-URL: https://github.com/nodejs/node/pull/3689
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-06 07:35:05 -08:00
Alejandro Oviedo
d26927c679 doc: add method links in events.markdown
Added referenced method links.

PR-URL: https://github.com/nodejs/node/pull/3187
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-11-06 16:15:01 +01:00
Shigeki Ohtsu
017fc5b391 doc: add caveats of algs and key size in crypto
Add description of user responsibility in the choice of cypto
algorithms and its key length. Some of recommendations for the safer
use are also described.

PR-URL: https://github.com/nodejs/node/pull/3479
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-05 10:47:28 -08:00
Ömer Fadıl Usta
44a298b61c Add missing va_end before return
PR-URL: https://github.com/nodejs/node/pull/3565
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-05 10:08:23 -08:00
Andres Suarez
faa3bb8663 module: remove unnecessary JSON.stringify
`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.

PR-URL: https://github.com/nodejs/node/pull/3578
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-05 09:48:11 -08:00
Ben Noordhuis
d461a0763f build: omit -gline-tables-only for --enable-asan
`-gline-tables-only` is a clang-only flag.  Drop it, it's not needed for
address sanitizer-enabled builds and it makes it impossible to build
with gcc.

Fixes: https://github.com/nodejs/node/issues/3656
PR-URL: https://github.com/nodejs/node/pull/3680
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-05 18:39:34 +01:00
fansworld-claudio
30ce3ebca3 docs: fs - change links to buffer encoding to Buffer class anchor
PR-URL: https://github.com/nodejs/node/pull/2796
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-05 09:32:45 -08:00
fansworld-claudio
2e38079ea4 docs: fs - remove encoding list and link to buffer 2015-11-05 09:31:35 -08:00
Ashok Suthar
8625a3815e http: remove unneeded cb check from setTimeout()
- This check is already covered in EventEmitter#addListener()

Refs: https://github.com/nodejs/node/pull/3618
PR-URL: https://github.com/nodejs/node/pull/3631
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-05 11:34:31 -05:00
Ben Noordhuis
dac1d38a02 doc: stdout/stderr can block when directed to file
Update the documentation for `process.stdout` and `process.stdout` to
clarify that writes can block when stdio is redirected to a file.  In
all other cases, it's non-blocking.

PR-URL: https://github.com/nodejs/node/pull/3170
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-05 17:27:45 +01:00
Steven R. Loomis
363a4e9223 doc: rename iojs-* groups to nodejs-*
As per #2525 a bunch of WGs are renamed from iojs-* to nodejs-*.
Update the WORKING_GROUPS.md to match.

Note specifically iojs-cn and iojs-tw were renamed to nodejs-zh-CN and
nodejs-zh-TW respectively.

Fixes: https://github.com/nodejs/node/issues/3247
PR-URL: https://github.com/nodejs/node/pull/3634
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-04 15:24:55 -08:00
James M Snell
3268383c2b doc: fix wrong date and known issue in changelog.md
* A known issue was resolved but not removed from the list
* The wrong date was documented in the changelog for v4.2.2

PR-URL: https://github.com/nodejs/node/pull/3650
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-11-04 15:21:00 -08:00
Imran Iqbal
a6a7338b1c test: fix test-net-persistent-keepalive for AIX
Fixed an intermittent issue on AIX where the 600ms timeout was reached
before the 'connection' event was fired. This resulted in a failure as
serverConnection would be undefined and the assert.equal would throw an
error. Changed the flow of the test so that the timeout is only set
after a connection has been made.

PR-URL: https://github.com/nodejs/node/pull/3646
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-04 15:18:49 -08:00
David Woods
471aa5a989 doc:fix function param order in assert doc
PR-URL: https://github.com/nodejs/node/pull/3533
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-03 13:13:07 -08:00
James M Snell
d006d6aa46 deps: update http-parser to 2.6.0
significant updates:

* [[`777ba4eded`](https://github.com/nodejs/node/commit/777ba4eded)] - **src**: introduce `http_parser_url_init` (Fedor Indutny) [nodejs/http-parser#225](https://github.com/nodejs/http-parser/pull/225)
* [[`e557b62744`](https://github.com/nodejs/node/commit/e557b62744)] - **src**: support LINK/UNLINK (RFC 2068, draft-snell-link-method) (Olivier Mengué) [nodejs/http-parser#267](https://github.com/nodejs/http-parser/pull/267)
* [[`eb5e9928b4`](https://github.com/nodejs/node/commit/eb5e9928b4)] - **src**: support ACL (WebDAV, RFC3744, Section 8.1). (Ivan Enderlin) [joyent/http-parser#260](https://github.com/joyent/http-parser/pull/260)
* [[`8b1d652322`](https://github.com/nodejs/node/commit/8b1d652322)] - **src**: support BIND/REBIND/UNBIND (WebDAV, RFC5842) (Ivan Enderlin) [joyent/http-parser#242](https://github.com/joyent/http-parser/pull/242)
* [[`7d75dd7325`](https://github.com/nodejs/node/commit/7d75dd7325)] - **src**: support IPv6 Zone ID as per RFC 6874 (Tatsuhiro Tsujikawa) [joyent/http-parser#253](https://github.com/joyent/http-parser/pull/253)

PR-URL: https://github.com/nodejs/node/pull/3569
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-11-03 13:08:05 -08:00
Sam P Gallagher-Bishop
47f654111f doc: typo fix in readme.md
Minor typo fix in the list of keys

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3649
2015-11-03 12:35:40 -08:00
James M Snell
3be3fb6538 2015-11-03, Version 4.2.2 "Argon" (LTS) Release 2015-11-03 12:09:16 -08:00
Evan Lucas
a4a0efc534 repl: don't crash if cannot open history file
Previously, if we are unable to open the history file, an error would
be thrown. Now, print an error message that we could not open
the history file, but don't fail.

Fixes: https://github.com/nodejs/node/issues/3610
PR-URL: https://github.com/nodejs/node/pull/3630
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-03 09:52:35 -06:00
Ben Noordhuis
82022a79b0 test: more regression tests for minDHSize option
Check that tls.connect() fails in the expected way when passing in
invalid minDHSize options.

PR-URL: https://github.com/nodejs/node/pull/3629
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-03 11:47:26 +01:00
Ben Noordhuis
cddf358f68 test: add regression test for 512 bits DH key
Check that trying to use a < 1024 bits DH key throws an exception.

parallel/test-tls-dhe tests this as well but it feels incongruous not to
do it here when both tests have similar logic for 1024/2048 bits keys.

PR-URL: https://github.com/nodejs/node/pull/3629
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-03 11:46:55 +01:00
Rich Trott
6d6bc5d9d8 test: mark http-pipeline-flood flaky
test-http-pipeline-flood has been flaky on Windows for some time.
Hopefully, https://github.com/nodejs/node/pull/2862 fixes it and
lands soon, but until then, let's mark it as flaky.

PR-URL: https://github.com/nodejs/node/pull/3616
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-11-02 13:58:05 -08:00
Guilherme Souza
ac7dd5fc6c doc: add note about timeout delay > TIMEOUT_MAX
When setTimeout() and setInterval() are called with `delay` greater than
TIMEOUT_MAX (2147483647), the supplied value is ignored and 1 is used
instead. Add a note about this in the timers docs.

PR-URL: https://github.com/nodejs/node/pull/3512
Reviewed-By: Trevor Norris <trev.norris@gmai.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-11-02 13:38:39 -07:00
Rich Trott
f6230b9b72 test: remove flaky designation from ls-no-sslv3
This test was marked flaky after failing in CI on arm7-wheezy two months
ago. It has not failed there since. This commit removes the flaky
designation.

Fixes: https://github.com/nodejs/node/issues/2554
PR-URL: https://github.com/nodejs/node/pull/3620
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-02 11:46:45 -08:00
Rebecca Turner
507fc53e37 deps: upgrade npm to 3.3.10
PR-URL: https://github.com/nodejs/node/pull/3599
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-02 14:25:04 -05:00
Rebecca Turner
6e40bf0659 gitignore: don't ignore 'debug' in deps/npm
PR-URL: https://github.com/nodejs/node/pull/3599
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-02 14:23:40 -05:00
Rebecca Turner
754061f3ae tools: update npm test tooling for 3.3.10+
PR-URL: https://github.com/nodejs/node/pull/3599
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-02 14:22:41 -05:00
Fedor Indutny
827ee498e3 buffer: neuter external nullptr buffers
Neuter external `nullptr` buffers, otherwise their contents will be
materialized on access, and the buffer instance will be internalized.

This leads to a crash like this:

    v8::ArrayBuffer::Neuter Only externalized ArrayBuffers can be
    neutered

Fix: #3619
PR-URL: https://github.com/nodejs/node/pull/3624
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-11-02 08:37:38 -05:00
Jason Gerfen
9e3aa451a1 doc: fix crypto spkac function descriptions
Fix regarding description of the following functions:

Certificate.exportPublicKey(spkac)
Certificate.exportChallenge(spkac)

The descriptions were applied incorrectly.

PR-URL: https://github.com/nodejs/node/pull/3614
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-01 23:57:28 +01:00
Emily Aviva Kapor-Mater
b7cc19c8f5 doc: add final full stop in CONTRIBUTING.md
PR-URL: https://github.com/nodejs/node/pull/3576
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-10-30 18:09:11 -07:00
Shigeki Ohtsu
be65f5f250 tools: fix gyp to work on MacOSX without XCode
This issue has already submitted to the upstream in
https://code.google.com/p/gyp/issues/detail?id=477
Use this commit until the upstream is to be fixed.

PR-URL: https://github.com/iojs/io.js/pull/1325
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-30 12:27:27 +01:00