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

12500 Commits

Author SHA1 Message Date
Tristian Flanagan
7e5a6b3272 doc: sort timers alphabetically
Reorders, with no contextual changes, the timers documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:40:23 -08:00
Tristian Flanagan
e4009b6341 doc: sort tty alphabetically
Reorders, with no contextual changes, the tty documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:40:19 -08:00
Tristian Flanagan
32d0d67700 doc: sort url alphabetically
Reorders, with no contextual changes, the url documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:40:15 -08:00
Tristian Flanagan
cff45b98b0 doc: sort vm alphabetically
Reorders, with no contextual changes, the vm documentation alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:40:11 -08:00
Tristian Flanagan
ed1f10de95 doc: sort querystring alphabetically
Reorders, with no contextual changes, the querystring documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:40:07 -08:00
Tristian Flanagan
69cbaf691e doc: sort punycode alphabetically
Reorders, with no contextual changes, the punycode documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:40:03 -08:00
Tristian Flanagan
a58f389779 doc: sort path alphabetically
Reorders, with no contextual changes, the path documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:59 -08:00
Tristian Flanagan
39a7fdf83d doc: sort os alphabetically
Reorders, with no contextual changes, the os documentation alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:55 -08:00
Tristian Flanagan
b690c78241 doc: sort globals alphabetically
Reorders, with no contextual changes, the globals documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:52 -08:00
Tristian Flanagan
b35c57b70c doc: sort fs alphabetically
Reorders, with no contextual changes, the fs documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:49 -08:00
Tristian Flanagan
6009c4b159 doc: sort events alphabetically
Reorders, with minimal contextual duplication, the events documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:45 -08:00
Tristian Flanagan
084e540397 doc: sort errors alphabetically
Reorders, with no contextual changes, the errors documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:42 -08:00
Tristian Flanagan
4315601252 doc: sort dgram alphabetically
Reorders, with no contextual changes, the dgram documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:38 -08:00
Tristian Flanagan
6f8e481085 doc: sort crypto alphabetically
Reorders, with no contextual changes, the crypto documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:35 -08:00
Tristian Flanagan
bf5e177913 doc: sort dns alphabetically
Reorders, with no contextual changes, the dns documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:31 -08:00
Tristian Flanagan
42d6431287 doc: sort console alphabetically
Reorders, with no contextual changes, the console documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:26 -08:00
Tristian Flanagan
4c912206f8 doc: sort cluster alphabetically
Reorders, with no contextual changes, the cluster documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:21 -08:00
Tristian Flanagan
f7169d2336 doc: sort child_process alphabetically
Reorders, with no contextual changes, the child_process documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:17 -08:00
Tristian Flanagan
c0360c1de8 doc: sort buffer alphabetically
Reorders, with minimal contextual duplication, the buffer documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:39:11 -08:00
Tristian Flanagan
e16c669a65 doc: sort assert alphabetically
Reorders, with no contextual changes, the assert documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:38:34 -08:00
Stefan Budeanu
b7089f67b9 crypto: Improve error checking and reporting
Added checks where necessary to prevent hard crashes and gave
precedence to returning the OpenSSL error strings instead of generic
error strings.

PR-URL: https://github.com/nodejs/node/pull/3753
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2015-11-12 18:02:11 -05:00
Ashley Williams
d781cdc349 docs: improve discoverability of Code of Conduct
- move CoC from CONTRIBUTING to top-level, separate COC file
- add note/link in CONTRIBUTING
- add note/link in README (both at top, and newcomer resources)
- move CoC section in CONTRIBUTING to top of file

PR-URL: https://github.com/nodejs/node/pull/3774
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 11:22:16 -08:00
Evan Lucas
7cb3a5427d doc: add note to util.isBuffer
Since util.isBuffer is deprecated, we should be explicit that
Buffer.isBuffer should be used instead.

PR-URL: https://github.com/nodejs/node/pull/3790
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-12 12:47:15 -06:00
Stefan Budeanu
9f71a3109e doc: Describe FIPSDIR environment variable
As per the OpenSSL User Guide, it is possible to use the FIPSDIR
environment variable to specify a custom install path for the
validated cryptographic module.

PR-URL: https://github.com/nodejs/node/pull/3752
Reviewed-By: Michael Dawsson <michael_dawson@ca.ibm.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-12 12:20:39 -05:00
Fedor Indutny
81e32ccdfe deps: cherry-pick 68e89fb from v8's upstream
Original commit message:

    This commit adds some postmortem data that is otherwise unavailable.

    I have discovered need in those values when writing:

    https://github.com/indutny/llnode

    BUG=

    Review URL: https://codereview.chromium.org/1436473002

    Cr-Commit-Position: refs/heads/master@{#31947}

This postmortem information is useful for both object inspection, and
function's context variables inspection.

PR-URL: https://github.com/nodejs/node/pull/3779
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-12 10:27:33 -05:00
Johan Bergström
7b4516356a tools: add tap output to cpplint
Implement a crude TAP13 writer for cpplint. Does its job and
not much else. Only supports writing TAP output to file,
not vs7 or emacs formats.

PR-URL: https://github.com/nodejs/node/pull/3448
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-12 12:13:27 +11:00
James M Snell
dac387e8aa doc: update lts description in the collaborator guide
PR-URL: https://github.com/nodejs/node/pull/3668
Reviewed-By: Julien Gilli <jgilli@fastmail.fm>
2015-11-11 11:51:58 -08:00
Zheng Chaoping
1594198600 fs: return null error on readFile() success
This commit ensures that readFile() callsback with a null
error consistently on success.

PR-URL: https://github.com/nodejs/node/pull/3740
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-11 13:58:47 -05:00
cjihrig
f299d870dc cluster: send suicide message on disconnect
This commit causes Worker.prototype.disconnect() to send a
suicide message to the cluster master. The function is also
restructured to eliminate redundant code.

Fixes: https://github.com/nodejs/node/issues/3238
PR-URL: https://github.com/nodejs/node/pull/3720
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-11 11:17:37 -05:00
cjihrig
b70dc67828 lib,test: remove publicly exposed freelist
The freelist module was deprecated in io.js and moved to an
internal module. This commit removes public access to freelist,
while leaving the internal module, which is still in use.

Fixes: https://github.com/nodejs/node/issues/569
PR-URL: https://github.com/nodejs/node/pull/3738
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-11 10:36:06 -05:00
Michaël Zasso
2930867a2b deps: update V8 to 4.6.85.31
This update contains the patch floated in
https://github.com/nodejs/node/issues/3390 and a fix for
Intl.NumberFormat.

Diff: https://chromium.googlesource.com/v8/v8.git/+/4.6.85.28..4.6.85.31

PR-URL: https://github.com/nodejs/node/pull/3698
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2015-11-11 08:17:17 +01:00
Rich Trott
25cd455407 tools: enforce throw new Error() with lint rule
Add linting rule requiring `throw new Error()` over `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:01:53 -08:00
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